## 4 Optimal Control Modeling for the UAV-UGV Formation-Maintenance Controller
### Optimal Formation-Maintenance Controller Design
#### 4.2.1 PI Optimal Formation-Maintenance Controller Design  
The perturbed system of type shown in Equation (14), with constant or slowly varying values, can be overcome using a PI type of control, similar to that in classical control theory. This section analyzes the problem of designing PI optimal controllers with zero values as the output regulation set points. First, the system perturbation is transformed into a perturbation of the control input, at which point, system (14) becomes  
\[\hat{\mathbf{X}}=\mathbf{AX}+\mathbf{B}(\mathbf{U}+\mathbf{\tilde{W}}) \tag{19}\]  
where \(\mathbf{\tilde{W}}\) denotes the transformed form of the original system perturbation. The following equation can be obtained from system (14):  
\[\mathbf{\tilde{W}}=\mathbf{B}^{-1}\mathbf{\tilde{B}}\mathbf{W} \tag{20}\]  
Next, we design the PI optimal controller of the perturbed system (19), which can be augmented as  
\[\left\{ \begin{array}{l}\mathbf{X}_{1}=\mathbf{A}_{1}\mathbf{X}_{1}+\mathbf{B}_{1}\mathbf{U}_{1} \\ \mathbf{Y}_{1}=\mathbf{C}_{1}\mathbf{X}_{1}\end{array} \right. \tag{21}\]  
where  
\[\mathbf{X}_{1}=\left[ \begin{array}{c}\mathbf{X}\\ \mathbf{U}+\mathbf{\tilde{W}}\end{array} \right] \tag{22}\]  
\[\mathbf{A}_{1}=\left[ \begin{array}{c}\mathbf{A}&\mathbf{B}\\ \mathbf{0}&\mathbf{0}\end{array} \right] \tag{23}\]  
\[\mathbf{B}_{1}=\left[ \begin{array}{c}\mathbf{0}\\ \mathbf{I}\end{array} \right] \tag{24}\]  
\[\mathbf{C}_{1}=\left[ \begin{array}{c}\mathbf{I}&\mathbf{0}\end{array} \right] \tag{25}\]  
For the augmented system (21), the quadratic performance index is given as  
\[J=\int_{t_{0}}^{t_{f}}\Big{[}\mathbf{X}_{1}^{T}\mathbf{Q}_{1}\mathbf{X}_{1}+\mathbf{U}_{1}^{T} \mathbf{R}_{1}\mathbf{U}_{1}\Big{]}dt \tag{26}\]  
where \(\mathbf{Q}_{1}\) is the state-regulation power-coefficient matrix of the augmented system and \(\mathbf{R}_{1}\) is the control energy power coefficient matrix of the augmented system. When the system (21) is controllable, according to optimal control theory, the minimum optimal control to achieve the quadratic performance index (26) is  
\[\mathbf{U}_{1}^{*}=-\mathbf{R}_{1}^{-1}\mathbf{B}_{1}^{T}\mathbf{P}\mathbf{X}_{1} \tag{27}\]  
Let us further analyze the quadratic performance index (26). Based on the composition of the state variable \(\mathbf{X}_{1}\), \(\mathbf{Q}_{1}\) can be decomposed as follows:  
\[\mathbf{Q}_{1}=\left[ \begin{array}{cc}\mathbf{Q}&\mathbf{0}\\ \mathbf{0}&\mathbf{R}\end{array} \right] \tag{28}\]  
Then, we can have  
\[\mathbf{X}_{1}^{T}\mathbf{Q}_{1}\mathbf{X}_{1}=\mathbf{X}^{T}\mathbf{Q}\mathbf{X}+(\mathbf{U}+\mathbf{\tilde{W }})^{T}\mathbf{R}(\mathbf{U}+\mathbf{\tilde{W}}) \tag{29}\]  
where \(\mathbf{Q}\) is the state-regulation power-coefficient matrix of the original system (14) and \(\mathbf{R}\) is its control energy power coefficient matrix. According to system (14), we can have  
\[\mathbf{X}^{T}\mathbf{Q}\mathbf{X}=\mathbf{X}^{T}\mathbf{C}^{T}\mathbf{Q}_{Y}\mathbf{C}\mathbf{X}=\mathbf{Y}^{T} \mathbf{Q}_{Y}\mathbf{Y} \tag{30}\]where \(\mathbf{Q}_{Y}\) is the output regulation power-coefficient matrix of the original system. The optimal quadratic state-regulation performance index described in Equation (26) becomes the optimal quadratic output-regulation problem.