## 3 State-Constrained Sub-Optimal Tracking Controller
### State-Constrained Sub-Optimal Tracking Controller  
The steady-state values of (27) and (28) are  
\[0=\mathbf{P}_{s}\mathbf{A}_{z}+\mathbf{A}_{z}{}^{T}\mathbf{P}_{s}-\mathbf{P}_ {s}\mathbf{B}\mathbf{R}_{\tau}{}^{-1}\mathbf{B}^{T}\mathbf{P}_{s}+\mathbf{Q}_{2}, \tag{35}\]  
\[\mathbf{g}_{s}=-\Big{(}\mathbf{A}_{c}{}^{T}\Big{)}{}^{-1}\mathbf{C}_{y}{}^{T} \mathbf{Q}\mathbf{r}+\Big{(}\mathbf{A}_{c}{}^{T}\Big{)}{}^{-1}\left[\begin{array} []{c}\mathbf{C}_{h}{}^{T}\mathbf{Q}_{x}-\mathbf{P}_{s}\mathbf{B}\mathbf{R}_{ \tau}{}^{-1}\mathbf{B}_{d}{}^{T}\mathbf{C}_{h}{}^{T}\mathbf{Q}_{\tau}\\ +\mathbf{A}_{d}{}^{T}\mathbf{C}_{h}{}^{T}\mathbf{Q}_{\tau}\Big{(}\mathbf{I}- \mathbf{C}_{h}\mathbf{B}_{d}\mathbf{R}_{\tau}{}^{-1}\mathbf{B}_{d}{}^{T}\mathbf{C }_{h}{}^{T}\mathbf{Q}_{\tau}\Big{)}\end{array}\right]\mathbf{w}, \tag{36}\]  
where  
\[\mathbf{A}_{c}=\mathbf{A}_{z}-\mathbf{B}\mathbf{R}_{\tau}{}^{-1}\mathbf{B}^{T} \mathbf{P}_{s}. \tag{37}\]Substituting (26) into (25) yields  
\[\mathbf{u}=-\Big{(}\mathbf{R_{\tau}}^{-1}\mathbf{B}^{T}\mathbf{P}_{s}+\mathbf{R_{ \tau}}^{-1}\mathbf{B_{d}}^{T}\mathbf{C_{\mathit{h}}}^{T}\mathbf{Q}_{\tau}\mathbf{ C_{\mathit{h}}}\mathbf{A}_{d}\Big{)}\mathbf{x}+\mathbf{R_{\tau}}^{-1}\mathbf{B}^{T} \mathbf{g}_{s}-\mathbf{R_{\tau}}^{-1}\mathbf{B_{d}}^{T}\mathbf{C_{\mathit{h}}}^ {T}\mathbf{Q}_{\tau}\mathbf{w}. \tag{38}\]  
Notably, (38) becomes the steady-state LQT controller [7,8] that uses steady-state values of (5) and (6) if \(\mathbf{Q}_{x}\) and \(\mathbf{Q}_{\tau}\) are null matrices.  
The sub-optimal controller is implemented by calculating (35)-(38), but \(\boldsymbol{\alpha}_{\tau}\) is needed in these calculations. Since \(\boldsymbol{\alpha}_{x}\) indicates current violations of the state constraints and \(\boldsymbol{\alpha}_{\tau}\) indicates possible violations of the state constraints that occur in a moment, \(\boldsymbol{\alpha}_{\tau}\) can be identified approximately by the following procedure:  
1. Identify \(\boldsymbol{\alpha}_{x}\) using current state values and calculate \(\mathbf{Q}_{x}=\text{diag}\Big{(}\boldsymbol{\alpha}_{x}^{T}\Big{)}\).
2. Calculate (24) and (35) using an algebraic Riccati equation solver with \(\mathbf{Q}_{\tau}=0\).
3. Calculate (36)-(38) using the result of step 2 and applying \(\mathbf{Q}_{\tau}=0\).
4. Calculate (9) using the result of step 3.
5. Identify \(\boldsymbol{\alpha}_{\tau}\) using the result of step 4.  
Since \(\boldsymbol{\alpha}_{x}\) has limited values (zero or a fixed value for each element), offline calculation results for lower computational loads can be used in step 2. The sub-optimal controller requires the following procedure in addition to the above procedure.  
6. Calculate \(\mathbf{Q}_{\tau}=\text{diag}\Big{(}\boldsymbol{\alpha}_{\tau}^{T}\Big{)}\) using the result of step 5.
7. Calculate (24) and (35) using an algebraic Riccati equation solver with the result of step 6.
8. Calculate (36)-(38) using the result of step 7.  
Since \(\boldsymbol{\alpha}_{\tau}\) also has limited values, step 7 can be performed offline. The main advantage of this procedure is that the total computation time of the procedure is limited to a fixed upper boundary. In the case of offline calculations of steps 2 and 7, it is obvious that the total computation load of the proposed controller is lower than that of the implicit MPC.