PID (Proportion Integration Differentiation) control method with integral saturation resisting function

By dynamically selecting the PID control mode and limiting the control output value, the performance degradation problem caused by integral saturation of the PID controller is solved, achieving high-precision and fast-response control.

CN121721931APending Publication Date: 2026-03-24BEIJING QTCREATE TECH
View PDF 0 Cites 1 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

When faced with integral saturation, PID controllers cause a decrease in the stability and response speed of the control system, affecting control accuracy and potentially leading to system oscillation or runaway, making it difficult to meet the requirements of high precision and fast response.

Method used

By selecting different control modes based on the magnitude of the error value, including combinations of proportional, integral, and derivative modes, and limiting the control output value when the output exceeds the capability range, maintaining the previous error value unchanged or updating the error value for integral calculation, the control mode switching threshold and the enable state of the integral term are dynamically adjusted to prevent the invalid accumulation of the integral term.

Benefits of technology

It effectively suppresses integral saturation, improves the stability and response speed of the control system, enhances adaptability and control accuracy under complex working conditions, and improves the overall performance of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121721931A_ABST
    Figure CN121721931A_ABST
Patent Text Reader

Abstract

The invention provides a PID (Proportion Integration Differentiation) control method with an integral saturation resisting function, which comprises the following steps of: acquiring a given value and a feedback sampling value of a control system, and determining a current error value based on the given value and the feedback sampling value; selecting a corresponding control mode according to the current error value; determining a current control output value variation based on the selected control mode; updating the control output value by using the control output value variation, and judging whether the updated control output value exceeds the output capability range of the controller or not; if the output capacity range is exceeded, the output capacity range is limited to a corresponding limit value, and a previous error value for integral calculation is kept unchanged; if the output capacity range is not exceeded, the current error value is updated to be the previous error value used for the next integral calculation, the problem of performance reduction caused by integral saturation in PID control is effectively solved, and the overall performance of the control system is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial automation control technology, and in particular to a PID control method with anti-integral saturation function. Background Technology

[0002] In modern industrial control systems, PID (Proportional-Integral-Derivative) controllers are widely used in various control scenarios due to their simple structure, ease of implementation, and strong adaptability. However, in practical applications, PID controllers often face the problem of integral saturation. When the output of the control system reaches the controller's limit value, the integral term will continue to accumulate errors, causing the control output value to fail to recover to normal in a timely manner, thus affecting the stability and response speed of the control system. This integral saturation phenomenon not only reduces the control accuracy of the system but may also lead to system oscillation or even runaway, severely limiting the application effect of PID controllers under complex operating conditions.

[0003] With the continuous development of industrial automation and intelligent manufacturing, the requirements for control system performance are becoming increasingly stringent, especially the increasing demand for control in complex dynamic environments with high precision and fast response. Traditional PID control methods often require manual parameter adjustment or the addition of external limiting circuits to mitigate integral saturation problems, but these methods suffer from drawbacks such as complex adjustment and poor adaptability. Summary of the Invention

[0004] This invention provides a PID control method with anti-integral saturation function to solve the technical problem that the system performance of existing PID control is difficult to meet the requirements of high precision and fast response due to integral saturation.

[0005] On the one hand, the present invention provides a PID control method with anti-integral saturation function, comprising: Obtain the setpoint and feedback sampled value of the control system, and determine the current error value based on the setpoint and feedback sampled value; Select the corresponding control mode based on the magnitude of the current error value; wherein, the control mode includes at least one combination of proportional, integral, and derivative modes; Based on the selected control mode, determine the current change in the control output value; Update the control output value using the change in the control output value, and determine whether the updated control output value exceeds the output capability range of the controller; If the output exceeds the output capability range, it will be limited to the corresponding limit value, and the previous error value used for integration calculation will remain unchanged. If the output capability is not exceeded, the current error value is updated to the previous error value for the next integration calculation.

[0006] According to the present invention, a PID control method with anti-integral saturation function selects a corresponding control mode based on the magnitude of the current error value, including: If the absolute value of the current error is less than or equal to the first error threshold, select the proportional-integral control mode or other control modes that include an integral term. If the absolute value of the current error is greater than the first error threshold and less than or equal to the second error threshold, select the proportional control mode or other control mode that does not include an integral term.

[0007] According to the PID control method with anti-integral saturation function provided by the present invention, the corresponding control mode is selected according to the magnitude of the current error value, and the method further includes: If the absolute value of the current error is greater than the second error threshold, select the pure proportional control mode, and use a proportional gain coefficient that is less than the proportional gain coefficient used in the proportional control mode.

[0008] According to the present invention, a PID control method with anti-integral saturation function determines the change in the current control output value based on the selected control mode, including: In proportional control mode, the change in the control output value is based on the product of the current error value and the proportional coefficient; In proportional-integral control mode, the change in the control output value is based on the sum of the product of the current error value and the proportional coefficient, and the product of the current error value and the integral coefficient.

[0009] According to the present invention, a PID control method with anti-integral saturation function limits the output to the corresponding limit value if the output exceeds the range, while maintaining the previous error value used for integral calculation unchanged, including: When the control output value is limited to the upper limit, if the current error value is positive, the previous error value remains unchanged. When the control output value is limited to the lower limit, if the current error value is negative, the previous error value remains unchanged.

[0010] According to the present invention, a PID control method with anti-integral saturation function is provided, the control method further includes: After the control output value is updated, the switching threshold of the control mode is dynamically adjusted according to the changing trend of the current error value. The dynamic adjustment of the control mode switching threshold includes: If the current error value shows a monotonically increasing or monotonically decreasing trend for several consecutive times, the first error threshold and the second error threshold are increased according to the rate of change of the error value in order to reduce the triggering frequency of the proportional-integral control mode. If the fluctuation range of the current error value is less than the preset amplitude within a certain period of time, then the first error threshold and the second error threshold are reduced.

