A kalman filter observer based generalized predictive control method and controller
By introducing a Kalman filter observer and an error contraction factor into predictive control, the problems of control system fluctuations and static deviations caused by model mismatch are solved, achieving fast and accurate control results.
Patent Information
- Application Number
- CN202210446910.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-26
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2042-04-26
AI Technical Summary
Existing predictive control methods cause fluctuations and oscillations in the control system when there are deviations between the model and the actual dynamic characteristics of the controlled object. Furthermore, the Kalman filter observer is prone to getting stuck in static bias during control convergence.
A generalized predictive control method based on Kalman filter observers is adopted. By introducing a shrinkage factor for the accuracy error of the Kalman filter model, Kalman filter observation data is used to replace the measured control quantity for deviation calculation. Incremental control output is introduced into the generalized predictive control to prevent static error traps and suppress fluctuations caused by model mismatch.
It effectively suppresses fluctuations and oscillations in the control system, improves the stability and accuracy of control, shortens the control convergence time, prevents system divergence, and achieves fast and accurate control results.
Smart Images

Figure CN115016247B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of advanced process control, and more particularly, to a generalized predictive control method based on Kalman filter observer and a generalized controller. BACKGROUND
[0002] In traditional process control, PID controller is usually adopted, and the PID controller is a control strategy for eliminating the deviation between the set value and the measured value of the controlled object, that is, the deviation is adjusted to eliminate the deviation, so the PID is a lag control strategy. In order to improve the rapidity and accuracy of control, model predictive control (MPC) emerges as the times require, which is based on the established model of the controlled object and can realize the prediction function of the controlled quantity, that is, the future value of the process output can be predicted according to the control input at the present time and the historical information of the process, so that the predictive control can optimize the solution of the control quantity according to the preset reference trajectory to make the predicted curve of the controlled quantity reach the set target value along the reference trajectory.
[0003] However, since the predicted value of the predictive control is obtained according to the model of the controlled object, when there is a large deviation between the model and the dynamic characteristics of the actual controlled object, the model mismatch will cause the fluctuation and even the oscillation of the control system. Kalman filter is an algorithm for optimally estimating the state of a system by using the state space equation of a linear system and observing the input and output data of the system, and if the model mismatch is regarded as a disturbance, the Kalman filter can suppress the disturbance, and the observation value is closer to the actual predicted value of the controlled quantity. However, the Kalman filter needs to estimate the error of the model precision when calculating, and when the error estimation value is large, the ability to suppress the model mismatch is stronger, but when the control process tends to converge, the observation value and the measured value are easy to form a fixed static deviation. Therefore, the model precision error estimation value of the Kalman filter needs to be dynamically corrected to more accurately obtain the estimated value of the controlled quantity. SUMMARY
[0004] The purpose of the present application is to provide a generalized predictive control method based on Kalman filter observer, which adds a state observer based on Kalman filter on the basis of generalized predictive control, uses the data observed by Kalman filter to replace the measured controlled quantity to calculate the deviation of generalized predictive control, and introduces a contraction factor of the model precision error of Kalman filter to prevent the Kalman filter observer from falling into a static error trap, thereby effectively suppressing the fluctuation and even the oscillation caused by the model mismatch, and eliminating the static deviation.
[0005] Specifically, the present application provides a generalized predictive control method based on Kalman filter observer, comprising the following steps:
[0006] S1: initializing the Kalman filter model and the predictive control model according to the predictive control model, Kalman filter initial parameters and generalized predictive control initial parameter information;
[0007] S2: correcting the Kalman filter reference model precision Q according to the generalized predictive control controlled variable prediction value, the measured controlled variable and the controlled variable set value;
[0008] S3: observing the Kalman filter model output based on the previous time control output and the measured controlled variable, and updating the Kalman filter model;
[0009] S4: replacing the measured controlled variable with the Kalman filter model observation output for the prediction control deviation calculation;
[0010] S5: performing the generalized predictive control calculation based on the controlled variable set value and the prediction control deviation to obtain the final control variable and issue it to the control device for execution.
[0011] Further, the step S1 comprises:
[0012] S11: establishing a predictive control model;
[0013] S12: discretizing the predictive control model and initializing the related parameters;
[0014] S13: converting the discretized transfer function model into a state space equation, establishing a Kalman filter observation model, and setting the Kalman filter observer measured precision error estimation value and the Kalman filter reference model precision.
[0015] Further, the Kalman filter observer measured precision error estimation value R is set as a constant value.
[0016] Further, in the step S2, the Kalman filter reference model precision Q is an S-shaped function about the difference between the generalized predictive controlled variable prediction value, the measured controlled variable and the controlled variable set value, which has the characteristics of controllable upper limit of precision error and monotonically increasing.
[0017] Further, the Q value is corrected by using the S-shaped function, and the calculation is as follows:
[0018]
[0019] wherein Q is the model precision error estimation value, Q max is the upper limit of the model precision error estimation value, and σ is the bandwidth parameter. Yy represents the generalized predictive control controlled variable prediction value, SV represents the controlled variable set value, and PV represents the measured controlled variable.
[0020] Further, in the step S3, the Kalman filter observer is based on the modified reference model precision error estimation value Q to filter and observe the current time controlled variable, to prevent the Kalman filter observer from falling into a static error trap.
[0021] Further, in the step S4, the controlled variable observation value observed by the Kalman filter is used to replace the measured controlled variable value, and is substituted into the prediction control deviation calculation, to suppress the control fluctuation or even oscillation caused by the large deviation between the model prediction value and the measured value when the model is distorted.
[0022] Further, in the step S5, the incremental control output mode is used in the generalized prediction control calculation, to facilitate the limitation of the control variable change rate.
[0023] Further, the application further provides a generalized prediction controller based on a Kalman filter observer, comprising:
[0024] An initialization module, which initializes the Kalman filter model and the prediction control model according to the prediction control model, the Kalman filter initial parameters and the generalized prediction control initial parameter information;
[0025] A model correction module, which corrects the Kalman filter reference model precision Q according to the controlled variable prediction value of the generalized prediction control, the measured controlled variable and the controlled variable set value;
[0026] A model updating module, which observes the Kalman filter model output based on the previous time control output and the measured controlled variable, and updates the Kalman filter model;
[0027] A deviation calculation module, which uses the Kalman filter model observation output to replace the measured controlled variable for the prediction control deviation calculation;
[0028] An output module, which performs the generalized prediction control calculation based on the controlled variable set value and the prediction control deviation, to obtain the final control variable and issue the control variable to the control device for execution.
[0029] The application has the following beneficial effects:
[0030] The application provides a generalized prediction control method based on a Kalman filter observer, which uses the disturbance elimination feature of the Kalman filter to improve the stability of the prediction control, realizes the fast, accurate and stable control of the prediction control, suppresses the control system fluctuation or even oscillation caused by the model mismatch, and improves the control performance.
[0031] After the above method, the system fluctuation or even oscillation caused by model mismatch can be effectively inhibited while the fast and accurate control characteristics of the predictive control are reserved, the dynamic overshoot of the controlled variable is reduced, the control convergence time is shortened, the dynamic process curve of the controlled variable is more gentle, the system divergence is prevented, the stability of the predictive control is improved, and the static deviation trap is prevented when the control converges. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1 is a schematic diagram of the generalized predictive control method based on the Kalman filter observer in the application.
[0033] Figure 2 is an S-shaped function curve of the Kalman model precision estimation error value Q in the application.
[0034] Figure 3 is a simulation comparison diagram in which the Kalman filter observation value is used to replace the measured value in the application.
[0035] Figure 4 is a closed-loop control logic flowchart in the application. DETAILED DESCRIPTION
[0036] The application will be further described below in conjunction with the drawings. The following examples are only used to more clearly illustrate the technical solutions of the application, and cannot be used to limit the protection scope of the application.
[0037] Figure 1 The generalized predictive control method based on the Kalman filter observer of the application is described, and the specific implementation process is as follows:
[0038] Step one, initialize the Kalman filter model and the predictive control method according to the predictive control model, the initial parameters of the Kalman filter, the initial parameters of the generalized predictive control, and other information;
[0039] Specifically, the step one includes:
[0040] establishing a predictive control model,
[0041] discretizing the predictive control model and initializing related parameters.
[0042] convert the discretized transfer function model into a state space equation, establish a Kalman filter model, and set the measured precision error and the model precision error estimation value of the model. The predictive control model G(s) is a transfer function model, and its structure form is as follows:
[0043]
[0044] wherein Y(s) and U(s) are Laplace transforms of output and input respectively, and i , βi Here, τ represents the model coefficients, and τ represents the pure time delay of the model.
[0045] In predictive control models, the model needs to be discretized. In Generalized Predictive Control (GPC), the Controlled Auto-Regressive Integrated Moving Average (CARIMA) model is used to discretize the predictive control model. Its model form is as follows:
[0046]
[0047]
[0048] Where y(t) is the system output, u(t) is the system input, e(t) is white noise, Δ is the difference factor, and the model vectors A, B, and C are obtained by model discretization.
[0049] At the same time, the relevant parameters of generalized predictive control (GPC) are initialized, including the model prediction step size P, the control step size M, and the modeling time domain N.
[0050] In the Kalman filter observer model, the transfer function model needs to be discretized and transformed into a state-space equation. The expression of the Kalman filter model is as follows:
[0051]
[0052] Where x(k) is the state observation at time k, x(k+1) is the state observation at time k+1, u(k) is the control input at time k, y(k) is the model output at time k, and KA, KB, and KC are state estimation matrices obtained from model transformation. The model transformation involves converting the previous transfer function model into a discrete state-space model.
[0053] Meanwhile, the measured accuracy error estimate R of the Kalman filter observer is set to 1. Thus, whether the Kalman filter output value is biased towards the measured value or the model calculation value can be controlled by adjusting the model accuracy error estimate Q.
[0054] Step 2: Correct the accuracy Q of the Kalman filter reference model based on the predicted value of the controlled variable of the generalized predictive control, the measured controlled variable, and the set value of the controlled variable.
[0055] Since the measured accuracy error estimate R of the Kalman filter observer is set to a fixed value of 1 in step one, the smaller the model accuracy error estimate Q, the closer the filter output is to the model prediction value; conversely, the larger Q is, the closer the filter output is to the measured value. When the difference between the predicted value yy of the generalized predictive control variable and the setpoint SV of the controlled variable is less than the difference between the measured controlled variable PV and the setpoint SV of the controlled variable, it indicates that the prediction is inaccurate and the model accuracy is low; conversely, it indicates that the prediction accuracy is high. Furthermore, considering that the measured value is the control target, the accuracy of Q should not be higher than R, i.e., Q should be greater than 1. Therefore, a sigmoid function is used to correct the Q value, and its calculation is as follows:
[0056]
[0057] Where: Q is the estimated model accuracy error, Q max σ represents the upper limit of the model accuracy error estimate, and σ is the bandwidth parameter. Yy represents the predicted value of the controlled variable in the generalized predictive control, SV represents the setpoint of the controlled variable, and PV represents the measured controlled variable.
[0058] like Figure 2 The figure shows Q about The curve showing the change.
[0059] Step 3: Observe the output of the Kalman filter model based on the control output and the measured controlled variable at the previous moment, and update the Kalman filter model.
[0060] Based on the model accuracy error estimate Q calculated in step two, the control output CV and the measured controlled variable PV from the previous moment are substituted into the Kalman filter observation model.
[0061] First, update the time:
[0062]
[0063] Then update the status:
[0064]
[0065] The final Kalman filter observation output kOut is:
[0066] kOut = KC·x(k+1)
[0067] Where: P(k) is the error correlation matrix, which is the identity matrix of the same order as KA during initialization; x(k+1) and Pk are intermediate variables for calculation; Q is the estimated value of model accuracy error; R is the estimated value of measured accuracy error; and KA, KB, and KC are the state-space model parameters obtained from the transfer function model transformation.
[0068] K(k) represents the Kalman filter gain (weights). CV(k) represents the predicted value of the state at time k+1, CV(k) represents the control output at time k, and P(k+1) represents the Kalman filter mean square error update matrix, i.e., the optimal mean square error at time k+1.
[0069] Step 4: Use the Kalman filter model to observe the output and replace the measured controlled variable to calculate the deviation of predictive control.
[0070] In generalized predictive control (GPC), the control output CV is obtained by inversely solving the reference trajectory of the predicted output value. However, to achieve closed-loop control, feedback correction of the prediction error is introduced. In conventional GPC control, the feedback correction is the difference between the measured output value PV and the model predicted output yy. However, due to the influence of model accuracy and disturbances, especially when the model is severely mismatched, the feedback correction error can fluctuate significantly, easily leading to control oscillations or even divergence. Therefore, in this method, the feedback correction error is calculated by observing the difference between the output value and the model predicted output yy using Kalman filtering, as follows:
[0071] e = kOut - yy
[0072] Where: e is the feedback correction deviation.
[0073] Since the Kalman filter model accuracy error estimate Q is a sigmoid function of PV, SV, and yy, when the model accuracy is high, the filter observer output should be biased towards the measured value SV to eliminate static bias; when the model accuracy is low, the filter observer output should be biased towards the model prediction value yy to avoid excessive feedback correction bias leading to control oscillation or even divergence.
[0074] like Figure 3 The figure shows a comparison of the control effects of a conventional GPC control error feedback correction strategy and a control strategy that uses Kalman filtering to observe the output kOut and replace the measured output value PV.
[0075] It can be seen that the control strategy of using Kalman filter observations to replace measured values can effectively suppress system oscillations when the model is mismatched, shorten the system convergence time, and even when the model mismatch is severe and the conventional GPC control system has diverged, the optimized GPC control strategy of using Kalman filter observations to replace measured values can also make the control system converge and avoid divergence.
[0076] Step 5: Perform generalized predictive control calculations based on the controlled variable setpoint and predictive control deviation to obtain the final control variable and send it to the control equipment for execution.
[0077] First, the control increment Δu is calculated based on the calculated feedback correction deviation e. The Diophantine equation is then solved recursively. When the prediction step size is P, the control step size is M = 1, and the modeling time domain is N, the calculation formula is:
[0078]
[0079] Where: Y n1 Y n0 The recursive vector used for calculation is initialized as a vector of length N; h is the assumed correction vector, initialized as a vector of length N with values between 0 and 1 during calculation; S is the displacement matrix, constructed as an N×N matrix, with the following format:
[0080]
[0081] Y p0 Let be the initial prediction vector for each iteration, initially a vector of length P; pp is the expansion vector, initialized as a P×N matrix, which is the first P rows of an N×N identity matrix, with the following format:
[0082]
[0083] D is the model update matrix, which is an M×P matrix, and its calculation formula is:
[0084]
[0085] Where: Q is the P-order identity matrix; R is the M-order zero matrix; A is the first P-step vector of the model step response vector θ; the model step response vector θ is the step response vector of the output y obtained when a unit step is made on the control quantity u in the control model, and its length is N. p I M Let represent the p-order and M-order identity matrices, respectively.
[0086] W is a setpoint matrix of order P, and its formula is:
[0087] W = SV × I P
[0088] The control increment Δu can be calculated using the above formula, and the control output u(k) at the current moment is:
[0089] u(k)=u(k-1)+Δu
[0090] Based on the control increment Δu, the predicted value for the next period can be updated on a rolling basis, that is:
[0091] Y n1 =Y n0 +θ×Δu
[0092] This allows for the rolling calculation of the control quantity, and u(k) is sent to the actuator as the control quantity CV to achieve predictive control.
[0093] This invention also proposes a generalized predictive controller based on a Kalman filter observer, comprising:
[0094] The initialization module initializes the Kalman filter model and the predictive control model based on the information of the predictive control model, the initial parameters of the Kalman filter, and the initial parameters of the generalized predictive control.
[0095] Model correction module: Corrects the accuracy Q of the Kalman filter reference model based on the predicted value of the controlled variable of the generalized predictive control, the measured controlled variable, and the setpoint of the controlled variable;
[0096] Model update module: Based on the control output and measured controlled variable of the previous moment, observe the output of the Kalman filter model and update the Kalman filter model;
[0097] Deviation calculation module: Calculates the deviation of predictive control by using the Kalman filter model to observe the output and replace the measured controlled variable.
[0098] Output module: Performs generalized predictive control calculations based on the controlled variable setpoint and predictive control deviation to obtain the final control quantity and sends it to the control equipment for execution.
[0099] The overall closed-loop control process is as follows: Figure 4 As shown. The closed-loop control process is as follows: For the current time k, firstly, the control output CV(k-1) at time k-1, as well as the controlled feedback PV(k-1) and setpoint SV(k) at time k are collected. The above measured data are then fed into the Kalman filter observer to calculate the Kalman filter observation output kOut. SV(k)-kOut is then used as the deviation of predictive control for generalized predictive control calculation. Finally, the control quantity CV(k) at time k is obtained and sent to the control device for execution. This process is repeated.
[0100] The applicant of this invention has provided a detailed description of the embodiments of the invention in conjunction with the accompanying drawings. However, those skilled in the art should understand that the above embodiments are merely preferred embodiments of the invention. The detailed description is only intended to help readers better understand the spirit of the invention and is not intended to limit the scope of protection of the invention. On the contrary, any improvements or modifications made based on the inventive spirit of the invention should fall within the scope of protection of the invention.
Claims
1. A generalized predictive control method based on a Kalman filter observer, characterized in that... Includes the following steps: S1: Initialize the Kalman filter model and the predictive control model based on the information of the predictive control model, the initial parameters of the Kalman filter, and the initial parameters of the generalized predictive control. S2: Correct the accuracy Q of the Kalman filter reference model based on the predicted value of the controlled variable of the generalized predictive control, the measured controlled variable, and the set value of the controlled variable; The accuracy Q of the Kalman filter reference model is an sigmoid function of the difference between the predicted value of the generalized predicted controlled variable, the measured controlled variable, and the setpoint of the controlled variable. It has a controllable upper limit for accuracy error and is monotonically increasing. The sigmoid function is used to correct the Q value, and its calculation is as follows: Where: Q is the estimated model accuracy error, Q max σ represents the upper limit of the model accuracy error estimate, σ is the bandwidth parameter, yy represents the predicted value of the controlled variable in the generalized predictive control, SV represents the setpoint of the controlled variable, and PV represents the measured controlled variable. S3: Observe the output of the Kalman filter model based on the control output and the measured controlled variable at the previous moment, and update the Kalman filter model accordingly; S4: Calculate the deviation of predictive control by observing the output of the Kalman filter model instead of the measured controlled variable; S5: Perform generalized predictive control calculations based on the controlled variable setpoint and predictive control deviation to obtain the final control quantity and send it to the control equipment for execution.
2. The generalized predictive control method as described in claim 1, characterized in that: Step S1 includes: S11: Establish a predictive control model; S12: Discretize the predictive control model and initialize the relevant parameters; S13: Convert the discretized transfer function model into a state-space equation, establish a Kalman filter observation model, and set the measured accuracy error estimate of the Kalman filter observer and the accuracy of the Kalman filter reference model.
3. The generalized predictive control method as described in claim 2, characterized in that, The measured accuracy error estimate R of the Kalman filter observer is set to a constant value.
4. The generalized predictive control method as described in claim 3, characterized in that, In step S3, the Kalman filter observer performs filtering observation on the controlled variable at the current moment based on the corrected reference model accuracy error estimate Q, to prevent the Kalman filter observer from falling into the static error trap.
5. The generalized predictive control method as described in claim 4, characterized in that, In step S4, the observed value of the controlled variable obtained by Kalman filtering is used to replace the measured value of the controlled variable, and it is substituted into the deviation calculation of predictive control in order to suppress control fluctuations or even oscillations caused by large deviations between the model prediction value and the measured value when the model is distorted.
6. The generalized predictive control method as described in claim 5, characterized in that: In step S5, when performing generalized predictive control calculations, an incremental control output method is adopted, which makes it easier to limit the rate of change of the control variables.
7. A generalized predictive controller based on a Kalman filter observer, characterized in that, include: The initialization module initializes the Kalman filter model and the predictive control model based on the information of the predictive control model, the initial parameters of the Kalman filter, and the initial parameters of the generalized predictive control. Model Correction Module: This module corrects the accuracy Q of the Kalman filter reference model based on the predicted value of the generalized predictive control variable, the measured controlled variable, and the setpoint of the controlled variable. In this module, the accuracy Q of the Kalman filter reference model is an S-shaped function of the difference between the predicted value of the generalized predictive control variable, the measured controlled variable, and the setpoint of the controlled variable. It has a controllable upper limit for accuracy error and is monotonically increasing. The S-shaped function is used to correct the Q value, and its calculation is as follows: Where: Q is the estimated model accuracy error, Q max σ represents the upper limit of the model accuracy error estimate, σ is the bandwidth parameter, yy represents the predicted value of the controlled variable in the generalized predictive control, SV represents the setpoint of the controlled variable, and PV represents the measured controlled variable. Model update module: Based on the control output and measured controlled variable of the previous moment, observe the output of the Kalman filter model and update the Kalman filter model; Deviation calculation module: Calculates the deviation of predictive control by using the Kalman filter model to observe the output and replace the measured controlled variable. Output module: Performs generalized predictive control calculations based on the controlled variable setpoint and predictive control deviation to obtain the final control quantity and sends it to the control equipment for execution.
8. The generalized predictive controller as described in claim 7, characterized in that, The initialization module establishes a predictive control model, discretizes the predictive control model, initializes the relevant parameters, then converts the discretized transfer function model into a state-space equation, establishes a Kalman filter observation model, and sets the measured accuracy error estimate of the Kalman filter observer and the accuracy of the Kalman filter reference model.
9. The generalized predictive controller as described in claim 8, characterized in that, The measured accuracy error estimate R of the Kalman filter observer is set to a constant value.
10. The generalized predictive controller as described in claim 9, characterized in that, The step model update module uses the corrected reference model accuracy error estimate Q to filter and observe the controlled variable at the current time, preventing the Kalman filter observer from falling into the static error trap.
11. The generalized predictive controller as described in claim 10, characterized in that, The deviation calculation module uses the observed value of the controlled variable obtained by Kalman filtering to replace the measured value of the controlled variable, and substitutes it into the deviation calculation of predictive control, so as to suppress the control fluctuations or even oscillations caused by large deviations between the model prediction value and the measured value when the model is distorted.
12. The generalized predictive controller as described in claim 11, characterized in that: When performing generalized predictive control calculations, the output module adopts an incremental control output method, which makes it easier to limit the rate of change of the control variable.
Citation Information
Patent Citations
Adaptive Kalman filtering algorithm applied to GPS navigation
CN105549049A
Dynamic matrix control method for permanent magnet synchronous motor
CN109412488A