Iterative learning control method, system and equipment of permanent magnet motor and storage medium
By introducing variable forgetting factor and Cheetah algorithm to optimize control gain in the advanced iterative learning control of permanent magnet motors, the control accuracy and response time problems of permanent magnet motors in non-repetitive and initial state inconsistent are solved, and a fast and stable desired output is achieved.
Patent Information
- Application Number
- CN202510504616.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2025-08-15
Smart Images

Figure CN120498324A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of permanent magnet motor control, and in particular to an iterative learning control method, system, device and storage medium for a permanent magnet motor. Background Art
[0002] With the rapid development of new energy, permanent magnet motors (PMMs) offer significant advantages as drive motors for new energy vehicles, such as high efficiency, compact size, high stability, and fast dynamic response. Consequently, they are widely used in new energy vehicles and automated production lines. While many technical solutions exist for controlling PMMs, these solutions remain limited due to the inherent manufacturing process precision and the fact that their internal parameters (such as inductance and flux linkage) fluctuate due to temperature, load changes, or magnet demagnetization, thus affecting control accuracy.
[0003] In practical applications, the control of permanent magnet motors requires that the motor rotor can repeatedly reach the same position under repeated and identical actual input current and initial rotor position in order to achieve precise control of the permanent magnet motor. However, due to the influence of the materials and manufacturing process accuracy of the permanent magnet motor, the initial rotor position of each control will have a certain deviation, resulting in inconsistent initial states. In addition, the temperature and magnet demagnetization effects during the operation of the motor will cause the motor rotor to fail to reach the required corresponding speed under the same input current conditions. These problems will cause the operating system to have a negative impact on the permanent magnet motor's need to run on the desired trajectory.
[0004] To achieve desired control of non-repetitive permanent magnet motors (PMMs), iterative learning control (ILC) and high-order ILC have been proposed in recent years to address control issues with random initial states and non-uniform operating ranges. When these traditional ILC methods are applied to the proposed non-repetitive PMM system, P-type ILC exhibits weak robustness when initial state deviations are large, while high-order ILC requires a long time to calibrate system parameters, increasing system response time and impacting real-time performance. In non-uniform operating ranges, P-type ILC typically relies on consistent system behavior at each iteration, leading to decreased control effectiveness when the system dynamics or operating state changes. High-order ILC, on the other hand, is unable to adjust the higher-order model in a timely manner, resulting in ineffective error compensation. Summary of the Invention
[0005] In order to solve the above technical problems, the present invention provides an iterative learning control method, system, device and storage medium for a permanent magnet motor. By introducing a variable forgetting factor, high-order iterative learning control is optimized to achieve the technical effect of improving the convergence speed of the non-repetitive permanent magnet motor and ensuring the output stability of the permanent magnet motor.
[0006] In a first aspect, the present invention provides an iterative learning control method for a permanent magnet motor, the method comprising:
[0007] Establishing a discrete dynamic model of the permanent magnet motor, and obtaining an actual output sequence of the permanent magnet motor based on the discrete dynamic model;
[0008] Obtaining an expected output sequence of the permanent magnet motor, and calculating an output error between the expected output sequence and the actual output sequence;
[0009] Establishing a high-order iterative learning law based on a variable forgetting factor according to the output error, wherein the variable forgetting factor is determined based on the output error;
[0010] An optimal control input of the permanent magnet motor is determined according to the high-order iterative learning law, and input control is performed on the permanent magnet motor according to the optimal control input.
[0011] Furthermore, the high-order iterative learning law is expressed by the following formula:
[0012]
[0013] Where c k+1 (q) represents the control input of the permanent magnet motor at the k+1th iteration q, U represents the order of high-order iterative learning, ψ k (q) represents the variable forgetting factor at the kth iteration q, H i represents the first control gain of the i-th order high-order iterative learning, P i represents the second control gain of the i-th order high-order iterative learning, c0(q) represents the initial control input, e′ k-i+1 (q+1) represents the output error corrected at the k-i+1th iteration q+1;
[0014] The following formula is used to express the constraints of the high-order iterative learning law:
[0015]
[0016] Where, ρ i represents the constraint coefficient of the i-th order high-order iterative learning, r(t+1) represents the probability of the operating trajectory range of the permanent magnet motor at time t+1, ψ i (t) represents the variable forgetting factor of the i-th order high-order iterative learning at time t, and B and C are both vector coefficients.
[0017] Furthermore, the step of calculating the variable forgetting factor includes:
[0018] Calculate the output error factor based on the ratio between the output error norms of the first two iterative controls;
[0019] Determine whether the output error factor and the current number of iterations meet the first constraint condition;
[0020] If the first constraint is met, the variable forgetting factor of the current iteration is calculated based on the initial value and growth rate of the variable forgetting factor;
[0021] If the first constraint condition is not met, then determine whether the output error factor, the current number of iterations, and the output error of the previous iterative control meet the second constraint condition;
[0022] If the second constraint condition is met, the variable forgetting factor of the current iteration number is set to the first preset factor;
[0023] If the second constraint condition is not met, the variable forgetting factor of the current iteration number is set to the second preset factor;
[0024] Among them, the first constraint condition is that the output error factor is less than or equal to the maximum error and the current number of iterations is less than or equal to the maximum number of iterations; the second constraint condition is that the output error factor is greater than the maximum error, the current number of iterations is greater than the maximum number of iterations, and the output error norm of the previous iterative control is greater than the error norm threshold.
[0025] Furthermore, the variable forgetting factor is expressed by the following formula:
[0026]
[0027] Where, ψ k (q) represents the variable forgetting factor at the kth iteration q, ψ1 represents the initial value of the variable forgetting factor, k represents the number of iterations, g represents the growth rate, σ represents the output error factor, ξ m represents the maximum error, δ m Indicates the maximum number of iterations, F l Indicates the first preset factor, F m represents the second preset factor, ||E k-1 || represents the output error norm of the k-1th iterative control, ||E m || represents the error norm threshold.
[0028] Furthermore, the step of establishing a high-order iterative learning law based on a variable forgetting factor according to the output error includes:
[0029] Using a cheetah algorithm to solve the control gain in the high-order iterative learning law to obtain an optimal control gain, wherein the control gain includes a first control gain and a second control gain;
[0030] The optimal control gain is input into the high-order iterative learning law to obtain the optimal high-order iterative learning law.
[0031] In a second aspect, the present invention provides an iterative learning control system for a permanent magnet motor, the system comprising:
[0032] A model building module is used to establish a discrete dynamic model of the permanent magnet motor and obtain an actual output sequence of the permanent magnet motor based on the discrete dynamic model;
[0033] an error calculation module, configured to set an expected output sequence corresponding to the actual output sequence, and calculate an output error between the expected output sequence and the actual output sequence;
[0034] a learning law construction module, configured to establish, according to the output error, a high-order iterative learning law based on a variable forgetting factor, wherein the variable forgetting factor is determined based on the output error;
[0035] The motor control module is used to determine the optimal control input of the permanent magnet motor according to the high-order iterative learning law, and perform input control on the permanent magnet motor according to the optimal control input.
[0036] Furthermore, the learning law construction module is further configured to express the high-order iterative learning law using the following formula:
[0037]
[0038] Where c k+1 (q) represents the control input of the permanent magnet motor at the k+1th iteration q, U represents the order of high-order iterative learning, ψ k (q) represents the variable forgetting factor at the kth iteration q, H i represents the first control gain of the i-th order high-order iterative learning, P i represents the second control gain of the i-th order high-order iterative learning, c0(q) represents the initial control input, e′ k-i+1 (q+1) represents the output error corrected at the k-i+1th iteration q+1;
[0039] The following formula is used to express the constraints of the high-order iterative learning law:
[0040]
[0041] Where, ρ i represents the constraint coefficient of the i-th order high-order iterative learning, r(t+1) represents the probability of the operating trajectory range of the permanent magnet motor at time t+1, ψ i (t) represents the variable forgetting factor of the i-th order high-order iterative learning at time t, and B and C are both vector coefficients.
[0042] Furthermore, the learning law construction module includes a variable forgetting factor calculation module;
[0043] The variable forgetting factor calculation module is used to calculate the output error factor according to the ratio between the output error norms of the previous two iterative controls;
[0044] Determine whether the output error factor and the current number of iterations meet the first constraint condition;
[0045] If the first constraint is met, the variable forgetting factor of the current iteration is calculated based on the initial value and growth rate of the variable forgetting factor;
[0046] If the first constraint condition is not met, then determine whether the output error factor, the current number of iterations, and the output error of the previous iterative control meet the second constraint condition;
[0047] If the second constraint condition is met, the variable forgetting factor of the current iteration number is set to the first preset factor;
[0048] If the second constraint condition is not met, the variable forgetting factor of the current iteration number is set to the second preset factor;
[0049] Among them, the first constraint condition is that the output error factor is less than or equal to the maximum error and the current number of iterations is less than or equal to the maximum number of iterations; the second constraint condition is that the output error factor is greater than the maximum error, the current number of iterations is greater than the maximum number of iterations, and the output error norm of the previous iterative control is greater than the error norm threshold.
[0050] In a third aspect, an embodiment of the present invention further provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0051] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0052] The present invention provides an iterative learning control method, system, device, and storage medium for a permanent magnet motor. The present invention ensures the stability of the permanent magnet motor output by introducing a variable forgetting factor into high-order iterative learning control and fine-tuning the forgetting factor based on the output error during the iteration process. By selecting the optimal control gain through an intelligent algorithm combined with a constraint function, the learning law is ensured to achieve the optimal convergence effect, reducing the acquisition of high-order gain prior knowledge, thereby effectively shortening the operation time of the permanent magnet motor. The iterative learning control method provided by the present invention effectively improves the convergence speed of non-repetitive permanent magnet motors, enables the permanent magnet motor to quickly achieve the desired output tracking effect under non-repetitive conditions, and ensures the stability of the permanent magnet motor output. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 1 is a flow chart of an iterative learning control method for a permanent magnet motor according to an embodiment of the present invention;
[0054] Figure 2 3 is a comparison diagram of the output trajectory and the expected output trajectory of the iterative learning control method of the permanent magnet motor during iteration in a comparative experiment according to an embodiment of the present invention;
[0055] Figure 3 1. This is a comparison diagram of the output tracking error of the iterative learning control method for the permanent magnet motor according to an embodiment of the present invention and other control methods in a comparative experiment;
[0056] Figure 4 1 is a schematic structural diagram of an iterative learning control system for a permanent magnet motor according to an embodiment of the present invention;
[0057] Figure 5 1 is a diagram showing the internal structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying 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 making creative efforts shall fall within the scope of protection of the present invention.
[0059] See also Figure 1 The first embodiment of the present invention provides an iterative learning control method for a permanent magnet motor, which includes steps S10 to S40:
[0060] Step S10, establishing a discrete dynamic model of the permanent magnet motor, and obtaining an actual output sequence of the permanent magnet motor according to the discrete dynamic model;
[0061] Step S20, setting an expected output sequence corresponding to the actual output sequence, and calculating an output error between the expected output sequence and the actual output sequence;
[0062] Step S30, establishing a high-order iterative learning law based on a variable forgetting factor according to the output error, wherein the variable forgetting factor is determined based on the output error;
[0063] Step S40 : determining an optimal control input of the permanent magnet motor according to the high-order iterative learning law, and performing input control on the permanent magnet motor according to the optimal control input.
[0064] In the present invention, a dynamic mathematical model of a permanent magnet motor is first established:
[0065]
[0066] Where k is the number of iterations, t is the running time of each iteration of the permanent magnet motor system, G is the mass constant of the permanent magnet motor rotor, τ is the magnetic flux constant of the permanent magnet motor, η is the pole pitch constant of the permanent magnet motor, R is the resistance of the fixed resistor, and p is the value of the fixed resistor. k (t) is the rotor position of the permanent magnet motor at the kth iteration t, ω k (t) is the rotor angular velocity of the permanent magnet motor at the kth iteration t, c k (t) is the input current of the permanent magnet motor at the kth iteration t, S k (t) is the actual output speed of the permanent magnet motor at the kth iteration t, μ k (t) and φ k (t) is the Gaussian white noise of the permanent magnet motor at the kth iteration t, which is independent of each other and has a standard deviation of 0.1.
[0067] In order to analyze the output sequence of the permanent magnet motor, the present invention uses the preset sampling time T l Discretize the system to obtain the discrete time series q after sampling the continuous system:
[0068]
[0069] Where, T d is the expected running time of the permanent magnet motor, and the sampling time T l Discretizing it is:
[0070]
[0071] Then, the rotor position p of the permanent magnet motor is calculated according to the discrete time sequence q. k (t), rotor angular velocity ω k (t), actual output speed Sk (t) is discretized to obtain p k (q),ω k (q) and S k (q).
[0072] Set the actual running time of the permanent magnet motor to T k , where T k ∈[T min ,T max ], T min and T max Respectively represent the minimum and maximum values of the actual running time, and T min <T d , T max >T d .
[0073] Based on the above discretization parameters, the sampling time T is used l Discretize the above continuous dynamic mathematical model into a discrete dynamic model:
[0074]
[0075] Where Z k (q) represents the position angular velocity vector of the permanent magnet motor at the kth iteration q, A, B and C represent vector coefficients, c k (q) represents the input current of the permanent magnet motor at the kth iteration q, μ k (t) and φ k (t) is the Gaussian white noise of the permanent magnet motor at the kth iteration t, which is independent of each other and has a standard deviation of 0.1. k (q) is the actual speed output by the permanent magnet motor at the kth iteration q, that is, the actual output sequence.
[0076] in:
[0077]
[0078] C=
[01]
[0079] Where p k (q) is the rotor position of the permanent magnet motor at the kth iteration q, ω k (q) is the rotor angular velocity of the permanent magnet motor at the kth iteration q, G is the mass constant of the permanent magnet motor rotor, τ is the magnetic flux constant of the permanent magnet motor, η is the pole pitch constant of the permanent magnet motor, R is the resistance of the fixed resistor, T l is the sampling time. Optionally, G = 1.635 kg, τ = 0.35 Wb, η = 0.031 m, and R = 8.6 Ω.
[0080] Assume that each control input cd (t) has a corresponding control desired trajectory S d (q), that is:
[0081]
[0082] Where Z d (q) represents the desired position angular velocity vector at time q, A, B and C represent vector coefficients, c d (q) represents the expected input current at time q, μ k (t) and φ k (t) is the Gaussian white noise of the permanent magnet motor at the kth iteration t, which is independent of each other and has a standard deviation of 0.1. d (q) is the desired speed output by the permanent magnet motor at time q, that is, the desired control trajectory.
[0083] in:
[0084]
[0085] C=
[01]
[0086] Where p d (q) is the desired rotor position of the permanent magnet motor at time q, ω d (q) is the expected rotor angular velocity of the permanent magnet motor at time q, G is the mass constant of the permanent magnet motor rotor, τ is the magnetic flux constant of the permanent magnet motor, η is the pole pitch constant of the permanent magnet motor, R is the resistance of the fixed resistor, T l is the sampling time.
[0087] According to the above discretization steps, the control desired trajectory is discretized, that is, the sampling time T is used l The expected output sequence obtained after sampling the desired control trajectory is S d (q·T l ). S d (q·T l ) represents the discrete time series q and sampling time T l The expected output sequence.
[0088] The non-uniform running time of the permanent magnet motor is considered to satisfy the Bernoulli distribution. Therefore, based on the Bernoulli distribution, the probability that the running trajectory of the permanent magnet motor system falls within the following interval can be determined as r(t):
[0089]
[0090] The probability of falling into other ranges is 1-r(t).
[0091] In iterative learning control theory, the output error of the kth iteration can be defined as:
[0092] e k (q) = S d (q)-S k (q)
[0093] Where, e k (q) represents the output error at the kth iteration q, S d (q) represents the expected output sequence at time q, S k (q) represents the actual output sequence at the kth iteration q.
[0094] Then the systematic error is uniformly corrected in the domain, namely:
[0095] When T k <T d hour:
[0096]
[0097] When T k <T d hour:
[0098] e′ k (q) = e k (q)
[0099] In order to solve the random control process of the permanent magnet motor initial state, it is assumed that the initial state of the permanent magnet motor system has the following random initial state offset:
[0100]
[0101] Where Z k (0) represents the initial state of the kth iteration, Z0 represents the fixed state, Indicates a preset positive constant.
[0102] Random initial state deviation means that the initial iteration state fluctuates randomly around a fixed state, and the expectation of the deviation is bounded.
[0103] For the non-repetitive permanent magnet motor nonlinear system, that is, the above-mentioned discrete dynamic model, the present invention adopts a high-order iterative control algorithm to perform iterative control. In order to solve the problems of slow convergence speed and weak robustness of conventional iterative control algorithms, the present invention introduces a variable forgetting factor into the high-order iterative control algorithm. By fine-tuning the forgetting factor based on the output error during the iteration process, the stability of the system output is ensured. The high-order iterative learning law based on the variable forgetting factor is expressed as follows:
[0104]
[0105] Where c k+1 (q) represents the control input of the permanent magnet motor at the k+1th iteration q, U represents the order of high-order iterative learning, ψ k (q) represents the variable forgetting factor at the kth iteration q, H i represents the first control gain of the i-th order high-order iterative learning, P i represents the second control gain of the i-th order high-order iterative learning, c0(q) represents the initial control input, e′ k-i+1 (q+1) represents the output error corrected at the k-i+1th iteration q+1.
[0106] Based on the above high-order iterative learning law, its control gain also needs to meet the following constraints:
[0107]
[0108] Where, ρ i represents the constraint coefficient of the i-th order high-order iterative learning, r(t+1) represents the probability of the operating trajectory range of the permanent magnet motor at time t+1, ψ i (t) represents the variable forgetting factor of the i-th order high-order iterative learning at time t, and B and C are both vector coefficients.
[0109] According to the above-mentioned high-order iterative learning law, the present invention introduces a variable forgetting factor in the high-order iterative control algorithm. The variable forgetting factor can be adjusted according to the error output by the permanent magnet motor. For example, the corresponding relationship between the error threshold and the variable forgetting factor is pre-set, and the corresponding variable forgetting factor is selected according to the error output by the system.
[0110] In order to further improve the refined control of the variable forgetting factor, in a preferred embodiment, the present invention also provides another method for calculating the variable forgetting factor, which specifically includes the following steps:
[0111] Calculate the output error factor based on the ratio between the output error norms of the first two iterative controls;
[0112] Determine whether the output error factor and the current number of iterations meet the first constraint condition;
[0113] If the first constraint is met, the variable forgetting factor of the current iteration is calculated based on the initial value and growth rate of the variable forgetting factor;
[0114] If the first constraint condition is not met, then determine whether the output error factor, the current number of iterations, and the output error of the previous iterative control meet the second constraint condition;
[0115] If the second constraint condition is met, the variable forgetting factor of the current iteration number is set to the first preset factor;
[0116] If the second constraint condition is not met, the variable forgetting factor of the current iteration number is set to the second preset factor;
[0117] Among them, the first constraint condition is that the output error factor is less than or equal to the maximum error and the current number of iterations is less than or equal to the maximum number of iterations; the second constraint condition is that the output error factor is greater than the maximum error, the current number of iterations is greater than the maximum number of iterations, and the output error norm of the previous iterative control is greater than the error norm threshold.
[0118] In this embodiment, first, the ratio of the output error norms of two consecutive iterative processes is used to determine whether the output state of the permanent magnet motor is stable. That is, the output error factor σ can be expressed as:
[0119]
[0120] Where, ||E k-1 || represents the output error norm of the k-1th iterative control, ||E k-2 || represents the output error norm of the k-2th iterative control.
[0121] Among them, ||E k ||=|e k (q)|.
[0122] Then, it is determined whether the output error factor and the current number of iterations satisfy the first constraint based on the output error and the number of iterations. In this embodiment, the first constraint is that the output error factor is less than or equal to the maximum error, and the current number of iterations is less than or equal to the maximum number of iterations, that is:
[0123] 0<σ≤ξ m ,k≤δ m
[0124] Where k is the number of iterations, σ is the output error factor, and ξ m represents the maximum error, δ m Indicates the maximum number of iterations.
[0125] If the first constraint is met, the variable forgetting factor corresponding to the current number of iterations is calculated according to the preset initial value and growth rate of the variable forgetting factor, that is:
[0126] ψ q (q)=ψ1+(k-1)g
[0127] Where, ψ k (q) represents the variable forgetting factor at the kth iteration q, ψ1 represents the initial value of the variable forgetting factor, and g represents the growth rate. m =2,δ m =3, g=0.02.
[0128] If the first constraint is not met, then determine whether the output error factor, the current number of iterations, and the output error of the previous iterative control meet the second constraint. The second constraint is that the output error factor is greater than the maximum error, the current number of iterations is greater than the maximum number of iterations, and the output error norm of the previous iterative control is greater than the error norm threshold, that is:
[0129] σ>ξ m ,k>δ m ,||E k-1 ||>||E m ||
[0130] Where, ||E m || represents the error norm threshold.
[0131] If the second constraint condition is met, it means that the system output has fluctuated, that is, the system output error has fluctuated. At this time, the forgetting factor is set according to the preset first preset factor:
[0132] ψ q (q) = F l
[0133] Among them, F l Indicates the first preset factor.
[0134] In this embodiment, the first preset factor is the minimum value of the variable forgetting factor. By setting the variable forgetting factor to the minimum value, the weight of the historical data is increased to stabilize the system output.
[0135] If both of the above constraints are not met, it means that the system output is stable in a certain operating range. At this time, the variable forgetting factor is set to the second preset factor F m , that is, taking the maximum value. At this time, the system gives priority to the newly iterated data and increases the weight of the new data.
[0136] By arranging the above calculation steps, we can get the expression of the variable forgetting factor:
[0137]
[0138] Where, ψ k (q) represents the variable forgetting factor at the kth iteration q, ψ1 represents the initial value of the variable forgetting factor, k represents the number of iterations, g represents the growth rate, σ represents the output error factor, ξ m represents the maximum error, δ m Indicates the maximum number of iterations, F l Indicates the first preset factor, F m represents the second preset factor, ||E k-1|| represents the output error norm of the k-1th iterative control, ||E m || represents the error norm threshold.
[0139] In this embodiment, by introducing a high-order iterative learning rate with a variable forgetting factor, the convergence speed of the permanent magnet motor system can be effectively improved, and the robustness of the permanent magnet motor system can be ensured.
[0140] In a preferred embodiment, in order to reduce the number of iterations required for the permanent magnet motor system to track the desired trajectory through iterative learning control, the present invention adopts an intelligent algorithm to obtain the optimal control gain of the high-order iterative learning law. Specifically, in this embodiment, the cheetah algorithm is used to update and optimize the control gain of the proposed control law.
[0141] The Cheetah Algorithm is a biomimetic optimization algorithm that effectively avoids falling into local optimal solutions by leveraging the cheetah's rapid movement and strategic adjustment behavior. It is suitable for different types of optimal parameter search problems. In this embodiment, applying the Cheetah Algorithm to the iterative learning control law can optimize the control gain parameters and improve the system's control performance. The specific steps include:
[0142] ① Initialize the cheetah population: For example, if the control law order is U = 2, the gain parameters include H1, H2, P1, and P2. The subscripts represent the order. For example, H1 is the first control gain when U = 1. Since H1 + H2 = 1, we only need to find the optimal solution for H1, P1, and P2.
[0143] Set the initial number of cheetah populations b = 20, set the maximum number of algorithm iterations L = 10, set the cheetah hunting behavior learning factor α = 0.5, and set the required control gain value range H h ∈[0.2,1], P 1h ∈[0.2,15], P 2h ∈[0.2,15];
[0144] Threshold function solution: According to the optimal parameters H1, P2, P2 required to be solved, set the parameter set ε of h cheetahs h =[H h ,P 1h ,P 2h ], and according to the parameter set ε h Set the threshold function of the Cheetah algorithm;
[0145] Hunting strategy: Hunting and tracking behaviors are performed according to the obtained threshold function, namely local search and global search;
[0146] Update the cheetah position: After each round of iteration, the cheetah position is updated based on the threshold function and the current cheetah state;
[0147] Termination condition: The iteration is terminated when the number of iterations of the algorithm reaches the maximum number of iterations L. Finally, the optimal control gains H1, P1, and P2 are generated by the cheetah algorithm.
[0148] The present invention provides a comparative experiment to verify the effectiveness of the control method provided by the present invention. In the comparative experiment, the control algorithms are traditional high-order iterative learning control and P-type iterative learning control. In this experiment, it is assumed that the desired output trajectory of the non-repetitive permanent magnet motor system is set to:
[0149] S d (q)=-sin(0.05T l πq)+0.5-0.5cos(0.2T l q)
[0150] Set the maximum number of system iterations k = 100 and the expected running time T d =0.47s.
[0151] The optimal control gains obtained using the Cheetah algorithm are shown in Table 1 below:
[0152] Table 1 Optimal control gain table
[0153]
[0154] In this experiment, the error indicator function ME is used k =max|S d (q)-S k (q)| is used to measure the convergence effect of the proposed control law compared with the traditional high-order iterative learning control law and the P-type iterative learning control law.
[0155] Figure 2 The comparison diagram of the output trajectory and the expected output trajectory diagram of the control method provided by the present invention at the 5th, 8th and 15th iterations is shown in FIG. Figure 2 It can be seen that the output trajectory of the permanent magnet motor system gradually tracks the expected output trajectory as the number of iterations increases, and has already tracked the expected trajectory at the 15th iteration.
[0156] Figure 3 The output tracking error comparison diagram of the control method provided by the present invention and the traditional high-order iterative learning control and P-type iterative learning control is shown in FIG. Figure 3It can be seen that the error indicator of the high-order iterative learning control algorithm COFFILC based on a variable forgetting factor provided by the present invention can converge to within the tolerable error within the 15th iteration, while the traditional high-order iterative learning control law requires the 40th iteration to make the error indicator converge to within the tolerable error, and the traditional P-type iterative learning control law requires the 60th iteration to make the error indicator converge to within the tolerable error. In other words, compared with the traditional iterative learning control algorithm, the high-order iterative learning control algorithm based on a variable forgetting factor provided by the present invention can quickly converge to within the tolerable error within a limited number of times, effectively improving the convergence speed.
[0157] This embodiment provides an iterative learning control method for a permanent magnet motor. This method ensures the stability of the permanent magnet motor's output by introducing a variable forgetting factor into high-order iterative learning control and fine-tuning the forgetting factor based on output error during the iteration process. Furthermore, an intelligent algorithm combined with a constraint function is used to select the optimal control gain, ensuring that the learning law achieves optimal convergence and reducing the need for prior knowledge of high-order gains, thereby effectively shortening the permanent magnet motor's operating time. The iterative learning control method provided by the present invention effectively improves the convergence speed of non-repetitive permanent magnet motors, enabling the permanent magnet motor to quickly achieve the desired output tracking effect under non-repetitive conditions and ensuring the stability of the permanent magnet motor's output.
[0158] See also Figure 4 Based on the same inventive concept, a second embodiment of the present invention proposes an iterative learning control system for a permanent magnet motor, comprising:
[0159] A model building module 10 is used to establish a discrete dynamic model of the permanent magnet motor and obtain an actual output sequence of the permanent magnet motor based on the discrete dynamic model;
[0160] an error calculation module 20, configured to set an expected output sequence corresponding to the actual output sequence, and calculate an output error between the expected output sequence and the actual output sequence;
[0161] A learning law construction module 30 is used to establish a high-order iterative learning law based on a variable forgetting factor according to the output error, wherein the variable forgetting factor is determined based on the output error;
[0162] The motor control module 40 is configured to determine an optimal control input of the permanent magnet motor according to the high-order iterative learning law, and perform input control on the permanent magnet motor according to the optimal control input.
[0163] In a preferred embodiment, the learning law construction module is further configured to express the high-order iterative learning law using the following formula:
[0164]
[0165] Where c k+1 (q) represents the control input of the permanent magnet motor at the k+1th iteration q, U represents the order of high-order iterative learning, ψ k (q) represents the variable forgetting factor at the kth iteration q, H i represents the first control gain of the i-th order high-order iterative learning, P i represents the second control gain of the i-th order high-order iterative learning, c0(q) represents the initial control input, e′ k-i+1 (q+1) represents the output error corrected at the k-i+1th iteration q+1;
[0166] The following formula is used to express the constraints of the high-order iterative learning law:
[0167]
[0168] Where, ρ i represents the constraint coefficient of the i-th order high-order iterative learning, r(t+1) represents the probability of the operating trajectory range of the permanent magnet motor at time t+1, ψ i (t) represents the variable forgetting factor of the i-th order high-order iterative learning at time t, and B and C are both vector coefficients.
[0169] In a preferred embodiment, the learning law building module includes a variable forgetting factor calculation module;
[0170] The variable forgetting factor calculation module is used to calculate the output error factor according to the ratio between the output error norms of the previous two iterative controls;
[0171] Determine whether the output error factor and the current number of iterations meet the first constraint condition;
[0172] If the first constraint is met, the variable forgetting factor of the current iteration is calculated based on the initial value and growth rate of the variable forgetting factor;
[0173] If the first constraint condition is not met, then determine whether the output error factor, the current number of iterations, and the output error of the previous iterative control meet the second constraint condition;
[0174] If the second constraint condition is met, the variable forgetting factor of the current iteration number is set to the first preset factor;
[0175] If the second constraint condition is not met, the variable forgetting factor of the current iteration number is set to the second preset factor;
[0176] Among them, the first constraint condition is that the output error factor is less than or equal to the maximum error and the current number of iterations is less than or equal to the maximum number of iterations; the second constraint condition is that the output error factor is greater than the maximum error, the current number of iterations is greater than the maximum number of iterations, and the output error norm of the previous iterative control is greater than the error norm threshold.
[0177] The technical features and effects of the iterative learning control system for a permanent magnet motor proposed in an embodiment of the present invention are the same as those of the method proposed in an embodiment of the present invention and are not further described here. Each module in the iterative learning control system for a permanent magnet motor described above can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the modules described above can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in a computer device in software form, so that the processor can call and execute the operations corresponding to each of the modules described above.
[0178] In addition, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0179] See also Figure 5 , an internal structure diagram of a computer device in one embodiment, the computer device can specifically be a terminal or a server. The computer device includes a processor, a memory, a network interface, a display and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an iterative learning control method for a permanent magnet motor is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0180] It can be understood by those skilled in the art that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have the same component arrangement.
[0181] In addition, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when the computer program is executed by a processor.
[0182] In summary, the embodiments of the present invention propose an iterative learning control method, system, device and storage medium for a permanent magnet motor. The method establishes a discrete dynamic model of the permanent magnet motor and obtains the actual output sequence of the permanent magnet motor based on the discrete dynamic model; obtains the expected output sequence of the permanent magnet motor and calculates the output error between the expected output sequence and the actual output sequence; establishes a high-order iterative learning law based on a variable forgetting factor based on the output error, wherein the variable forgetting factor is determined based on the output error; determines the optimal control input of the permanent magnet motor based on the high-order iterative learning law, and performs input control on the permanent magnet motor based on the optimal control input. The present invention introduces a variable forgetting factor into the high-order iterative learning control and fine-tunes the forgetting factor based on the output error during the iteration process, thereby ensuring the stability of the permanent magnet motor output; selects the optimal control gain through an intelligent algorithm combined with a constraint function, thereby ensuring that the learning law can achieve the optimal convergence effect, reducing the acquisition of high-order gain prior knowledge, and thus effectively shortening the operation time of the permanent magnet motor. The iterative learning control method provided by the present invention effectively improves the convergence speed of the non-repetitive permanent magnet motor, enables the permanent magnet motor to quickly achieve the desired output tracking effect under non-repetitive conditions, and ensures the stability of the permanent magnet motor output.
[0183] Each embodiment in this specification is described in a progressive manner, and the same or similar parts of each embodiment can be directly referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. It should be noted that the various technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0184] The above-described embodiments merely represent several preferred implementations of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art could make several improvements and substitutions without departing from the technical principles of the present invention, and these improvements and substitutions should also be considered within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be based on the scope of protection of the claims.
Claims
1. An iterative learning control method for a permanent magnet motor, characterized in that: include: Establishing a discrete dynamic model of the permanent magnet motor, and obtaining an actual output sequence of the permanent magnet motor based on the discrete dynamic model; Obtaining an expected output sequence of the permanent magnet motor, and calculating an output error between the expected output sequence and the actual output sequence; Establishing a high-order iterative learning law based on a variable forgetting factor according to the output error, wherein the variable forgetting factor is determined based on the output error; An optimal control input of the permanent magnet motor is determined according to the high-order iterative learning law, and input control is performed on the permanent magnet motor according to the optimal control input.
2. The iterative learning control method for a permanent magnet motor according to claim 1, characterized in that: The high-order iterative learning law is expressed by the following formula: Where c k+1 (q) represents the control input of the permanent magnet motor at the k+1th iteration q, U represents the order of high-order iterative learning, ψ k (q) represents the variable forgetting factor at the kth iteration q, H i represents the first control gain of the i-th order high-order iterative learning, P i represents the second control gain of the i-th order high-order iterative learning, c0(q) represents the initial control input, e′ k-i+1 (q+1) represents the output error corrected at the k-i+1th iteration q+1; The following formula is used to express the constraints of the high-order iterative learning law: Where, ρ i represents the constraint coefficient of the i-th order high-order iterative learning, r(t+1) represents the probability of the operating trajectory range of the permanent magnet motor at time t+1, ψ i (t) represents the variable forgetting factor of the i-th order high-order iterative learning at time t, and B and C are both vector coefficients.
3. The iterative learning control method for a permanent magnet motor according to claim 2, characterized in that: The calculation step of the variable forgetting factor includes: Calculate the output error factor based on the ratio between the output error norms of the first two iterative controls; Determine whether the output error factor and the current number of iterations meet the first constraint condition; If the first constraint is met, the variable forgetting factor of the current iteration is calculated based on the initial value and growth rate of the variable forgetting factor; If the first constraint condition is not met, then determine whether the output error factor, the current number of iterations, and the output error of the previous iterative control meet the second constraint condition; If the second constraint condition is met, the variable forgetting factor of the current iteration number is set to the first preset factor; If the second constraint condition is not met, the variable forgetting factor of the current iteration number is set to the second preset factor; Among them, the first constraint condition is that the output error factor is less than or equal to the maximum error and the current number of iterations is less than or equal to the maximum number of iterations; the second constraint condition is that the output error factor is greater than the maximum error, the current number of iterations is greater than the maximum number of iterations, and the output error norm of the previous iterative control is greater than the error norm threshold.
4. The iterative learning control method for a permanent magnet motor according to claim 3, characterized in that: The variable forgetting factor is expressed by the following formula: Where, ψ k (q) represents the variable forgetting factor at the kth iteration q, ψ1 represents the initial value of the variable forgetting factor, k represents the number of iterations, g represents the growth rate, σ represents the output error factor, ξ m represents the maximum error, δ m Indicates the maximum number of iterations, F l Indicates the first preset factor, F m represents the second preset factor, ||E k-1 || represents the output error norm of the k-1th iterative control, ||E m || represents the error norm threshold.
5. The iterative learning control method for a permanent magnet motor according to claim 2, characterized in that: The step of establishing a high-order iterative learning law based on a variable forgetting factor according to the output error includes: Using a cheetah algorithm to solve the control gain in the high-order iterative learning law to obtain an optimal control gain, wherein the control gain includes a first control gain and a second control gain; The optimal control gain is input into the high-order iterative learning law to obtain the optimal high-order iterative learning law.
6. An iterative learning control system for a permanent magnet motor, characterized in that: include: A model building module is used to establish a discrete dynamic model of the permanent magnet motor and obtain an actual output sequence of the permanent magnet motor based on the discrete dynamic model; an error calculation module, configured to set an expected output sequence corresponding to the actual output sequence, and calculate an output error between the expected output sequence and the actual output sequence; a learning law construction module, configured to establish, according to the output error, a high-order iterative learning law based on a variable forgetting factor, wherein the variable forgetting factor is determined based on the output error; The motor control module is used to determine the optimal control input of the permanent magnet motor according to the high-order iterative learning law, and perform input control on the permanent magnet motor according to the optimal control input.
7. The iterative learning control system for a permanent magnet motor according to claim 6, characterized in that: The learning law building module is further used to express the high-order iterative learning law using the following formula: Where c k+1 (q) represents the control input of the permanent magnet motor at the k+1th iteration q, U represents the order of high-order iterative learning, ψ k (q) represents the variable forgetting factor at the kth iteration q, H i represents the first control gain of the i-th order high-order iterative learning, P i represents the second control gain of the i-th order high-order iterative learning, c0(q) represents the initial control input, e′ k-i+1 (q+1) represents the output error corrected at the k-i+1th iteration q+1; The following formula is used to express the constraints of the high-order iterative learning law: Where, ρ i represents the constraint coefficient of the i-th order high-order iterative learning, r(t+1) represents the probability of the operating trajectory range of the permanent magnet motor at time t+1, ψ i (t) represents the variable forgetting factor of the i-th order high-order iterative learning at time t, and B and C are both vector coefficients.
8. The iterative learning control system for a permanent magnet motor according to claim 7, characterized in that: The learning law building module includes a variable forgetting factor calculation module; The variable forgetting factor calculation module is used to calculate the output error factor according to the ratio between the output error norms of the previous two iterative controls; Determine whether the output error factor and the current number of iterations meet the first constraint condition; If the first constraint is met, the variable forgetting factor of the current iteration is calculated based on the initial value and growth rate of the variable forgetting factor; If the first constraint condition is not met, then determine whether the output error factor, the current number of iterations, and the output error of the previous iterative control meet the second constraint condition; If the second constraint condition is met, the variable forgetting factor of the current iteration number is set to the first preset factor; If the second constraint condition is not met, the variable forgetting factor of the current iteration number is set to the second preset factor; The first constraint condition is that the output error factor is less than or equal to the maximum error and the current number of iterations is less than or equal to the maximum number of iterations; The second constraint condition is that the output error factor is greater than the maximum error, the current number of iterations is greater than the maximum number of iterations, and the output error norm of the previous iterative control is greater than the error norm threshold.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.