# Hybrid Particle Swarm Optimization Genetic LQR Controller for Active Suspension
## 3 Controller Design  
### LQR Controller Design  
The linear quadratic regulator (LQR) control strategy takes the objective function as the object [32; 33]. Generally, the suspension dynamic deflection and vertical acceleration of the sprung mass are used to evaluate the performance of ride comfort; the tire dynamic load is usually used to evaluate the performance of the vehicle handling stability. Therefore, the LQR control objective function can be expressed as  
\[J=\int_{0}^{\infty}[q_{1}\dot{x}_{s}(t)+q_{2}(x_{s}(t)-x_{u}(t))^{2}+q_{3}(k_{t }(x_{g}(t)-x_{u}(t)))^{2}+q_{4}u(t)^{2}]dt \tag{6}\]  
where \(q_{1}\), \(q_{2}\), \(q_{3}\), and \(q_{4}\) represent the weight coefficients of the LQR control objective function. According to the traditional empirical method, it can be determined that \(q_{1}=1\), \(q_{2}=5000\), and \(q_{3}=500\). As active force is not involved in performance indicators, \(q_{4}=0\).  
When rewriting the objective function, a linear quadratic regulator matrix form is shown as  
\[J=\int_{0}^{\infty}[Y^{T}QY+U^{T}RU]dt \tag{7}\]  
where \(Q=diag\big{[}q_{1}\quad q_{2}\quad q_{3}\big{]}\) is the weight matrix of the stable variable; \(R=[q_{4}]\) is the weight matrix of the control variable.  
Then, bringing \(Y=CX+DU\) into the equation of the linear quadratic regulator matrix form yields:  
\[J=\int_{0}^{\infty}[X^{T}Q_{d}X+2X^{T}N_{d}U+U^{T}R_{d}U]dt \tag{8}\]  
where \(Q_{d}=C^{T}QC=\left[\begin{array}{cccc}q_{1}k_{s}^{2}/m_{s}^{2}+q_{2}&q_{1} k_{s}c_{s}/m_{s}^{2}&0&-q_{1}k_{s}c_{s}/m_{s}^{2}\\ q_{1}k_{s}c_{s}/m_{s}^{2}&q_{1}c_{s}^{2}/m_{s}^{2}&0&-q_{1}c_{s}^{2}/m_{s}^{2} \\ 0&0&q_{3}k_{s}^{2}&0\\ -q_{1}k_{s}c_{s}/m_{s}^{2}&-q_{1}c_{s}^{2}/m_{s}^{2}&0&q_{1}c_{s}^{2}/m_{s}^{2} \end{array}\right]\), \([R_{d}=q_{4}+q_{1}/m_{s}{}^{2}]\), \([N_{d}=C^{T}QD=\left[\begin{array}{cccc}-q_{1}k_{s}/m_{s}^{2}&-q_{1}c_{s}/m_{s }^{2}&0&q_{1}c_{s}/m_{s}^{2}\end{array}\right]^{T}\).  
Therefore, Equation (8) can be expressed as (9).  
\[J=\int_{0}^{\infty}\Big{[}X^{T}Q_{d}X+U^{T}R_{d}U\Big{]}dt \tag{9}\]  
In the LQR controller design, the control law can be expressed as (10).  
\[U=-KX \tag{10}\]  
where \(K=R_{d}{}^{-1}B^{T}P\) is the output feedback gain matrix. Moreover, \(P\) can be obtained by solving the Riccati equation.  
\[PA+A^{T}P-PBR_{d}{}^{-1}B^{T}P+Q_{d}=0 \tag{11}\]  
Let \(u=-(k_{1}(x_{s}(t)-x_{u}(t))+k_{2}x_{s}(t)+k_{3}(q(t)-x_{u}(t))+k_{4}x_{u}(t))\). \(k_{1}\), \(k_{2}\), \(k_{3}\), and \(k_{4}\) are the coefficients of the control load equation.  
According to (5), the state space form of the quarter car active suspension with LQR is shown as (12).  
\[\begin{array}{l}\dot{X}(t)=A_{1}X(t)+B_{1}W(t)\\ Y(t)=C_{1}X(t)\end{array} \tag{12}\]\[\text{where}\;\;A_{1}\;=\;\left[\begin{array}{cccc}0&1&0&-1\\ \frac{-k_{x}-k_{1}}{m_{a}}&\frac{-c_{s}-k_{2}}{m_{a}}&\frac{-k_{3}}{m_{a}}&\frac {c_{s}-k_{4}}{m_{a}}\\ 0&0&0&-1\\ \frac{k_{x}+k_{1}}{m_{a}}&\frac{c_{s}+k_{2}}{m_{a}}&\frac{k_{3}+k_{1}}{m_{a}}& \frac{-c_{s}+k_{4}}{m_{a}}\\ \end{array}\right]C_{1}\;=\;\left[\begin{array}{cccc}\frac{-k_{x}-k_{1}}{m_{a }}&\frac{-k_{2}}{m_{a}}&\frac{-k_{3}}{m_{a}}&\frac{-k_{4}}{m_{a}}\\ 1&0&0&0\\ 0&0&k_{t}&0\\ \end{array}\right]\]