PID parameter adjustment method and device based on SA and PID parameter adjustment system

By applying simulated annealing algorithm (SA) and normal distribution search in PID parameter adjustment, the problems of poor stability and local optimal solutions for PID parameter adjustment in the prior art are solved, and more efficient and accurate control system performance is achieved.

CN119805919APending Publication Date: 2025-04-11BEIJING SYLINCOM TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411974367.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In the prior art, the PID parameter adjustment method has poor stability and can only find local optimal solutions.

Method used

The PID parameters are optimized by using a simulation annealing algorithm (SA)-based method, and the search process is guided by MATLAB simulation and normal distribution until the optimal PID parameters are found.

Benefits of technology

The stability of PID parameter adjustment is improved, the problem of local optimal solution is avoided, and the response speed, accuracy and efficiency of the control system is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119805919A_ABST
    Figure CN119805919A_ABST
Patent Text Reader

Abstract

The invention provides a PID parameter adjustment method and device based on SA and a PID parameter adjustment system. The method comprises the steps that initial PID parameters are acquired, and the initial PID parameters comprise an initial proportion parameter, an initial integral parameter and an initial differential parameter; performing optimization processing on the initial PID parameter by using an SA algorithm to obtain an optimized PID parameter; and controlling the servo motor to operate by adopting the optimized PID parameters. According to the scheme, the problems that in the prior art, a PID parameter adjusting method is poor in stability, and only a local optimal solution can be found easily are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of servo motor control, and in particular to a parameter adjustment method, device, computer program product and PID parameter adjustment system based on SA. Background Art

[0002] Servo motor control algorithms are a key component in modern automation systems. They are designed to precisely control the motion and behavior of servo motors and are widely used in a variety of industries, including robotics, automated production lines, precision machining equipment, aerospace, and equipment. Servo motors are a special type of motor that can precisely control speed, position, and acceleration. They are widely used in areas that require highly accurate control. These motors are often integrated into closed-loop control systems, where control algorithms continuously adjust the input to the motor based on feedback to ensure that the desired motion state is achieved or maintained. The main role of servo motor control algorithms is to improve the responsiveness, accuracy, and efficiency of the system. By fine-tuning the speed and position of the motor, these algorithms help the system reach the set goals quickly and accurately, while optimizing energy consumption and reducing wear, thereby extending the life of the equipment. Advanced control algorithms can also handle more complex dynamic environments and improve the robustness of the control system.

[0003] The existing servo motor control algorithms include: PID control, vector control (Field-Oriented Control, FOC), direct torque control (Direct Torque Control, DTC), adaptive control and model predictive control (Model Predictive Control, MPC), etc.

[0004] Among them, PID control is the most widely used control algorithm, which adjusts the output of the controller through three main parameters: proportion (P), integral (I) and differential (D) to achieve the desired control effect.

[0005] Although the existing PID parameter adjustment methods are widely used in industrial control systems, they are accompanied by many problems and limitations. The manual adjustment method is overly dependent on the operator's experience, lacks systematicity and repeatability, and the adjustment process is usually time-consuming and inefficient. Although the automatic adjustment method and the response curve method have improved the automation level to a certain extent, their performance is often unstable in the face of complex and changing system environments, and they may only be able to find local optimal solutions. Summary of the invention

[0006] The main purpose of the present application is to provide a PID parameter adjustment method, device, computer program product and PID parameter adjustment system based on SA, so as to at least solve the problem that the PID parameter adjustment method in the prior art has poor stability and can only find local optimal solutions.

[0007] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a PID parameter adjustment method based on SA is provided, comprising: obtaining initial PID parameters, wherein the initial PID parameters include initial proportional parameters, initial integral parameters and initial differential parameters; using the SA algorithm to optimize the initial PID parameters to obtain optimized PID parameters; and using the optimized PID parameters to control the operation of the servo motor.

[0008] Optionally, the SA algorithm is used to optimize the initial PID parameters to obtain optimized PID parameters, including: using the SA algorithm to search, and using MATLAB simulation and normal distribution to guide the search process until the optimal PID parameters are found to obtain the optimized PID parameters.

[0009] Optionally, the SA algorithm is used for searching, and MATLAB simulation and normal distribution are used to guide the searching process until the optimal PID parameters are found to obtain the optimized PID parameters, including: calculating the optimal proportional parameters according to the first formula to obtain the optimized proportional parameters, wherein the first formula is:

[0010]

[0011] in, represents the optimized proportional parameter, Indicates the effect of K on the temperature T P The next step is to iterate the function of the required normal distribution mean, K P represents the gain coefficient of the proportional parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, and the rise time is the time required for the temperature to reach the target temperature value from the initial state, and R n represents the standard rise time simulated by MATLAB, S represents the stabilization time simulated by MATLAB, and the stabilization time is the duration of the temperature being in the standard temperature range, sgn represents the sign function, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial proportional parameter under the first temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial proportional parameter at the second temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial proportional parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T cIndicates the preset temperature threshold.

[0012] Optionally, the SA algorithm is used for searching, and MATLAB simulation and normal distribution are used to guide the searching process until the optimal PID parameters are found to obtain the optimized PID parameters, including: calculating the optimal integral parameter according to the second formula to obtain the optimized integral parameter, wherein the second formula is:

[0013]

[0014] in, represents the optimized integral parameter, Indicates the effect of K on the temperature T I The next step is to iterate the function of the required normal distribution mean, K I represents the gain coefficient of the integral parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, and the rise time is the time required for the temperature to reach the target temperature value from the initial state, and R n represents the standard rise time of MATLAB simulation, S represents the stabilization time of MATLAB simulation, and the stabilization time is the duration of the temperature within the standard temperature range, S n represents the standard stabilization time of MATLAB simulation, sgn represents the symbolic function, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial integral parameter under the first temperature condition, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial integral parameter under the first temperature, represents the influence coefficient of the stabilization time on the iterative distribution mean μ of the initial integral parameter under the first temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial integral parameter at the second temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial integral parameter under the second temperature, represents the influence coefficient of the stabilization time on the iterative distribution mean μ of the initial integral parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

[0015] Optionally, the SA algorithm is used for searching, and MATLAB simulation and normal distribution are used to guide the searching process until the optimal PID parameters are found to obtain the optimized PID parameters, including: calculating the optimal differential parameters according to the third formula to obtain the optimized differential parameters, wherein the third formula is:

[0016]

[0017] in, represents the optimized differential parameter, Indicates the effect of K on the temperature T D The next step is to iterate the function of the required normal distribution mean, K D represents the gain coefficient of the differential parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, which is the time required for the temperature to reach the target temperature value from the initial state, S represents the stabilization time of MATLAB simulation, which is the duration of the temperature within the standard temperature range, and S n represents the standard stabilization time of MATLAB simulation, sgn represents the symbolic function, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial differential parameter under the first temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial differential parameter under the first temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial differential parameter at the second temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial differential parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

[0018] Optionally, in the process of optimizing the initial PID parameters using the SA algorithm to obtain optimized PID parameters, the method further includes: obtaining the first solution obtained for the N-1th time, obtaining a first calculation result value corresponding to the first solution, wherein the solution is a PID parameter value, and the calculation result value is a performance index value obtained by weighted averaging according to MATLAB simulation, and N≥1; obtaining the second solution obtained for the Nth time, obtaining a second calculation result value corresponding to the second solution; when the first calculation result value is less than the second calculation result value, adjusting the second solution to the first solution; when the first calculation result value is greater than or equal to the second calculation result value, adjusting the second solution to the first solution with a target probability, wherein the calculation formula of the target probability is:

