# Balance Control of a Configurable Inverted Pendulum on an Omni-Directional Wheeled Mobile Robot
## 3 Using Second-Order Sliding Mode Control to Design the Stabilizing Controllers
### Controller Design for a Rotary Inverted Pendulum
For \(|\beta|\leq\frac{\mathcal{T}}{2}-\varepsilon\), the nonlinearity \(\psi(t,y_{z})\) lies in the sector of \([g_{1},\,K_{2}]\) with \(g_{1}\ll K_{2}<\infty\) and \(g_{1}=\frac{g}{R_{c}}\). Denote \(G_{0}(s)\) to be the transfer function from \(u_{z}\) to \(y_{z}\). Here  
\[G_{0}(s)=\frac{k(s+a)}{s^{2}(s+b)}. \tag{58}\]  
The following lemma is based on the circular criterion [28]. **Lemma 1**. : _The system (55)-(57) is asymptotically stable for \(x_{z}\in\left\{x_{z}\in R^{3}\Big{|}|x_{1}|\leq\frac{\mathcal{T}}{2}-\varepsilon\right\}\), if \(\frac{1+K_{2}G_{0}(s)}{1+g_{1}G_{0}(s)}\) is strictly positive real._  
**Remark 1**: _Let_  
\[ \begin{split} G_{1}(s)&=\frac{1+K_{2}G_{0}(s)}{1+g_{1} G_{0}(s)},\\ &=\frac{s^{2}(s+b)+K_{2}k(s+a)}{s^{2}(s+b)+g_{1}k(s+a)}.\end{split}  \tag{59}\]  
_A sufficient condition of \(a\), \(b\), and \(k\) for having \(G_{1}(s)\) be strictly positive real is given below. For transfer function \(G_{1}(s)\) to be strictly positive real, \(G_{1}(s)\) is analytic in \(\mathbb{R}_{\rm e}[s]\geq 0\) and \(\mathbb{R}_{\rm e}[G_{1}(j\omega)]>0\) for all \(\omega\in R\). Based on the Routh-Hurwitz criterion [29], we have_  
\[\left\{ \begin{array}{l}k>0,\\ b>a>0,\end{array} \right. \tag{60}\]  
_to guarantee \(G_{1}(s)\) to be Hurwitz stable, i.e., analytic in \(\mathbb{R}_{\rm e}[s]\geq 0\). Now consider_  
\[ \begin{split}\mathbb{R}_{\rm e}[G_{1}(j\omega)]&=\mathbb{R }_{\rm e}\bigg{[}\frac{(-b\omega^{2}+K_{2}ka)+j\omega(-\omega^{2}+K_{2}k)}{(- b\omega^{2}+g_{1}ka)+j\omega(-\omega^{2}+g_{1}k)}\bigg{]},\\ &=\frac{(-b\omega^{2}+K_{2}ka)(-b\omega^{2}+g_{1}ka)+\omega^{2}(- \omega^{2}+K_{2}k)(-\omega^{2}+g_{1}k)}{(-b\omega^{2}+g_{1}ka)^{2}+\omega^{2} (-\omega^{2}+g_{1}k)^{2}}.\end{split}  \tag{61}\]  
_Denote the denominator of (61) to be_  
\[\Delta_{G_{1}}(\omega)=(-b\omega^{2}+g_{1}ka)^{2}+\omega^{2}(-\omega^{2}+g_{1 }k)^{2}. \tag{62}\]  
_Then, we have_  
\[R_{\epsilon}[G_{1}(j\omega)]=\frac{\omega^{6}+[b^{2}-k(K_{2}+g_{1})]\omega^{4 }+[K_{2}g_{1}k^{2}-bka(K_{2}+g_{1})]\omega^{2}+K_{2}g_{1}k^{2}a^{2}}{\Delta_{ G_{1}}(\omega)}. \tag{63}\]  
_If_  
\[\left\{ \begin{array}{l}b^{2}{>}k(K_{2}+g_{1}),\\ K_{2}g_{1}k^{2}>bka(K_{2}+g_{1}),\end{array} \right. \tag{64}\]  
_it gives that \(R_{\epsilon}[G_{1}(j\omega)]>0\) for all \(\omega\in R\). By simply choosing_  
\[\left\{ \begin{array}{l}k=K_{2}+g_{1},\\ b>K_{2}+g_{1},\\ ab<K_{2}g_{1},\end{array} \right. \tag{65}\]  
_it follows that inequalities of (64) are satisfied such that \(R_{\epsilon}[G_{1}(j\omega)]>0\) for all \(\omega\in R\). From (60) and (65), it follows that \(G_{1}(s)\) is strictly positive real if_  
\[\left\{ \begin{array}{l}b>a>0,\\ k=K_{2}+g_{1},\\ b>K_{2}+g_{1},\\ ab<K_{2}g_{1},\end{array} \right. \tag{66}\]  
_The condition (66) shows that for given \(K_{2}>g_{1}>0\) there always exist \(a\), \(b\), and \(k\) such that \(G_{1}(s)\) is strictly positive real._  
_Consider the following system_  
\[\dot{x}_{z}=f_{z}(t,x_{z})+Ae^{-a_{1}(t-t_{0})}, \tag{67}\]_where \(x_{z}\in R^{n}\), \(f:R_{+}\times R^{n}\to R^{n}\) is a sufficiently smooth vector field and \(f_{z}(t,0)=0\) for \(t>t_{0}\geq 0\), \(A\) is an \(n\times 1\) matrix, \(a_{1}>0\) and \(t>t_{0}\geq 0\)._  
**Lemma 2**. : _Consider the system as defined in (67) and assume a continuously differentiable function \(V_{0}(t,x_{z}):R^{+}\times R^{n}\to R\) exists which satisfy_  
\[\left\{ \begin{array}{l}c_{1}\|x_{z}\|^{2}\leq V_{0}(t,x_{z})\leq c_{2}\|x_{ z}\|^{2},\\ \dfrac{\partial V_{0}}{\partial t}+\dfrac{\partial V_{0}}{\partial x_{z}}f_{ z}(t,x_{z})\leq-c_{3}\|x_{z}\|^{2},\\ \left|\dfrac{\partial V_{0}}{\partial x_{z}}A\right|\leq c_{4}\|x_{z}\|, \end{array} \right. \tag{68}\]  
_where \(c_{1}\), \(c_{2}\), \(c_{3}\), and \(c_{4}\) are some positive constants. Then, the globally exponential stability at the origin of the system (67) is obtained._  
Proof.