# Robust Control for a Slung-Mass Quadcopter Under Abrupt Velocity Changes
## 2 System Modeling and Robust Control Design
### Longitudinal Robust Control Design (\(x,\theta\))  
After a finite time from (2a):  
\[(M+m)\ddot{x}=-ml(\cos\alpha\dot{\alpha}-\sin\alpha\dot{\alpha}^{2})+g(M+m)tan \theta+d_{1} \tag{14}\]  
Proposing the following robust torque control for the attitude  
\[\tau=-k_{\tau}sign(\dot{\theta}-(\theta-\theta_{d})) \tag{15}\]  
where \(k_{\tau}>|d_{3}|\). After a finite time and from (2d) \(\theta\) converges to \(\theta_{d}\).  
By choosing \(\theta_{d}=\frac{1}{g}\tan^{-1}\theta_{1}\) where \(\theta_{1}\) is defined latter, then  
\[(M+m)\ddot{x}=-ml(\cos\alpha\ddot{\alpha}-\sin\alpha\dot{\alpha}^{2})+(M+m) \theta_{1}+d_{1} \tag{16}\]  
where \(\theta_{1}\) is the virtual control input of \(x\) dynamics. Considering the following hypothesis 2: \(|\cos\alpha\ddot{\alpha}-\sin\alpha\dot{\alpha}^{2}|+|d_{1}|<\Gamma_{2}\), and \(\Gamma_{2}>0\). The following expression \(S_{x}\) is proposed:  
\[S_{x}=(\dot{x}-\dot{x}_{d})+(x-x_{d}) \tag{17}\]  
Then, the \(S_{x}\) derivative is obtained as follows:  
\[\dot{S}_{x} =\ddot{x}-\ddot{x}_{d}+\dot{x}-\dot{x}_{d} \tag{18}\] \[=\frac{1}{M+m}(-ml(\cos\alpha\ddot{\alpha}-\sin\alpha\dot{\alpha} ^{2}+d_{1}))+\theta_{1}-\dot{x}_{d}+\dot{x}-\dot{x}_{d}\]  
Let us propose the following positive function:  
\[V_{x}=\frac{1}{2}S_{x}^{2} \tag{19}\]and its derivative is obtained as follows:  
\[\dot{V}_{x}=S_{x}\dot{S}_{x}=S_{x}(\frac{1}{M+m}(-ml(\cos\alpha\dot{\alpha}-\sin \alpha\dot{\alpha}^{2}))+\theta_{1}-\ddot{x}_{d}+\dot{x}-\dot{x}_{d}) \tag{20}\]  
The proposed attitude control algorithm is given by  
\[\theta_{1}=-k_{x}sign(S_{x})+\ddot{x}_{d}+\dot{x}-\dot{x}_{d}+d_{1} \tag{21}\]  
then  
\[\dot{V}_{x}\leq\frac{1}{M+m}(\Gamma_{2}-k_{x}sign(S_{x})) \tag{22}\]  
where \(k_{x}>\Gamma_{2}\), then  
\[\dot{V}_{x}\leq-\frac{k_{x}}{M+m}|S_{x}|\leq 0 \tag{23}\]  
after a finite time \(S_{x}\to 0\).  
The longitudinal error is defined as follows:  
\[e=x-x_{d},\quad\dot{e}=\dot{x}-\dot{x}_{d} \tag{24}\]  
then, \(S_{x}=\dot{e}+e=0\) so \(e\to 0\) exponentially. Define the desired longitudinal position as follows:  
\[\begin{split} x_{d}&=\int\alpha dt+at\\ \dot{x}_{d}&=\alpha+a\\ \dot{x}_{d}&=\dot{\alpha}\end{split} \tag{25}\]  
where \(a\) is the constant velocity desired displacement. From the above it follows that  
\[\ddot{e}=\ddot{x}-\dot{\alpha} \tag{26}\]  
Therefore, introducing (16) and (21) into (26)  
\[\begin{split}\ddot{e}&=-\frac{ml(\cos\alpha\dot{ \alpha}-\sin\alpha\dot{\alpha}^{2})}{M+m}-k_{x}sign(S_{x})+\ddot{x}_{d}-\dot{x }+\dot{x}_{d}-\dot{\alpha}\\ \ddot{e}+\dot{e}&\leq\frac{\Gamma_{2}}{M+m}-k_{x} sign(\dot{e}+e)\end{split} \tag{27}\]  
Finally, after a certain time \(\ddot{e}\to 0\) hence \(\ddot{x}\to\dot{\alpha}\).  
So that after a time \(t_{1}>t\), from Equation (2c) and applying the sliding mode control then \(z\)-dynamics converges, so \(z\to z_{d}\), \(\dot{z}\) and \(\ddot{z}\) converges to zero in finite time.  
\[ml^{2}\ddot{\alpha}=-ml\cos\alpha\dot{\alpha}-mlg\sin\alpha \tag{28}\]  
\(\alpha\) angle is bounded by the mechanical constraints to \(-\frac{\pi}{4}<\alpha<\frac{\pi}{4}\).  
Proposing the following positive function:  
\[V_{\alpha}=\frac{1}{2}\dot{\alpha}^{2}+\frac{\ddot{g}}{l}(1-cos\alpha)\geq 0 \tag{29}\]  
Then, using (2c)  
\[\dot{V}_{\alpha}=-\frac{1}{l}\dot{\alpha}^{2}cos\alpha\leq 0 \tag{30}\]  
According with the [PERSON]'s theorem \(\dot{V}=0\) then \(\dot{\alpha}\cos\alpha=0\). From (2c), \(mgl\sin\alpha=0\), then \(\alpha=0\) so the origin is asymptotically stable.  
When the \(\alpha\) angle is small the \(\alpha\)--dynamics becomes  
\[\ddot{\alpha}=-\frac{1}{l}\dot{\alpha}-\frac{g}{l}\alpha \tag{31}\]  
which is a stable dynamic for \(\alpha\) angle and converges to zero asymptotically.