An adaptive PID control method and system based on error dynamic adjustment
By constructing an error slope trend factor and a global optimization strategy, and dynamically adjusting PID parameters, the problems of slow response and poor robustness of traditional PID control under nonlinear and strong disturbance conditions are solved, and efficient adaptive control on an embedded platform is realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 上海旷鹰赛光学科技有限公司
- Filing Date
- 2025-09-24
- Publication Date
- 2026-05-12
AI Technical Summary
Traditional PID control is slow to respond, has large overshoot and poor robustness under nonlinear, strong disturbance and time-varying conditions. Furthermore, embedded platforms have limited resources and it is difficult to deploy complex control strategies. Existing adaptive methods lack forward-looking dynamic error judgment.
By constructing a trend factor for the error slope and dynamically adjusting PID parameters in conjunction with a global optimization strategy, the feasible region of parameters is defined using system characteristics and prior knowledge, and an error objective function is constructed to achieve online parameter optimization.
It improves the robustness and response speed of the PID controller under strong disturbance scenarios, ensures that the parameters adapt to the current operating conditions, avoids local optima, and balances real-time performance and optimization accuracy.
Smart Images

Figure CN121386343B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of adaptive control technology, and in particular to an adaptive PID control method and system based on dynamic error adjustment. Background Technology
[0002] PID (Proportional-Integral-Derivative) control algorithms have been widely used in industrial control due to their simple structure, ease of implementation, and robustness. However, with the increasing complexity of industrial systems, especially in scenarios involving nonlinearity, strong disturbances, and time-varying conditions, the limitations of traditional PID control become increasingly apparent. Fixed-parameter PID control often suffers from slow response, large overshoot, and poor robustness. The limited computing power and storage resources of embedded platforms also make the deployment of complex control strategies difficult. Many existing adaptive or gain-scheduling methods adjust parameters primarily based on the current error, ignoring the trend of error changes over time and lacking forward-looking judgment of the dynamic pattern of "divergence-convergence-oscillation," thus making it difficult to tune in a timely and robust manner under strong disturbances or sudden changes in operating conditions. Furthermore, traditional online tuning is prone to getting trapped in local optima, and it is difficult to share experience and parameters between different operating conditions. Summary of the Invention
[0003] In view of this, the present invention proposes an adaptive PID control method and system based on dynamic error adjustment.
[0004] The technical solution of this invention is implemented as follows: The first aspect of this invention provides an adaptive PID control method based on dynamic error adjustment, comprising:
[0005] The system's error value at each time step is determined based on the system's output value and expected output value, and the corresponding error slope is obtained based on the error values at adjacent time steps.
[0006] A trend factor is constructed using the error slope at the current moment and the error slope at historical moments. Based on the trend factor, a first adjustment strategy is executed on the initial PID controller parameters to obtain the first target parameters. The PID controller parameters include proportional coefficient, integral coefficient, and derivative coefficient.
[0007] Based on system characteristics and prior knowledge, the feasible region of the first objective parameter and the corresponding evaluation time window are determined. An error objective function is constructed within each evaluation time window, and a global optimization strategy is used to search for a second objective parameter within the feasible region that optimizes the error objective function. The second objective parameter is then determined as the current PID controller parameter of the system.
[0008] Based on the above technical solutions, preferably, the step of constructing a trend factor using the error slope at the current moment and the error slope at historical moments, and executing a first adjustment strategy on the initial PID controller parameters based on the trend factor to obtain the first target parameter, includes:
[0009] The first influence factor is obtained by multiplying the error slope at the current moment and the error slope at the previous moment; the second influence factor is obtained by multiplying the error slope at the previous moment and the error slope at the moment before that.
[0010] The sum of the first influence factor and the second influence factor is determined as the trend factor.
[0011] Based on the above technical solutions, preferably, the global optimization strategy includes at least one of particle swarm optimization algorithm, genetic algorithm, simulated annealing algorithm, cross-entropy method and Bayesian optimization algorithm.
[0012] Based on the above technical solutions, preferably, the step of determining the feasible domain of the first target parameter and the corresponding evaluation time window according to system characteristics and prior knowledge, and constructing an error objective function within each evaluation time window, includes:
[0013] The first value range of the first target parameter is determined based on the system characteristics, and the first value range is narrowed by combining the prior knowledge to obtain the parameter feasible region of the first target parameter; the system characteristics include the dynamic range of the system and the limitation range of the actuator;
[0014] At least one suitable time period is selected as the evaluation time window based on the dynamic characteristics of the system; the dynamic characteristics include the system's response time and settling time.
[0015] Within each evaluation time window, the actual output signal and the desired output signal of the system are collected, and an error objective function is constructed based on the difference between the actual output signal and the desired output signal; the desired output signal is the ideal output set according to the control objective of the system, and the actual output signal is the true output of the system under the action of the current PID parameters; the error objective function includes at least one of absolute error, squared error and constraint penalty function.
[0016] Based on the above technical solutions, preferably, the step of collecting the actual output signal and the expected output signal of the system within each evaluation time window, and constructing an error objective function based on the difference between the actual output signal and the expected output signal, includes:
[0017] The weights corresponding to the absolute error, squared error, and constraint penalty function are adjusted using an adaptive algorithm.
[0018] An error objective function is constructed based on the weighted sum of the absolute error, the squared error, and the constraint penalty function.
[0019] Based on the above technical solutions, preferably, the step of using a global optimization strategy to search for a second objective parameter within the feasible region of the parameters that optimizes the error objective function, and determining the second objective parameter as the current PID controller parameter of the system, includes:
[0020] A set of initial PID parameter combinations is randomly generated within the feasible region of the parameters;
[0021] The PID parameter combination is adjusted according to the error objective function. A local search algorithm is used to search the parameter space near each parameter in the PID parameter combination, so that the error objective function value gradually decreases. Combined with group learning, optimization iteration is performed until the maximum number of iterations is reached or the error objective function value is less than a preset threshold. The corresponding PID parameter combination is then determined as the current PID controller parameters of the system.
[0022] Based on the above technical solutions, preferably, the step of using a global optimization strategy to search for a second objective parameter that optimizes the error objective function within the feasible region of the parameters, and determining the second objective parameter as the current PID controller parameter of the system, further includes:
[0023] A parameter-error mapping mathematical model is established based on system characteristics and prior knowledge; the parameter-error mapping mathematical model characterizes the mapping relationship between the error objective function and the first objective parameter;
[0024] The model parameters of the parameter-error mapping mathematical model are updated based on the recursive least squares method or the SPSA gradient approximation method to determine the second objective parameter that optimizes the error objective function.
[0025] Furthermore, a second aspect of the present invention provides an adaptive PID control system based on dynamic error adjustment, comprising: a slope determination module, a parameter adjustment module, and a parameter optimization module; wherein,
[0026] The slope determination module is configured to determine the error value of the system output at each time step based on the system output value and the expected output value, and to obtain the corresponding error slope based on the error values of adjacent time steps.
[0027] The parameter adjustment module is configured to construct a trend factor using the error slope at the current moment and the error slope at historical moments, and to execute a first adjustment strategy on the initial PID controller parameters based on the trend factor to obtain the first target parameter;
[0028] The parameter optimization module is configured to determine the feasible domain of the first target parameter and the corresponding evaluation time window based on system characteristics and prior knowledge, construct an error objective function within each evaluation time window, and use a global optimization strategy to search for a second target parameter within the feasible domain that optimizes the error objective function, and determine the second target parameter as the current PID controller parameter of the system.
[0029] More preferably, a third aspect of the present invention provides an electronic device, including a processor and a memory; the memory stores a computer program, wherein the computer program, when executed by the processor, implements the adaptive PID control method based on error dynamic adjustment described in the first aspect.
[0030] More preferably, a fourth aspect of the present invention provides a computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the adaptive PID control method based on error dynamic adjustment as described in the first aspect.
[0031] The adaptive PID control method and system based on dynamic error adjustment of the present invention have the following advantages over the prior art:
[0032] 1. By constructing a trend factor based on historical error slopes, the direction of error change can be predicted in advance, thereby adjusting parameters before actual error overshoot. An error objective function is constructed within each evaluation time window, and a global optimization strategy is used to search for optimal parameters, avoiding the "globally optimal but locally suboptimal" problem caused by fixed PID parameters. By re-searching for optimal parameters within the feasible parameter domain, the controller is ensured to always adapt to the current operating conditions, improving robustness under strong disturbance scenarios.
[0033] 2. By analyzing the variation pattern of the error slope, parameters are dynamically adjusted to compensate for nonlinear effects. The feasible region of parameters is defined based on system characteristics and prior knowledge to avoid global optimization falling into physically infeasible solutions. Through a two-stage, hierarchical design for parameter adjustment, the first stage requires only simple arithmetic operations, while the second stage is executed offline within the evaluation time window, balancing real-time performance and optimization accuracy.
[0034] 3. The trend factor quantifies the "acceleration" of error changes, enabling the controller to adjust ahead of the actual error overshoot. During the global optimization phase, the trend factor provides dynamic trend information to guide the search direction. Simultaneously, it provides real-time feedback on the system's dynamic characteristics, dynamically adjusts the feasible domain boundaries of parameters, and dynamically adjusts the evaluation time window by continuously monitoring the changing trend of the error slope, ensuring that the PID parameters always match the current operating conditions. Attached Figure Description
[0035] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0036] Figure 1 A flowchart illustrating an adaptive PID control method based on dynamic error adjustment provided in an embodiment of the present invention;
[0037] Figure 2 A schematic diagram of the structure of an adaptive PID control system based on dynamic error adjustment provided in an embodiment of the present invention;
[0038] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0039] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0040] In some embodiments, such as Figure 1 As shown, Figure 1 This is a flowchart illustrating an adaptive PID control method based on dynamic error adjustment provided in an embodiment of the present invention; the adaptive PID control method based on dynamic error adjustment provided by the present invention includes:
[0041] S110 determines the error value of the system output at each time step based on the system output value and the expected output value, and obtains the corresponding error slope based on the error values of adjacent time steps.
[0042] Here, the system output and expected output values at multiple moments can be collected to obtain a continuous error curve. The system output value represents the actual output value of the system, while the expected output value represents the output value under ideal conditions. To suppress sensor noise, moving average or Kalman filtering can be used to preprocess the output signal before calculating the error value. The error slope represents the difference between the error values at adjacent moments divided by the time interval, corresponding to the derivative term in PID control.
[0043] S120: Construct a trend factor using the error slope at the current moment and the error slope at historical moments; execute the first adjustment strategy on the initial PID controller parameters based on the trend factor to obtain the first target parameters; the PID controller parameters include proportional coefficient, integral coefficient and derivative coefficient.
[0044] In some embodiments, S120, a trend factor is constructed using the error slope at the current moment and the error slope at historical moments. Based on the trend factor, a first adjustment strategy is executed on the initial PID controller parameters to obtain the first target parameters, including:
[0045] The first influence factor is obtained by multiplying the error slope at the current moment and the error slope at the previous moment; the second influence factor is obtained by multiplying the error slope at the previous moment and the error slope at the moment before that.
[0046] The sum of the first and second impact factors is determined as the trend factor.
[0047] In this embodiment, the trend factor can be expressed as:
[0048] ;
[0049] in, The slope representing the error at the current moment, The slope representing the error at the previous moment. The slope representing the error at the previous time step.
[0050] The first adjustment strategy can be summarized as: if If so, it is judged as a divergent trend, and the upward trend is improved. Suppress bias; if If so, it is determined to be a convergence trend, which strengthens. Improve steady-state accuracy; if If so, it is judged as a fluctuating trend, and the price is reduced. Reduce control overshoot. , , These are the proportional coefficient, integral coefficient, and differential coefficient, respectively. Specific values can be determined based on experience. Trend factor With threshold Used for:
[0051] 1) Limit the prior kernel width of the search subdomain or schedule Bayesian optimization of BO;
[0052] 2) In Reduce the search frequency when the value is below the threshold. Increase search frequency when the size is large to balance exploration and exploitation.
[0053] In an alternative embodiment, the following trend prediction parameters are defined to match the error sequence:
[0054] : The initial stationary observation period of the error (Stabilization delay). Error fluctuation detection window: The detection range where the error changes drastically. Trend analysis duration; : PID parameter adjustment latency; : Control reaction time; where t1~t5 are timing reference parameters used to coordinate the timing matching relationship between data sampling, trend analysis and control signal application.
[0055] Define reference trend factor With actual trend factors The deviation value is Further define the upper limit of the allowable error. And adjust the parameters according to the following strategies:
[0056] like If so, the current parameter configuration will be retained;
[0057] like Then, adjustments will be made according to the following rules:
[0058] If the system response speed is lagging, reduce the speed. To speed up PID updates;
[0059] If the system disturbance is large or the overshoot is severe, increase the adjustment. Strengthen trend filtering buffer.
[0060] S130: Based on system characteristics and prior knowledge, determine the feasible region of the first objective parameter and the corresponding evaluation time window. Construct an error objective function within each evaluation time window, and use a global optimization strategy to search for the second objective parameter that optimizes the error objective function within the feasible region. Determine the second objective parameter as the current PID controller parameter of the system.
[0061] In some embodiments, the global optimization strategy includes at least one of particle swarm optimization, genetic algorithm, simulated annealing, cross-entropy method and Bayesian optimization algorithm.
[0062] In some embodiments, the feasible domain of the first objective parameter and the corresponding evaluation time window are determined based on system characteristics and prior knowledge, and an error objective function is constructed within each evaluation time window, including:
[0063] The first value range of the first target parameter is determined based on the system characteristics, and the first value range is narrowed down by combining prior knowledge to obtain the parameter feasible region of the first target parameter; the system characteristics include the dynamic range of the system and the limitation range of the actuator;
[0064] Select at least one suitable time period as the evaluation time window based on the dynamic characteristics of the system; the dynamic characteristics include the system's response time and settling time.
[0065] Within each evaluation time window, the actual output signal and the desired output signal of the system are collected, and an error objective function is constructed based on the difference between the actual output signal and the desired output signal. The desired output signal is the ideal output set according to the control objective of the system, and the actual output signal is the true output of the system under the action of the current PID parameters. The error objective function includes at least one of the following: absolute error, squared error, and constraint penalty function.
[0066] In some embodiments, within each evaluation time window, the actual output signal and the desired output signal of the system are collected, and an error objective function is constructed based on the difference between the actual output signal and the desired output signal, including:
[0067] The weights corresponding to the absolute error, squared error, and constraint penalty function are adjusted using an adaptive algorithm.
[0068] The objective function of error is constructed by weighting the absolute error, squared error, and constraint penalty function.
[0069] In this embodiment, the feasible domain of the parameters is defined as follows:
[0070] ;
[0071] Evaluation Window satisfy: .
[0072] Construct the objective function within each window:
[0073] ;
[0074] in, It is the weight of the weighted absolute error term. It is the weight of the squared error term. It controls the weight of the incremental energy term. These are the weights of the constraint penalty function. It is the integration time window. .
[0075] in accordance with Using a global optimization strategy Search and update internally and in safety constraints , Download online applications.
[0076] In one example, a safety exploration mechanism is set up: a barrier is introduced when the temperature / power approaches its limit. Enter the objective function, or shrink The upper bound is used to avoid hardware risks.
[0077] In one example, Bayesian optimization is established using Gaussian process regression. The proxy model uses Expectation Improvement (EI), Upper Confidence Bound (UCB), or Probabilistic Improvement (PI) as the acquisition function for global sampling.
[0078] The desired improvement can be expressed as:
[0079] ;
[0080] Indicates the expected improvement value. This represents the currently known optimal value of the objective function. Indicates the Gaussian process at point The predicted mean, Indicates the Gaussian process at point The standard deviation of the prediction.
[0081] In some embodiments, a global optimization strategy is employed to search for a second objective parameter within the feasible region of parameters that optimizes the error objective function, and the second objective parameter is determined as the current PID controller parameter of the system, including:
[0082] A set of initial PID parameter combinations is randomly generated within the parameter feasible region;
[0083] The PID parameter combination is adjusted according to the error objective function. A local search algorithm is used to search the parameter space near each parameter in the PID parameter combination, so that the error objective function value gradually decreases. Combined with group learning, optimization iteration is carried out until the maximum number of iterations is reached or the error objective function value is less than a preset threshold. The corresponding PID parameter combination is then determined as the current PID controller parameters of the system.
[0084] In this embodiment, the fast layer and the slow layer coordinate scheduling, when When the value is large, increase the search frequency of the slow layer or expand the search radius; when When the values are small, reduce the search frequency and rely more on fast layer fine-tuning. Specifically, a hybrid strategy of "initializing the model and refining using a global method" can be adopted.
[0085] ;
[0086] Performing a restricted global search within the sphere allows us to utilize prior knowledge while also escaping local optima. This represents the radius of the sphere.
[0087] This also involves PID calculation and anti-saturation:
[0088] ;
[0089] Integral resistance to saturation:
[0090] ;
[0091] For back-calculation coefficients, The integrator is in the th The state of the step, Indicates input, Bit sampling period, Indicates the actual output of the controller. This indicates the maximum allowable output amplitude of the actuator.
[0092] Taking Particle Swarm Optimization (PSO) as an example, the parameter updates of PSO satisfy:
[0093] ;
[0094] ;
[0095] in, , Keep the search direction in mind. Indicates individual learning. It represents group learning.
[0096] In some embodiments, a global optimization strategy is employed to search for a second objective parameter that optimizes the error objective function within the parameter feasible region, and the second objective parameter is determined as the current PID controller parameter of the system. The method further includes:
[0097] A parameter-error mapping mathematical model is established based on system characteristics and prior knowledge; the parameter-error mapping mathematical model represents the mapping relationship between the error objective function and the first objective parameter;
[0098] The model parameters of the parameter-error mapping mathematical model are updated based on the recursive least squares method or the SPSA gradient approximation method, and the second objective parameter that optimizes the error objective function is determined.
[0099] In this embodiment, a parameter-error mapping mathematical model is established:
[0100] ;
[0101] in, These are basis functions. It is a weight that can be updated online. It is an environmental / operating condition characteristic. This represents the projection operator, used to ensure that the updated parameters always remain within a feasible region. This represents the initial or baseline parameter vector. This represents the input feature vector, which includes the error magnitude, error rate of change, cumulative error, error variance, and environmental / operating condition characteristics.
[0102] Weight The online update satisfies the recursive least squares (RLS) or SPSA gradient approximation:
[0103] ;
[0104] Indicates the first The weight vector of the next iteration This indicates the step size (learning rate), which controls the update magnitude. This represents the gradient of the objective function with respect to the controller parameters. This represents the projection operator.
[0105] In some embodiments, please refer to Figure 2 , Figure 2 This is a schematic diagram of an adaptive PID control system based on dynamic error adjustment, provided as an embodiment of the present invention. The present invention provides an adaptive PID control system 200 based on dynamic error adjustment, comprising: a slope determination module 210, a parameter adjustment module 220, and a parameter optimization module 230; wherein,
[0106] The slope determination module 210 is configured to determine the error value of the system output at each time based on the system output value and the expected output value, and to obtain the corresponding error slope based on the error values of adjacent time points;
[0107] The parameter adjustment module 220 is configured to construct a trend factor using the error slope at the current moment and the error slope at historical moments, and to execute a first adjustment strategy on the initial PID controller parameters based on the trend factor to obtain the first target parameter;
[0108] The parameter optimization module 230 is configured to determine the feasible region of the first objective parameter and the corresponding evaluation time window based on system characteristics and prior knowledge, construct an error objective function within each evaluation time window, and use a global optimization strategy to search for the second objective parameter that makes the error objective function optimal within the feasible region, and determine the second objective parameter as the current PID controller parameter of the system.
[0109] In some embodiments, the parameter adjustment module 220 is specifically configured as follows:
[0110] The first influence factor is obtained by multiplying the error slope at the current moment and the error slope at the previous moment; the second influence factor is obtained by multiplying the error slope at the previous moment and the error slope at the moment before that.
[0111] The sum of the first and second impact factors is determined as the trend factor.
[0112] In some embodiments, the global optimization strategy includes at least one of particle swarm optimization, genetic algorithm, simulated annealing, cross-entropy method and Bayesian optimization algorithm.
[0113] In some embodiments, the parameter optimization module 230 is specifically configured as follows:
[0114] The first value range of the first target parameter is determined based on the system characteristics, and the first value range is narrowed down by combining prior knowledge to obtain the parameter feasible region of the first target parameter; the system characteristics include the dynamic range of the system and the limitation range of the actuator;
[0115] Select at least one suitable time period as the evaluation time window based on the dynamic characteristics of the system; the dynamic characteristics include the system's response time and settling time.
[0116] Within each evaluation time window, the actual output signal and the desired output signal of the system are collected, and an error objective function is constructed based on the difference between the actual output signal and the desired output signal. The desired output signal is the ideal output set according to the control objective of the system, and the actual output signal is the true output of the system under the action of the current PID parameters. The error objective function includes at least one of the following: absolute error, squared error, and constraint penalty function.
[0117] In some embodiments, the parameter optimization module 230 is specifically configured as follows:
[0118] The weights corresponding to the absolute error, squared error, and constraint penalty function are adjusted using an adaptive algorithm.
[0119] The objective function of error is constructed by weighting the absolute error, squared error, and constraint penalty function.
[0120] In some embodiments, the parameter optimization module 230 is specifically configured as follows:
[0121] A set of initial PID parameter combinations is randomly generated within the parameter feasible region;
[0122] The PID parameter combination is adjusted according to the error objective function. A local search algorithm is used to search the parameter space near each parameter in the PID parameter combination, so that the error objective function value gradually decreases. Combined with group learning, optimization iteration is carried out until the maximum number of iterations is reached or the error objective function value is less than a preset threshold. The corresponding PID parameter combination is then determined as the current PID controller parameters of the system.
[0123] In some embodiments, the parameter optimization module 230 is specifically configured as follows:
[0124] A parameter-error mapping mathematical model is established based on system characteristics and prior knowledge; the parameter-error mapping mathematical model represents the mapping relationship between the error objective function and the first objective parameter;
[0125] The model parameters of the parameter-error mapping mathematical model are updated based on the recursive least squares method or the SPSA gradient approximation method, and the second objective parameter that optimizes the error objective function is determined.
[0126] It should be noted that the adaptive PID control system based on error dynamic adjustment provided in this application embodiment and the adaptive PID control method based on error dynamic adjustment provided in this application embodiment are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned adaptive PID control method based on error dynamic adjustment, and the repeated parts will not be described again.
[0127] In some embodiments, please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 300 provided in this embodiment includes a processor 310 and a memory 320; the memory 320 stores a computer program, wherein the computer program, when executed by the processor, implements the aforementioned adaptive PID control method based on dynamic error adjustment.
[0128] Specifically, processor 310 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. Processor 310 may also include onboard memory for caching purposes. Processor 310 may be a single processing unit or multiple processing units for performing different actions of the method flow according to embodiments of this application.
[0129] The memory 320 may be any medium capable of containing, storing, transmitting, propagating, or transmitting instructions. For example, the memory 320 may include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, apparatuses, or propagation media. Specific examples of the memory 320 include: magnetic storage devices such as magnetic tape or hard disk drives (HDDs); optical storage devices such as optical discs (CD-ROMs); and may also be random access memory (RAM) or flash memory; and / or wired / wireless communication links.
[0130] This application also provides a computer-readable medium storing a computer program thereon, which, when executed by a processor, implements the aforementioned adaptive PID control method based on dynamic error adjustment. This computer-readable medium may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into that device / apparatus / system. The aforementioned computer-readable medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0131] According to embodiments of this application, a computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wired, optical fiber, radio frequency signals, etc., or any suitable combination thereof.
[0132] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments and / or claims of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application. Therefore, the scope of this application should not be limited to the above embodiments, but should be defined not only by the appended claims, but also by their equivalents. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this invention should be included within the protection scope of this invention.
Claims
1. An adaptive PID control method based on dynamic error adjustment, characterized in that, include: The system's error value at each time step is determined based on the system's output value and expected output value, and the corresponding error slope is obtained based on the error values at adjacent time steps. The error slope represents the difference between error values at adjacent time points divided by the time interval; A trend factor is constructed using the error slope at the current moment and the error slope at historical moments. Based on the trend factor, a first adjustment strategy is executed on the initial PID controller parameters to obtain the first target parameters. The PID controller parameters include proportional coefficient, integral coefficient, and derivative coefficient; Based on system characteristics and prior knowledge, the feasible region of the first objective parameter and the corresponding evaluation time window are determined. An error objective function is constructed within each evaluation time window, and a global optimization strategy is used to search for a second objective parameter within the feasible region that optimizes the error objective function. The second objective parameter is then determined as the current PID controller parameter of the system.
2. The adaptive PID control method based on dynamic error adjustment as described in claim 1, characterized in that, The process of constructing a trend factor using the error slope at the current moment and the error slope at historical moments, and then executing a first adjustment strategy on the initial PID controller parameters based on the trend factor to obtain the first target parameters includes: The first influence factor is obtained by multiplying the error slope at the current moment and the error slope at the previous moment; the second influence factor is obtained by multiplying the error slope at the previous moment and the error slope at the moment before that. The sum of the first influence factor and the second influence factor is determined as the trend factor.
3. The adaptive PID control method based on dynamic error adjustment as described in claim 1, characterized in that, The global optimization strategy includes at least one of the following: particle swarm optimization algorithm, genetic algorithm, simulated annealing algorithm, cross-entropy method, and Bayesian optimization algorithm.
4. The adaptive PID control method based on dynamic error adjustment as described in claim 1, characterized in that, The step of determining the feasible region of the first target parameter and the corresponding evaluation time window based on system characteristics and prior knowledge, and constructing an error objective function within each evaluation time window, includes: The first value range of the first target parameter is determined based on the system characteristics, and the first value range is narrowed by combining the prior knowledge to obtain the parameter feasible region of the first target parameter; the system characteristics include the dynamic range of the system and the limitation range of the actuator; At least one suitable time period is selected as the evaluation time window based on the dynamic characteristics of the system; the dynamic characteristics include the system's response time and settling time. Within each evaluation time window, the actual output signal and the desired output signal of the system are collected, and an error objective function is constructed based on the difference between the actual output signal and the desired output signal; the desired output signal is the ideal output set according to the control objective of the system, and the actual output signal is the true output of the system under the action of the current PID parameters; the error objective function includes at least one of absolute error, squared error and constraint penalty function.
5. The adaptive PID control method based on dynamic error adjustment as described in claim 4, characterized in that, Within each evaluation time window, the actual output signal and the expected output signal of the system are collected, and an error objective function is constructed based on the difference between the actual output signal and the expected output signal, including: The weights corresponding to the absolute error, squared error, and constraint penalty function are adjusted using an adaptive algorithm. An error objective function is constructed based on the weighted sum of the absolute error, the squared error, and the constraint penalty function.
6. The adaptive PID control method based on dynamic error adjustment as described in claim 1, characterized in that, The step of employing a global optimization strategy to search for a second objective parameter within the feasible region of the parameters that optimizes the error objective function, and determining the second objective parameter as the current PID controller parameter of the system, includes: A set of initial PID parameter combinations is randomly generated within the feasible region of the parameters; The PID parameter combination is adjusted according to the error objective function. A local search algorithm is used to search the parameter space near each parameter in the PID parameter combination, so that the error objective function value gradually decreases. Combined with group learning, optimization iteration is performed until the maximum number of iterations is reached or the error objective function value is less than a preset threshold. The corresponding PID parameter combination is then determined as the current PID controller parameters of the system.
7. The adaptive PID control method based on dynamic error adjustment as described in claim 1, characterized in that, The step of employing a global optimization strategy to search for a second objective parameter within the feasible region of the parameters that optimizes the error objective function, and determining the second objective parameter as the current PID controller parameter of the system, further includes: A parameter-error mapping mathematical model is established based on system characteristics and prior knowledge; the parameter-error mapping mathematical model characterizes the mapping relationship between the error objective function and the first objective parameter; The model parameters of the parameter-error mapping mathematical model are updated based on the recursive least squares method or the SPSA gradient approximation method to determine the second objective parameter that optimizes the error objective function.
8. An adaptive PID control system based on dynamic error adjustment, characterized in that, include: The system includes a slope determination module, a parameter adjustment module, and a parameter optimization module; among which, The slope determination module is configured to determine the error value of the system output at each time step based on the system output value and the expected output value, and to obtain the corresponding error slope based on the error values at adjacent time steps; the error slope represents the difference between the error values at adjacent time steps divided by the time interval. The parameter adjustment module is configured to construct a trend factor using the error slope at the current moment and the error slope at historical moments, and to execute a first adjustment strategy on the initial PID controller parameters based on the trend factor to obtain the first target parameter; The parameter optimization module is configured to determine the feasible domain of the first target parameter and the corresponding evaluation time window based on system characteristics and prior knowledge, construct an error objective function within each evaluation time window, and use a global optimization strategy to search for a second target parameter within the feasible domain that optimizes the error objective function, and determine the second target parameter as the current PID controller parameter of the system.
9. An electronic device comprising a processor and a memory; said memory having a storage for a computer program, wherein, When the computer program is executed by the processor, it implements the adaptive PID control method based on dynamic error adjustment as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that, It stores a computer program, wherein when the computer program is executed by a processor, it implements the adaptive PID control method based on dynamic error adjustment as described in any one of claims 1 to 7.