Improved PID control method based on kalman filtering
By using an improved PID control method based on Kalman filtering, the problem of traditional PID algorithms being susceptible to noise interference in switching power supplies is solved, resulting in more stable and faster power output and improved system reliability and lifespan.
Patent Information
- Application Number
- PCT/CN2025/087664
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-30
- Filing Date
- 2025-04-08
- Publication Date
- 2026-02-05
AI Technical Summary
Traditional digital PID algorithms are susceptible to noise interference in switching power supplies, leading to system instability and large overshoot during startup, which affects equipment reliability and lifespan.
An improved PID control method based on Kalman filtering is adopted. By adjusting the PID parameters and combining variable speed integral and integral separation algorithms, a low-pass filter is introduced, and the Kalman filter is used to reduce the influence of noise. Finally, the feedback quantity is iteratively optimized to achieve stable output.
It improves the stability and noise immunity of the PID controller, reduces overshoot, shortens settling time, and enhances system response speed and accuracy.
Smart Images

Figure CN2025087664_05022026_PF_FP_ABST
Abstract
Description
Improved PID control method based on Kalman filtering TECHNICAL FIELD
[0001] The present application relates to the field of PID control and Kalman filtering, and particularly relates to an improved PID control method based on Kalman filtering. BACKGROUND
[0002] In power supply, stability and precision are very important indicators. For power output voltage, if it cannot be kept stable and accurate, it may cause damage to the circuit, equipment and even the whole system. In the design of switching power supply, due to different workloads and environmental changes, the power supply system is often disturbed by many known and unknown signals, which will have a great impact on the normal operation of the equipment.
[0003] The front-end compensation algorithm currently adopted is a traditional digital PID algorithm, which is generally stable, is easily disturbed by noise, and has the problem of excessive overshoot when the system starts, which will cause the load equipment to pass through a large current value in a short time, thereby reducing the system reliability of the equipment and damaging the service life of the equipment. SUMMARY
[0004] The improved PID control method based on Kalman filtering solves the problems of the prior art.
[0005] In a first aspect, the present application provides an improved PID control method based on Kalman filtering, comprising:
[0006] Step 1: obtaining the system transfer function G(s) of the controlled object according to the actual situation model, specifying the expected signal or target value yd of the system output, and then selecting the PID method according to the expected signal, including the position type PID, the incremental type PID, etc., and then selecting the proportional coefficient kp, the integral coefficient ki and the differential coefficient kd of the PID.
[0007] Step 2: continuously adjusting the PID parameters to find the best. First, set the proportional coefficient, gradually increase it from 0 until the system static error reaches the minimum and just does not produce oscillation. Then continuously increase the integral coefficient to eliminate the static error, and appropriately reduce the proportional coefficient to prevent the system from producing oscillation. Finally, adjust the differential coefficient to reduce the adjustment time and overshoot, and simultaneously adjust the proportional coefficient and the integral coefficient until the response curve of the system reaches the best.
[0008] Step 3: according to the incremental type PID method, the output value after the last error sampling is:
[0009] The output value obtained from the current error sampling is subtracted from the last one to obtain the incremental type PID formula: Δu(k)=u(k)-u(k-1) Δu(k)=k p(error(k) - error(k-1)) + k i error(k) + k d (error(k) - 2error(k-1) + error(k-2))
[0010] According to the above formula, the target value is subtracted from the current feedback of the controlled object to obtain an error, and the error value is calculated through the proportional term, the integral term and the differential term to obtain an output component. The three components are added together to obtain the output of the PID.
[0011] Step 4: The integral term of the incremental PID is improved, and the variable-speed integral and integral separation algorithm is introduced. The integral speed is changed according to the size of the deviation. That is, the expression of the integral term is:
[0012] Where β is a function of the deviation, that is:
[0013] Where A and B represent the set threshold value, and the expression of the variable-speed integral PID algorithm is:
[0014] Step 5: The PID output obtained above is applied to the controlled object, i.e. the load, and after driving the load, a noisy and unstable output signal is obtained, which is then sent to Kalman filtering for processing.
[0015] Step 6: The optimal value is estimated using the Kalman equation. First, according to the dynamic model of the system, the state equation and the control input, the state estimation value at the current time is predicted according to the state estimation value at the last time. The prediction result includes the state vector and the state covariance matrix, which describe the expected value and uncertainty of the state, that is: P k =F k P k-1 F k T +Qk
[0016] Where represents the posterior state estimation value at k-1 time, i.e. the update result at the last time. is the prior state estimation value at k time, i.e. the optimal estimation prediction value obtained according to the last time (k-1 time), which is the result of the prediction equation. P k-1 represents the posterior estimation covariance at k-1 time, i.e. the covariance of . P k is the prior estimation covariance at the current k time, i.e. the covariance of . F kis the state transition matrix, which is the model of the target state transition.
[0017] According to the observation data, the optimal estimation of the current state and the state uncertainty are calculated. The state correction is performed according to the state estimation value obtained in the prediction step and the actual measurement value by using the observation equation. The Kalman gain is calculated by using the Kalman gain equation, and is used to weigh the reliability of the predicted value and the measured value. Then, the state estimation value and the covariance are updated according to the difference between the Kalman gain, the measured value and the predicted value, that is: K = P k H k T (H k P k H k T +R k ) -1 P k '=P k -KH k P k
[0018] wherein K is the Kalman gain, which is an intermediate calculation result of the filtering. H k is the state variable to the conversion matrix of the measurement, which represents the relationship between the state and the observation, and is responsible for converting the m-dimensional measurement value to the n-dimensional state variable to meet the mathematical form. R k is the measurement noise covariance. represents the posterior state estimation value at k time, that is, the optimal estimation at the current time. T represents transposition. P k ' represents the posterior estimation covariance at k time, that is, the covariance of , which represents the uncertainty of the current state. Wherein and P k ' are the results obtained after filtering.
[0019] Step 7: The optimal value obtained by the above Kalman equation processing is the final expected filtered output. The output is fed back to the input of the PID after sampling, and the above steps 3-5 are repeatedly iterated to make the feedback quantity approach the target expected signal, and finally a stable output signal is obtained.
[0020] The improved PID control method based on Kalman filtering provided by the application obtains the optimal estimation of the system state by predicting the current state and updating the observation data, thereby reducing the influence of measurement error and noise and improving the performance and stability of the PID controller. BRIEF DESCRIPTION OF DRAWINGS
[0021] The accompanying drawings, which are included to provide a further understanding of the embodiments of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the principles of the application. In the drawings:
[0022] Fig. 1 is a schematic diagram of a system principle of the improved PID control method based on Kalman filtering provided by an exemplary embodiment of the present application.
[0023] Fig. 2 is a diagram of the effect of the conventional PID control without Kalman filtering in Embodiment 1 of the present application.
[0024] Fig. 3 is a diagram of the effect of the PID control with Kalman filtering in Embodiment 1 of the present application.
[0025] Fig. 4 is a diagram of the comparison of the effects of the two kinds of PID control in Embodiment 1 of the present application. DETAILED DESCRIPTION
[0026] The exemplary embodiments will be described in detail herein below with reference to the accompanying drawings.
[0027] The nomenclature in the present application is explained as follows:
[0028] PID is an algorithm for control, which stands for "proportional, integral and derivative".
[0029] The technical concept of the present application is as follows:
[0030] The whole running process of the PID control based on Kalman filtering is as follows: firstly, a target value is specified for the system, which is the desired signal. The target value is subtracted from the current feedback of the controlled object to obtain an error, and the error value is calculated through the proportional term, the integral term and the derivative term to obtain the output components, and the three components are added to obtain the output of the PID. In order to strengthen the effect of the integral term, the variable-speed integral and integral separation algorithm are added, so that the integral speed can be changed according to the system deviation, thereby reducing the system overshoot and improving the system response speed. In order to prevent high-frequency interference caused by the derivative signal, the incomplete derivative algorithm is introduced, and a low-pass filter is added to the derivative term. The output of the PID is applied to the controlled object to obtain a noisy output signal, and then the output is fed back to the PID after Kalman filtering, so that the feedback quantity is constantly iterated to approach the target value, and finally a stable output signal is obtained.
[0031] The improved PID control method based on Kalman filtering provided by the present application aims to solve the above technical problems of the prior art.
[0032] The embodiments of the present application will be described below with reference to the accompanying drawings.
[0033] Embodiment 1: The embodiment of the present application provides an improved PID control method based on Kalman filtering, as shown in Figure 1, which comprises the following steps:
[0034] Based on the steps 1-7 of the description, the proportional part (P) is not improved, the variable speed integral module is added in the integral part (I) for guiding the PID feedback to change the integral speed according to the system deviation, the low-pass filter is added in the differential part (D) for guiding the PID to prevent the high-frequency interference caused by the differential signal, the output is added to the control disturbance term w, the PID output and the control disturbance term w act on the controlled object, then the output is added to the measurement noise v and output to the Kalman filter, and the branch directly adds the PID output to the control disturbance term w to the Kalman filter, and the output value of the Kalman filter is fed back to the input of the PID after sampling, and the steps 3-5 are repeatedly continued, so that the feedback quantity is constantly iterated to approach the target expected signal, and finally the stable optimal output signal is obtained.
[0035] The controlled object is a second-order system, the system transfer function is G(s) = 400 / (s 2 + 50s), the sampling time is 1ms, the disturbance noise w(k) and the measurement noise v(k) are both white noise with a covariance of 1 and an amplitude of 0.01, that is, Q = 1 and R = 1. The input expected signal is a pwm wave signal with a period of 2s, and the simulation time is 4s. The incremental PID is used, and the three coefficients of the PID are: kp = 12.0, ki = 0.80, and kd = 0.20.
[0036] The effect comparison chart of the PID control combined with or not combined with the Kalman filter is obtained, and the simulation results are shown in Figures 2-4. The PID control performance without the Kalman filter: the signal-to-noise ratio is 18.9dB, the overshoot sigma is 3.6%, and the regulation time ts is 2.207s. The PID control performance with the Kalman filter: the signal-to-noise ratio is 20.8dB, the overshoot sigma is 0%, and the regulation time ts is 2.089s.
[0037] As can be seen from the above comparison results, after the Kalman filter is used, the waveform tracking becomes more stable, the waveform tracking error is reduced, and the signal-to-noise ratio is significantly increased. At the same time, the use of the Kalman filter can shorten the convergence time of the PID control, eliminate the overshoot introduced by the system, significantly reduce the influence of noise, reduce the number of oscillations, make the system quickly reach stability, and obtain a stable system output.
[0038] In several embodiments provided by the present application, it should be understood that the disclosed method can be implemented in other ways. For example, the division of the modules is only a logical function division, and actual implementation can have another division manner, for example, multiple modules or components can be combined or integrated into another device, or some features can be ignored or not executed.
[0039] The above detailed description of the specific implementation of the present application further explains the purpose, technical solutions and beneficial effects of the present application. It should be understood that the above description is only a specific implementation of the present application and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. An improved PID control method based on Kalman filter, characterized in that, include: In the process of obtaining the target value of the desired signal, the error value is obtained by subtracting the target value from the current feedback quantity of the controlled object. The output of the PID is obtained from the error value. The output of the PID is applied to the controlled object to obtain a noisy output signal. After passing through Kalman filtering, the output is fed back to the PID. The feedback quantity is continuously iterated to make it approach the target value, and finally a stable output signal is obtained. Specifically, variable speed integral and integral separation algorithms are added to the integral term of the PID to change the integral speed according to the size of the system deviation. Incomplete differentiation algorithm and low-pass filter are added to the derivative term of the PID to prevent high-frequency interference.
2. The improved PID control method based on Kalman filter according to claim 1, characterized in that, The process of obtaining the target value of the desired signal specifically includes the following steps: Step 1: Obtain the system transfer function G(s) of the controlled object, obtain the dynamic behavior information of the system through the complex frequency domain variable s, specify the target value of the system output, i.e. the desired signal yd, select the PID method based on the desired signal, and then select the proportional coefficient kp, integral coefficient ki, and derivative coefficient kd of the PID. Step 2: Continuously adjust the PID parameters to find the optimal PID parameters; Step 3: Based on the PID method, calculate the output value u(k-1) after the last error sampling, where k is the number of samplings; Step 4: Introduce variable-speed integration and integral separation algorithms to improve the speed of integration based on the magnitude of the deviation; Step 5: The obtained PID output is applied to the controlled object, i.e., the load. After being driven by the load, a noisy and unstable output signal is obtained, which is then sent to the Kalman filter for processing. Step 6: Use the Kalman equation to estimate the optimal value; Step 7: Based on the optimal output value obtained in Step 6, sample the optimal value and feed it back to the PID input. Continue to repeat Steps 3-5, iterating continuously to make the feedback quantity approach the target desired signal, and finally obtain a stable output signal.
3. The improved PID control method based on Kalman filter according to claim 2, characterized in that, In step 1, the PID method includes: positional PID and incremental PID; When the incremental PID method is selected, the output value after the last error sample is obtained in step 3 as follows: The incremental PID formula is obtained by subtracting the current error sampled output value from the previous one: Δu(k)=u(k)-u(k-1) Δu(k) = k p (error(k) - error(k - 1)) + k i error(k) +k d (error(k)-2error(k-1)+error(k-2)) According to the above formula, the error is obtained by subtracting the target value from the current feedback quantity of the controlled object. The error value is then processed through three stages: proportional term, integral term, and derivative term to obtain the output component. The sum of the three components is the PID output.
4. The improved PID control method based on Kalman filter according to claim 3, characterized in that, Step 2 specifically includes: first, adjusting the proportional coefficient, gradually increasing it from 0 until the system static error reaches its minimum and just before oscillation occurs; then, continuously increasing the integral coefficient to eliminate the static error; finally, adjusting the derivative coefficient to reduce the adjustment time and overshoot, and simultaneously adjusting the proportional coefficient and integral coefficient together until the system response curve reaches its optimal value. In particular, appropriately reducing the proportional coefficient is used to prevent system oscillations.
5. The improved PID control method based on Kalman filter according to claim 4, characterized in that, Step 4 specifically includes: The expression for the integral term is: where β is a function of the bias, i.e.: where A and B are expressed as a set threshold value, then the expression of the variable speed integral PID algorithm is:
6. The improved PID control method based on Kalman filter according to claim 5, characterized in that, Step 6, which uses the Kalman equation to estimate the optimal value, specifically includes: First, according to the dynamic model of the system, the state equation and the control input, the state estimation value at the current time is predicted according to the state estimation value at the last time, wherein the prediction result includes a state vector for describing the state expectation value and a state covariance matrix for describing the state uncertainty, State vector: The state covariance matrix: P k = F k P k-1 F k T + Qk wherein represents the a posteriori state estimate at time k - 1, i.e. the update result of the previous time, is the a priori state estimate at time k, i.e. the optimal estimated prediction from the previous time (time k-1), which is the result of the prediction equation; P k-1 denotes the a posteriori estimation covariance at time k-1, i.e. covariance P k is the prior estimation covariance at the current time instant k, i.e. covariance, F k is the state transition matrix, is the model of the target state transition, and Q is the covariance of the system process, which is used to represent the error between the state transition matrix and the actual process.
7. The improved PID control method based on Kalman filter according to claim 6, characterized in that, In step 6, according to the observation data, the specific process of calculating the optimal estimation of the current state and the state uncertainty includes the following: using the observation equation and the actual measurement value, the state estimation value obtained in the prediction step is corrected, the Kalman gain is calculated through the Kalman gain equation, which is used to weigh the reliability of the prediction value and the measurement value, and then according to the difference between the Kalman gain, the measurement value and the prediction value, the state estimation value and the covariance are updated, that is: Kalman gain: K = P k H k T (H k P k H k T +R k ) -1 Posterior state estimate at time k: Posterior estimation covariance at time k: P k ' = P k - KH k P k where K is the Kalman gain, an intermediate calculation result of the filtering; H k is the state variable to measurement conversion matrix, representing the relationship connecting the state and observation, responsible for converting the m-dimensional measurement value to n-dimensional, making it consistent with the mathematical form of the state variable; R k is the measurement noise covariance; T represents the transpose; denotes the a posteriori state estimate at time k, i.e. the optimal estimate at the current time; P k denotes the a posteriori estimate covariance at time k, i.e. covariance of the state, representing the uncertainty of the current state; wherein and P k The result after filtering.
Citation Information
Patent Citations
Control method of PID controller
CN101893849A
Speed change integral PID controller for asynchronous motor vector control of electromobile
CN103269195A
Adjustable terahertz detector temperature control system based on integral separation
CN106227265A
Integral separated PID control method
CN109001973A
Ocean vessel course control composite optimization oil saving method
CN113031614A
Cited By
Magnetic field estimation method based on adaptive algorithm
CN121980132A
A method and system for optimizing purification process parameters of diesel anti-wear agents
CN122239413A
Remote sensing method for coordinated operation status of feeder terminal unit (FTU) and pole-mounted circuit breaker
CN122283426A