PID controller self-tuning method and system based on combination fitness function optimization
By combining fitness function optimization into a PID controller self-tuning method, the complexity of traditional PID parameter tuning methods and the difficulty of setting FNN-PID hyperparameters are solved, achieving efficient PID parameter optimization and improving the dynamic response and steady-state control performance of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-22
- Publication Date
- 2026-03-31
AI Technical Summary
Traditional PID parameter tuning methods are cumbersome and difficult to obtain the optimal parameter combination that balances speed, stability and robustness when faced with time-varying motor parameters and nonlinear load disturbances. The hyperparameter setting of the FNN-PID controller constitutes a high-dimensional, non-convex optimization problem.
A self-tuning method for a PID controller based on combined fitness function optimization is adopted. By constructing an FNN-PID controller, a time-weighted error square integral-nonlinear penalty combined fitness function is introduced. The hyperparameters are iteratively optimized using an artificial rabbit swarm element heuristic algorithm, forming a closed-loop process of parameter generation, simulation evaluation, and fitness feedback, and outputting the optimal hyperparameter combination.
It significantly lowers the application threshold of advanced controllers, resolves the contradiction between dynamic response speed and steady-state control accuracy, ensures rapid elimination of steady-state errors and suppression of overshoot during transient processes, and optimizes system performance indicators.
Smart Images