[0011] According to the PID control method with anti-integral saturation function provided by the present invention, the corresponding control mode is selected according to the magnitude of the current error value, and the method further includes: If the absolute value of the current error is greater than the second error threshold, select the proportional-derivative control mode; In the proportional-derivative control mode, the change in the control output value is based on the product of the current error value and the proportional coefficient, and the product of the error rate of change and the derivative coefficient. According to the PID control method with anti-integral saturation function provided by the present invention, the previous error value used for integral calculation has an integral enable state flag bit, and the update logic of the flag bit includes: When the control output value is not limited, and the current error value has the same sign as the error value of the previous cycle, and the absolute value of the error shows a decreasing trend, set this flag bit to allow the integral term to participate in the accumulation. When the control output value is limited, or the sign of the current error value is flipped, or the absolute value of the error shows an increasing trend, the flag bit is reset to prevent the accumulation of the integral term. In proportional-integral control mode, the current error value is included in the integral term calculation only when the flag is set.

[0012] According to the PID control method with anti-integral saturation function provided by the present invention, during the period when the control output value is limited to the limit value, the method further includes determining the integral reset condition: If the control output value is limited due to saturation, then determine whether the current error value is opposite to the driving direction of the saturation control output; If the current error value is opposite to the saturation drive direction, then the integral term is reset.

[0013] According to the PID control method with anti-integral saturation function provided by the present invention, the reset operation of the integral term specifically includes: Clear the previous error value used for integration calculation; And / or, accumulate and clear the integrals.

[0014] According to the PID control method with anti-integral saturation function provided by the present invention, the corresponding control mode is selected according to the magnitude of the current error value, and the method further includes: If the absolute value of the current error is greater than the second error threshold, select the pure proportional control mode, and use a proportional gain coefficient that is less than the proportional gain coefficient used in the proportional control mode.

[0015] This invention provides a PID control method with anti-integral saturation function. By selecting different control modes according to the magnitude of the error value, and combining amplitude limiting processing of the control output value and reasonable management of the integral term, it can effectively suppress the occurrence of integral saturation. Simultaneously, by maintaining the previous error value unchanged or updating the error value for integral calculation, the accumulation process of the integral term is further optimized, thereby improving the stability and response speed of the control system, enhancing the adaptability and control accuracy of the PID controller under complex operating conditions, effectively solving the performance degradation problem caused by integral saturation in PID control, and significantly improving the overall performance of the control system. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this 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 some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the PID control method with anti-integral saturation function provided in an embodiment of the present invention. Figure 2 This is a schematic diagram illustrating the basic principle of the electro-hydraulic servo system provided in this embodiment of the invention; Figure 3 This is a schematic diagram illustrating the basic principle of the electric servo system provided in this embodiment of the invention; Figure 4 This is a schematic diagram of the structure of a PID control device with anti-integral saturation function provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0019] Figure 1 This is a flowchart illustrating the PID control method with anti-integral saturation function provided in an embodiment of the present invention.

[0020] See Figure 1 A PID control method with anti-integral saturation function may include the following steps.

[0021] Step 101: Obtain the setpoint and feedback sampled value of the control system, and determine the current error value based on the setpoint and feedback sampled value.

[0022] Step 102: Select the corresponding control mode based on the current error value.

[0023] Control mode selection refers to switching between different combinations of control algorithms based on the threshold range where the absolute value of the error falls. This can be implemented using an interval comparator, which helps avoid interference from the integral term when the error is large. The control modes include at least one combination of proportional, integral, and derivative algorithms.

[0024] Step 103: Based on the selected control mode, determine the change in the current control output value.

[0025] Among them, the change in control output value refers to the adjustment amount of the output within each control cycle, which is the absolute change in control output value.

[0026] Step 104: Update the control output value using the change in the control output value, and determine whether the updated control output value exceeds the output capability range of the controller.

[0027] Step 105: If the output exceeds the output capability range, limit it to the corresponding limit value and keep the previous error value used for integration calculation unchanged.

[0028] Among them, maintaining the previous error value means retaining historical error data when the output is limited. Specifically, it can be stored in a register, which effectively prevents the continuous accumulation of invalid errors.

[0029] Step 106: If the output capability range is not exceeded, update the current error value to the previous error value for the next integration calculation.

[0030] Specifically, the system collects feedback signals from the controlled object in real time and compares them with the setpoint to generate the current error signal. By comparing the absolute value of the error with a preset threshold, it selects either proportional control or proportional-integral (PI) control mode. In PI mode, the output increment includes a weighted sum of the current error and historical errors; in pure proportional mode, only the current error is considered. After each calculation, the output is checked to ensure it does not exceed the actuator's physical limits. When output limiting occurs, the error value from the previous cycle required for integral calculation remains unchanged, thus interrupting the accumulation of the integral term. When the output is within the normal operating range, the current error is stored as the historical error value for the next cycle.

[0031] In this embodiment, by selecting different control modes based on the magnitude of the error value, and combining this with amplitude limiting of the control output value and reasonable management of the integral term, the occurrence of integral saturation can be effectively suppressed. Simultaneously, by maintaining the previous error value unchanged or updating the error value for integral calculation, the accumulation process of the integral term is further optimized, thereby improving the stability and response speed of the control system, enhancing the adaptability and control accuracy of the PID controller under complex operating conditions, effectively solving the performance degradation problem caused by integral saturation in PID control, and significantly improving the overall performance of the control system.

