PID (Proportion Integration Differentiation) control parameter setting method and device based on neural network, equipment and medium
Through the PID control parameter tuning method based on neural network, the problem of low efficiency and poor accuracy of manual tuning method of high-precision guide rail table is solved, and rapid automatic adjustment and efficient production are achieved.
Patent Information
- Application Number
- CN202411726349.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-28
AI Technical Summary
The PID control parameter setting of the high-precision guide rail movable table in the prior art depends on manual methods, and there are problems such as slow adjustment speed, low accuracy, long time, cumbersome manual operation, long time and easy to make mistakes.
The PID control parameter tuning method based on neural network is adopted, and the input data and output data of the servo system are obtained, combined with the neural network algorithm, and the neural network model representing the relationship between the input data and the output data is determined, and the optimal PID control parameters are determined through optimization solutions.
It realizes rapid automatic adjustment of PID parameters, effectively reducing the test adjustment time, improving production efficiency, and reducing the possibility of manual judgment errors.
Smart Images

Figure CN119535950A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of controller parameter setting, and in particular to a PID control parameter setting method, device, equipment and medium based on a neural network. Background Art
[0002] With the continuous development of semiconductor equipment, the requirements for control accuracy of the guide rail axis motion system are increasing. The guide rail axis motion system mainly includes: base plate, guide rail, slider, motor, grating scale, load, and drive control system. During motion, the main requirements are uniform speed performance during uniform linear motion and fast and stable performance of stepping motion. At present, the commonly used control algorithm in motion control system is PID control algorithm, which includes proportional (Proportional, referred to as P), integral (Integral, referred to as I) and derivative (Derivative, referred to as D). This algorithm is simple and reliable, and is the most commonly used control algorithm.
[0003] However, the PID control parameter setting of the high-precision guide rail motion table is still based on the traditional manual setting method, such as the critical setting method, which gradually increases the P parameter until the response reaches the critical state of oscillation, and then appropriately reduces the P parameter. Then, according to the oscillation period and oscillation amount during oscillation, the I and D parameters are adjusted according to a certain proportional coefficient. However, this method has the disadvantages of slow adjustment speed, low accuracy and long time. Especially in high-precision systems, small changes in PID control parameters will cause large fluctuations. Therefore, the manual method takes a long time to find a set of suitable PID control parameters, resulting in cumbersome manual operations, long time consumption and manual operation errors. Summary of the invention
[0004] The present invention provides a PID control parameter setting method, device, equipment and medium based on neural network, which can realize rapid automatic adjustment of PID parameters, effectively reduce test adjustment time, improve production efficiency, and reduce the possibility of manual judgment errors.
[0005] In a first aspect, an embodiment of the present invention provides a PID control parameter setting method based on a neural network, comprising:
[0006] Acquire at least one set of input data of a servo system and output data of the servo system corresponding to the input data, wherein the input data of the servo system includes PID control parameters and expected state quantities, and the output data of the servo system includes system state quantities output by the servo system after operation based on the PID control parameters and the expected state quantities;
[0007] Based on each group of input data and output data of the servo system and in combination with a set neural network algorithm, determine a neural network model for representing the relationship between the input data and output data of the servo system;
[0008] The neural network model is optimized and solved to determine the optimal PID control parameters.
[0009] In a second aspect, an embodiment of the present invention provides a PID control parameter setting device based on a neural network, comprising:
[0010] A data acquisition module, used to acquire at least one set of input data of a servo system and output data of the servo system corresponding to the input data, wherein the input data of the servo system includes PID control parameters and expected state quantities, and the output data of the servo system includes system state quantities output by the servo system after operation based on the PID control parameters and the expected state quantities;
[0011] A model determination module, used to determine a neural network model for representing the relationship between the input data and the output data of the servo system based on each group of input data and output data of the servo system in combination with a set neural network algorithm;
[0012] The parameter solving module is used to optimize and solve the neural network model to determine the optimal PID control parameters.
[0013] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the neural network-based PID control parameter tuning method as described in any embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the neural network-based PID control parameter tuning method as described in any embodiment of the present invention when executed.
[0018] The embodiment of the present invention provides a method, device, equipment and medium for setting PID control parameters based on neural network, the method comprising: first obtaining at least one set of input data of a servo system and output data of the servo system corresponding to the input data, wherein the input data of the servo system includes PID control parameters and expected state quantities, and the output data of the servo system includes system state quantities output by the servo system after operation based on the PID control parameters and expected state quantities; then determining a neural network model for representing the relationship between the input data and output data of the servo system based on each set of input data and output data of the servo system in combination with a set neural network algorithm; finally optimizing and solving the neural network model to determine the optimal PID control parameters. Different from the method of manually setting PID control parameters in the prior art, the above technical scheme uses a neural network algorithm to fit the relationship between PID control parameters, expected state quantities and system state quantities, that is, fits the mapping relationship between the input and output of the servo system, uses a trained neural network model to simulate the loop of the servo system, and then uses an optimization algorithm to solve the neural network model to obtain the final PID control parameters as the set PID control parameters. The PID parameters can be automatically adjusted quickly, the test adjustment time can be effectively reduced to improve production efficiency, and the possibility of manual judgment errors can be reduced.
[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A flowchart of a PID control parameter tuning method based on a neural network provided in Embodiment 1 of the present invention;
[0022] Figure 2 A flowchart of another neural network-based PID control parameter tuning method provided in Embodiment 2 of the present invention;
[0023] Figure 3 A flowchart of a PID control parameter setting method based on a neural network provided in the second embodiment of the present invention;
[0024] Figure 4A schematic diagram of the structure of a PID control parameter setting device based on a neural network provided in Embodiment 3 of the present invention;
[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "original", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Embodiment 1
[0029] Figure 1 The present invention provides a flowchart of a neural network-based PID control parameter setting method, which is applicable to the case of rapid setting of PID control parameters. The method can be performed by a neural network-based PID control parameter setting device, which can be implemented in the form of hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the neural network-based PID control parameter tuning method provided in the first embodiment may specifically include the following steps:
[0030] S101. Acquire at least one set of input data of a servo system and output data of the servo system corresponding to the input data.
[0031] The input data of the servo system includes PID control parameters and expected state quantities, and the output data of the servo system includes the system state quantities output by the servo system after operation based on the PID control parameters and the expected state quantities. The PID control parameters include proportional parameters, integral parameters and differential parameters. The expected state quantities include expected position, expected speed and expected acceleration. The system state quantities include feedback position, feedback speed and feedback acceleration.
[0032] In this embodiment, the controller outputs a set of PID control parameters and expected state quantities (i.e., expected position, expected speed, and expected acceleration) to the actuator motor of the servo system. After the actuator motor runs for one cycle, the system state quantities of this cycle (i.e., feedback position, feedback speed, and feedback acceleration) are obtained. This step is repeated to obtain the PID control parameters, expected state quantities, and system state quantities within a period of time. The PID control parameters and expected state quantities are used as input data of the servo system, and the corresponding output system state quantities of the servo system are used as output data of the servo system corresponding to the input data.
[0033] S102: Based on each group of input data and output data of the servo system and in combination with a set neural network algorithm, determine a neural network model for representing the relationship between the input data and output data of the servo system.
[0034] Among them, the neural network algorithm is a kind of machine learning algorithm, which is a nonlinear fitting algorithm with self-tuning function. It can fit most systems, and the relationship between input and output can be effectively predicted by fitting the system. In the field of motion control, it can accurately fit complex systems and effectively establish a nonlinear relationship between input and output. In this embodiment, a model-free neural network algorithm is used. Exemplarily, the set neural network algorithm can use a multi-layer feedforward (Back Propagation, BP) neural network.
[0035] In this embodiment, the input data and output data of the servo system obtained above are input into the set neural network algorithm, and the relationship between the expected input and the actual output is fitted by the neural network algorithm to obtain a neural network model for representing the relationship between the input data and the output data of the servo system. This is equivalent to using a neural network to establish a mapping relationship between the system servo parameters and the system state based on the servo parameters and system state provided by the servo system, outside the control system and in an offline state.
[0036] S103, optimizing and solving the neural network model to determine the optimal PID control parameters.
[0037] In this embodiment, an optimization algorithm is applied to the mapping relationship trained by the neural network to optimize and output a set of optimal PID control parameters, and then this set of optimal PID control parameters can be input into the controller. Exemplarily, a quantum particle swarm optimization algorithm can be used to optimize the neural network model. For example, an objective function can be constructed based on the neural network model. The quantum particle swarm optimization algorithm uses the objective function as the fitness function to quickly optimize and obtain the optimal PID parameter solution, which is recorded as the optimal PID control parameter.
[0038] It can be understood that based on the feedback of actual motion parameters (i.e., position, velocity, and acceleration), the time spent on manually modifying parameters repeatedly and then modifying parameters based on observations can be reduced, and the modification effect is quantitatively analyzed by the algorithm, reducing the possibility of manual misjudgment. This algorithm can effectively improve production efficiency.
[0039] The above technical solution uses a neural network algorithm to fit the relationship between PID control parameters, expected state quantities and system state quantities, that is, to fit the mapping relationship between the input and output of the servo system, uses a trained neural network model to simulate the loop of the servo system, and then uses an optimization algorithm to solve the neural network model to obtain the final PID control parameters as the PID control parameters after adjustment. The PID parameters can be adjusted automatically and quickly, effectively reducing the test adjustment time and improving production efficiency, and can reduce the possibility of manual judgment errors.
[0040] As an optional embodiment of the embodiment of the present invention, based on the above embodiment, after determining the optimal PID control parameters, the method further includes:
[0041] The optimal PID control parameters are input into the controller, and the step of obtaining at least one set of input data of the servo system and output data of the servo system corresponding to the input data is returned and re-executed until the system state quantity output by the servo system meets the set optimization conditions.
[0042] The optimization condition may be set such that the difference between the expected state quantity of the system input and the system state quantity of the output of the system after operation is less than the set error. In this embodiment, after optimizing and outputting a set of optimal PID control parameters, the optimized PID control parameters are input back into the controller, run for a cycle, obtain at least one set of input data of the servo system and the output data of the servo system corresponding to the input data, train and optimize a set of PID parameters again, repeat steps S101 to S103 in a cycle, until the system state quantity output by the servo system meets the requirements.
[0043] The above technical solution adds a step to further optimize the optimal PID control parameters. The optimal PID control parameters obtained by the optimization algorithm are input into the servo system. The optimal PID control parameters are verified and further optimized through actual operation data, so that more accurate control can be achieved based on the adjusted optimal PID control parameters.
[0044] Embodiment 2
[0045] Figure 2 A flow chart of another neural network-based PID control parameter tuning method provided in Example 2 of the present invention. This embodiment is a further optimization of the above embodiment. In this embodiment, "obtaining at least one set of input data of a servo system and output data of the servo system corresponding to the input data" is further limited and optimized, and "based on each set of input data and output data of the servo system, combined with a set neural network algorithm, determining a neural network model for representing the relationship between the input data and output data of the servo system" is further limited and optimized, and "optimizing and solving the neural network model to determine the optimal PID control parameters" is further limited and optimized.
[0046] like Figure 2 As shown, this embodiment 2 provides a PID control parameter tuning method based on a neural network, which specifically includes the following steps:
[0047] S201. After a controller outputs a set of PID control parameters and expected state quantities to an actuator motor of a servo system and the actuator motor runs for one cycle, a system state quantity output by the servo system is obtained.
[0048] In this embodiment, the controller outputs a set of PID control parameters and expected state quantities to the actuator motor of the servo system. After the actuator motor runs for a cycle, the system state quantity of the servo system in this cycle is obtained. For example, assuming that the expected state quantity is expressed as ξ d =[x d v d a d ], the system state quantity is expressed as ξ n =[x n v n a n ], where x d represents the desired position, v d represents the expected speed, a d represents the expected acceleration, x n Indicates the feedback position, v n Indicates the feedback speed, a n Indicates the feedback acceleration.
[0049] S202: Use the PID control parameters and the expected state quantity as input data of the servo system, and use the system state quantity as output data of the servo system corresponding to the input data.
[0050] In this embodiment, the PID control parameters and the expected state quantity are used as input data of the servo system, and the PID control parameters can be considered as servo parameters. The system state quantity is used as output data of the servo system after one cycle.
[0051] S203, update the PID control parameters and the expected state quantity, and return to execute the step of obtaining the system state quantity output by the servo system.
[0052] In this embodiment, the PID control parameters and the desired state quantity are updated, and the above steps S201 and S202 are repeated.
[0053] S204: Acquire each group of input data of the servo system within a set time period and output data of the servo system corresponding to the input data.
[0054] The set time period can be set according to actual conditions. Specifically, the input data of the servo system within a period of time, namely, the PID control parameters and the expected state quantity, and the corresponding output data of the servo system, namely, the system state quantity, are obtained.
[0055] S205. For each set of data, the PID control parameters and expected state quantities of the servo system are input into a set neural network algorithm for a forward propagation, and the predicted state quantities are output.
[0056] The neural network algorithm set may be a BP neural network. The process of the BP neural network can be expressed as: i =x×u,H o =sigmoid(H i +h b ), Y=H o ×v, where u and v represent weight matrices, x represents input, Y represents output, and h represents b Represents the bias term. Based on the above process, a forward propagation is performed. The forward propagation is performed through the following steps: Input layer to hidden layer: The input feature vector enters the hidden layer through the input layer, and the output of the hidden layer is calculated. Hidden layer to output layer: The output of the hidden layer enters the output layer as input, and finally the prediction result of the model is calculated. Activation function: In each network layer, the output is processed using an activation function. Common activation functions include sigmoid, etc. For each set of data, the PID control parameters and expected state quantities of the servo system are input into the set neural network algorithm for a forward propagation, and the predicted state quantity is output.
[0057] S206. Based on the set loss function, determine the loss function value of the predicted state quantity and the system state quantity.
[0058] In this embodiment, the loss function is set as: ξ d represents the predicted state quantity, ξ i represents the system state, and loss represents the predicted state ξ d and the system state quantity ξ i Specifically, the predicted state quantity and the system state quantity are input into the set loss function to obtain the loss function values of the two.
[0059] S207. According to the loss function value, the weight matrix of the neural network algorithm is updated by using the gradient descent method, and the forward propagation process is returned to be re-executed until the training termination condition is met, so as to obtain a neural network model for representing the relationship between the input data and the output data of the servo system.
[0060] In this embodiment, the training termination condition may be that the loss function value between the predicted state quantity and the actual output system state quantity is less than a set threshold. According to the loss function value, the weight matrices u and v of the neural network algorithm are updated using the gradient descent method, and then the forward propagation process is performed again, and this step is repeated until the training termination condition is met, that is, the network training is completed, thereby obtaining the mapping relationship between the input data and the output data of the servo system, and the mapping relationship is represented by the neural network model here.
[0061] S208. Construct an objective function based on the neural network model.
[0062] In this embodiment, a neural network model is used to simulate the control loop of the replacement servo system. After the neural network model is obtained, different PID control parameters are used to obtain the optimal solution under this model. What kind of algorithm is used to obtain the optimal solution? Here, an optimization algorithm is used to optimize the solution with the objective function as the fitness function. Specifically, the neural network model is placed in the objective function as an algorithm, and then the optimization solution is performed later. The neural network model is simplified and expressed as: NNP([PIDξ d ])=ξ p , where ξ d Represents the servo system input PID control parameters and the desired state quantity ξ p The predicted state quantity of the servo system output when ;
[0063] The objective function is expressed as: F = P*max(E)+Q*ΣE+R*e, where F represents the fitness value, P, Q, and R represent weight matrices, E represents the error between each group of predicted state quantities and the expected state quantities of the servo system, and e represents the error between a group of predicted state quantities and the expected state quantities of the servo system;
[0064] E=[ξ pn -ξ dn ], where ξ pn represents the nth group of predicted state quantities of the servo system, ξ dn Represents the nth set of desired state quantities of the servo system.
[0065] S209: Taking the objective function as the fitness function, optimizing the fitness function by using a set optimization algorithm to obtain the optimal PID control parameters.
[0066] Among them, the setting optimization algorithm adopts the quantum particle swarm optimization algorithm. The quantum particle swarm optimization algorithm uses the objective function as the fitness function, quickly searches for the best solution to the optimal PID parameter. In the quantum particle swarm optimization algorithm, the possible solutions to the problem to be optimized are called "particles", which represent a point in the n-dimensional space. Each particle has a fitness value determined by the objective function. By iterating in the search space, each generation of particles is continuously updated to finally obtain the optimal solution. Taking the objective function as the fitness function, the setting optimization algorithm is used to optimize the fitness function, so as to obtain a set of optimal PID parameter solutions as the optimal PID control parameters. The quantum particle swarm algorithm randomly inputs n groups of PID control parameters to optimize the neural network model. By continuously iterating and updating the PID control parameters, an optimal PID control parameter can be converged.
[0067] For example, in order to more clearly describe the execution process of the neural network-based PID control parameter tuning method provided in an embodiment of the present invention, Figure 3 A flowchart of a PID control parameter setting method based on a neural network provided in the second embodiment of the present invention is shown in FIG. Figure 3As shown, the PID control parameters and the desired trajectory (position, velocity and acceleration) are input into the servo system. The control loop of the servo system can be recorded as a servo loop. The servo loop includes a position loop, a velocity loop and an actuator. The servo system outputs feedback position, feedback velocity and feedback acceleration. The desired position, velocity and acceleration, as well as the feedback position, feedback velocity and feedback acceleration are input into the neural network processor (NNP). Based on whether the loss function value is minimized, the neural network is trained to obtain a neural network model representing the mapping relationship between the input and output of the servo system. The neural network model is then solved based on the quantum particle swarm optimization algorithm (QPSO in the figure). QPSO predicts PID to NNP, and NNP predicts and outputs it to QPSO to optimize PID and obtain the optimal PID control parameters, which are fed back to the servo system for control.
[0068] The above technical solution specifies the steps of obtaining the input data and output data of the servo system, determining the neural network model used to represent the relationship between the input data and output data of the servo system, and optimizing and solving the neural network model to determine the optimal PID control parameters. In addition to the existing servo loop, the PID control parameters are quickly adjusted offline to effectively reduce the test adjustment time. Relying on the system motion state data and servo parameters provided by the servo loop, a neural network is used to establish the relationship between the system parameters and the system state, and then the optimal PID parameter group is selected based on the quantum particle swarm algorithm to optimize the objective function, thereby reducing the possibility of manual judgment errors and effectively improving production efficiency.
[0069] Furthermore, as a specific implementation method, the objective function can be optimized as the fitness function, and the fitness function can be optimized by using a set optimization algorithm to obtain the optimal PID control parameters, including:
[0070] 1) Initialize the particle swarm.
[0071] In this embodiment, the particle swarm is initialized, the initial position of each particle is randomly initialized, and the optimal individual position and the optimal group position are initialized.
[0072] 2) Calculate the average optimal position of all particles.
[0073] In this embodiment, the average optimal position of all particles is expressed as: mbest represents the average optimal position of all particles, m represents the number of particles, P i represents the optimal individual position of the ith particle.
[0074] 3) According to the fitness value of each particle in the fitness function, update the optimal individual position and optimal group position of each particle.
[0075] This step is used to calculate the fitness of each particle according to the fitness function, and update the optimal individual position and optimal group position of each particle according to the following formula.
[0076] Among them, the formula for the optimal position of the particle is expressed as:
[0077] Where f(·) is the fitness function, p i (t-1) represents the optimal individual position of particle i in the t-1th iteration, x i represents the position of particle i, p i (t) represents the optimal individual position of particle i in the tth iteration, p g (t) represents the optimal position of the particle swarm in the tth iteration.
[0078] 4) Calculate the random points for each particle.
[0079] 5) Update the position of each particle.
[0080] Among them, the position equation is expressed as:
[0081] x(t+1)=x(t)+v(t+1), v(t+1)=wv(t)+c1r1(t)[p i (t)-x(t)]+c2r2(t)[p g (txt)],
[0082] In the formula, x(t) represents the particle position, v(t) represents the particle velocity, and p i (t) represents the optimal individual position of particle i in the tth iteration, p g (t) represents the optimal position of the particle swarm at the tth iteration, w and c are coefficients, and r represents a random function.
[0083] 6) Determine whether the current iteration meets the iteration termination condition.
[0084] In this embodiment, the iteration termination condition may be that the iteration reaches the minimum fitness or the number of iterations reaches a set number. This step is used to determine whether the current iteration meets the iteration termination condition.
[0085] 7) If the current iteration does not meet the iteration termination condition, return to the step of calculating the average optimal position of all particles.
[0086] Specifically, if the current iteration does not meet the iteration termination condition, the process returns to re-execute the step of calculating the average optimal position of all particles.
[0087] 8) If the current iteration meets the iteration termination condition, the particle position of the last iteration is configured as the optimal PID control parameter.
[0088] Specifically, if the current iteration satisfies the iteration termination condition, the example position of the last iteration is configured as the optimal PID control parameter.
[0089] The above technical solution specifies the steps of optimizing the fitness function by setting an optimization algorithm to obtain the optimal PID control parameters.
[0090] Embodiment 3
[0091] Figure 4 Schematic diagram of the structure of a PID control parameter setting device based on a neural network provided in Embodiment 3 of the present invention. The device can be applied to the case of setting PID control parameters. The PID control parameter setting device based on a neural network can be configured in an electronic device, such as Figure 4 As shown, the device includes: a data acquisition module 31, a model determination module 32 and a parameter solution module 33; wherein,
[0092] A data acquisition module 31 is used to acquire at least one set of input data of the servo system and output data of the servo system corresponding to the input data, wherein the input data of the servo system includes PID control parameters and expected state quantities, and the output data of the servo system includes system state quantities output by the servo system after operation based on the PID control parameters and the expected state quantities;
[0093] A model determination module 32, for determining a neural network model for representing the relationship between the input data and the output data of the servo system based on each set of input data and output data of the servo system in combination with a set neural network algorithm;
[0094] The parameter solving module 33 is used to optimize and solve the neural network model to determine the optimal PID control parameters.
[0095] The above technical solution uses a neural network algorithm to fit the relationship between PID control parameters, expected state quantities and system state quantities, that is, to fit the mapping relationship between the input and output of the servo system, uses a trained neural network model to simulate the loop of the servo system, and then uses an optimization algorithm to solve the neural network model to obtain the final PID control parameters as the PID control parameters after adjustment. The PID parameters can be adjusted automatically and quickly, effectively reducing the test adjustment time and improving production efficiency, and can reduce the possibility of manual judgment errors.
[0096] Optionally, the data acquisition module 31 is specifically used for:
[0097] A set of PID control parameters and expected state quantities are output to the actuator motor of the servo system through the controller, and after the actuator motor runs for one cycle, the system state quantity output by the servo system is obtained;
[0098] The PID control parameters and the expected state quantity are used as the input data of the servo system, and the system state quantity is used as the output data of the servo system corresponding to the input data;
[0099] Update the PID control parameters and the expected state quantity, and return to execute the step of obtaining the system state quantity output by the servo system;
[0100] Each group of input data of the servo system within a set time period and the output data of the servo system corresponding to the input data are obtained.
[0101] Optionally, the model determination module 32 is specifically configured to:
[0102] For each set of data, the PID control parameters and expected state quantities of the servo system are input into the set neural network algorithm for a forward propagation, and the predicted state quantities are output;
[0103] Based on the set loss function, determine the loss function value of the predicted state quantity and the system state quantity;
[0104] According to the loss function value, the gradient descent method is used to update the weight matrix of the neural network algorithm, and the forward propagation process is returned and re-executed until the training termination condition is met, thereby obtaining a neural network model for representing the relationship between the input data and output data of the servo system.
[0105] Optionally, the parameter solving module 33 includes:
[0106] A function building unit, used to build a target function based on a neural network model;
[0107] The parameter solving unit is used to use the objective function as the fitness function, adopt a set optimization algorithm to optimize the fitness function, and obtain the optimal PID control parameters.
[0108] Optionally, the neural network model is represented as: NNP([PIDξ d ])=ξ p , where ξ d Represents the servo system input PID control parameters and the desired state quantity ξ p The predicted state quantity of the servo system output when ;
[0109] The objective function is expressed as: F = P*max(E)+Q*∑E+R*e, where F represents the fitness value, P, Q, and R represent weight matrices, E represents the error between each group of predicted state quantities and the expected state quantity of the servo system, and e represents the error between a group of predicted state quantities and the expected state quantity of the servo system;
[0110] E=[ξ pn -ξ dn ], where ξ pnrepresents the nth group of predicted state quantities of the servo system, ξ dn Represents the nth set of desired state quantities of the servo system.
[0111] Optionally, the parameter solving unit is specifically used for:
[0112] Initialize particle swarm;
[0113] Calculate the average optimal position of all particles;
[0114] According to the fitness value of each particle in the fitness function, update the optimal individual position and optimal group position of each particle;
[0115] Calculate random points for each particle;
[0116] Update the position of each particle;
[0117] Determine whether the current iteration meets the iteration termination condition;
[0118] If the current iteration does not meet the iteration termination condition, return to the step of calculating the average optimal position of all particles;
[0119] If the current iteration meets the iteration termination condition, the particle position of the last iteration is configured as the optimal PID control parameter.
[0120] Optionally, the device further comprises a parameter optimization module, which is specifically used to:
[0121] The optimal PID control parameters are input into the controller, and the step of obtaining at least one set of input data of the servo system and output data of the servo system corresponding to the input data is returned and re-executed until the system state quantity output by the servo system meets the set optimization conditions.
[0122] The neural network-based PID control parameter setting device provided in the embodiment of the present invention can execute the neural network-based PID control parameter setting method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0123] Embodiment 4
[0124] Figure 5A schematic diagram of the structure of an electronic device provided for Embodiment 4 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0125] like Figure 5 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0126] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0127] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 41 executes the various methods and processes described above, such as a PID control parameter tuning method based on a neural network.
[0128] In some embodiments, the neural network-based PID control parameter tuning method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the neural network-based PID control parameter tuning method described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to execute the neural network-based PID control parameter tuning method by any other appropriate means (e.g., by means of firmware).
[0129] The electronic device 40 can be deployed as an edge computing device at the edge of the intersection, which greatly reduces the data transmission network delay and the operating burden of the server of the road traffic management center. The device is lightweight and can be deployed quickly, which reliably and efficiently guarantees the implementation of the PID control parameter setting method based on the neural network. The electronic device can not only complete the data access, fusion and identification of the holographic perception device and obtain the positioning information of the target vehicle, but also support the algorithm implementation of the above-mentioned PID control parameter setting method based on the neural network, forming a stable, fast and lightweight intersection "thinking center". The electronic device can make full use of the various sensor data in the holographic road network environment, give full play to the unique advantages of each sensor, and realize high-precision and all-round perception of the target vehicle. With its low-latency data transmission network and efficient lightweight deployment, it ensures the rapid response and reliable execution of the analysis algorithm. The electronic device 40 can be a separate hardware device, or it can be integrated into existing intersection equipment, such as traffic lights or electric police systems.
[0130] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0131] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0132] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0133] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0134] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0135] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0136] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements a neural network-based PID control parameter tuning method as provided in any embodiment of the present invention.
[0137] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code for the operation of the present disclosure, including but not limited to object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0138] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0139] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A PID control parameter setting method based on neural network, characterized in that: include: Acquire at least one set of input data of a servo system and output data of the servo system corresponding to the input data, wherein the input data of the servo system includes PID control parameters and expected state quantities, and the output data of the servo system includes system state quantities output by the servo system after operation based on the PID control parameters and the expected state quantities; Based on each group of input data and output data of the servo system and in combination with a set neural network algorithm, determine a neural network model for representing the relationship between the input data and output data of the servo system; The neural network model is optimized and solved to determine the optimal PID control parameters.
2. The method according to claim 1, characterized in that The acquiring at least one set of input data of the servo system and output data of the servo system corresponding to the input data comprises: A set of PID control parameters and expected state quantities are output to an actuator motor of the servo system through a controller, and after the actuator motor runs for one cycle, a system state quantity output by the servo system is obtained; Using the PID control parameters and the expected state quantity as input data of the servo system, and using the system state quantity as output data of the servo system corresponding to the input data; Update PID control parameters and expected state quantities, and return to execute the step of obtaining the system state quantity output by the servo system; Each group of input data of the servo system within a set time period and output data of the servo system corresponding to the input data are obtained.
3. The method according to claim 1, characterized in that The determining of a neural network model for representing the relationship between the input data and the output data of the servo system based on each group of input data and output data of the servo system in combination with a set neural network algorithm comprises: For each set of data, the PID control parameters and expected state quantities of the servo system are input into a set neural network algorithm for a forward propagation, and the predicted state quantities are output; Based on a set loss function, determining loss function values of the predicted state quantity and the system state quantity; According to the loss function value, the weight matrix of the neural network algorithm is updated by using the gradient descent method, and the forward propagation process is returned and re-executed until the training termination condition is met, thereby obtaining a neural network model for representing the relationship between the input data and output data of the servo system.
4. The method according to claim 1, characterized in that: The step of optimizing and solving the neural network model to determine the optimal PID control parameters includes: Based on the neural network model, construct an objective function; The objective function is used as the fitness function, and a setting optimization algorithm is used to optimize the fitness function to obtain the optimal PID control parameters.
5. The method according to claim 4, characterized in that The neural network model is expressed as: NNP([PIDξ d ])=ξ p , where ξ d Represents the servo system input PID control parameters and the desired state quantity ξ p The predicted state quantity of the servo system output when ; The objective function is expressed as: F = P*max(E)+Q*ΣE+R*e, where F represents the fitness value, P, Q, and R represent weight matrices, E represents the error between each group of predicted state quantities and the expected state quantity of the servo system, and e represents the error between a group of predicted state quantities and the expected state quantity of the servo system; E=[ξ pn -ξ dn ], where ξ pn represents the nth group of predicted state quantities of the servo system, ξ dn Represents the nth set of desired state quantities of the servo system.
6. The method according to claim 4, characterized in that The method of taking the objective function as the fitness function and optimizing the fitness function by using a set optimization algorithm to obtain the optimal PID control parameters includes: Initialize particle swarm; Calculate the average optimal position of all particles; According to the fitness value of each particle of the fitness function, the optimal position of each individual particle and the global optimal position of the particle swarm are updated; Calculate random points for each particle; Update the position of each particle; Determine whether the current iteration meets the iteration termination condition; If the current iteration does not meet the iteration termination condition, return to the step of calculating the average optimal position of all particles; If the current iteration meets the iteration termination condition, the particle position of the last iteration is configured as the optimal PID control parameter.
7. The method according to claim 1, characterized in that After determining the optimal PID control parameters, it also includes: The optimal PID control parameters are input into the controller, and the step of obtaining at least one set of input data of the servo system and output data of the servo system corresponding to the input data is returned and re-executed until the system state quantity output by the servo system meets the set optimization conditions.
8. A PID control parameter setting device based on neural network, characterized in that: include: A data acquisition module, used to acquire at least one set of input data of a servo system and output data of the servo system corresponding to the input data, wherein the input data of the servo system includes PID control parameters and expected state quantities, and the output data of the servo system includes system state quantities output by the servo system after operation based on the PID control parameters and the expected state quantities; A model determination module, used to determine a neural network model for representing the relationship between the input data and the output data of the servo system based on each group of input data and output data of the servo system in combination with a set neural network algorithm; The parameter solving module is used to optimize and solve the neural network model to determine the optimal PID control parameters.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the neural network-based PID control parameter tuning method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a neural network-based PID control parameter tuning method as described in any one of claims 1-7 when executed.
Citation Information
Cited By
Data collection method and device for servo parameter setting, servo system and storage medium
CN120406311A
Data setting method and system and computer readable storage medium
CN120415214A
Intelligent servo control method of glass edge grinding machine guided by causal priori
CN121348966A
A causal prior guided intelligent servo control method for glass edger
CN121348966B