# Robust Speed Control of a Multi-Mass System: Analytical Tuning and Sensitivity Analysis
## 3 Development of the Control Algorithm
### Controller Design  
The linear-quadratic (LQ) optimization method is implemented to systematically determine the state's feedback gains [8; 35; 36]. LQ design leads to a more robust controller than the eigenvalue placement gains method [8; 35; 36]. So, the LQ method will be adopted to design the state feedback gains. The main idea of the LQ optimization approach is to minimize a quadratic cost function (7), with \(\mathbf{Q}\) and \(\mathbf{R}\) as the weighting matrices for the state vector (\(\mathbf{x}\)) and the input vector (\(\mathbf{u}\)), respectively. The cost function (\(\mathbf{J}\)) is minimized by the state feedback controller law (8) and subject to the plant system dynamics. This approach, in contrast to the standard pole placement method, leads to a globally optimal solution for the gain matrix (\(\mathbf{K_{LQ}}\)). \(\mathbf{K_{LQ}}\) is determined as in Equation (9), which also depends on the solution (\(\mathbf{P}\)) of the Riccati Equation (10). A state control loop can easily be implemented with a well-designed system model. Then, the feedback of all state variables creates a  
Figure 4: Poles of the system plant. multi-loop control loop [8]. Practically speaking, designing a good-performing SS controller will be challenging if not all the necessary system state variables are measurable, which is a pervasive issue in industrial applications [7; 11; 13]. Unfortunately, direct feedback from each state variable is often unfeasible since measuring every mechanical variable would be difficult, excessively costly, or reduce the system's reliability. Hence, advanced estimators of these variables are necessary [18; 19; 37]. Therefore, estimating the nonmeasurable variables with estimation algorithms, such as the Luenberger observer, neural network, or Kalman filters [35; 36], becomes indispensable to solving the problem of nonmeasurable state variables [18; 19; 37]. In many research studies, Luenberger observers were employed to estimate nonmeasurable state variables. If the system is linear with nonvariant parameters and moderate measurement noises, then the states can be accurately estimated [19]. \[J=\int_{0}^{\infty}\left(x^{T}Qx+u^{T}Ru\right)dt \tag{7}\]  
\[u=-K_{LQ}x \tag{8}\]  
\[K_{LQ}=R^{-1}B_{M}^{T}P \tag{9}\]  
\[A^{T}P+PA-PB_{M}R^{-1}B_{M}^{T}P+Q=0 \tag{10}\]  
The Luenberger observer gain matrix (\(L_{LQ}\)) is attained by the pole placement method. In order to obtain a high estimation quality, the desired poles are determined from the eigenvalues of the closed-loop characteristics matrix (11) of the full-state feedback controller, and the same method is utilized [11]. Then, the dynamics of the estimated state variables vector (\(\dot{x}\)) are determined by Equation (12). By comparing the actual measured output (\(y\)) with the estimated output (\(\dot{y}\)), \(\dot{x}\) is corrected until it matches the actual state variables vector (\(x\)). Therefore, the observer's error dynamics (\(e\)) are given in Equation (13)  
\[\left(A_{cl}\right)_{LQ}= \begin{bmatrix}A-B_{M}K_{LQ}&B_{M}\\ C&0\end{bmatrix}  \tag{11}\]  
\[\dot{\dot{x}}=A\dot{x}+B_{M}u+L_{LQ}(y-\dot{y}) \tag{12}\]  
\[\dot{e}=\dot{x}-\dot{\dot{x}}=\big{(}A-L_{LQ}C\big{)}e. \tag{13}\]  
So far, the regulator is designed to handle the transient state. However, the steady-state error needs to be handled. Unlike the other control methods, \(LQ\) feedbacks all the states multiplied with the designed \(K_{LQ}\), and then compares the final result with the reference signal. A precompensation gain (\(F\)) is added to the reference signal as an adjustment. The gain \(F\) is determined using Equation (14) [8; 35; 36]. \[F=\Big{(}C\big{(}-A+BK_{LQ}\big{)}^{-1}B\Big{)}^{-1} \tag{14}\]  
We obtain the full \(LQ\) controller by assembling the full-state controller with the linear part of the state estimator. Lastly, the obtained closed-loop system is described in Equation (15) [8; 35]  
\[\dot{\dot{x}}=(A-L_{LQ}C-B_{M}K_{LQ})\dot{x}+\big{[}FB_{M}L_{LQ}\big{]} \begin{bmatrix} y_{d}\\ y\end{bmatrix} u=-K_{LQ}\dot{x}+Fy_{d}.