[0019]

[0020] P represents the target probability, f value (S) represents the first calculation result value, f value (S′) represents the second calculation result value, and T represents the current temperature.

[0021] Optionally, in the process of using the SA algorithm to optimize the initial PID parameters to obtain optimized PID parameters, the method also includes: obtaining the current number of iterations and the current temperature, wherein the current number of iterations is the number of current iterations in the optimization process using the SA algorithm, and the current temperature is the temperature for adjusting parameters in the optimization process using the SA algorithm; when the current number of iterations is greater than a preset number threshold and the current temperature is less than a preset minimum temperature, exiting the iterative process.

[0022] According to another aspect of the present application, a parameter adjustment device for SA-based PID is provided, comprising: a first acquisition unit, used to acquire initial PID parameters, wherein the initial PID parameters include initial proportional parameters, initial integral parameters and initial differential parameters; an optimization unit, used to optimize the initial PID parameters using an SA algorithm to obtain optimized PID parameters; and a control unit, used to control the operation of a servo motor using the optimized PID parameters.

[0023] According to another aspect of the present application, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the steps of any one of the SA-based PID parameter adjustment methods are implemented.

[0024] According to another aspect of the present application, a PID parameter tuning system is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of the SA-based PID parameter tuning methods.

[0025] By applying the technical solution of the present application and using the SA algorithm to optimize the PID parameters, the SA algorithm can perform a global search and has good global search capabilities. It can find the global optimal solution and avoid the problem of local optimality, making the parameter adjustment scheme of this scheme more stable. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0027] Figure 1 A hardware structure block diagram of a mobile terminal for performing a parameter adjustment method of a PID based on SA provided in an embodiment of the present application is shown;

[0028] Figure 2 A flow chart of a PID parameter adjustment method based on SA provided in accordance with an embodiment of the present application is shown;

[0029] Figure 3 shows a flow chart of servo motor PID control;

[0030] Figure 4 The overall framework diagram of PID control parameter adjustment proposed in this scheme is shown;

[0031] Figure 5 The simulated annealing algorithm flow chart is shown;

[0032] Figure 6 A schematic diagram of the process of a random iteration method based on normal distribution in a solution space is shown;

[0033] Figure 7 A structural block diagram of a PID parameter adjustment device based on SA provided according to an embodiment of the present application is shown.

[0034] The above drawings include the following reference numerals:

[0035] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION

[0036] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0037] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0039] The existing PID control parameter adjustment methods mainly include the following:

[0040] Manual adjustment method (classic method):

[0041] Manual tuning is the most basic PID parameter adjustment method, which usually requires the operator to adjust the parameters based on experience and system response. The Ziegler-Nichols method is one of the famous manual tuning strategies, which provides a systematic step to set parameters. This method first requires setting the integral and differential gains to zero, increasing the proportional gain until the system output begins to oscillate, recording the proportional gain (called critical gain) and oscillation period at this time, and then calculating the initial PID parameters based on this information.

[0042] Automatic adjustment method:

[0043] Automatic tuning methods use specific algorithms or logic to automatically set PID parameters. These methods are usually based on a dynamic model of the control system and use software tools to automatically calculate the optimal parameters. For example, some modern PID controllers have built-in self-tuning functions that can automatically adjust parameters when they are first installed or when the control environment changes.

[0044] Response Curve Method:

[0045] The response curve method relies on the system's response to certain test signals (such as step signals). By analyzing the system's response curve, such as overshoot, rise time, and settling time, the PID parameters are adjusted to achieve the desired control performance. The Cohen-Coon method is a common response curve parameter adjustment method.

[0046] Although the existing PID parameter adjustment methods are widely used in industrial control systems, they are accompanied by many problems and limitations. The manual adjustment method is overly dependent on the operator's experience, lacks systematicity and repeatability, and the adjustment process is usually time-consuming and inefficient. Although the automatic adjustment method and the response curve method have improved a certain level of automation, their performance is often unstable when facing a complex and changing system environment, and they may only be able to find a local optimal solution. In addition, most methods require a long adjustment cycle and a large amount of experimental data, which increases the implementation cost. Overall, the existing technology still needs to be improved in terms of efficiency, accuracy, adaptability and user-friendliness.

[0047] As introduced in the background technology, the PID parameter adjustment method in the prior art has poor stability and can easily only find a local optimal solution. To solve the above problem, the embodiments of the present application provide a PID parameter adjustment method, device, computer program product and PID parameter adjustment system based on SA.

[0048] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0049] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a PID parameter adjustment method based on SA according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0050] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the display method of device information in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0051] In this embodiment, a SA-based PID parameter adjustment method running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0052] Figure 2 FIG. 1 is a flow chart of a PID parameter adjustment method based on SA according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0053] Step S201, obtaining initial PID parameters, wherein the initial PID parameters include an initial proportional parameter, an initial integral parameter and an initial differential parameter;

[0054] Specifically, in the PID control algorithm, the three parameters of proportional (P), integral (I), and differential (D) jointly determine the output of the controller, thereby affecting the operating performance of the servo motor. Before the optimization begins, the initial values ​​of the PID parameters need to be determined.

[0055] Step S202, using the SA algorithm to optimize the above initial PID parameters to obtain optimized PID parameters;

[0056] Specifically, the simulated annealing algorithm is applied to optimize the initial PID parameters. The simulated annealing algorithm is a global optimization technique inspired by the annealing process of matter in solid physics. The algorithm avoids falling into the local optimal solution by randomly searching in the solution space while allowing inferior solutions to be accepted with a certain probability, thereby finding a solution that is closer to the global optimal solution. In the context of PID parameter optimization, this process involves generating new parameter groups, evaluating the control performance under these new parameter groups, and then deciding whether to accept these new parameters based on the algorithm rules. After a series of iterations, the algorithm will eventually converge to a set of optimized PID parameters that can provide better servo motor control performance.

[0057] Step S203, using the optimized PID parameters to control the operation of the servo motor.

[0058] Specifically, once the optimized PID parameters are obtained through the simulated annealing algorithm, these parameters will be applied to the PID controller of the servo motor to control the operation of the motor. The optimized PID parameters can help the controller respond to the motor movement instructions more accurately, quickly and stably, reduce overshoot, shorten rise time and stabilization time. This step is the key to converting the theoretical results of the optimization algorithm into practical applications. The optimized parameters can significantly improve the response speed, accuracy and efficiency of the servo motor control system, ensuring that the motor can reach or maintain the preset motion state under various working conditions, thereby improving the performance of the entire automation system.

[0059] Through this embodiment, the SA algorithm is used to optimize the PID parameters. The SA algorithm can perform a global search and has good global search capabilities. It can find the global optimal solution and avoid the problem of local optimality, making the parameter adjustment scheme of this scheme more stable.

[0060] Specifically, the PID controller can be modeled first, such as Figure 3 As shown, the PID controller consists of three parts: proportional (P), integral (I) and derivative (D).

[0061] The impact of each part on the control output is as follows:

[0062] Proportional control (P) formula:

[0063] u P =K P *e(t);

[0064] Function: Adjust the control output according to the current error. The function of proportional control is to respond to errors quickly, but using proportional control alone may cause system steady-state errors.

[0065] Integral control (I) formula:

[0066]

[0067] Function: Adjust the control output according to the accumulated value of the error. Integral control can eliminate steady-state errors, but too strong an integral effect may cause the system to respond more slowly or even cause oscillation.

[0068] Differential control (D) formula:

[0069]

[0070] Function: Adjust the control output according to the rate of change of the error. Differential control helps to predict the trend of the error and make corrections in advance, improving the stability and response speed of the system, but too strong a differential effect may be sensitive to noise.

[0071] The output of the PID controller is a linear combination of the three components above:

[0072]

[0073] Among them, K P, K I, K D , are the gain coefficients of proportional, integral and differential control respectively, and e(t) is the difference between the set value and the actual value at time t.

[0074] Specifically, the SA-based servo motor PID control parameter adjustment algorithm proposed in the solution of this application can effectively reduce manual intervention and significantly improve the automation level and efficiency of the parameter optimization process. At the same time, the global search capability of simulated annealing is used to avoid the problem of local optimality and increase the probability of finding the global optimal solution. In the SA iteration, by dynamically adjusting the search strategy (random adjustment based on normal distribution), it can better adapt to the performance changes of the system under different working conditions.

[0075] Specifically, the simulated annealing algorithm of the present application is applied to PID parameter optimization, and the simulated annealing algorithm is introduced into the adjustment process of PID parameters. The global search advantage of simulated annealing is utilized to find the global optimal or near-optimal PID parameter setting with a higher probability, which is difficult to achieve with traditional methods.

[0076] This method enables the PID parameter optimization process to jump out of the local optimal solution and improves the possibility of finding the global optimal solution. Compared with traditional methods, it can search in a larger parameter space, increasing the probability of finding a more suitable parameter setting, thereby significantly improving the overall performance and stability of the control system.

[0077] In the specific implementation process, the SA algorithm is used to optimize the above initial PID parameters to obtain the optimized PID parameters, which can be achieved through the following steps: using the SA algorithm to search, and using MATLAB simulation and normal distribution to guide the search process until the optimal PID parameters are found, thereby obtaining the above optimized PID parameters.

[0078] In this scheme, the SA algorithm can avoid falling into the local optimal solution and is more likely to find the global optimal solution or the PID parameter setting close to the global optimal solution, which significantly improves the performance of the control system. The dynamic adjustment of the normal distribution parameters and the evaluation function based on the MATLAB simulation results make the search process more intelligent and efficient, and can automatically adjust the search range according to the current system performance feedback.

[0079] Specifically, the simulated annealing algorithm is a random optimization technique that mimics the physical annealing process and searches for the global optimal solution to a problem by performing a random search with a cooling mechanism in the solution space. In the scenario of PID parameter optimization, SA generates different PID parameter combinations and evaluates the impact of these combinations on system performance, thereby gradually and iteratively searching for the best parameter settings. A key feature of SA is that it allows certain suboptimal solutions to be accepted in the "hot" stage, which helps the algorithm escape the trap of local optimal solutions and search for a wider solution space.

[0080] MATLAB is a widely used mathematical computing and simulation tool that can efficiently simulate and evaluate various control algorithms. In this optimization process, MATLAB is used to simulate servo motor control systems with different PID parameters to evaluate performance indicators such as overshoot, rise time, and settling time. The simulation results of MATLAB are used as the evaluation function input of the SA algorithm to guide the algorithm in the direction of searching for better parameters. Through simulation, the performance of the PID controller can be systematically evaluated and optimized without the actual hardware cost and risk.

[0081] During the iteration of the SA algorithm, a normal distribution is used to generate new PID parameter combinations. The mean and variance of the normal distribution are dynamically adjusted based on the current search status and system performance feedback. This mechanism allows the algorithm to search in the parameter space in a way that focuses on the area near the current optimal solution while exploring further areas when necessary. By adjusting the parameters of the normal distribution, the algorithm can balance the globality and locality of the search and improve search efficiency.

[0082] The iteration process of the SA algorithm will continue until the preset termination condition is reached, such as the temperature drops to a certain level or the number of iterations reaches an upper limit. The algorithm continuously generates and evaluates the PID parameter group and eventually converges to a set of optimal or near-optimal PID parameters that can provide the best servo motor control performance.

[0083] Specifically, Figure 4 As shown, the scheme of the present application is designed based on the evaluation function of system performance feedback. In this scheme, the evaluation function of SA is defined based on the system performance indicators (such as overshoot, rise time and stabilization time) obtained by MATLAB simulation. These performance indicators are used to measure the quality of PID control effect, and are integrated into a single evaluation value by weighted average to guide the search process in the simulated annealing algorithm.

[0084] The evaluation function design based on actual control performance feedback makes the parameter adjustment process more in line with actual application requirements. By accurately measuring the importance of each performance indicator, it can ensure that the PID controller achieves the optimal control effect in actual operation, especially when dealing with systems with complex dynamic characteristics, and can more effectively adjust parameters to meet performance requirements.

[0085] The normal distribution adjustment mechanism of the solution of this application uses normal distribution to adjust the generation of PID parameters in each iteration. In each iteration, based on the previous performance evaluation results, the mean and variance of the normal distribution are dynamically adjusted to generate new parameter combinations in a more targeted manner. If the previous results indicate poor performance, the normal distribution will be adjusted accordingly to push the parameters to change in a direction that is more likely to improve performance.

[0086] This dynamic adjustment mechanism based on normal distribution brings higher flexibility and adaptability to the optimization of PID parameters. It allows the algorithm to adjust the search strategy according to the actual control effect, effectively adjusting for specific system performance deficiencies. This not only enhances the responsiveness of the control system, but also improves its adaptability in a changing environment, ensuring that the controller can maintain excellent control performance under different operating conditions.

[0087] As mentioned above, the solution of this application is based on the SA algorithm, and proposes an efficient and accurate PID parameter optimization algorithm that can find the global optimal solution in a wider parameter space, significantly improving the stability and efficiency of the control system. The evaluation function ensures that the parameter adjustment process is strictly based on the actual control performance, so that the optimized parameters are not only effective in theory, but also can significantly improve the system response in practical applications. At the same time, the dynamic adjustment mechanism of the normal distribution provides flexibility and adaptability for parameter search, allowing the algorithm to intelligently adjust the search direction according to the current system performance and optimize the control effect. On the whole, this method provides a PID control parameter automatic optimization solution suitable for complex industrial environments, which greatly improves the automation level of the adjustment process and the performance of the control system.

[0088] Specifically, the SA algorithm is initialized and defined, and the initial solution is set, that is, the initial K is set. P, K I, KD Value, denoted as vector S = {K P ,K I ,K D} T , and is used to store the current solution in subsequent iterations;

[0089] Define the matrix W 10*4 , store the 10 best parameter groups and evaluation function values ​​encountered so far;

[0090] Define the initial temperature as T;

[0091] Define the number of iterations Num at the current temperature;

[0092] Define the cooling rate α (0<α<1, generally selected between 0.8 and 0.99);

[0093] Define the end temperature T min ;

[0094] Define performance requirement vector Need = {O n ,R n ,S n} T ;