[0032] In one embodiment of this specification, selecting a corresponding control mode based on the magnitude of the current error value includes: Step 1: If the absolute value of the current error is less than or equal to the first error threshold, select proportional-integral control mode or other control modes that include an integral term; The absolute value of the current error refers to the absolute value of the difference between the given value and the feedback sampled value. This can be achieved using subtraction and absolute value function calculations, and is used to quantify the magnitude of the error. The first error threshold is a preset error critical value, which can be implemented using empirical values ​​or values ​​set based on the system's dynamic characteristics. It is used to delineate the switching boundary between proportional-integral (PI) control mode and proportional control mode. Proportional-integral (PI) control mode refers to a control method that simultaneously introduces proportional and integral terms. This can be achieved using a linear combination of proportional and integral coefficients, and is used to improve control accuracy within a small error range.

[0033] Step 2: If the absolute value of the current error is greater than the first error threshold and less than or equal to the second error threshold, select the proportional control mode or other control mode that does not include an integral term. Among them, the proportional control mode refers to the control method that only introduces the proportional term. Specifically, it can be achieved by multiplying the proportional coefficient and the error value, which is used to avoid excessive accumulation of the integral term within the mean error range.

[0034] Specifically, when the absolute value of the error is within a small range, it is considered close to the target state, and a proportional-integral (PI) control mode is used to eliminate steady-state error through the accumulation of the integral term. When the absolute value of the error increases to a moderate range, it is considered to deviate from the target state but not significantly, and the system switches to proportional control mode, retaining only the proportional term to suppress the continuous accumulation of the integral term. For example, the first error threshold can be 1.2 times the maximum allowable steady-state error of the system, and the second error threshold can be twice the first error threshold. During this process, the selection of the control mode is based on the real-time comparison between the absolute value of the error and the preset threshold. By adjusting the control strategy in stages, ineffective accumulation of the integral term under large errors is avoided.

[0035] In this embodiment, by setting an error threshold to divide the control mode, the integral term is actively shut down within the error range, thereby reducing the risk of integral saturation. For example, existing technologies may use proportional-integral control throughout the entire error range, while this solution achieves dynamic mode switching through threshold judgment, optimizing the range of action of the integral term while ensuring control accuracy. This application can suppress the continuous accumulation of the integral term when the error is large, preventing the controller from losing its regulating ability due to output saturation, while maintaining integral action within a small error range to eliminate steady-state deviation. As a result, the anti-saturation capability of the control system is enhanced, and a balance is effectively achieved between dynamic response speed and steady-state accuracy.

[0036] In one embodiment of this specification, selecting the corresponding control mode based on the magnitude of the current error value further includes: If the absolute value of the current error is greater than the second error threshold, select the pure proportional control mode, and use a proportional gain coefficient that is less than the proportional gain coefficient used in the proportional control mode.

[0037] Pure proportional control mode refers to a control method that generates the change in control output value solely through a proportional element, without introducing integral or derivative elements. Specifically, this can be achieved by shutting down the integral and derivative terms when the absolute value of the error exceeds a second threshold, thus preventing the integral term from accumulating continuously when the error is large. The proportional gain coefficient refers to the linear amplification factor between the error value and the change in control output value in the proportional control element. It can be implemented using a dynamic adjustment algorithm or a preset parameter table. In pure proportional control mode, using a lower proportional gain coefficient can reduce drastic changes in the control output.

[0038] Specifically, when the absolute value of the error exceeds the second error threshold, the system enters a pure proportional control mode. In this mode, the integral term is completely disabled, retaining only the proportional gain. The proportional gain coefficient is set to a smaller value compared to the conventional proportional control mode, for example, 0.5 to 0.8 times the conventional proportional gain coefficient. In this mode, the change in the control output value is only related to the product of the current error value and the adjusted proportional gain coefficient. Because the proportional gain coefficient is reduced, the adjustment of the system output under large error conditions is suppressed, avoiding frequent reaching of the controller's limit value due to excessive proportional action. Simultaneously, disabling the integral term eliminates the risk of continuous error accumulation, thus preventing integral saturation.

[0039] In this embodiment, by switching to pure proportional mode and reducing the proportional gain coefficient within a large error range, both integral term accumulation and output abrupt changes are avoided by reducing the proportional gain strength, thus balancing adjustment speed and stability when the error is large. This application can effectively suppress the continuous accumulation of the integral term under large error conditions, reducing the risk that the control output will exceed the controller's capability range due to excessive proportional action. At the same time, by reducing the proportional gain coefficient, it avoids severe oscillations in the system under large errors, thereby improving the anti-saturation capability and dynamic response stability of the control system.

[0040] In one embodiment of this specification, selecting the corresponding control mode based on the magnitude of the current error value further includes: If the absolute value of the current error is greater than the second error threshold, select the proportional-derivative control mode; In proportional-derivative control mode, the change in the control output value is based on the product of the current error value and the proportional coefficient, and the product of the error rate of change and the derivative coefficient.

[0041] In this embodiment, when the system experiences a large deviation (i.e., the absolute value of the current error is greater than the second error threshold), it indicates that the controlled object may be experiencing a severe disturbance (such as a sudden load change or a step jump in the setpoint). If the integral term is still enabled at this time, it is very easy for the integral term to saturate due to the continuous accumulation of large errors, resulting in sluggish system response or even overshoot and oscillation. To address this, the present invention introduces a proportional-derivative (PD) control mode as a control strategy. By enabling the PD control mode under large error conditions, the system's ability to respond quickly to large disturbances or step commands is effectively improved, while avoiding the ineffective accumulation of the integral term under large deviations. This significantly suppresses overshoot and oscillation, enhancing the robustness and dynamic performance of the control system.

[0042] In this embodiment, the specific control mode can be flexibly configured according to the error magnitude, system dynamic characteristics, and control objectives to achieve optimal anti-integral saturation effect and control performance. For example, if the absolute value of the current error is less than or equal to the first error threshold, the system is in the fine adjustment stage. At this time, in addition to proportional-integral (PI) control, proportional-integral-derivative (PID) control mode can also be used to eliminate steady-state error by utilizing integral action, while improving dynamic performance through derivative action, thereby further enhancing control accuracy.

