# Adaptive Super-Twisting Control for Mobile Wheeled Inverted Pendulum Systems
## 2 Modeling of MWIP System
In the following, \(\left(\hat{\cdot}\right)\) denotes the nominal value of \(\left(\cdot\right)\). \(\Delta M(q),\Delta N(q,\dot{q}),\Delta O(\dot{q})\) serve as the bias parts to denote the model uncertainties, and all the model uncertainties and external disturbances are assumed to lump into a single disturbance vector \(\tau_{d}^{*}\). \[\hat{M}\left(q\right)\ddot{q}+\hat{N}\left(q,\dot{q}\right)+\hat{O}\left(q \right)=\tau+\tau_{d}^{*}, \tag{3}\]  
where  
\[\left\{ \begin{array}{l}\hat{M}\left(q\right)=M\left(q\right)-\Delta M\left(q \right)\\ \hat{N}\left(q,q\right)=N\left(q,q\right)-\Delta N\left(q,q\right)\\ \hat{O}\left(\dot{q}\right)=O\left(\dot{q}\right)-\Delta O\left(\dot{q}\right) \\ \tau_{d}^{*}=\left[\tau_{d1}^{*}\quad\tau_{d2}^{*}\quad\tau_{d3}^{*}\right]^{T} \\ \tau_{ext}-\Delta M\left(q\right)\dot{q}-\Delta N\left(q,\dot{q}\right)-\Delta O \left(\dot{q}\right).\end{array} \right. \tag{4}\]To facilitate the design of the controller, we multiply both sides of this equation with the inverse of \(\hat{M}\left(q\right)\) and rewrite Equation (3) as follows. \[\left[ \begin{array}{c}\dot{q}_{1}\\ \ddot{q}_{2}\\ \ddot{q}_{3}\end{array} \right]= F+G\left[ \begin{array}{c}u_{A}\\ u_{B}\end{array} \right]+\tau_{d}, \tag{5}\]  
where  
\[F=\left[ \begin{array}{c}f_{1}\\ f_{2}\\ f_{3}\end{array} \right],G=\left[ \begin{array}{cc}g_{1}&0\\ g_{2}&0\\ 0&g_{3}\end{array} \right],\]  
\[\left\{ \begin{array}{l}\tau_{d1}=\Delta_{1}^{-1}\left\{\hat{m}_{22}\tau_{d1}^ {*}-\hat{m}_{12}\cos\left(q_{2}\right)\tau_{d2}^{*}\right\}\\ \tau_{d2}=\Delta_{1}^{-1}\left\{\hat{m}_{11}\tau_{d2}^{*}-\hat{m}_{12}\cos \left(q_{2}\right)\tau_{d1}^{*}\right\}\\ \tau_{d3}=\Delta_{2}^{-1}\tau_{d3}^{*},\end{array} \right.\]  
\[\left\{ \begin{array}{l}f_{1}=\Delta_{1}^{-1}\left\{\hat{m}_{12}\hat{m}_{22} \sin\left(q_{2}\right)\left(q_{2}^{2}+q_{3}^{2}\right)\right.\\ \left.-\hat{m}_{12}\hat{I}_{bl}\sin\left(q_{2}\right)\cos^{2}\left(q_{2}\right) q_{3}^{2}\right.\\ \left.-\hat{m}_{12}\hat{G}_{b}\sin\left(q_{2}\right)\cos\left(q_{2}\right) \right.\\ \left.+2\left(\hat{m}_{22}+\hat{m}_{12}\cos\left(q_{2}\right)\right)\hat{D}_{ b}\left(q_{2}-q_{1}\right)-2\hat{m}_{22}\hat{D}_{w}q_{1}\right\}\\ g_{1}=\Delta_{1}^{-1}\left\{\hat{m}_{22}+\hat{m}_{12}\cos\left(q_{2}\right)\right\} \\ f_{2}=\Delta_{1}^{-1}\left\{\hat{m}_{11}\hat{I}_{bl}\sin\left(q_{2}\right) \cos\left(q_{2}\right)q_{3}^{2}+\hat{m}_{11}\hat{G}_{b}\sin\left(q_{2}\right) \right.\\ \left.-\hat{m}_{12}^{2}\sin\left(q_{2}\right)\cos\left(q_{2}\right)\left(q_{2} ^{2}+q_{3}^{2}\right)\right.\\ \left.-2\left(\hat{m}_{11}+\hat{m}_{12}\cos\left(q_{2}\right)\right)\hat{D}_{ b}\left(q_{2}-\hat{q}_{1}\right)\\ \left.+2\hat{m}_{12}\cos\left(q_{2}\right)\hat{D}_{w}q_{1}\right\}\\ g_{2}=\Delta_{1}^{-1}\left\{-\hat{m}_{11}-\hat{m}_{12}\cos\left(q_{2}\right) \right\}\\ f_{3}=\Delta_{2}^{-1}\left\{-2\hat{I}_{bl}\sin\left(q_{2}\right)\cos\left(q_{2} \right)q_{2}q_{3}-\hat{m}_{12}\sin\left(q_{2}\right)\hat{q}_{1}q_{3}\right.\\ \left.-\frac{2\hat{b}^{2}}{\hat{r}^{2}}\left(\hat{D}_{b}+\hat{D}_{w}\right)q_{3 }\right\}\\ g_{3}=\Delta_{2}^{-1}\frac{\hat{b}}{\hat{r}}\\ \Delta_{1}=\hat{m}_{11}\hat{m}_{22}-\hat{m}_{12}^{2}\cos^{2}\left(q_{2}\right) \\ \Delta_{2}=\hat{m}_{33}+\hat{I}_{bl}\sin^{2}\left(q_{2}\right)\\ u_{A}=u_{r}+u_{l}\\ u_{B}=u_{r}-u_{l}.\end{array} \right.\]  
In addition, we give the following hypothesis about the lumped disturbances. **Assumption 1**. : _The disturbances \(\tau_{d1},\tau_{d2},\tau_{d3}\) are bounded._  
\[\left\|\tau_{d}\right\|\leq\mu, \tag{6}\]  
_where \(\mu\) is a positive number to represent the bounds of the disturbances._