[0095] Define performance vector EP = {O, R, S} T =MATLAB(S).

[0096] Specifically, for the setting of the SA algorithm objective function:

[0097] Input the solution vector S into the prepared MATLAB program to obtain three key performance indicators: overshoot (O), rise time (R) and settling time (S). The objective function is as follows:

[0098] f value (S) = μ O *O+μ R *R+μ S *S;

[0099] μ O , μ R , μ S Indicates different weight coefficients.

[0100] Specifically, the normal distribution parameter setting function for solution iteration and the process of generating new solutions. In the traditional manual parameter adjustment method, when O is too low and R is too long, K needs to be increased. P When O is too high and R is too short, K ​​needs to be reduced. P When R is too long, K needs to be increased. I , when O is too high and S is too short, K ​​needs to be reduced I; When O is too low and S is too long, K needs to be increased D , rarely reduce K D According to the above process, the normal distribution mean setting function used for solution iteration adopts the strategy of comprehensive application of exponential logarithm. The specific process is combined with Figure 5 Explain with the following content.

[0101] In some embodiments, the SA algorithm is used for searching, and MATLAB simulation and normal distribution are used to guide the searching process until the optimal PID parameters are found, and the above-mentioned optimized PID parameters are obtained, which can be specifically realized by the following steps: according to the first formula, the optimal proportional parameter is calculated to obtain the optimized proportional parameter, wherein the above-mentioned first formula is:

[0102]

[0103] in, represents the above optimized proportional parameter, Indicates the effect of K on the temperature T P The next step is to iterate the function of the required normal distribution mean, K P represents the gain coefficient of the proportional parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, which is the time required for the temperature of the initial state to reach the target temperature value, and R n represents the standard rise time simulated by MATLAB, S represents the stabilization time simulated by MATLAB, the above stabilization time is the duration of the temperature within the standard temperature range, sgn represents the sign function, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial proportional parameter under the first temperature condition, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial proportional parameter at the second temperature, K R,KP,L,μ represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial proportional parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

[0104] In this solution, a dynamic adjustment mechanism of the mean of the normal distribution is used, which can flexibly adjust the direction and range of the parameter search according to the current temperature and system performance feedback (overshoot, rise time, and stabilization time). This means that in the early iterations (high temperature stage), the algorithm will be more inclined to explore a larger parameter space, and when the temperature drops (low temperature stage), the algorithm will focus more on fine-tuning the parameters to gradually converge to the optimal solution. The cooling mechanism of the simulated annealing algorithm using exponential and logarithmic functions helps the algorithm avoid falling into a local optimal solution. At higher temperatures, the algorithm is more sensitive to larger performance deviations, and can span a larger parameter space and explore a variety of possible parameter combinations; at lower temperatures, the algorithm can also respond to smaller performance differences and adjust parameters more accurately, thereby finding the optimal solution globally. More accurate optimized proportional parameters can be obtained through this embodiment.

[0105] Specifically, Indicates the effect of O, R, S on K at the algorithm temperature T P The function of the mean of the normal distribution required for the next iteration; sgn is a sign function, the purpose of which is to determine whether the mean is set to positive or negative based on the size of the existing performance and the target performance; the purpose of the function being a piecewise function is that when the temperature is high in the early stage of the algorithm, the practical exponential function can be more sensitive to larger performance deviations and can search a larger solution space; when the temperature is low in the later stage of the algorithm, a logarithmic function is used, which is sensitive to smaller performance gaps and allows for more detailed parameter adjustments in the later stage of the algorithm. is a positive value, indicating that under H (high temperature), O has a P The influence coefficient of the iterative distribution mean μ, is a positive value, indicating that under L (low temperature), O is P The influence coefficient of the iterative distribution mean μ, and the meanings of the remaining K are similar and will not be repeated here.

[0106] Specifically, overshoot refers to the maximum percentage by which the system response exceeds the target value before reaching its final value. In the time domain response, when the system adjusts from one state to another, the output may temporarily exceed the desired target value and then return to the vicinity of the target value. The overshoot reflects the smoothness of the system response. The larger the overshoot, the worse the smoothness of the system response.

[0107] Rise Time is the time required for a system response to rise from its initial state to and remain at a certain percentage of its final value. Specifically, the rise time is the time from the moment the response begins to leave its initial value to the first time it reaches 90% of the steady-state value or the time required to rise from the initial value to 10% to 90% of the steady-state value, depending on the specific standard. The shorter the rise time, the faster the system reaches the target value, which is very important in systems that require fast response.

[0108] Settling time is a measure of the time it takes for a system response to settle near its target value. Typically, settling time is defined as the duration for the response to first reach within ±2% or ±5% of the target value. Settling time reflects the efficiency of a system in entering and remaining in a steady state from a transient state. The shorter the settling time, the faster the system enters a steady state, but this usually requires a trade-off with overshoot and rise time, as fast settling may be accompanied by a large overshoot.

[0109] In the specific implementation process, the SA algorithm is used for searching, and MATLAB simulation and normal distribution are used to guide the search process until the optimal PID parameters are found. The above-mentioned optimized PID parameters can be obtained by the following steps: According to the second formula, the optimal integral parameter is calculated to obtain the optimized integral parameter, wherein the above-mentioned second formula is:

[0110]

[0111] in, represents the above optimized integral parameter, Indicates the effect of K on the temperature T I The next step is to iterate the function of the required normal distribution mean, K I represents the gain coefficient of the integral parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, which is the time required for the temperature of the initial state to reach the target temperature value, and R n represents the standard rise time of MATLAB simulation, S represents the stabilization time of MATLAB simulation, and the above stabilization time is the duration of the temperature within the standard temperature range, S n represents the standard stabilization time of MATLAB simulation, sgn represents the symbolic function, represents the influence coefficient of the above rise time on the iterative distribution mean μ of the above initial integral parameter under the first temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial integral parameter under the first temperature, represents the influence coefficient of the above stabilization time on the iterative distribution mean μ of the above initial integral parameter under the above first temperature, represents the influence coefficient of the above rise time on the iterative distribution mean μ of the above initial integral parameter under the second temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial integral parameter under the second temperature, represents the influence coefficient of the above stabilization time on the iterative distribution mean μ of the above initial integral parameter under the above second temperature, the above first temperature is greater than the above second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

[0112] In this solution, a dynamic adjustment mechanism of the mean of the normal distribution is used, which can flexibly adjust the direction and range of the parameter search according to the current temperature and system performance feedback (overshoot, rise time, and stabilization time). This means that in the early iterations (high temperature stage), the algorithm will be more inclined to explore a larger parameter space, and when the temperature drops (low temperature stage), the algorithm will focus more on fine-tuning the parameters to gradually converge to the optimal solution. The use of exponential and logarithmic functions combined with the cooling mechanism of the simulated annealing algorithm helps the algorithm avoid falling into a local optimal solution. At higher temperatures, the algorithm is more sensitive to larger performance deviations, and can span a larger parameter space and explore a variety of possible parameter combinations; at lower temperatures, the algorithm can also respond to smaller performance differences and adjust parameters more accurately, thereby finding the optimal solution globally. More accurate optimized integral parameters can be obtained through this embodiment.