[0043] In one embodiment of this specification, determining the change in the current control output value based on the selected control mode may include: In proportional control mode, the change in the control output value is based on the product of the current error value and the proportional coefficient; In proportional-integral control mode, the change in the control output value is based on the sum of the product of the current error value and the proportional coefficient, and the product of the current error value and the integral coefficient.

[0044] In this embodiment, when the absolute value of the error exceeds the first threshold, only the proportional element is activated, instantly pulling the deviation back quickly and preventing overshoot caused by continued integral scaling. Once the error shrinks to within the first threshold, the system immediately switches to proportional-integral mode, gradually accumulating the small error until the steady-state error is almost zero. If the control output reaches the upper or lower limit, the controller immediately freezes the integral "ledger," ceasing accumulation and completely blocking the source of integral saturation. Once the output returns to the safe zone and the error direction reverses, the integral function automatically resumes. Thus, the advantage of PID control being free of residual error is retained while reducing overshoot and recovery time by nearly half, achieving "fast, accurate, and stable" anti-saturation control.

[0045] In one embodiment of this specification, determining the change in the current control output value based on the selected control mode may include: In proportional control mode, the change in the control output value is proportional to the product of the current error value and the proportional coefficient; In proportional-integral control mode, the change in the control output value is proportional to the sum of the products of the current error value and the proportional coefficient, and the products of the current error value and the integral coefficient.

[0046] The change in control output value refers to the adjustment of the output within each control cycle. It is the absolute change in the control output value, specifically achieved by multiplying the error signal and the gain coefficient. Its magnitude reflects the strength of the error's effect on the output. Proportional control mode refers to a control method that uses only the proportional term to calculate the output. This can be achieved by suppressing the integral term from participating in the calculation, and is suitable for quickly adjusting the output when the error is large. Proportional-integral control mode refers to a control method that uses both proportional and integral terms to calculate the output. Specifically, the integral term can be accumulated using an error accumulator, and it is suitable for improving control accuracy when the error is small.

[0047] Specifically, when the system is in proportional control mode, the output increment is determined solely by the product of the error value and the proportional coefficient. In this mode, the integral term is disabled to prevent continuous error accumulation that could lead to output saturation. When the system switches to proportional-integral (PI) control mode, the output increment is influenced by both the proportional and integral terms. In this mode, the integral accumulation of the error is activated, gradually eliminating the steady-state error. The switching between the two modes is based on the threshold range of the absolute value of the error. When the error is large, pure proportional control is prioritized; once the error falls within a smaller range, the integral function is activated, thus suppressing integral saturation while maintaining control accuracy.

[0048] In this embodiment, a mode switching mechanism automatically shuts down the integral term when the error exceeds a set threshold, eliminating the root cause of integral saturation while retaining the integral correction capability when the error is small, thus achieving a balance between control accuracy and anti-saturation capability. This application can dynamically adjust the effective range of the integral term according to the error, maintaining control accuracy while suppressing output saturation, solving the control lag problem caused by the continuous accumulation of the integral term in traditional methods, and improving the system's response speed and stability under complex operating conditions.

[0049] In one embodiment of this specification, if the output capability range is exceeded, it is limited to the corresponding limit value, and the previous error value used for integration calculation remains unchanged, including: When the control output value is limited to the upper limit, if the current error value is positive, the previous error value remains unchanged. When the control output value is limited to the lower limit, if the current error value is negative, the previous error value remains unchanged.

[0050] The upper limit value refers to the maximum physical quantity value that the controller can output, which can be determined by the controller's maximum stroke or maximum drive voltage parameter. The lower limit value refers to the minimum physical quantity value that the controller can output, usually determined by the controller's minimum stroke or minimum drive voltage. The previous error value refers to the error data of the previous control cycle used for integral term calculation, which can be stored in registers in digital control systems. The error direction is determined by comparing the current error value with the zero value; if the signs are the same, the error is considered to be in the same direction.

[0051] Specifically, when the control system output reaches the controller's upper operating point, if a positive deviation still exists, it means the integral term is still accumulating positive error. Freezing the update operation of the previous error value at this point prevents the integral term from continuing to accumulate error in a saturated state. Similarly, when the output is limited to the lower limit and a negative error exists, maintaining the previous error value prevents the integral term from erroneously accumulating. This selective freezing mechanism is triggered only when the output is limited and the error direction is consistent with the limiting direction, thus preserving the integral action's ability to eliminate steady-state error while effectively suppressing integral saturation.

[0052] In this embodiment, by intelligently determining the correspondence between the error direction and the limiting state, error updates are frozen only under specific conditions that may trigger integral overload. This maintains the dynamic characteristics of integral control while avoiding the ineffective accumulation of the integral term. This application effectively solves the control lag problem caused by the continuous accumulation of the integral term when the controller output is saturated. During the output limiting stage, the integral calculation reference value is selectively maintained through directional judgment, ensuring that the correct integral quantity can be immediately called to participate in the adjustment after the control system leaves saturation. This significantly shortens the system recovery time and avoids the steady-state error residue that may be caused by traditional integral separation methods.

[0053] In one embodiment of this specification, the control method further includes: After the control output value is updated, the switching threshold of the control mode is dynamically adjusted according to the changing trend of the current error value. The dynamic adjustment of the control mode switching threshold includes: If the current error value shows a monotonically increasing or monotonically decreasing trend for several consecutive times, the first error threshold and the second error threshold are increased according to the rate of change of the error value in order to reduce the triggering frequency of the proportional-integral control mode. If the fluctuation range of the current error value is less than the preset amplitude within a certain period of time, then the first error threshold and the second error threshold are reduced.

