## 3 Dynamic Model and Control
### Air Dynamics Modeling and Ground Dynamics Modeling
\[T_{i}=k_{f}\omega_{i}^{2} \tag{20}\]  
\[T_{tot}=\sum_{i=1}^{4}k_{f}\omega_{i}^{2} \tag{21}\]  
where \(T_{i}\) is the \(i\)th rotor lift, \(k_{f}\) is the lift coefficient, \(\omega_{i}\) is the rotational speed of the \(i\)th rotor. \(T_{tot}\) is the total lift of the robot. The dynamics model of robot is shown in the following equation, ignoring air resistance. \[\left\{ \begin{array}{l}(m+m_{s}+m_{v})\ddot{p}_{w}=R_{b}^{w}T_{tot}-(m+m_{s} +m_{v})g+F_{\text{ext}}\\ I\overset{\bullet}{\omega}=-\omega\times I\omega+M\\ \eta=A\end{array} \right. \tag{22}\]  
where \(A=\left[ \begin{array}{c}\eta_{\theta}\\ -\eta_{\theta}-\theta\end{array} \right]\) and \(d_{2}\sin\eta_{\theta}\) is the relative forward extension of the suction cup. \(m\) is the mass of the body, \(m_{s}\) is the mass of the first joint, and \(m_{v}\) is the mass of second joint. In the actual robot adsorption process, the roll angle is always close to 0 degrees in order to maintain the robot balance. Therefore, \(M\) can be expressed as follows. \[M=\left[ \begin{array}{cccccccc}-lk_{f}&lk_{f}&lk_{f}&-lk_{f}&0&0&0\\ -lk_{f}&-lk_{f}&lk_{f}&lk_{f}&L_{1}&d_{2}\sin\eta_{1}&d_{2}\sin\eta_{1}+d_{1 }\sin(\eta_{1}+\eta_{2})\\ k_{m}&-k_{m}&k_{m}&-k_{m}&0&0&0\end{array} \right]\left[ \begin{array}{c} \omega_{1}^{2}\\ \omega_{2}^{2}\\ \omega_{3}^{2}\\ \omega_{4}^{2}\\ mg\\ m_{s}g\\ m_{v}g\end{array} \right]+\left[ \begin{array}{c}0\\ \tau_{ext}\\ 0\end{array} \right] \tag{23}\]  
where \(k_{m}\) is the drag coefficient. \(\tau_{ext}\) is the moment due to the external force \(F_{ext}\). \(L_{1}\) is the \(y\)-axis moment of the body mass in the body coordinate system. When the suction cup is not in stable contact with the wall, the suction cup makes contact with the wall at small speeds modeled by a spring damping model. \[F_{ext}=\left[ \begin{array}{c}0\\ F_{L}+F_{R}+F_{sc}\\ 0\end{array} \right] \tag{24}\]  
\[\left\{ \begin{array}{c}F_{sc}=\left\{\begin{array}{c}K|\delta|+C\overset{ \bullet}{\delta},\delta<0\\ 0,\delta\geq 0\\ \end{array}\right.\\ \delta=x_{p}-d_{2}\sin\eta_{1}-d_{1}\sin(\eta_{1}+\eta_{2})\end{array} \right. \tag{25}\]  
where \(x_{p}\) is the distance between \(O_{b}\) and the wall, \(K\) is the contact stiffness, and \(C\) is the damping coefficient. The velocity \(v_{0}\) and angular velocity \(w_{0}\) of the ground motion of the robot are shown in the following equation. \[\left\{ \begin{array}{c}v_{0}=\frac{v_{L}+v_{R}}{2}\\ w_{0}=\frac{v_{R}-v_{L}}{2J_{3}}\end{array} \right. \tag{26}\]  
where \(v_{L}\) and \(v_{R}\) are the left and right wheel speeds, respectively. According to Equation (26), we can obtain the position and heading angle in the world coordinate system. \[\left[ \begin{array}{c}\dot{x}_{0}\\ \dot{y}_{0}\\ \dot{\psi}_{0}\end{array} \right]=\left[ \begin{array}{cc}\cos\psi_{0}&0\\ \sin\psi_{0}&0\\ 0&1\end{array} \right]\left[ \begin{array}{c}v_{0}\\ w_{0}\end{array} \right] \tag{27}\]  
where \((x_{0},y_{0})\) is the position of the robot on the ground and \(\psi_{0}\) is the heading angle for the ground motion. Similarly, the dynamics modeling of the ground part can be represented by the Euler-Lagrange equation.