[0113] Specifically, Indicates the effect of O, R, S on K at the algorithm temperature T I The next step is to iterate the function of the required normal distribution mean; the addition and subtraction of the sign function in the function is because some performance parameters will only affect the parameter adjustment when they are too large or too small.

[0114] In some embodiments, the SA algorithm is used for searching, and MATLAB simulation and normal distribution are used to guide the searching process until the optimal PID parameters are found, and the above-mentioned optimized PID parameters are obtained, which can be specifically realized by the following steps: according to the third formula, the optimal differential parameters are calculated to obtain the optimized differential parameters, wherein the above-mentioned third formula is:

[0115]

[0116] in, represents the above optimized differential parameters, Indicates the effect of K on the temperature T D The next step is to iterate the function of the required normal distribution mean, K D represents the gain coefficient of the differential parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O nrepresents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, which is the time required for the temperature to reach the target temperature value from the initial state, S represents the stabilization time of MATLAB simulation, which is the duration of the temperature within the standard temperature range, S n represents the standard stabilization time of MATLAB simulation, sgn represents the symbolic function, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial differential parameter under the first temperature condition, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial differential parameter under the first temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial differential parameter at the second temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial differential parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

[0117] In this solution, a dynamic adjustment mechanism of the mean of the normal distribution is used, which can flexibly adjust the direction and range of the parameter search according to the current temperature and system performance feedback (overshoot, rise time, and stabilization time). This means that in the early iterations (high temperature stage), the algorithm will be more inclined to explore a larger parameter space, and when the temperature drops (low temperature stage), the algorithm will focus more on fine-tuning the parameters to gradually converge to the optimal solution. The use of exponential and logarithmic functions combined with the cooling mechanism of the simulated annealing algorithm helps the algorithm avoid falling into a local optimal solution. At higher temperatures, the algorithm is more sensitive to larger performance deviations, and can span a larger parameter space and explore a variety of possible parameter combinations; at lower temperatures, the algorithm can also respond to smaller performance differences and adjust parameters more accurately, thereby finding the optimal solution globally. More accurate optimized differential parameters can be obtained through this embodiment.

[0118] Specifically, the variance design adopts the square strategy, and the normal distribution variance function required for the three parameter adjustments is as follows:

[0119]

[0120]

[0121] The above formula gives three normal distributions Randomly generate three numbers to form the iteration vector ΔS={ΔK P ,ΔK I ,ΔK D},S′=S+ΔS.

[0122] In the specific implementation process, when the SA algorithm is used to optimize the above initial PID parameters to obtain the optimized PID parameters, the above method also includes the following steps: obtaining the first solution obtained for the N-1th time, obtaining the first calculation result value corresponding to the above first solution, wherein the solution is the PID parameter value, and the calculation result value is the performance index value obtained by weighted averaging according to MATLAB simulation, N≥1; obtaining the second solution obtained for the Nth time, obtaining the second calculation result value corresponding to the above second solution; when the above first calculation result value is less than the above second calculation result value, adjusting the above second solution to the above first solution; when the above first calculation result value is greater than or equal to the above second calculation result value, adjusting the above second solution to the above first solution with a target probability, wherein the calculation formula of the above target probability is:

[0123]

[0124] P represents the above target probability, f value (S) represents the value of the first calculation result, f value (S′) represents the above-mentioned second calculation result value, and T represents the current temperature.

[0125] In this scheme, by allowing solutions with worse performance to be accepted under certain conditions, the simulated annealing algorithm can escape the trap of local optimal solutions and is more likely to find the global optimal solution in the parameter space. As the number of iterations increases, the temperature (T) will gradually decrease, which will reduce the probability of accepting solutions with worse performance, making the search process more biased towards local optimization until it finally converges to the optimal solution. In the early stages of the iteration, the temperature is high, and the algorithm tends to explore and accept a wider solution space to find possible directions for improvement; in the later stages of the iteration, the temperature decreases, and the algorithm becomes more picky and tends to use the better solutions that have been found for local optimization. The calculation method of the target probability allows the algorithm to flexibly decide whether to update the parameters based on the performance difference between the current solution and the new solution and the current temperature. This flexibility helps avoid premature convergence to a suboptimal solution while ensuring the high quality of the final solution.

[0126] Specifically, during the optimization process, each round of iteration will generate a new solution (parameter combination), where the first solution refers to the solution obtained at the current iteration round N-1, that is, a set of PID parameter values.

[0127] In the MATLAB simulation environment, the weighted average of the system performance indicators is obtained when the PID parameters in the first solution are used to control the servo motor. These performance indicators can include overshoot, rise time, and settling time, which reflect the effect of PID control.

[0128] At the current iteration round N, the algorithm generates a new parameter combination through normal distribution, which is the second solution.

[0129] The second calculation result value is similar to the first calculation result value, and the second calculation result value is a weighted average value of the system performance index obtained when the PID parameters in the second solution are used to control the servo motor in the MATLAB simulation environment.

[0130] Next, the algorithm decides whether to update the solution based on the comparison between the first calculation result value and the second calculation result value. If the first calculation result value is less than the second calculation result value, it means that the control effect of the second solution is worse, but in the simulated annealing algorithm, it is still possible to accept the second solution with a certain probability to avoid falling into the local optimum. If the first calculation result value is greater than or equal to the second calculation result value, it means that the second solution is at least not worse than the first solution. At this time, the second solution is adjusted to the first solution with the target probability. The negative sign and exponential operation in the formula ensure that when the performance of the second solution is worse, the probability of accepting the second solution will decrease as the temperature decreases. The lower the temperature, the more the algorithm tends to only accept solutions that can improve performance.

[0131] Specifically, the judgment of the new solution after iteration, assuming the new solution is S′, if f value (S) <f value (S′), then accept the new solution and let the current solution S = S′; if f value (S)≥f value (S′), then with probability Accept the new solution and set the current solution S = S'.

[0132] In some embodiments, in the process of using the SA algorithm to optimize the above-mentioned initial PID parameters to obtain optimized PID parameters, the above-mentioned method also includes the following steps: obtaining the current number of iterations and the current temperature, wherein the above-mentioned current number of iterations is the number of current iterations in the optimization process using the SA algorithm, and the above-mentioned current temperature is the temperature for adjusting parameters in the optimization process using the SA algorithm; when the above-mentioned current number of iterations is greater than the preset number threshold and the above-mentioned current temperature is less than the preset minimum temperature, exiting the iterative process.

[0133] In this scheme, the convergence speed of the algorithm can be controlled by setting the iteration number threshold and the minimum temperature. The preset number threshold ensures that the algorithm does not run indefinitely, but stops after reaching a certain number of times, even if the absolutely optimal solution may not have been reached. This helps to find a balance between the quality of the solution and the calculation time. When the temperature drops to the minimum temperature, the algorithm tends to accept new solutions more conservatively, thereby ensuring the rationality and optimization quality of the final solution. Solutions below the preset minimum temperature usually undergo a certain degree of "cooling" process, which means that they have undergone global search and local fine-tuning to a certain extent, and are more likely to be close to the global optimal solution of the problem.

[0134] Specifically, during the optimization process, two key variables need to be tracked: the current number of iterations and the current temperature. The current number of iterations reflects the progress of the optimization process, and the number of iterations will gradually increase from the beginning to the end of the algorithm. The current temperature is a control parameter in the algorithm that affects the probability of the algorithm accepting a worse solution, and usually decreases gradually during the iteration process.