[0054] The dynamic adjustment of the control mode switching threshold refers to automatically modifying the critical conditions for mode switching based on the real-time error change characteristics of the system. This can be achieved by combining an error change trend monitoring algorithm with a threshold adaptive adjustment module, and by analyzing the monotonicity and fluctuation amplitude of the error sequence to determine the system state. The error value change trend refers to the direction and rate of increase or decrease of the error over time, which can be achieved by calculating the difference sequence or fitted slope of the error values ​​over multiple consecutive control cycles. The trigger frequency refers to the number of times the control mode switches per unit time, which can be achieved by statistically analyzing the time interval of mode switching events or the number of counting cycles.

[0055] Specifically, the system continuously monitors the monotonic changes in error values ​​during control. When the error is detected to be increasing in the same direction for three consecutive control cycles, a threshold adjustment mechanism is activated. For example, if the error change rate exceeds a set threshold, the first error threshold is increased from the initial value of 0.5% to 0.8%, and the second error threshold is increased from 1.2% to 1.5%, thereby expanding the effective range of the proportional control mode. When the system enters a stable state and the error fluctuation amplitude is less than 0.2% for ten consecutive cycles, the first error threshold is restored to 0.5%, and the second error threshold is restored to 1.2%, enhancing control accuracy. This dynamic adjustment mechanism automatically matches the optimal control mode switching conditions by identifying the dynamic characteristics of the system online.

[0056] In this embodiment, online optimization of the threshold parameter is achieved by introducing error trend analysis, avoiding control mode oscillation or response lag caused by improper threshold setting. Through the above technical solution, this application effectively solves the problem of inflexible mode switching in traditional PID control under complex operating conditions. By adjusting the control mode switching threshold in real time, the risk of integral saturation is reduced while ensuring control accuracy. The proportional control range is rapidly expanded in the early stages of system disturbance to suppress error growth, and a high-precision control mode is restored in the stable phase, achieving dynamic optimization of control performance and improving the system's anti-interference capability and steady-state accuracy.

[0057] In one embodiment of this specification, the control method further includes: After the control output value is updated, the filtering parameters are dynamically adjusted based on the magnitude and rate of change of the current error value to perform filtering processing on the control output value, including: When the current error value is greater than the maximum value of the preset error range and the rate of change is greater than the maximum value of the preset rate range, the filtering strength is reduced to speed up the response speed of the control output value. When the current error value is less than the minimum value of the preset rate range and the rate of change is less than the minimum value of the preset rate range, increase the filtering strength.

[0058] Among them, the filter parameters refer to the filter time constant or cutoff frequency used to adjust the smoothness of the control output signal. Specifically, they can be implemented using the coefficients of a first-order low-pass filter, and their values ​​directly affect the signal's high-frequency noise suppression capability. Dynamic adjustment refers to changing the filter parameters according to the real-time operating status of the system. This can be achieved through error threshold comparison and rate change judgment logic, and its function is to balance the response speed and stability of the control system. The preset error range and preset rate range refer to the pre-set range of absolute error values ​​and their rate of change, which can be determined through experimental data or system characteristics. They are used to define the trigger conditions for adjusting the filter intensity under different operating conditions.

[0059] Specifically, during the operation of the control system, when the detected error value exceeds the upper limit of the preset error range and the rate of change exceeds the upper limit of the preset rate range, the system is determined to be in a state of rapid deviation from the target state. At this time, the filter strength is reduced to decrease signal delay, enabling the controller to respond quickly to error changes. When the error value is below the lower limit of the preset error range and the rate of change is below the lower limit of the preset rate range, the system is determined to be in a stable adjustment phase. At this time, the filter strength is increased to suppress high-frequency interference signals and prevent the controller from taking unnecessary actions due to noise. The adjustment of the filter strength is achieved by changing the filter's time constant; for example, a smaller time constant is set during the rapid error change phase, and a larger time constant is set during the stable phase.

[0060] In this embodiment, a dual judgment mechanism based on error magnitude and rate of change enables real-time optimization of the filter parameters, ensuring both dynamic response capability and improved steady-state control accuracy. This application effectively solves the contradiction in control performance caused by fixed filter parameters. It reduces filter delay during the rapid adjustment phase to accelerate convergence, and enhances the filtering effect to suppress noise interference during the stable phase. Thus, it balances the speed and stability of the control system under complex operating conditions, avoiding overshoot or oscillation caused by mismatched filter strength.

[0061] In one embodiment of this specification, the previous error value used for integration calculation has an integration enable state flag bit, and the update logic of the flag bit includes: When the control output value is not limited, and the current error value has the same sign as the error value of the previous cycle, and the absolute value of the error shows a decreasing trend, set this flag bit to allow the integral term to participate in the accumulation. When the control output value is limited, or the sign of the current error value is flipped, or the absolute value of the error shows an increasing trend, the flag bit is reset to prevent the accumulation of the integral term. In proportional-integral control mode, the current error value is included in the integral term calculation only when the flag is set.

[0062] The integration enable flag is a logical variable used to control whether the integral term participates in the accumulation. It can be implemented using a binary variable or a register bit, and its state is dynamically adjusted based on the error trend and output limiting status. Setting the flag allows the integral term to accumulate, which can be achieved through logical operations or conditional statements, activating integration during the error convergence phase. Resetting the flag disables the integral term from accumulating, which can be achieved through interrupt triggering or a status monitoring module, suppressing integral accumulation when the error diverges or the output is limited.