Figure CN121386359B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent control and servo drive technology, specifically to a PID controller self-tuning method and system based on combined fitness function optimization. Background Technology
[0002] In modern servo drive and industrial automation systems, high-performance motor control strategies, represented by Field-Oriented Control (FOC), play a crucial role. The performance of such control frameworks largely depends on the parameter tuning of the PID controllers in their internal speed and current loops. Traditional PID parameter tuning methods, such as the Ziegler-Nichols method or relying on manual trial and error by engineers, are not only cumbersome and inefficient, but also struggle to achieve the optimal parameter combination that balances speed, stability, and robustness when facing complex operating conditions such as time-varying motor parameters and nonlinear load disturbances.
[0003] To address these challenges, intelligent control strategies such as Fuzzy Neural Network PID (FNN-PID) have emerged. These controllers, by integrating the reasoning capabilities of fuzzy logic with the learning capabilities of neural networks, can dynamically adjust PID parameters based on the real-time error state of the system, thus exhibiting superior adaptability. However, the design of FNN-PID controllers introduces new complexities: the output of its neural network typically requires a set of linear gain parameters (…). ) and bias ( The parameters need to be transformed to map to the physical domain of PID parameters suitable for the controlled object. The setting of this set of hyperparameters has a decisive impact on the final performance of the controller, but its tuning itself constitutes a high-dimensional, non-convex optimization problem. Summary of the Invention
[0004] The purpose of this invention is to provide a PID controller self-tuning method and system based on combined fitness function optimization to solve the problems mentioned in the background art.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: a PID controller self-tuning method based on combined fitness function optimization, comprising the following steps:
[0006] Construct an FNN-PID controller, and convert the basic adjustment output of the FNN-PID controller into a set of hyperparameter vectors by their respective gain and bias parameters;
[0007] Based on the FNN-PID controller and the controlled object, a closed-loop system simulation model is established;
[0008] Introducing a time-weighted error square integral-nonlinear penalty combination fitness function to optimize an artificial rabbit swarm heuristic algorithm; and
[0009] Using the hyperparameter vector as the optimization variable, the system simulation model is iteratively called to obtain the fitness value and use it as optimization feedback; the optimal hyperparameter corresponding to the fitness value satisfying the preset conditions is output.
[0010] Preferably, the FNN-PID controller uses system error and error change rate as dual inputs and outputs the basic adjustments of proportional, integral, and derivative parameters in parallel.
[0011] A set of hyperparameter vectors includes proportional gain, proportional bias, integral gain, integral bias, differential gain, and differential bias.
[0012] Preferably, the fitness value includes a time-weighted error squared integral term and a nonlinear penalty term. satisfy:
[0013] ;
[0014] in, To control system error; The time-weighted squared error integral term is denoted by t, where t is time. This indicates the simulation duration set for the closed-loop system. For non-linear penalty terms, This is a piecewise nonlinear penalty term; This represents the total number of simulation steps.
[0015] Preferably, the piecewise nonlinear penalty term satisfy:
[0016] ;
[0017] in, and These are preset high and low penalty thresholds. > ; and These are the corresponding penalty weights. ≫ .
[0018] Preferably, penalty weight The penalty weight is 10000. A value of 100 indicates a high penalty threshold. The penalty threshold is 0.07 rad / s. It is 0.03 rad / s.
[0019] Preferably, based on the feedback fitness value, the artificial rabbit swarm heuristic algorithm begins executing the main loop, including:
[0020] At the beginning of each iteration, the energy factor is calculated based on the current iteration number It and the maximum iteration number MaxIt;
[0021] When the energy factor is greater than 1, execute the global exploration strategy;
[0022] When the energy factor is not greater than 1, a local development strategy is executed.
[0023] Preferably, based on the obtained fitness value, it is determined whether the fitness value satisfies both the preset convergence condition and is the current minimum fitness value; if it satisfies the convergence condition and is the current minimum fitness value, the optimal hyperparameter is updated to the current population hyperparameter, and the next generation population hyperparameter is updated based on the optimization strategy of the optimized artificial rabbit swarm optimization algorithm; if at least one of the two conditions is not satisfied, the optimal hyperparameter is not updated, and the next generation population hyperparameter is updated based on the optimization strategy of the optimized artificial rabbit swarm optimization algorithm, and the system simulation model is iteratively called to run; when the last iteration is completed, the optimization is terminated and the current optimal hyperparameter is output.
[0024] Preferably, the closed-loop system simulation model is a magnetic field orientation control system simulation model.
[0025] This invention also discloses a PID controller self-tuning system based on combined fitness function optimization, the system comprising:
[0026] The controller module is configured to dynamically generate control signals based on the input system state and a set of hyperparameter vectors including gain and bias.
[0027] The system simulation module, coupled to the controller module, is configured to simulate the closed-loop control process of the controller module on a controlled object and output a quantitative performance evaluation index as a fitness value.
[0028] The parameter optimization module is configured to execute an artificial rabbit swarm optimization algorithm, using the hyperparameter vector as the optimization variable, receiving the fitness value as optimization feedback, and iteratively generating and updating the hyperparameters until convergence to an optimal solution.
[0029] Beneficial effects: The method of this invention forms a closed-loop process of "parameter generation-simulation evaluation-fitness feedback," and the globally optimal individual output is the desired optimal hyperparameter combination. It transforms the originally highly complex hyperparameter tuning process, which relied on expert experience, into a well-defined and automatically executable optimization task, significantly lowering the application threshold of advanced controllers. Furthermore, by introducing a fitness function combining time-weighted error square integral and nonlinear penalty, this invention resolves the contradiction between dynamic response speed and steady-state control accuracy in traditional optimization methods. This ensures rapid elimination of steady-state errors while effectively suppressing overshoot in transient processes, resulting in comprehensive optimization of system performance indicators. Attached Figure Description
[0030] Figure 1 This is a schematic block diagram of the overall architecture of the system of the present invention.
[0031] Figure 2 This is a diagram showing the internal structure and data flow of the controller module in an embodiment of the present invention.
[0032] Figure 3 This is the overall logic flowchart of the hyperparameter optimization method of the present invention.
[0033] Figure 4 This is a flowchart of the internal iterative logic of the Artificial Rabbit Group Optimization (ARO) algorithm used in this invention.
[0034] Figure 5 This is a schematic diagram of the convergence curve of the fitness function value during the optimization iteration process in an embodiment of the present invention.
[0035] Figure 6 The figures show a comparison of simulation results between the present invention and controllers optimized based on the IAE fitness function or the ITSE fitness function in the embodiments of the present invention. Detailed Implementation
[0036] To make the objectives and advantages of this invention clearer, the invention will be specifically described below with reference to embodiments. It should be understood that the following text is merely used to describe one or more specific embodiments of the invention and does not strictly limit the scope of protection specifically claimed by the invention.
[0037] Example: A self-tuning system for a PID controller based on combined fitness function optimization, referenced. Figure 1As shown, it includes a parameter optimization module 100 and a system simulation module 200. The parameter optimization module 100 embeds and executes the Artificial Rabbit Group Optimization (ARO) algorithm, which is responsible for searching in the multidimensional hyperparameter space. The system simulation module 200 embeds a controller module 300 and a controlled object model 400, which is responsible for evaluating the performance of each set of hyperparameters provided by module 100. The two interact through hyperparameter set 101 and fitness value 102 to form an iterative optimization closed loop of "parameter generation-simulation evaluation-fitness feedback".
[0038] refer to Figure 2 The diagram shows the internal structure and data flow of the controller module 300, specifically:
[0039] The inputs to the controller module 300 are the system error e and the error change rate ec; these two input signals are first fed into the fuzzy neural network (FNN) core 301.
[0040] FNN core 301 is constructed as a fuzzy neural network with a five-layer network topology. The specific hierarchical structure and data flow of this network are as follows:
[0041] The first layer is the input layer, which contains two neuron nodes that receive the real-time system error e(t) and the error change rate ec(t) from the external input, respectively. These two crisp values characterize the dynamics of the system.
[0042] The second layer is the fuzzification layer, where neurons are used to fuzzify the input signal. Each input neuron is connected to multiple membership function neurons. These neurons use a Gaussian function as the membership function to map the sharp input value to the membership of multiple preset fuzzy linguistic variables (e.g., negative large (NB), negative small (NS), zero (ZO), positive small (PS), positive large (PB)).
[0043] The third layer is the fuzzy rule reasoning layer, where each node represents a fuzzy reasoning rule. This layer calculates the trigger strength of each expert rule, such as "IF e is A AND ec is B THEN ...", by performing a fuzzy AND operation (e.g., taking the smaller or multiply) on the membership signals from the fuzzification layer.
[0044] The fourth layer is the normalization layer. This layer performs normalization calculations on the trigger strength of each rule output by the rule reasoning layer. That is, it calculates the proportion of the trigger strength of each rule in the sum of the trigger strengths of all rules to obtain the normalized weight coefficient.
[0045] The fifth layer is the output layer (or defuzzification layer). This layer performs a weighted summation of the conclusions of the fuzzy rules based on the weight coefficients output by the normalization layer, and finally calculates and outputs three independent and clear control adjustment signals, namely the proportional adjustment amount. Integral Adjustment and differential adjustment .
[0046] Among them, the three output signals of the FNN core 301 are respectively sent to the corresponding linear transformation units 302, 303, and 304;
[0047] Taking the proportional channel as an example, the final dynamically changing proportional parameter It is generated from the following relation:
[0048] ;
[0049] Integral parameters and differential parameters The generation methods are the same; among them, , , , , and This constitutes the six-dimensional hyperparameter vector to be optimized.
[0050] Another embodiment of this application provides a self-tuning method for a PID controller based on combined fitness function optimization, comprising the following steps:
[0051] Construct a fuzzy neural network (FNN) PID controller, i.e., an FNN-PID controller; the FNN-PID controller uses the system error ( ) and error change rate ( As dual inputs, the system outputs the basic adjustment values of three parameters in parallel: proportional P, integral I, and derivative D; each parameter is adjusted through its respective gain. ) and bias ( The hyperparameters are linearly transformed and parameterized into a set of hyperparameter vectors, including the scaling gain ( ), proportional bias ( ), integral gain ( ), integral bias ( ), differential gain ( ) and differential bias ( );
[0052] A closed-loop system simulation model is established based on the FNN-PID controller and the controlled object.
[0053] A metaheuristic algorithm for optimizing artificial rabbit swarms (ITSE-NLP-ARO) is introduced, using the Time-weighted Squared Error–Nonlinear Penalty-Artificial Rabbit Optimization (ITSE-NLP-ARO) combined fitness function. The hyperparameter vector is used as the optimization variable, and the system simulation model is iteratively called for execution, referencing... Figures 3-4 As shown, it specifically includes:
[0054] Step 1: Determine the dimension of the hyperparameters to be optimized (Dim=6), and set the upper bound (Ub) and lower bound (Lb) for each hyperparameter; set the control parameters of the ARO algorithm, including the maximum number of iterations MaxIteration and the population size PopSize; then, randomly generate PopSize individuals in the six-dimensional space defined by [Lb, Ub] to form the initial population.
[0055] Step 2: Perform a fitness evaluation for each individual in the current population (i.e., each set of candidate hyperparameters); this process is completed in the closed-loop system simulation model.
[0056] In an exemplary embodiment, the closed-loop system simulation model is constructed as a high-fidelity two-phase hybrid stepper motor field-oriented control (FOC) system dynamic model based on the MATLAB / Simulink environment. This model employs a cascaded dual-closed-loop control architecture in its topology, with an outer loop for speed control and an inner loop for current control. It fully integrates the mathematical and physical models of the coordinate transformation module (Park transform and its inverse transform), current regulator, space vector pulse width modulation (SVPWM) module, inverter, and the two-phase hybrid stepper motor itself. An FNN-PID controller, acting as a speed regulator, is deployed in the outer speed loop of this cascaded control structure, and its output serves as the command reference for the inner current loop. To quantitatively evaluate the controller's dynamic tracking performance and steady-state characteristics, the excitation input of the system simulation model is set to a step reference speed command, and the simulation period is set to a duration sufficient to ensure the system can fully transition from transient response to steady state.
[0057] After the simulation, the fitness value based on the combination of time-weighted error square integral (ITSE) and nonlinear penalty (NLP) term is calculated by the performance calculation unit integrated in the system simulation model according to the following formula. :
[0058] ;
[0059] in, To control system error; The time-weighted error square integral term, because it is multiplied by time It amplifies the steady-state error in the later stages, effectively forcing the optimization algorithm to quickly eliminate the steady-state error and significantly improving the steady-state accuracy of the system. This indicates the simulation duration set for the closed-loop system. This is a non-linear penalty term, based on the absolute value of the instantaneous error. The magnitude of the penalty is graded to strongly suppress overshoot in the system during transient processes such as startup, acceleration, and deceleration. This is a piecewise nonlinear penalty term; The total number of simulation steps is given. By combining the time-weighted integral of squared errors (ITSE) with the nonlinear penalty (NLP) term, the problem that traditional single indicators (such as IAE or ITSE) cannot simultaneously take into account the speed, stability and high accuracy of the system is successfully solved.
[0060] Among them, the piecewise nonlinear penalty term satisfy:
[0061] ;
[0062] in, and These are preset high and low penalty thresholds. > ; and These are the corresponding penalty weights. ≫ .
[0063] In one exemplary embodiment, the penalty weight The penalty weight is 10000. A value of 100 indicates a high penalty threshold. The penalty threshold is 0.07 rad / s. It is 0.03 rad / s.
[0064] Step 3: After obtaining the fitness values of the entire population, the artificial rabbit population metaheuristic algorithm begins executing its main loop, including:
[0065] At the beginning of each iteration, the energy factor is calculated based on the current iteration number It and the maximum iteration number MaxIt;
[0066] When the energy factor is greater than 1, a global exploration strategy (detour foraging) is implemented. The individual will update its position according to the following formula, that is, move a large step towards other randomly selected individuals in the population:
[0067] ;
[0068] in, For the new individual position; R represents the randomly selected individual position; R is the running operator, a random vector used to simulate the step length of a rabbit moving around in search of food. This represents the current individual's location. The random noise vector simulates random disturbances during the foraging process, which helps prevent getting trapped in local optima.
[0069] When the energy factor is no greater than 1, a local development strategy (random hiding) is implemented. The individual will conduct a small-scale, fine-grained search around its own location according to the following formula:
[0070] ;
[0071] in, For the new individual position; R represents the current position of the individual; R is the running operator, a random vector used to simulate the step size of a rabbit moving around to find food. `b` is a random number between [0, 1]; `b` is a randomly generated candidate hidden position. All newly generated positions will be constrained by a boundary check function to ensure that they do not exceed the preset range [Lb, Ub].
[0072] Step 4: Recalculate the fitness value of newly generated individuals using the method from Step 2, and update the population according to the greedy criterion; simultaneously, update the recorded global optimal solution; then, determine whether the current iteration count has reached MaxIteration. If not, return to Step 2; if so, the algorithm terminates.
[0073] After the algorithm terminates, the final saved global optimal solution is output, which is the optimal combination of hyperparameters sought; refer to Figure 5 The figure illustrates the optimal fitness value in a typical optimization task. The process of monotonically decreasing and eventually converging as the number of iterations increases intuitively verifies the effectiveness and convergence of the method of the present invention.
[0074] This application also provides a specific embodiment that comprehensively analyzes the effectiveness and superiority of the method provided above; the following settings are made:
[0075] The method of this invention (ITSE-NLP-ARO) was compared with optimization methods based on IAE fitness function and ITSE fitness function through trapezoidal velocity curve simulation experiments: Results are referenced. Figure 6 As shown in Table 1:
[0076] Table 1 compares the simulation results of the present invention with those of controllers optimized based on IAE fitness function or ITSE fitness function.
[0077] Project Controller Peak absolute error (rad / s) Average error (rad / s) IAE_ARO controller 0.2939 0.0263 ITSE_ARO Controller 0.1425 0.0218 ITSE_NLP_ARO Controller 0.1272 0.0207
[0078] Simulation results show that the method of the present invention can significantly optimize system performance indicators, especially in balancing speed and overshoot suppression. As shown in Table 1, compared with the controller based on IAE fitness function optimization, the method of the present invention reduces the peak absolute error by 56.72% and the average error by 21.29%; compared with the controller based on ITSE fitness function optimization, the method of the present invention reduces the peak absolute error by 10.74% and the average error by 5.05%. Figure 6 The simulation optimization results curves shown strongly demonstrate the significant technical superiority of the fitness function (ITSE-NLP) based on the combination of time-weighted error square integral (ITSE) and nonlinear penalty (NLP) terms in high-performance motor control.
[0079] The embodiments of the present invention have been described in detail above with reference to the examples. However, the present invention is not limited to the above embodiments. For those skilled in the art, after learning the contents described in the present invention, several equivalent changes and substitutions can be made without departing from the principle of the present invention. These equivalent changes and substitutions should also be considered to fall within the protection scope of the present invention.
Claims
1. A method for self-tuning of PID controller based on combination fitness function optimization, characterized in that: The method comprises the following steps: constructing an FNN-PID controller, and parameterizing a basic adjustment amount output by the FNN-PID controller into a set of hyperparameter vectors through respective gain and bias parameters; establishing a closed-loop system simulation model based on the FNN-PID controller and a controlled object; introducing a time-weighted error square integral-nonlinear penalty combined fitness function to optimize an artificial rabbit swarm optimization algorithm; taking the hyperparameter vectors as optimization variables, iteratively calling the system simulation model, obtaining a fitness value as optimization feedback, and outputting an optimal hyperparameter corresponding to the fitness value meeting a preset condition; the FNN-PID controller takes system error and error change rate as double inputs and outputs basic adjustments of proportional, integral, and differential parameters in parallel; The fitness value includes a time-weighted error-squared integral term and a non-linear penalty term, the fitness value satisfies: ; wherein, is a control system error; is a time weighted error squared integral term, t is time, represents a simulation duration set for the closed loop system; is a non-linear penalty term, is a piece-wise non-linear penalty term; is a total number of simulation steps; The segmented non-linear penalty term satisfies: ; wherein, and are preset high and low penalty thresholds, > ; and are respective penalty weights, ≫ .
2. The method for self-tuning of PID controller based on optimization of a combination fitness function according to claim 1, characterized in that: the set of hyperparameter vectors comprises proportional gain, proportional bias, integral gain, integral bias, differential gain, and differential bias. Based on the feedback of the fitness value, the artificial rabbit swarm optimization algorithm starts to execute a main loop, which comprises:
3. The method for self-tuning of PID controller based on optimization of a combination fitness function as claimed in claim 2 wherein: penalty weight is 10000, the penalty weight is 100, the high penalty threshold is 0.07 rad / s, the low penalty threshold is 0.03 rad / s.
4. The method for self-tuning of PID controller based on combination fitness function optimization as claimed in claim 2, wherein: At the beginning of each iteration, an energy factor is calculated according to the current iteration number It and the maximum iteration number MaxIt; When the energy factor is greater than 1, a global exploration strategy is executed; When the energy factor is not greater than 1, a local development strategy is executed. Based on the obtained fitness value, it is determined whether the fitness value meets both a preset convergence condition and is the current minimum fitness value; if both conditions are met, the optimal hyperparameter is updated to the current population hyperparameter, and the optimization strategy of the optimized artificial rabbit swarm optimization algorithm is continued to update the next generation population hyperparameter; if at least one of the two conditions is not met, the optimal hyperparameter is not updated, and the optimization strategy of the optimized artificial rabbit swarm optimization algorithm is continued to update the next generation population hyperparameter, and the system simulation model is iteratively called; when the last iteration ends, the optimization is terminated and the current optimal hyperparameter is output.
5. The method for self-tuning of PID controller based on optimization of a combination fitness function as claimed in claim 4 wherein: The closed-loop system simulation model is a field-oriented control system simulation model.
6. The method for self-tuning of PID controller based on optimization of a combination fitness function according to claim 1, characterized in that: The system comprises:
7. The system for self-tuning of PID controller based on optimization of a combination fitness function according to any one of claims 1-6, characterized in that: a controller module configured to dynamically generate a control signal according to input system states and a set of hyperparameter vectors containing gain and bias; a system simulation module coupled with the controller module and configured to simulate a closed-loop control process of the controller module on a controlled object and output a quantitative performance evaluation index as a fitness value; a parameter optimization module configured to execute an artificial rabbit swarm optimization algorithm, take the hyperparameter vectors as optimization variables, receive the fitness value as optimization feedback, and generate and update the hyperparameters through iteration until converging to an optimal solution.
Citation Information
Patent Citations
PID controller parameter setting algorithm based on improved PSO (particle swarm optimization) algorithm
CN107272403A
PID controller optimization method based on improved meta-heuristic algorithm
CN116610025A