[0135] Check whether two termination conditions are met:

[0136] Whether the current number of iterations is greater than the preset number threshold. The preset number threshold is the upper limit of the number of iterations to prevent the algorithm from running indefinitely and consuming too much time resources. For example, 5 times, 6 times, 10 times, etc.

[0137] Is the current temperature lower than the preset minimum temperature? The preset minimum temperature is the end point of the algorithm's "cooling" process. When the temperature drops below this value, the algorithm considers that it has reached a sufficiently "cold" state and no further iteration is required to avoid over-optimization and unnecessary calculations. For example, 10℃, 15℃, 20℃, etc.

[0138] If the above two termination conditions are met at the same time, that is, the current number of iterations exceeds the preset number threshold, and the current temperature drops below the preset minimum temperature, the algorithm will exit the iteration process, indicating that the optimization process has been completed and the current solution is considered to be the best solution or close to the best solution after sufficient iterations.

[0139] Specifically, the process description of the solution of this application is as follows: Figure 6 As shown, the following steps are included:

[0140] Step 1: According to the specific parameters of the servo motor and the working environment requirements, set the algorithm initial temperature to T, cooling rate α, and termination temperature T min , performance requirement vector Need, solution vector S initialized based on experience or randomness, number of iterations Num at the current temperature.

[0141] Step 2: Input S into MATLAB to obtain the performance vector EP S , calculate f value Values ​​and matrix W 10*4 Compared with the existing solutions in value If the value is greater than that of any set of parameters, the smallest set is eliminated and S is left. The new solution S′ is obtained according to the above iterative method and input into MATLAB again to obtain the performance vector EP S′ , find f value The value is determined by the above-mentioned method for judging the new solution to determine whether it is accepted.

[0142] Step three, calculate whether the number of iterations at this temperature reaches Num, and does not reach regression step two.

[0143] Step 4: Cool down the algorithm by the cooling coefficient α to T=αT. If the temperature does not reach the minimum temperature, return to step 2.

[0144] Step 5: Get W 10*4 The ten better sets of liberation were put into actual motors for testing and the optimal parameters were selected.

[0145] The inventors of this application discovered in their research on servo motor control algorithms that traditional parameter adjustment methods for PID algorithms mostly rely on the experience summarized by past adjusters. This method can meet the control requirements in most cases, and the process and theory of parameter adjustment are already quite mature. However, this method is very difficult and time-consuming, and it is inefficient and can easily fall into a local optimum. In actual engineering, this often delays the project schedule and limits the precision and accuracy of the servo motor to a certain extent.

[0146] According to the above analysis, the inventor uses the SA algorithm to perform a global search for PID parameters, and uses normal distribution to randomly adjust parameters according to overshoot, rise time and stabilization time during the iteration process, which can effectively handle the requirements of nonlinear, time-varying or highly complex control systems for parameters and avoid falling into the problem of local optimality. At the same time, MATLAB is used to simulate the solution generated in the SA algorithm process, and the influence of the three indicators of overshoot, rise time and stabilization time is comprehensively considered. Finally, some of the better solutions are taken from SA and put into the motor for actual testing, which can solve the problem that there is a certain difference between simulation and reality, and can also reduce the number of actual motor measurements to control costs.

[0147] In summary, this scheme proposes a servo motor PID control parameter tuning algorithm based on simulated annealing algorithm (SA). This algorithm improves the traditional PID parameter tuning algorithm based on SA, uses the global search capability of simulated annealing, and guides the search process through an evaluation function combined with MATLAB simulation results. The evaluation function considers three key performance indicators: overshoot, rise time, and settling time, and comprehensively considers them through weighted average. In each iteration, according to the system performance under the current PID parameters, the parameter value is randomly adjusted using normal distribution (the mean and variance of the normal distribution will also be dynamically adjusted), so as to more flexibly respond to the behavior of the system under different working conditions, so as to explore a better parameter combination. This algorithm combines specific system performance feedback and intelligent search strategies. Compared with traditional PID parameter tuning methods, it can converge to the optimal solution faster, significantly improving the efficiency of the adjustment process and the performance of the control system. Through this method, not only the automation level of parameter adjustment is improved, but also the adaptability and stability of the control system in a changing environment are enhanced.

[0148] The embodiment of the present application also provides a parameter adjustment device based on SA's PID. It should be noted that the parameter adjustment device based on SA's PID of the embodiment of the present application can be used to execute the parameter adjustment method for SA's PID provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and those that have been described will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0149] The following introduces the SA-based PID parameter adjustment device provided in an embodiment of the present application.

[0150] Figure 7 is a structural block diagram of a PID parameter adjustment device based on SA according to an embodiment of the present application. Figure 7 As shown, the device comprises:

[0151] A first acquisition unit 10 is used to acquire initial PID parameters, wherein the initial PID parameters include an initial proportional parameter, an initial integral parameter and an initial differential parameter;

[0152] The optimization unit 20 is used to optimize the initial PID parameters using the SA algorithm to obtain optimized PID parameters;

[0153] The control unit 30 is used to control the operation of the servo motor by using the above-mentioned optimized PID parameters.

[0154] Through this embodiment, the SA algorithm is used to optimize the PID parameters. The SA algorithm can perform a global search and has good global search capabilities. It can find the global optimal solution and avoid the problem of local optimality, making the parameter adjustment scheme of this scheme more stable.

[0155] In the specific implementation process, the optimization unit includes an optimization module, which is used to use the SA algorithm to search, and uses MATLAB simulation and normal distribution to guide the search process until the optimal PID parameters are found, thereby obtaining the above-mentioned optimized PID parameters.

[0156] In this scheme, the SA algorithm can avoid falling into the local optimal solution and is more likely to find the global optimal solution or the PID parameter setting close to the global optimal solution, which significantly improves the performance of the control system. The dynamic adjustment of the normal distribution parameters and the evaluation function based on the MATLAB simulation results make the search process more intelligent and efficient, and can automatically adjust the search range according to the current system performance feedback.

[0157] In some embodiments, the optimization module includes a first optimization submodule, and the first optimization submodule is used to calculate the optimal proportional parameter according to the first formula to obtain the optimized proportional parameter, wherein the first formula is:

[0158]

[0159] in, represents the above optimized proportional parameter, Indicates the effect of K on the temperature T P The next step is to iterate the function of the required normal distribution mean, K P represents the gain coefficient of the proportional parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, which is the time required for the temperature of the initial state to reach the target temperature value, and R n represents the standard rise time simulated by MATLAB, S represents the stabilization time simulated by MATLAB, the above stabilization time is the duration of the temperature within the standard temperature range, sgn represents the sign function, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial proportional parameter under the first temperature condition, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial proportional parameter at the second temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial proportional parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

[0160] In this solution, a dynamic adjustment mechanism of the mean of the normal distribution is used, which can flexibly adjust the direction and range of the parameter search according to the current temperature and system performance feedback (overshoot, rise time, and stabilization time). This means that in the early iterations (high temperature stage), the algorithm will be more inclined to explore a larger parameter space, and when the temperature drops (low temperature stage), the algorithm will focus more on fine-tuning the parameters to gradually converge to the optimal solution. The cooling mechanism of the simulated annealing algorithm using exponential and logarithmic functions helps the algorithm avoid falling into a local optimal solution. At higher temperatures, the algorithm is more sensitive to larger performance deviations, and can span a larger parameter space and explore a variety of possible parameter combinations; at lower temperatures, the algorithm can also respond to smaller performance differences and adjust parameters more accurately, thereby finding the optimal solution globally. More accurate optimized proportional parameters can be obtained through this embodiment.

