A servo control system and a neural network feedforward controller training method
By introducing a neural network feedforward controller and genetic algorithm optimization into the servo control system, the problem of performance degradation of iterative learning control in non-repetitive motion is solved, and excellent trajectory tracking performance under different motion conditions is achieved.
Patent Information
- Application Number
- CN202211294257.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-21
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2042-10-21
AI Technical Summary
Iterative learning control is only applicable to repetitive motion systems. Its performance deteriorates sharply when the reference trajectory changes, making it difficult to achieve good trajectory tracking performance in both repetitive and non-repetitive motions.
A servo control system is adopted, which combines an adder/subtractor, a feedback controller, a neural network feedforward controller, and an adder. The optimal feedforward control signal for multiple different reference trajectories is learned through an iterative learning control method. The hyperparameters of the neural network are optimized using a genetic algorithm, the neural network feedforward controller is trained, and a mapping relationship between the reference trajectory and the optimal feedforward control signal is established to achieve real-time prediction of different trajectories.
It achieves excellent trajectory tracking performance in both repetitive and non-repetitive motions, improving the adaptability and tracking accuracy of the servo control system.
Smart Images

Figure CN115759215B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of servo control technology, and in particular to a servo control system and a neural network feedforward controller training method. Background Technology
[0002] Motion systems, as core components of numerous processing, manufacturing, and testing equipment, play a crucial role in industrial production and national defense. Their servo control performance directly determines the overall performance of these equipment. In servo control systems, feedforward control is employed to reduce trajectory tracking errors introduced by the reference trajectory, thereby improving trajectory tracking performance. Iterative learning control is a typical feedforward control method. It uses the feedforward control signal and trajectory tracking error from the previous trajectory tracking task to correct the feedforward control signal for the next trajectory tracking task, obtaining the optimal feedforward control signal through multiple iterations. Compared to other feedforward control methods, iterative learning control exhibits superior trajectory tracking performance in repetitive motion systems.
[0003] However, iterative learning control is only applicable to repetitive motion systems, and its performance deteriorates sharply when the reference trajectory changes. Therefore, there is an urgent need to propose a feedforward control method that can leverage the advantages of iterative learning control in repetitive trajectory tracking tasks while ensuring adaptability to different trajectory tracking tasks, enabling the servo control system to achieve excellent trajectory tracking performance in both repetitive and non-repetitive motion. Summary of the Invention
[0004] Therefore, it is necessary to provide a servo control system and a neural network feedforward controller training method to address the above-mentioned technical problems.
[0005] A servo control system includes: an adder / subtractor, a feedback controller, a neural network feedforward controller, an adder, and a controlled object;
[0006] The input terminal of the adder / subtractor is connected to the reference trajectory and the output terminal of the controlled object; the output terminal of the adder / subtractor is connected to the input terminal of the feedback controller; the input terminal of the neural network feedforward controller is connected to the reference trajectory; the output terminals of the feedback controller and the neural network feedforward controller are connected to the input terminal of the adder; the output terminal of the adder is connected to the input terminal of the controlled object.
[0007] The adder / subtractor acquires the reference trajectory and the position signal output by the controlled object, performs a subtraction operation to generate a trajectory tracking error, and outputs the trajectory tracking error to the feedback controller; the feedback controller generates a feedback control signal based on the trajectory tracking error; the neural network feedforward controller predicts the optimal feedforward control signal in real time based on the reference trajectory; the adder acquires the feedback control signal output by the feedback controller and the optimal feedforward control signal output by the neural network feedforward controller, performs a summation operation to generate a total control signal, and outputs the total control signal to the controlled object; the controlled object performs trajectory tracking motion under the drive of the total control signal.
[0008] In servo motion control, a neural network feedforward controller predicts the optimal feedforward control signal in real time based on a reference trajectory to compensate for the trajectory tracking error introduced by the reference trajectory.
[0009] A method for training a neural network feedforward controller in a servo control system, comprising the following steps:
[0010] Step 1: Use an iterative learning control method to learn the optimal feedforward control signal for multiple different reference trajectories, and determine the input and output of the neural network;
[0011] Step two: Select the architecture and training algorithm for the neural network;
[0012] Step 3: Use a genetic algorithm to optimize the hyperparameters of the neural network, such as the number of hidden layers, the number of hidden layer neurons, the initial weight values, and the learning rate. Train the neural network feedforward controller based on the reference trajectory and the optimal feedforward control signal to establish a mapping relationship between the reference trajectory and the optimal feedforward control signal.
[0013] The input to the neural network is the reference trajectory at the current time and several previous times, and the multi-order derivatives of the reference trajectory. The output of the neural network is the optimal feedforward control signal.
[0014] Since the optimal feedforward control signal has a temporal sequence, the architecture of the neural network can be selected as a time-series neural network with input delay or a recurrent neural network.
[0015] When the total number of weights in a neural network is less than 1000, the Levenberg-Marquardt algorithm or the quasi-Newton algorithm can be used to train the neural network. When the total number of weights in a neural network is greater than or equal to 1000, the conjugate gradient method can be used.
[0016] The specific steps for optimizing the hyperparameters of a neural network using a genetic algorithm include:
[0017] Step 1: Initialization. Set the evolution number j=0, set the range of hyperparameter values, and select the encoding method. A set of hyperparameter values is considered an individual in the genetic algorithm. Determine the number of individuals n, and all individuals constitute the population. Randomly generate initial individuals, encode the initial individuals to obtain the initial population. Design the fitness function using the mean square error between the predicted output and the expected output of the neural network feedforward controller. Determine the selection and crossover operation methods, and set the crossover probability and mutation probability. Set the evolution termination condition.
[0018] Step 2: Train the neural network sequentially using the hyperparameter values of each individual in the initial population, and calculate the individual fitness value based on the fitness function;
[0019] Step 3: Determine the selection probability of each individual based on its fitness value; based on the selection probability, select individuals from the population n times, and place the selected individuals into the intermediate population.
[0020] Step 4: Pair individuals in the intermediate population into pairs, assign a random number to each pair, and compare the random number with the crossover probability. If the random number is less than the crossover probability, the two individuals are crossovered, and the two new individuals generated by the crossover replace the original individuals and are placed into the intermediate population; otherwise, no crossover is performed, and the original individuals remain in the intermediate population.
[0021] Step 5: Assign a random number to each individual in the intermediate population, compare the random number with the mutation probability. If the random number is less than the mutation probability, the individual undergoes a mutation operation, and the new individual generated by the mutation operation replaces the original individual and is placed in the intermediate population; otherwise, no mutation operation is performed, and the original individual remains in the intermediate population.
[0022] Step 6: The intermediate population after the mutation operation is the new population generated in the (j+1)th evolution. Decode each individual in the new population. The decoding result is the updated hyperparameter value. Use the updated hyperparameter to train the neural network and calculate the individual fitness value according to the fitness function.
[0023] Step 7: Determine whether the evolution result meets the evolution termination condition. If the evolution termination condition is met, end the evolution and the hyperparameter of the individual with the highest fitness value in the new population is the optimal hyperparameter; otherwise, return to step 3.
[0024] The servo control system of this invention includes an adder / subtractor, a feedback controller, a neural network feedforward controller, an adder, and a controlled object. The training method for the neural network feedforward controller is as follows: an iterative learning control method is used to learn the optimal feedforward control signals for multiple different reference trajectories, determining the input and output of the neural network, selecting the neural network architecture and training algorithm, optimizing the hyperparameters of the neural network using a genetic algorithm, and training the neural network feedforward controller based on the reference trajectory and the optimal feedforward control signal. In servo motion control, the neural network feedforward controller predicts the optimal feedforward control signal in real time based on the reference trajectory, compensating for the trajectory tracking error introduced by the reference trajectory. This invention combines the advantages of iterative learning control and neural networks, enabling the servo control system to achieve excellent trajectory tracking performance in both repetitive and non-repetitive motions. Attached Figure Description
[0025] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings:
[0026] Figure 1 This is a schematic diagram of the servo control system in one embodiment of the present invention;
[0027] Figure 2 This is a Bode diagram of the controlled object in one embodiment of the present invention;
[0028] Figure 3 This is a flowchart illustrating the neural network feedforward controller training method of a servo control system in one embodiment of the present invention.
[0029] Figure 4 This is a reference trajectory curve used in one embodiment of the present invention;
[0030] Figure 5 This is a comparison diagram of trajectory tracking errors when the method of the present invention and the iterative learning control method repeatedly track trajectory 1 in one embodiment of the present invention;
[0031] Figure 6 This is a comparison chart of trajectory tracking errors of the method of the present invention and the iterative learning control method when the reference trajectory changes from trajectory 1 to trajectory 2 in one embodiment of the present invention. Detailed Implementation
[0032] This invention discloses a servo control system and a neural network feedforward controller training method. To more clearly and comprehensively demonstrate the features and advantages of this invention, a detailed description will be given below based on an embodiment of this invention, in conjunction with the accompanying drawings.
[0033] In this embodiment, the servo control system is as follows: Figure 1 As shown, it includes: an adder / subtractor, a feedback controller, a neural network feedforward controller, an adder, and the controlled object;
[0034] The input terminals of the adder / subtractor are connected to the reference trajectory and the output terminals of the controlled object; the output terminals of the adder / subtractor are connected to the input terminals of the feedback controller; the input terminals of the neural network feedforward controller are connected to the reference trajectory; the output terminals of the feedback controller and the neural network feedforward controller are connected to the input terminals of the adder; and the output terminals of the adder are connected to the input terminals of the controlled object.
[0035] The adder / subtractor acquires the reference trajectory and the position signal output by the controlled object, performs a subtraction operation to generate a trajectory tracking error, and outputs the trajectory tracking error to the feedback controller. The feedback controller generates a feedback control signal based on the trajectory tracking error. The neural network feedforward controller predicts the optimal feedforward control signal in real time based on the reference trajectory. The adder acquires the feedback control signal output by the feedback controller and the optimal feedforward control signal output by the neural network feedforward controller, performs a sum operation to generate a total control signal, and outputs the total control signal to the controlled object. The controlled object performs trajectory tracking motion under the drive of the total control signal.
[0036] In this embodiment, the Bode diagram of the controlled object is as follows: Figure 2 As shown.
[0037] In this embodiment, the feedback controller is designed as a PID controller, which makes the closed-loop stability of the servo control system stable.
[0038] In this embodiment, the sampling period of the servo control system is 0.0002s.
[0039] In this embodiment, the specific steps of the neural network feedforward controller training method for the servo control system are as follows: Figure 3 As shown, it includes:
[0040] Step 1: Use an iterative learning control method to learn the optimal feedforward control signal for multiple different reference trajectories, and determine the input and output of the neural network;
[0041] Step two: Select the architecture and training algorithm for the neural network;
[0042] Step 3: Use a genetic algorithm to optimize the hyperparameters of the neural network, such as the number of hidden layers, the number of hidden layer neurons, the initial weight values, and the learning rate. Train the neural network feedforward controller based on the reference trajectory and the optimal feedforward control signal to establish a mapping relationship between the reference trajectory and the optimal feedforward control signal.
[0043] In this embodiment, an iterative learning control method is used to learn the optimal feedforward control signal for 40 different reference trajectories.
[0044] In this embodiment, the input to the neural network is the reference trajectory at the current time and the previous four time points, and the first four derivatives of the reference trajectory. The output of the neural network is the optimal feedforward control signal.
[0045] In this embodiment, the neural network architecture is selected as a time series neural network with input delay.
[0046] In this embodiment, the Levenberg-Marquardt algorithm is selected as the training algorithm for the neural network.
[0047] In this embodiment, the specific steps for optimizing the hyperparameters of the neural network using a genetic algorithm are as follows: Figure 3 As shown, it includes:
[0048] Step 1: Initialization. Set the evolution number j=0, set the range of hyperparameter values, and select the encoding method. A set of hyperparameter values is considered an individual in the genetic algorithm. Determine the number of individuals n, and all individuals constitute the population. Randomly generate initial individuals, encode the initial individuals to obtain the initial population. Design the fitness function using the mean square error between the predicted output and the expected output of the neural network feedforward controller. Determine the selection and crossover operation methods, and set the crossover probability and mutation probability. Set the evolution termination condition.
[0049] Step 2: Train the neural network sequentially using the hyperparameter values of each individual in the initial population, and calculate the individual fitness value based on the fitness function;
[0050] Step 3: Determine the selection probability of each individual based on its fitness value; based on the selection probability, select individuals from the population n times, and place the selected individuals into the intermediate population.
[0051] Step 4: Pair individuals in the intermediate population into pairs, assign a random number to each pair, and compare the random number with the crossover probability. If the random number is less than the crossover probability, the two individuals are crossovered, and the two new individuals generated by the crossover replace the original individuals and are placed into the intermediate population; otherwise, no crossover is performed, and the original individuals remain in the intermediate population.
[0052] Step 5: Assign a random number to each individual in the intermediate population, compare the random number with the mutation probability. If the random number is less than the mutation probability, the individual undergoes a mutation operation, and the new individual generated by the mutation operation replaces the original individual and is placed in the intermediate population; otherwise, no mutation operation is performed, and the original individual remains in the intermediate population.
[0053] Step 6: The intermediate population after the mutation operation is the new population generated in the (j+1)th evolution. Decode each individual in the new population. The decoding result is the updated hyperparameter value. Use the updated hyperparameter to train the neural network and calculate the individual fitness value according to the fitness function.
[0054] Step 7: Determine whether the evolution result meets the evolution termination condition. If the evolution termination condition is met, end the evolution and the hyperparameter of the individual with the highest fitness value in the new population is the optimal hyperparameter; otherwise, return to step 3.
[0055] In this embodiment, the number of individuals is 20, and the individuals are encoded using real number encoding.
[0056] In this embodiment, the fitness function f is the mean square error e between the predicted output and the desired output of the neural network feedforward controller. p The function, with the expression:
[0057]
[0058] Where i = 1, 2, ..., 20, f i Let e be the fitness value of the i-th individual. p,i Let k be the mean square error between the predicted output and the expected output of the neural network feedforward controller for the i-th individual, and k be a constant, according to e p,i The order of magnitude is determined; in this embodiment, k is taken as 1 × 10⁻⁶. -20 .
[0059] In this embodiment, the smaller the mean square error between the predicted output and the expected output of the neural network feedforward controller, the higher the prediction accuracy of the neural network feedforward controller for the optimal feedforward control signal, the larger the corresponding individual fitness value, and the better the individual.
[0060] In this embodiment, the selection operation method is the roulette wheel selection method, the crossover operation method is a single-point crossover, the crossover probability is 0.6, and the mutation probability is 0.01.
[0061] In this embodiment, the evolution termination condition is that the number of evolutions j = 10.
[0062] In this embodiment, the roulette wheel selection method is used, and the selection probability p for each individual is... i The calculation method is as follows:
[0063]
[0064] In this embodiment, the obtained neural network feedforward controller predicts the optimal feedforward control signal in real time based on the reference trajectory to compensate for the trajectory tracking error introduced by the reference trajectory.
[0065] In this embodiment, using the obtained neural network feedforward controller, two reference trajectories that have not been used in the aforementioned training are randomly selected to perform a trajectory tracking task, thereby verifying the effectiveness of the method of the present invention; the selected reference trajectories are as follows: Figure 4 As shown.
[0066] In this embodiment, the optimal feedforward control signal of trajectory 1 is learned using an iterative learning control method. Trajectory tracking motion is performed under trajectory 1 and its optimal feedforward control signal, and the trajectory tracking error is recorded.
[0067] In this embodiment, the reference trajectory is changed from trajectory 1 to trajectory 2, and trajectory tracking motion is performed under the optimal feedforward control signals of trajectory 2 and trajectory 1, and the trajectory tracking error is recorded.
[0068] In this embodiment, the method of the present invention is used to perform trajectory tracking motion on trajectory 1 and record the trajectory tracking error.
[0069] In this embodiment, the method of the present invention is used to perform trajectory tracking motion on trajectory 2 and record the trajectory tracking error.
[0070] In this embodiment, the trajectory tracking errors of the method of the present invention and the iterative learning control method under trajectory 1 are as follows: Figure 5 As shown; clearly, in repetitive motion, the method of the present invention can achieve trajectory tracking performance comparable to that of iterative learning control methods, thus realizing the expected control objective.
[0071] In this embodiment, when the reference trajectory changes from trajectory 1 to trajectory 2, the trajectory tracking error of the method of the present invention and the iterative learning control method is as follows: Figure 6 As shown, it is clear that in non-repetitive motion, the trajectory tracking performance of the iterative learning control method deteriorates significantly, while the method of this invention can still achieve excellent trajectory tracking performance.
[0072] The above description is merely a specific embodiment of the present invention, but it should be noted that the scope of protection of the present invention is not limited thereto; modifications, changes, and substitutions made by those skilled in the art within the technical scope disclosed in the present invention, without departing from the principles and spirit of the present invention, should all be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the claims.
Claims
1. A servo control system, characterized in that, include: Adder / subtractor, feedback controller, neural network feedforward controller, adder, and controlled object; The input terminal of the adder / subtractor is connected to the reference trajectory and the output terminal of the controlled object; the output terminal of the adder / subtractor is connected to the input terminal of the feedback controller; the input terminal of the neural network feedforward controller is connected to the reference trajectory. The output of the feedback controller and the output of the neural network feedforward controller are connected to the input of the adder; the output of the adder is connected to the input of the controlled object. The adder / subtractor acquires the reference trajectory and the position signal output by the controlled object, performs a subtraction operation to generate a trajectory tracking error, and outputs the trajectory tracking error to the feedback controller; the feedback controller generates a feedback control signal based on the trajectory tracking error; the neural network feedforward controller predicts the optimal feedforward control signal in real time based on the reference trajectory; the adder acquires the feedback control signal output by the feedback controller and the optimal feedforward control signal output by the neural network feedforward controller, performs a summation operation to generate a total control signal, and outputs the total control signal to the controlled object; the controlled object performs trajectory tracking motion under the drive of the total control signal; The neural network feedforward controller is obtained by training the neural network to learn the optimal feedforward control signals of multiple different reference trajectories using an iterative learning control method.
2. The servo control system according to claim 1, characterized in that, In servo motion control, a neural network feedforward controller predicts the optimal feedforward control signal in real time based on a reference trajectory to compensate for the trajectory tracking error introduced by the reference trajectory.
3. A neural network feedforward controller training method based on the servo control system according to claim 1 or 2, characterized in that, The specific steps include: Step 3-1): Use an iterative learning control method to learn the optimal feedforward control signal for multiple different reference trajectories, and determine the input and output of the neural network; Step 3-2): Select the architecture and training algorithm for the neural network; Step 3-3) Optimize the hyperparameters of the neural network using a genetic algorithm, including: number of hidden layers, number of hidden layer neurons, initial weight values and learning rate. Train the neural network feedforward controller based on the reference trajectory and the optimal feedforward control signal, and establish the mapping relationship between the reference trajectory and the optimal feedforward control signal.
4. The neural network feedforward controller training method for a servo control system according to claim 3, characterized in that, The input to the neural network is the reference trajectory at the current time and several previous times, and the multi-order derivatives of the reference trajectory. The output of the neural network is the optimal feedforward control signal.
5. The neural network feedforward controller training method for a servo control system according to claim 3, characterized in that, Since the optimal feedforward control signal has a temporal sequence, the architecture of the neural network is chosen to be a time-series neural network or a recurrent neural network with an input delay.
6. The neural network feedforward controller training method for a servo control system according to claim 3, characterized in that, When the total number of weights in the neural network is less than a preset value, the Levenberg-Marquardt algorithm or the quasi-Newton algorithm is selected to train the neural network. When the total number of weights in the neural network is greater than or equal to the preset value, the conjugate gradient method is selected to train the neural network.
7. The neural network feedforward controller training method for a servo control system according to claim 3, characterized in that, The specific steps for optimizing the hyperparameters of a neural network using a genetic algorithm include: Step 7-1): Initialization, record the evolution number j = 0, set the range of hyperparameter values, and select the encoding method; a set of hyperparameter values is considered as an individual in the genetic algorithm; determine the number of individuals n, and all individuals constitute the population; randomly generate initial individuals, encode the initial individuals to obtain the initial population; design the fitness function using the mean square error between the predicted output and the expected output of the neural network feedforward controller; determine the selection and crossover operation methods, and set the crossover probability and mutation probability; set the evolution termination condition. Step 7-2): Train the neural network sequentially using the hyperparameter values of each individual in the initial population, and calculate the individual fitness value according to the fitness function. Step 7-3): Determine the selection probability of each individual based on its fitness value; based on the selection probability, select individuals from the population n times and place the selected individuals into the intermediate population. Step 7-4): Pair individuals in the intermediate population into pairs, assign a random number to each pair, and compare the random number with the crossover probability. If the random number is less than the crossover probability, the two individuals are crossovered, and the two new individuals generated by the crossover replace the original individuals and are put into the intermediate population; otherwise, no crossover is performed, and the original individuals are kept in the intermediate population. Step 7-5): Assign a random number to each individual in the intermediate population, compare the random number with the mutation probability. If the random number is less than the mutation probability, the individual undergoes a mutation operation, and the new individual generated by the mutation operation replaces the original individual and is placed in the intermediate population; otherwise, no mutation operation is performed, and the original individual remains in the intermediate population. Steps 7-6): The intermediate population after the mutation operation is the new population generated in the (j+1)th evolution. Decode each individual in the new population. The result of the decoding is the updated hyperparameter value. Use the updated hyperparameter to train the neural network and calculate the individual fitness value according to the fitness function. Step 7-7): Determine if the evolutionary result meets the evolution termination condition. If it does, end the evolution, and the hyperparameter of the individual with the highest fitness value in the new population is the optimal hyperparameter; otherwise, return to step 7-3).