[0063] Specifically, in proportional-integral (PI) control mode, the accumulation of the integral term requires three conditions to be met: the control output has not reached the controller's limit value, the error direction has not reversed, and the absolute value of the error shows a continuously decreasing trend. For example, when the control system is in a stable adjustment phase and the error gradually decreases, the flag is set, and the integral term participates in the calculation normally to eliminate the steady-state error; when controller saturation occurs or the error suddenly increases, the flag is reset, and the integral term pauses accumulation to avoid integral saturation. Furthermore, the determination of the decreasing trend of the absolute value of the error can be achieved by comparing the absolute value difference between the current error and the historical error, for example, by using a sliding window to record the error values ​​of the most recent several periods and performing trend analysis.

[0064] In this embodiment, by introducing an integral enable flag and dynamically judging based on the error change trend and output state, the convergence and divergence phases of the error can be effectively distinguished. Integral action is only allowed when the error steadily decreases, thus avoiding the accumulation of invalid integrals. This application can precisely control the activation timing of the integral term, maintaining steady-state accuracy while avoiding invalid accumulation of the integral term when the system oscillates or the output is limited. For example, during the rapid adjustment phase when the error direction changes frequently, the integral term is automatically masked to prevent reverse accumulation leading to overshoot; during the fine-tuning phase near the set value, the integral term is reactivated to eliminate residual errors. This dynamic adjustment mechanism significantly improves the anti-saturation capability and adjustment stability of the control system.

[0065] In one embodiment of this specification, while the control output value is limited to a limit value, the determination of an integral reset condition is also included: If the control output value is limited due to saturation, then determine whether the current error value is opposite to the driving direction of the saturation control output; If the current error value is opposite to the saturation drive direction, then the integral term is reset.

[0066] In this embodiment, a typical scenario of integral saturation is as follows: the controller output has reached its upper limit (e.g., a valve is fully open), but due to external disturbances (e.g., a sudden decrease in load), the controlled variable begins to deviate from the set value in the opposite direction, causing the error sign to reverse (e.g., originally a positive error, now a negative error). At this time, although the controller is running at full load, the system actually needs reverse adjustment, while the integral term continues to accumulate in the wrong direction, severely slowing down the recovery speed. To address this, the present invention sets integral reset trigger conditions: the controller output is in a limited state (saturation); the current error direction is opposite to the driving direction of the saturated output. The present invention triggers integral reset by detecting the reversal of the error direction in the saturated state, accurately identifying "false saturation" or "overshoot saturation" scenarios, promptly clearing the accumulation of erroneous integrals, significantly shortening the system recovery time from the saturated state, effectively avoiding prolonged loss of control or secondary overshoot caused by integral lag, and significantly improving control safety and response agility.

[0067] In one embodiment of this specification, the integral term is reset as follows: Clear the previous error value used for integration calculation; And / or, accumulate and clear the integrals.

[0068] In this embodiment, by clearly defining the specific operation method of integral reset, the thoroughness of integral state reset is ensured, and residual integral interference caused by incomplete reset is avoided. This allows the controller to immediately enter the correct adjustment track after the direction is reversed, further enhancing the reliability and engineering practicality of the anti-integral saturation mechanism.

[0069] In one embodiment of this specification, while the control output value is limited to a limit value, the method further includes: Start a reverse error accumulation counter to record the number of control cycles in which saturation occurs consecutively in the same direction; When the counter reaches the preset threshold, an integral zeroing instruction is generated, which forces the previous error value used for integral calculation to be cleared to zero and freezes the integral term until the control output leaves the saturation region and the error direction is reversed. The counter is reset to zero when the control output leaves the saturation region or the error direction reverses.

[0070] The reverse error accumulator counter is a counting device used to count the number of consecutive cycles in which the control output remains in a saturated state and the error direction does not change. It can be implemented using a software counter or a hardware register, updating the count value by periodically detecting the output limiting state and error direction. The integral clear instruction is a signal triggered when the counter reaches a preset threshold, forcibly clearing historical integral data. This can be achieved by generating an interrupt or control instruction through a logic judgment module to block the accumulation process of the integral term. Freezing the integral term temporarily disables integral operations after the integral is cleared. This can be achieved by setting a status flag or cutting off the integral path, until the system is out of saturation and the error direction reverses, at which point the integral function is restored.

[0071] Specifically, when the control output is limited to its limit value due to exceeding the controller's capability, the reverse error accumulation counter starts working. For example, if the output remains at its upper limit and the error remains positive, the counter increments cycle by cycle. When the count value reaches a preset threshold, it is determined whether the conditions of continuous saturation, unchanged error direction, and no significant decrease in absolute error value are met. If these conditions are met, an integral zeroing operation is triggered. At this time, the historical accumulated value of the integral term is forcibly reset to zero, and the integral operation is frozen to prevent further accumulation of integrals and subsequent recovery delays. When the output leaves the limiting region or the error direction reverses, the counter is reset, and the integral function returns to normal. This mechanism can effectively identify abnormal operating conditions of prolonged unidirectional saturation and accelerate system recovery by actively intervening in the integral term.

[0072] In some specific implementations, the reverse error accumulator counter is initialized to zero when output limiting is first detected, and thereafter checks whether the error direction is consistent with the limiting direction in each control cycle. For example, when the output is limited to the upper limit and the error remains positive, the counter increments by one each cycle; if the error becomes negative or the output deviates from the upper limit, the counter is immediately reset to zero. The preset threshold can be set according to the dynamic characteristics of the system, for example, set to 5-10 control cycles. After the integral zeroing instruction is triggered, the storage unit of the integral accumulator is set to zero, and the operating state of the integral operation module is locked through the status register.