[0161] In the specific implementation process, the optimization module includes a second optimization submodule, which is used to calculate the optimal integral parameter according to the second formula to obtain the optimized integral parameter, wherein the second formula is:

[0162]

[0163] in, represents the above optimized integral parameter, Indicates the effect of K on the temperature T I The next step is to iterate the function of the required normal distribution mean, K I represents the gain coefficient of the integral parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, which is the time required for the temperature of the initial state to reach the target temperature value, and R n represents the standard rise time of MATLAB simulation, S represents the stabilization time of MATLAB simulation, and the above stabilization time is the duration of the temperature within the standard temperature range, S n represents the standard stabilization time of MATLAB simulation, sgn represents the symbolic function, represents the influence coefficient of the above rise time on the iterative distribution mean μ of the above initial integral parameter under the first temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial integral parameter under the first temperature, represents the influence coefficient of the above stabilization time on the iterative distribution mean μ of the above initial integral parameter under the above first temperature, represents the influence coefficient of the above rise time on the iterative distribution mean μ of the above initial integral parameter under the second temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial integral parameter under the second temperature, represents the influence coefficient of the above stabilization time on the iterative distribution mean μ of the above initial integral parameter under the above second temperature, the above first temperature is greater than the above second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

[0164] In this solution, a dynamic adjustment mechanism of the mean of the normal distribution is used, which can flexibly adjust the direction and range of the parameter search according to the current temperature and system performance feedback (overshoot, rise time, and stabilization time). This means that in the early iterations (high temperature stage), the algorithm will be more inclined to explore a larger parameter space, and when the temperature drops (low temperature stage), the algorithm will focus more on fine-tuning the parameters to gradually converge to the optimal solution. The use of exponential and logarithmic functions combined with the cooling mechanism of the simulated annealing algorithm helps the algorithm avoid falling into a local optimal solution. At higher temperatures, the algorithm is more sensitive to larger performance deviations, and can span a larger parameter space and explore a variety of possible parameter combinations; at lower temperatures, the algorithm can also respond to smaller performance differences and adjust parameters more accurately, thereby finding the optimal solution globally. More accurate optimized integral parameters can be obtained through this embodiment.

[0165] In some embodiments, the optimization module includes a third optimization submodule, and the third optimization submodule is used to calculate the optimal differential parameter according to a third formula to obtain the optimized differential parameter, wherein the third formula is:

[0166]

[0167] in, represents the above optimized differential parameters, Indicates the effect of K on the temperature T D The next step is to iterate the function of the required normal distribution mean, K D represents the gain coefficient of the differential parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O nrepresents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, which is the time required for the temperature to reach the target temperature value from the initial state, S represents the stabilization time of MATLAB simulation, which is the duration of the temperature within the standard temperature range, S n represents the standard stabilization time of MATLAB simulation, sgn represents the symbolic function, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial differential parameter under the first temperature condition, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial differential parameter under the first temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial differential parameter at the second temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial differential parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

[0168] In this solution, a dynamic adjustment mechanism of the mean of the normal distribution is used, which can flexibly adjust the direction and range of the parameter search according to the current temperature and system performance feedback (overshoot, rise time, and stabilization time). This means that in the early iterations (high temperature stage), the algorithm will be more inclined to explore a larger parameter space, and when the temperature drops (low temperature stage), the algorithm will focus more on fine-tuning the parameters to gradually converge to the optimal solution. The use of exponential and logarithmic functions combined with the cooling mechanism of the simulated annealing algorithm helps the algorithm avoid falling into a local optimal solution. At higher temperatures, the algorithm is more sensitive to larger performance deviations, and can span a larger parameter space and explore a variety of possible parameter combinations; at lower temperatures, the algorithm can also respond to smaller performance differences and adjust parameters more accurately, thereby finding the optimal solution globally. More accurate optimized differential parameters can be obtained through this embodiment.

[0169] In the specific implementation process, the above-mentioned device also includes a second acquisition unit, a third acquisition unit, a first adjustment unit and a second adjustment unit. The second acquisition unit is used to obtain the first solution obtained for the N-1th time and the first calculation result value corresponding to the above-mentioned first solution in the process of optimizing the above-mentioned initial PID parameters using the SA algorithm to obtain the optimized PID parameters, wherein the solution is the PID parameter value, and the calculation result value is the performance index value obtained by weighted averaging according to MATLAB simulation, N≥1; the third acquisition unit is used to obtain the second solution obtained for the Nth time and obtain the second calculation result value corresponding to the above-mentioned second solution; the first adjustment unit is used to adjust the above-mentioned second solution to the above-mentioned first solution when the above-mentioned first calculation result value is less than the above-mentioned second calculation result value; the second adjustment unit is used to adjust the above-mentioned second solution to the above-mentioned first solution with a target probability when the above-mentioned first calculation result value is greater than or equal to the above-mentioned second calculation result value, wherein the calculation formula of the above-mentioned target probability is:

[0170]

[0171] P represents the above target probability, f value (S) represents the value of the first calculation result, f value (S′) represents the above-mentioned second calculation result value, and T represents the current temperature.

[0172] In this scheme, by allowing solutions with worse performance to be accepted under certain conditions, the simulated annealing algorithm can escape the trap of local optimal solutions and is more likely to find the global optimal solution in the parameter space. As the number of iterations increases, the temperature (T) will gradually decrease, which will reduce the probability of accepting solutions with worse performance, making the search process more biased towards local optimization until it finally converges to the optimal solution. In the early stages of the iteration, the temperature is high, and the algorithm tends to explore and accept a wider solution space to find possible directions for improvement; in the later stages of the iteration, the temperature decreases, and the algorithm becomes more picky and tends to use the better solutions that have been found for local optimization. The calculation method of the target probability allows the algorithm to flexibly decide whether to update the parameters based on the performance difference between the current solution and the new solution and the current temperature. This flexibility helps avoid premature convergence to a suboptimal solution while ensuring the high quality of the final solution.

[0173] In some embodiments, the device further includes a fourth acquisition unit and an exit unit. The fourth acquisition unit is used to acquire the current number of iterations and the current temperature in the process of optimizing the initial PID parameters using the SA algorithm to obtain the optimized PID parameters. The current number of iterations is the number of current iterations in the optimization process using the SA algorithm, and the current temperature is the temperature for adjusting the parameters in the optimization process using the SA algorithm. The exit unit is used to exit the iterative process when the current number of iterations is greater than a preset number threshold and the current temperature is less than a preset minimum temperature.

[0174] In this scheme, the convergence speed of the algorithm can be controlled by setting the iteration number threshold and the minimum temperature. The preset number threshold ensures that the algorithm does not run indefinitely, but stops after reaching a certain number of times, even if the absolutely optimal solution may not have been reached. This helps to find a balance between the quality of the solution and the calculation time. When the temperature drops to the minimum temperature, the algorithm tends to accept new solutions more conservatively, thereby ensuring the rationality and optimization quality of the final solution. Solutions below the preset minimum temperature usually undergo a certain degree of "cooling" process, which means that they have undergone global search and local fine-tuning to a certain extent, and are more likely to be close to the global optimal solution of the problem.

