# Robust Speed Control of a Multi-Mass System: Analytical Tuning and Sensitivity Analysis
## 3 Development of the Control Algorithm
### Controller Design
\tag{15}\]  
The block diagram representation of the complete system's transfer function (16) is illustrated in Figure 5. \(G(s)\) is the state-space system's transfer function, and the transfer function from the manipulated variable \(M_{M}\) to the output \(y\) is given in Equation (17). The regulator transfer function \(R(s)\) comprises the state's feedback controller and observer. \[G(s)=\frac{Y(s)}{M_{M}(s)}=C(sI-A)^{-1}B_{M}\;G_{\Delta} \tag{16}\]  
The closed-loop poles of the LQ-controlled system in Figure 5 cannot be specified directly. According to Equations (9), which also depends on the solution (\(\mathbf{P}\)) of the Riccati Equation (10), if the weighting matrices \(\mathbf{Q}\) and \(R\) are chosen to be diagonal matrices, each feedback gain in \(\mathbf{K_{LQ}}\) could be tuned for its corresponding state variable without affecting the feedback gains for the other state variables [8,11]. The tuning of the \(\mathbf{Q}\) and \(R\) is performed iteratively, and the results are shown in Equation (17). The criteria of tuning were minimizing the following: first, the difference between the estimated values of \((\theta_{M}-\theta_{W})\) and \((\theta_{W}-\theta_{Sx})\), which is crucial in reducing the fluctuations and vibration in the system [11]; second, the steady-state error of \(y\)[8,11]; and third, the controller effort by minimizing the manipulated variable \(M_{M}\), which decreases the stress on the mechanical parts and, at the same time, prevents overloading the electrical components [11,22,23]. With \(Q\) and \(R\), \(\mathbf{K_{LQ}}\) and \(\mathbf{L_{LQ}}\) are determined as in Equation (18). The value of precompensation gain \(F\) is equal to 277. Figure 6 presents upgrading the \(LQ\)-controlled system, shown in Figure 5, to the \(LQ\) with an integral action (\(LQI\))-controlled system. The \(LQI\) controller design is achieved according to [8,10,20]. First, the plant should be redefined with an extended form to include the integral action. After that, feedback should be considered in the controller structure to regulate the output variable through the integrator. Then, all the \(LQ\) design theories are applied to \(LQI\). \[\mathbf{Q}= \begin{bmatrix}1\times 10^{8}&0&0&0&0\\ 0&1&0&0&0\\ 0&0&5\times 10^{6}&0&0\\ 0&0&0&1&0\\ 0&0&0&0&1\times 10^{7}\end{bmatrix} ,R=1500 \tag{17}\]  
\[\mathbf{K_{LQ}}= \begin{bmatrix}250.75&-1211.20&12.07&612.79&14.07\end{bmatrix} , \;\mathbf{L_{LQ}}= \begin{bmatrix}401.65\\ 0.01\\ 97.35\\ -0.08\\ 3.38\end{bmatrix}  \tag{18}\]  
Figure 5: Block diagram of the plant system and the full-state controller. The first step in the design procedure is to define the error between the measured output and desired output and desired signal as a new state variable (\(\hat{\xi}\)) so that the extended system with the integrator becomes as in Equation (19). \[ \begin{gathered}\hat{\xi}=y-y_{d}\\ \mathbf{u}=-\mathbf{K}_{\mathbf{x}}x-K_{\xi}\xi-Fy_{d}\\ \begin{bmatrix}\dot{x}\\ \dot{\xi}\end{bmatrix}=\begin{bmatrix}A&0\\ C&0\end{bmatrix}\begin{bmatrix}x\\ \dot{\xi}\end{bmatrix}+\begin{bmatrix}B\\ 0\end{bmatrix}\mathbf{u}+\begin{bmatrix}0\\ -1\end{bmatrix}y_{d}\\ y=\begin{bmatrix}C&0\end{bmatrix}\begin{bmatrix}x\\ \dot{\xi}\end{bmatrix}\end{gathered}  \tag{19}\]  
It was found that using the same tuned values of the weighting matrices \(\mathbf{Q}\) and \(R\) in weighting matrices of \(LQI\), which are \(\mathbf{Q}_{i}\) and \(R_{i}\), will lead to equivalent robustness and control effort to \(LQ\). Of course, an additional tuning effort is made for the last \(\mathbf{Q}_{i}\) parameter related to the new state variable (\(\hat{\xi}\)). In addition, the tuning was made with the aim of both \(LQ\) and \(LQI\) having analogous closed-loop poles so that a reasonable comparison between them could be made. The tuned \(\mathbf{Q}_{i}\) and \(R_{i}\) are provided in Equation (20). The gain matrix for \(LQI\) (\(\mathbf{K}_{LQI}\)) and its observer gain matrix (\(\mathbf{L}_{LQI}\)) are determined similarly for \(\mathbf{K}_{LQ}\) and \(\mathbf{L}_{LQ}\).