## 3 Flight Controller Design
### Altitude Proportional-Integral-Derivative Controller Design  
Consider the fully-actuated subsystem \(\mathcal{S}_{1}\) shown in (19). Assume that the change rate of disturbance is bounded by  
\[|\dot{d}_{z}|\leq\dot{d}_{z}^{+} \tag{34}\]  
where \(\dot{d}_{z}^{+}>0\) is a known value. Define the tracking errors \(e_{z1}\) and \(e_{z2}\) as  
\[\begin{array}{l}e_{z1}=z-z_{d}\\ e_{z2}=\dot{z}-\dot{z}_{d}\end{array} \tag{35}\]  
The error dynamics is then obtained:  
\[\begin{array}{l}\dot{e}_{z1}=e_{z2}\\ \dot{e}_{z2}=\frac{F\mathrm{c}_{\theta}}{m}-g+\frac{d_{z}}{m}-\dot{z}_{d}\end{array} \tag{36}\]  
Design the proportional-integral-derivative (PID) control law as  
\[F=\frac{m}{\mathrm{c}_{\theta}}u_{z} \tag{37}\]  
where  
\[u_{z}=\dot{z}_{d}-k_{pz}e_{z1}-k_{iz}\int_{0}^{t}\!e_{z1}(\tau)\,d\tau-k_{dz}e _{z2}+g \tag{38}\]  
and the control gain pair \((k_{pz},k_{iz},k_{dz})>0\). Substituting the control law (37) into (36) gives the closed-loop system as  
\[\begin{array}{l}\dot{e}_{z1}=e_{z2}\\ \dot{e}_{z2}=-k_{pz}e_{z1}-k_{iz}\int_{0}^{t}\!e_{z1}(\tau)\,d\tau-k_{dz}e_{z2}+ \frac{d_{z}}{m}\end{array} \tag{39}\]To analyze the stability, define an extended state \(e_{z0}\) as follows:  
\[e_{z0}=\int_{0}^{t}e_{z1}(\tau)\,d\tau-\frac{d_{z}}{mk_{iz}} \tag{40}\]  
Then, the extended closed-loop system (39) can be described by  
\[\dot{\mathbf{e}}_{z}=\mathbf{A}_{z}\mathbf{e}_{z}+\mathbf{v}_{z} \tag{41}\]  
where \(\mathbf{e}_{z}=[e_{z0},e_{z1},e_{z2}]^{T}\) is the augmented error state vector, \(\mathbf{v}_{z}=[-\frac{\dot{d}_{z}}{mk_{iz}},0,0]^{T}\) is the extended disturbance vector, and the closed-loop system matrix is  
\[\mathbf{A}_{z}=\begin{bmatrix}0&1&0\\ 0&0&1\\ -k_{iz}&-k_{pz}&-k_{dz},\end{bmatrix} \tag{42}\]  
respectively.  
Obviously, (41) is the standard form of the general error system described in (21). Therefore, by Theorem 1, the design problem is to choose the control gain pair \((k_{pz},k_{iz},k_{dz})\) properly such that the matrix \(\mathbf{A}_{z}\) is Hurwitz. As a consequence, there exists a Lyapunov function \(V_{z}=\mathbf{e}_{z}^{T}\mathbf{P}_{z}\mathbf{e}_{z}\), where \(\mathbf{P}_{z}=\mathbf{P}_{z}^{T}>0\) and thereby \(\dot{V}_{z}\leq-\lambda_{min}(\mathbf{Q}_{z})\|\mathbf{e}_{z}\|(\|\mathbf{e}_ {z}\|-e_{z})\) is achieved, where \(\mathbf{Q}_{z}=\mathbf{Q}_{z}^{T}>0\) is the feasible solution of (25):  
\[\mathbf{P}_{z}\mathbf{A}_{z}+\mathbf{A}_{z}^{T}\mathbf{P}_{z}+\mathbf{Q}_{z} <\mathbf{0} \tag{43}\]  
Moreover, \(\epsilon_{z}=\frac{2\lambda_{max}(\mathbf{P}_{z})}{\lambda_{min}(\mathbf{Q}_ {z})}\frac{d_{z}^{+}}{mk_{iz}}\) according to (31).  
As a result, the tracking error \(\mathbf{e}_{z}\) will approach a region \(\epsilon_{z}\) eventually, i.e.,  
\[\|\mathbf{e}_{z}\|\rightarrow\epsilon_{z}\quad\text{as}\quad t\rightarrow\infty. \tag{44}\]  
**Remark 1**.: _Note that providing the external disturbance \(d_{z}\) satisfies the slow time-varying condition, i.e., \(d_{z}\to 0\), and it can be deduced from (44) that \(\epsilon\to 0\) and \(\dot{V}_{z}\leq-\lambda_{min}(\mathbf{Q}_{z})\|\mathbf{e}_{z}\|^{2}\), which further implies that the fully-actuated subsystem \(\mathcal{S}_{1}\) is asymptotically stable._