[0175] The above-mentioned SA-based PID parameter adjustment device includes a processor and a memory, and the above-mentioned first acquisition unit, optimization unit and control unit are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.

[0176] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the problem of poor stability of the PID parameter adjustment method in the prior art and the problem of only being able to find a local optimal solution can be solved by adjusting the kernel parameters.

[0177] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0178] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the SA-based PID parameter adjustment method.

[0179] An embodiment of the present invention provides a processor, which is used to run a program, wherein the SA-based PID parameter adjustment method is executed when the program is running.

[0180] An embodiment of the present invention provides a device, the device includes a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the steps of the parameter adjustment method of the PID based on the SA are implemented. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.

[0181] A computer program product includes a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the SA-based PID parameter adjustment method in each embodiment of the present application are implemented.

[0182] The present application provides a PID parameter tuning system, comprising one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of the above-mentioned SA-based PID parameter tuning methods.

[0183] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0184] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0185] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0186] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0187] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0188] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0189] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0190] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0191] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0192] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A parameter adjustment method for PID based on SA, characterized in that: include: Acquire initial PID parameters, wherein the initial PID parameters include an initial proportional parameter, an initial integral parameter, and an initial differential parameter; Using the SA algorithm, the initial PID parameters are optimized to obtain optimized PID parameters; The optimized PID parameters are used to control the operation of the servo motor.

2. The method according to claim 1, characterized in that The SA algorithm is used to optimize the initial PID parameters to obtain optimized PID parameters, including: The SA algorithm is used to search, and MATLAB simulation and normal distribution are used to guide the search process until the optimal PID parameters are found, thereby obtaining the optimized PID parameters.

3. The method according to claim 2, characterized in that The SA algorithm is used to search, and MATLAB simulation and normal distribution are used to guide the search process until the optimal PID parameters are found, and the optimized PID parameters are obtained, including: According to the first formula, the optimal ratio parameter is calculated to obtain the optimized ratio parameter, wherein the first formula is: in, represents the optimized proportional parameter, Indicates the effect of K on the temperature T P The next step is to iterate the function of the required normal distribution mean, K P represents the gain coefficient of the proportional parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, and the rise time is the time required for the temperature of the initial state to reach the target temperature value, and R n represents the standard rise time simulated by MATLAB, S represents the stabilization time simulated by MATLAB, and the stabilization time is the duration of the temperature being in the standard temperature range, sgn represents the sign function, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial proportional parameter under the first temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial proportional parameter at the second temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial proportional parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

4. The method according to claim 2, characterized in that: The SA algorithm is used to search, and MATLAB simulation and normal distribution are used to guide the search process until the optimal PID parameters are found, and the optimized PID parameters are obtained, including: According to the second formula, the optimal integral parameter is calculated to obtain the optimized integral parameter, wherein the second formula is: Among them, μ KI represents the optimized integral parameter, Indicates the effect of temperature T on K I The next step is to iterate the function of the required normal distribution mean, K I represents the gain coefficient of the integral parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, and the rise time is the time required for the temperature of the initial state to reach the target temperature value, and R n represents the standard rise time of MATLAB simulation, S represents the stabilization time of MATLAB simulation, and the stabilization time is the duration of the temperature within the standard temperature range, S n represents the standard stabilization time of MATLAB simulation, sgn represents the symbolic function, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial integral parameter under the first temperature condition, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial integral parameter under the first temperature, represents the influence coefficient of the stabilization time on the iterative distribution mean μ of the initial integral parameter under the first temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial integral parameter at the second temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial integral parameter under the second temperature, represents the influence coefficient of the stabilization time on the iterative distribution mean μ of the initial integral parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

5. The method according to claim 2, characterized in that: The SA algorithm is used to search, and MATLAB simulation and normal distribution are used to guide the search process until the optimal PID parameters are found, and the optimized PID parameters are obtained, including: According to the third formula, the optimal differential parameter is calculated to obtain the optimized differential parameter, wherein the third formula is: Among them, μ KD represents the optimized differential parameter, Indicates the effect of temperature T on K D The next step is to iterate the function of the required normal distribution mean, K D represents the gain coefficient of the differential parameter, O represents the overshoot value simulated by MATLAB, and the overshoot value is the maximum percentage of the output temperature value exceeding the target temperature value, O n represents the standard overshoot of MATLAB simulation, R represents the rise time of MATLAB simulation, which is the time required for the temperature to reach the target temperature value from the initial state, S represents the stabilization time of MATLAB simulation, which is the duration of the temperature within the standard temperature range, and S n represents the standard stabilization time of MATLAB simulation, sgn represents the symbolic function, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial differential parameter under the first temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial differential parameter under the first temperature, represents the influence coefficient of the overshoot on the iterative distribution mean μ of the initial differential parameter at the second temperature, represents the influence coefficient of the rise time on the iterative distribution mean μ of the initial differential parameter under the second temperature, the first temperature is greater than the second temperature, T represents the current temperature, T c Indicates the preset temperature threshold.

6. The method according to any one of claims 2 to 5, characterized in that In the process of optimizing the initial PID parameters using the SA algorithm to obtain optimized PID parameters, the method further includes: Obtain a first solution obtained for the N-1th time, and obtain a first calculation result value corresponding to the first solution, wherein the solution is a PID parameter value, and the calculation result value is a performance index value obtained by weighted average according to MATLAB simulation, and N≥1; Obtain a second solution obtained for the Nth time, and obtain a second calculation result value corresponding to the second solution; When the first calculation result value is less than the second calculation result value, adjusting the second solution to the first solution; When the first calculation result value is greater than or equal to the second calculation result value, the second solution is adjusted to the first solution with a target probability, wherein the calculation formula of the target probability is: P represents the target probability, f value (S) represents the first calculation result value, f value (S ′ ) represents the second calculation result value, and T represents the current temperature.

7. The method according to any one of claims 1 to 5, characterized in that In the process of optimizing the initial PID parameters using the SA algorithm to obtain optimized PID parameters, the method further includes: Obtain the current number of iterations and the current temperature, wherein the current number of iterations is the number of current iterations in the optimization process using the SA algorithm, and the current temperature is the temperature for adjusting parameters in the optimization process using the SA algorithm; When the current number of iterations is greater than a preset number threshold and the current temperature is less than a preset minimum temperature, the iteration process is exited.

8. A parameter adjustment device based on SA PID, characterized in that: include: A first acquisition unit, used to acquire initial PID parameters, wherein the initial PID parameters include an initial proportional parameter, an initial integral parameter and an initial differential parameter; An optimization unit, used to optimize the initial PID parameters using an SA algorithm to obtain optimized PID parameters; The control unit is used to control the operation of the servo motor by using the optimized PID parameters.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the SA-based PID parameter adjustment method described in any one of claims 1 to 7 are implemented.

10. A PID parameter adjustment system, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a parameter adjustment method for executing the SA-based PID as described in any one of claims 1 to 7.

Citation Information

Cited By

  • PI controller parameter optimization method and device based on adaptive algorithm, and terminal

    CN120802597A