[0073] In this embodiment, by dynamically monitoring the duration of saturation and actively resetting the integral term, the hysteresis effect caused by integral accumulation can be quickly eliminated, shortening the system recovery time from saturation and avoiding the risk of oscillation caused by continuous accumulation of the integral term. This application can promptly block the invalid accumulation of the integral term when the control output is constrained for a long time, effectively preventing the control quantity recovery delay problem caused by integral saturation, improving the stability and response speed of the system under extreme conditions, and ensuring through a conditional judgment mechanism that the integral zeroing operation is triggered only under abnormal conditions of continuous unidirectional saturation, avoiding malfunctions of the integral function during normal adjustment.

[0074] In one embodiment of this specification, the reverse error accumulator counter operates according to the following steps: When the control output value is first limited to the limit value, the reverse error accumulation counter is initialized with an initial value of zero. If the direction of the error value remains unchanged for multiple consecutive control cycles while the control output value is limited to the limit value, the value of the reverse error accumulator counter increases cycle by cycle. When the value of the reverse error accumulator reaches the preset quantity threshold, it is determined whether the integral clearing condition is met. If the integral zeroing condition is met, an integral zeroing instruction is generated to clear the previous error value used for integral calculation and freeze the integral term until the control output value leaves the saturation region and the error direction is reversed. When the control output value leaves the saturation region or the error direction reverses, the reverse error accumulation counter is cleared and normal integral calculation is resumed. The conditions for resetting points to zero include: Control the output value to remain saturated; The direction of the error value remains unchanged; The absolute value of the error did not decrease significantly.

[0075] The reverse error accumulator counter is a counting device used to record the number of consecutive saturated control cycles in the same direction. It can be implemented using a software counter or a hardware register. Its function is to determine whether the integral term needs to be forcibly reset by quantizing the saturation duration. The preset quantity threshold is the counting critical value that triggers integral zeroing. This can be set experimentally or based on the system's dynamic characteristics to balance response speed and anti-interference capability. The integral zeroing conditions include continuous control output saturation, unchanged error direction, and no significant decrease in the absolute value of the error. This can be implemented through a logic judgment module. Its function is to terminate integral accumulation promptly when the error is not effectively mitigated, avoiding control lag caused by continuous saturation.

[0076] Specifically, when the control output is limited due to exceeding the controller's capability, the counter begins to accumulate the number of saturation cycles in the same direction. If the error direction remains unchanged and does not decrease effectively, an integral zeroing operation is triggered when the accumulated number of cycles reaches a preset threshold, forcibly resetting the integral term and freezing its updates until the system exits the saturation state or the error direction reverses. This mechanism actively intervenes before the accumulation of the integral term leads to a deterioration in control performance by dynamically monitoring the saturation duration and error change trend, thereby avoiding overshoot or oscillation caused by the continuous accumulation of the integral term in traditional methods.

[0077] In this embodiment, by introducing a counter and a multi-condition judgment mechanism, the integral accumulation can be actively cleared when the error is not effectively mitigated. Simultaneously, the integral function is restored by combining the error direction reversal condition, thereby suppressing integral saturation while maintaining the system's dynamic response capability. This application can automatically identify and clear historical accumulation of the integral term when the control output remains saturated and the error is not effectively reduced, avoiding control lag or overshoot caused by continuous accumulation of the integral term. This scheme, through condition judgment and dynamic counting mechanisms, reduces the need for manual intervention while maintaining control stability, improving the system's adaptability under complex operating conditions.

[0078] This invention can be applied to a variety of servo control systems, such as electric servo control systems or hydraulic servo control systems.

[0079] The basic principle of electro-hydraulic servo system is as follows: Figure 2 As shown, the system mainly consists of an instruction generation module, a feedback controller, a servo valve, a servo hydraulic cylinder, a sensor, and a load / displacement output module. The instruction generation module generates a load loading reference instruction in real time based on the displacement of the test product. The feedback controller superimposes this instruction with the load acquisition signal fed back by the sensor, calculates the real-time load error, and sends it to the servo valve. The servo valve adjusts the flow rate of the hydraulic oil in the two chambers of the servo hydraulic cylinder according to the output signal of the feedback controller, and the servo hydraulic cylinder provides the specified load to the test product based on this signal. The sensor acquires the load output signal in real time, and superimposes it with the sensor's own accuracy error and the interference signal formed by interference coupling of the acquisition system, transmitting this as a feedback signal to the feedback controller. The entire system achieves closed-loop control through a load feedback control loop, ensuring that the test product can complete the loading task according to the given load loading reference instruction, while simultaneously adjusting the control signal in real time through the feedback mechanism to meet the system's accuracy requirements.

[0080] The basic principle of electric servo system is as follows Figure 3As shown, the system mainly consists of an instruction generation module, a feedback controller, a motor driver, a servo motor, a sensor, and a load / displacement output module. The instruction generation module generates a load loading reference instruction in real time based on the displacement of the test product. The feedback controller superimposes this instruction with the load acquisition signal fed back by the sensor to calculate the real-time load error and sends the error signal to the motor driver. The motor driver adjusts the operating state of the servo motor in real time according to the output signal of the feedback controller. The servo motor drives the loading actuator according to the control signal of the driver, providing the specified load to the test product. The sensor acquires the load output signal in real time and superimposes it with the sensor's own accuracy error and the interference signal formed by interference coupling of the acquisition system, transmitting this as a feedback signal to the feedback controller. The entire system achieves closed-loop control through a load feedback control loop, ensuring that the test product can complete the loading task according to the given load loading reference instruction, while simultaneously adjusting the control signal in real time through the feedback mechanism to meet the system's accuracy requirements.

[0081] Based on the same general inventive concept, this invention also protects a PID control device with anti-integral saturation function, such as... Figure 4 As shown, Figure 4 This is a schematic diagram of the PID control device with anti-integral saturation function provided in an embodiment of the present invention. The PID control device with anti-integral saturation function provided by the present invention will be described below. The PID control device with anti-integral saturation function described below can be referred to in correspondence with the PID control method with anti-integral saturation function described above.

