# Hybrid Model Predictive Control of Semiactive Suspension in Electric Vehicle with Hub-Motor
## 4 HM-EV Semiactive Suspension Kalman Filter Design  
In the hybrid model predictive controller design, we assumed that all state variables were measurable, but, in reality, not all state variables are measurable. Some noise and interference is inevitable in the input and output measurement data of the system. It is then necessary to reconstruct the system using a state observer and correct the state and output values of the reconstructed system by the error between the measured output and the observer output, so that the state and output values of the observer approximate the real state and output of the system. The equation of state for a multivariate linear system in a stochastic environment, as described by the Kalman filter, is as follows:  
\[\left\{ \begin{array}{c}x(k+1)=Ax(k)+Bu(k)+G\omega(k)\\ y(k)=Cx(k)+Du(k)+F\omega(k)+v(k)\end{array} \right. \tag{36}\]  
\(\omega,v\) are a white process noise and measurement noise, which are subjected to a multivariate Gaussian distribution and are independent of each other, as follows:  
\[\left\{ \begin{array}{c}p(\omega)\sim N(0,Q)\\ p(v)\sim N(0,R)\end{array} \right. \tag{37}\]  
where \(Q\) is the process noise covariance matrix and \(R\) is the measurement noise covariance matrix. The principle of Kalman filtering is to use the Kalman gain to correct the state prediction so that it approximates the actual value. The state variable can be estimated by the following equation:  
\[\hat{x}(k+1)=A\hat{x}(k)+Bu(k)+L(k)(y\left(k\right)-C\hat{x}(k)-Du(k)) \tag{38}\]  
where the optimal observer gain \(L\) can be calculated by the discrete Riccati equation. \[\left\{ \begin{array}{c}L(k)=(AP(k)C^{T}+\overline{N})\left(CP(k)C^{T}+ \overline{R}\right)^{-1}\\ M(k)=P(k)C^{T}\left(CP(k)C^{T}+\overline{R}\right)^{-1}\\ Z(k)=(I-M(k)C)P(k)(I-M(k)C)^{T}+M(k)\overline{R}M^{T}(k)\\ P(k+1)=\left(A-\overline{N}\overline{R}^{-1}C\right)Z(k)(A-\overline{N} \overline{R}^{-1}C)^{T}+\overline{Q}-N\overline{R}^{-1}N^{T}\\ \overline{Q}=GQG^{T}\\ \overline{R}=R+FN+N^{T}F^{T}+FQF^{T}\\ \overline{N}=G\left(QF^{T}+N\right)\end{array} \right. \tag{39}\]  
The Kalman filter minimizes the state estimation error covariance by solving the discrete algebraic Riccati equation to obtain the optimal gain matrix _L(k)_. For an HM-EV semiactive suspension system, the measurable outputs are the acceleration of vertical vibration of the sprung mass and the suspension dynamic deflection. Thus, using these two measurable via the Kalman filter to estimate the state of the entire system. Under the disturbance of white noise, the observer results under C-class road excitation are shown in the figure below. As shown in Figures 7-16, for each state variable, the difference between the estimated and actual values of the Kalman filter is very small under different noise disturbances and can meet the control requirements. Figure 8: Observed results of vertical velocity of stator and residual unsprung mass. (**a**) Comparison of observed and actual values. (**b**) Relative error between observed and actual values. Figure 7: Observed results of vertical velocity of the sprung mass. (**a**) Comparison of observed and actual values. (**b**) Relative error between observed and actual values. Figure 11: Observed results of tire deflection. (**a**) Comparison of observed and actual values. (**b**) Relative error between observed and actual values. Figure 12: Observed results of vertical velocity of the sprung mass. (**a**) Comparison of observed and actual values. (**b**) Relative error between observed and actual values. Figure 10: Observed results of motor stator eccentricity. (**a**) Comparison of observed and actual values. (**b**) Relative error between observed and actual values. Figure 14: Observed results of vertical velocity of rotor, rim and tire. (**a**) Comparison of observed and actual values. (**b**) Relative error between observed and actual values. Figure 13: Observed results of vertical velocity of stator and residual unsprung mass. (**a**) Comparison of observed and actual values.