[0082] A PID control device with anti-integral saturation function includes an acquisition module 401, a mode selection module 402, an output increment module 403, a capability judgment module 404, a maintenance module 405, and an update module 406.

[0083] The acquisition module 401 is used to acquire the setpoint and feedback sampled value of the control system, and determine the current error value based on the setpoint and feedback sampled value; The mode selection module 402 is used to select the corresponding control mode according to the magnitude of the current error value; The output increment module 403 is used to determine the change in the current control output value based on the selected control mode; The capability judgment module 404 is used to update the control output value using the change in the control output value, and to determine whether the updated control output value exceeds the output capability range of the controller. The maintenance module 405 is used to limit the output to the corresponding limit value if the output capability range is exceeded, and to maintain the previous error value used for integration calculation unchanged; The update module 406 is used to update the current error value to the previous error value for the next integration calculation if the output capability range is not exceeded.

[0084] Figure 5 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention.

[0085] like Figure 5 As shown, the electronic device may include a processor 510, a communication interface 520, a memory 530, and a communication bus 540. The processor 510, communication interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logic instructions from the memory 530 to execute a PID control method with anti-integral saturation functionality.

[0086] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0087] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the PID control method with anti-integral saturation function provided by the above methods.

[0088] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the PID control method with anti-integral saturation function provided by the above methods.

[0089] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0090] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0091] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A PID control method with anti-integral saturation function, characterized in that, include: Obtain the given value and feedback sample value of the control system, and determine the current error value based on the given value and the feedback sample value; Based on the magnitude of the current error value, select the corresponding control mode; wherein, the control mode includes at least one combination of proportional, integral, and derivative modes; Based on the selected control mode, determine the current change in the control output value; The control output value is updated using the change in the control output value, and it is determined whether the updated control output value exceeds the output capability range of the controller. If the output exceeds the specified range, it is limited to the corresponding limit value, and the previous error value used for integration calculation remains unchanged. If the output capability range is not exceeded, the current error value is updated to the previous error value for the next integration calculation.

2. The PID control method with anti-integral saturation function according to claim 1, characterized in that, Based on the magnitude of the current error value, select the corresponding control mode, including: If the absolute value of the current error is less than or equal to the first error threshold, select the proportional-integral control mode or other control modes that include an integral term. If the absolute value of the current error is greater than the first error threshold and less than or equal to the second error threshold, select the proportional control mode or other control mode that does not include an integral term.

3. The PID control method with anti-integral saturation function according to claim 2, characterized in that, Based on the selected control mode, determine the current change in the control output value, including: In proportional control mode, the change in the control output value is based on the product of the current error value and the proportional coefficient; In proportional-integral control mode, the change in the control output value is based on the sum of the product of the current error value and the proportional coefficient, and the product of the current error value and the integral coefficient.

4. The PID control method with anti-integral saturation function according to claim 1, characterized in that, If the output exceeds the stated output capability range, it is limited to the corresponding limit value, and the previous error value used for integration calculation remains unchanged, including: When the control output value is limited to the upper limit, if the current error value is positive, the previous error value remains unchanged. When the control output value is limited to the lower limit, if the current error value is negative, the previous error value remains unchanged.

5. The PID control method with anti-integral saturation function according to claim 2, characterized in that, The control method further includes: After the control output value is updated, the switching threshold of the control mode is dynamically adjusted according to the changing trend of the current error value. The dynamic adjustment of the control mode switching threshold includes: If the current error value shows a monotonically increasing or monotonically decreasing trend for multiple consecutive times, then according to the rate of change of the error value, the first error threshold and the second error threshold are increased to reduce the triggering frequency of the proportional-integral control mode. If the fluctuation range of the current error value is less than the preset amplitude within a certain period of time, then the first error threshold and the second error threshold are reduced.

6. The PID control method with anti-integral saturation function according to claim 2, characterized in that, Based on the magnitude of the current error value, the corresponding control mode is selected, which also includes: If the absolute value of the current error is greater than the second error threshold, select the proportional-derivative control mode; In the proportional-derivative control mode, the change in the control output value is based on the product of the current error value and the proportional coefficient, and the product of the error rate of change and the derivative coefficient.

7. The PID control method with anti-integral saturation function according to claim 1, characterized in that, The previous error value used for integration calculation has an integration enable status flag, and the update logic for the flag includes: When the control output value is not limited, and the current error value has the same sign as the error value of the previous cycle, and the absolute value of the error shows a decreasing trend, set this flag bit to allow the integral term to participate in the accumulation. When the control output value is limited, or the sign of the current error value is flipped, or the absolute value of the error shows an increasing trend, the flag bit is reset to prevent the accumulation of the integral term. In proportional-integral control mode, the current error value is included in the integral term calculation only when the flag is set.

8. The PID control method with anti-integral saturation function according to claim 1, characterized in that, During the period when the control output value is limited to the limit value, the method also includes: determining the integral reset condition. If the control output value is limited due to saturation, then determine whether the current error value is opposite to the driving direction of the saturation control output; If the current error value is opposite to the saturation drive direction, then the integral term is reset.

9. The PID control method with anti-integral saturation function according to claim 8, characterized in that, The reset operation for the integral term specifically includes: Clear the previous error value used for integration calculation to zero; And / or, accumulate and clear the integrals.

10. The PID control method with anti-integral saturation function according to claim 2, characterized in that, Based on the magnitude of the current error value, the corresponding control mode is selected, which also includes: If the absolute value of the current error is greater than the second error threshold, select the pure proportional control mode, and use a proportional gain coefficient that is less than the proportional gain coefficient used in the proportional control mode.

Citation Information

Cited By

  • Wireless charging ground end anti-saturation PID control method and system

    CN122001064A