# 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
: Consider the following first-order linear differential equation  
\[\dot{\xi}(t)=-a_{1}\xi(t),t\geq t_{0}\geq 0, \tag{69}\]  
Then the solution of (69) is  
\[\xi(t)=c_{0}e^{-a_{1}(t-t_{0})},t\geq t_{0}\geq 0, \tag{70}\]  
where \(c_{0}=\xi(t_{0})\
eq 0\) is a constant. The system (67) can be written using the augmented state \(\xi\) as  
\[\left\{ \begin{array}{l}\dot{x}_{z}=f(t,x_{z})+\dfrac{A}{c_{0}}\xi,\\ \dot{\xi}=-a_{1}\xi.\end{array} \right. \tag{71}\]  
Now, the following Lyapunov candidate functions is considered  
\[V(t,x_{z},\xi)=V_{0}(t,x_{z})+\dfrac{1}{2}\eta\xi^{2}, \tag{72}\]  
where \(\eta\) is a positive constant. The derivative of \(V\) along the trajectory of (71) is given by  
\[\dot{V}(t,x_{z},\xi) =\dfrac{\partial V_{0}}{\partial t}+\dfrac{\partial V_{0}}{ \partial x_{z}}[f_{z}(t,x_{z})+\dfrac{A}{c_{0}}\xi]-a_{1}\eta\xi^{2}, \tag{73}\] \[=\dfrac{\partial V_{0}}{\partial t}+\dfrac{\partial V_{0}}{ \partial x_{z}}f_{z}(t,x_{z})+\dfrac{1}{c_{0}}\dfrac{\partial V_{0}}{ \partial x_{z}}A\xi-a_{1}\eta\xi^{2},\] \[\leq-c_{3}\|x_{z}\|^{2}+\dfrac{c_{4}}{|c_{0}|}\|x_{z}\|\cdot|\xi |-a_{1}\eta|\xi|^{2},\] \[=-c_{3}\bigg{[}\|x_{z}\|-\dfrac{1}{2}\dfrac{c_{4}}{c_{3}|c_{0}|}| \xi|\bigg{]}^{2}-\left(a_{1}\eta-\dfrac{1}{4}\dfrac{c_{4}^{2}}{c_{3}c_{0}^{2}} \right)|\xi|^{2}.\]  
By denoting  
\[x_{za}=\bigg{[} \begin{array}{c}x_{z}\\ \xi\end{array} \bigg{]}. \tag{74}\]  
and choosing \(\eta\) such that  
\[a_{1}\eta-\dfrac{1}{4}\dfrac{c_{4}^{2}}{c_{3}c_{0}^{2}}>0, \tag{75}\]we have  
\[\dot{V}(t,x_{z},\xi)\leq-c_{5}\|x_{zz}\|^{2}\leq-c_{6}V(t,x_{z},\xi) \tag{76}\]  
where \(c_{5}\) and \(c_{6}\) are a positive constants. It concludes that the origin of the system (67) is globally exponentially stable. Now, we are ready to state the stability of the zero dynamics of (51). **Theorem 1**. : _(stability of zero dynamics): The transfer function \(G_{1}(s)=\dfrac{s^{2}(s+b)+K_{2}k(s+a)}{s^{2}(s+b)+g_{1}k(s+a)}\) is strictly positive real with the appropriately chosen parameters of \(a\), \(b\), and \(k\). Then, the semi-global asymptotic stability can be obtained over the upper-half plane for the equilibrium point of the zero dynamics (51)._  
Proof. : The zero dynamics (51) can be written as  
\[\dot{x}_{z}=f_{z}(t,x_{z})+Ae^{-\alpha(t-t_{0})}, \tag{77}\]  
with  
\[x_{z} = \left[ \begin{array}{c}x_{1}\\ x_{2}\\ x_{3}\end{array} \right]=\left[ \begin{array}{c}\beta\\ \dot{\beta}\\ w\end{array} \right], \tag{78}\] \[f_{z}(t,x_{z}) = \left[ \begin{array}{c}x_{2}\\ (a-b)x_{2}+(ab-a^{2})x_{1}+a^{2}(a-b)w-kH(x_{1},\phi)\tan x_{1}\\ x_{1}-ax_{3}\end{array} \right],\] (79) \[A = \left[ \begin{array}{c}0\\ ka^{2}[z_{\phi}(t_{0})+k^{-1}\beta(t_{0})]\\ 0\end{array} \right]. \tag{80}\]  
According to Lemma 1 and Kalman-Yakubovich-Popov lemma [30], there is a Lyapunov candidate function \(V(x_{z})=\dfrac{1}{2}x_{z}{}^{\mathrm{T}}Px_{z}\) with positive definite matrix \(P\) when \(G_{1}(s)\) is strictly positive real. Along the trajectories of the unforced system \(\dot{x}_{z}=f_{z}(t,x_{z})\), the time derivative of \(V(x_{z})\) is given by  
\[\dot{V}(x_{z})=\dfrac{\partial V}{\partial x_{z}}f_{z}\leq-k_{3}x_{z}^{\mathrm{ T}}Px_{z}, \tag{81}\]  
where \(k_{3}>0\), and for some \(\varepsilon>0\), \(x_{z}\in\Omega=\{x_{z}\in R^{3}\Big{|}|x_{1}|\leq\dfrac{\pi}{2}-\varepsilon\}\). Now, for the forced system (77), with  
\[\lambda_{\min}(P)\|x_{z}\|^{2}\leq V(x_{z})\leq\lambda_{\max}(P)\|x_{z}\|^{2}, \tag{82}\]  
\[\dfrac{\partial V}{\partial x_{z}}f_{z}\leq-k_{3}x_{z}^{\mathrm{T}}Px_{z}, \tag{83}\]  
\[\Big{|}\dfrac{\partial V}{\partial x_{z}}A\Big{|}\leq k_{4}\|x_{z}\|, \tag{84}\]where \(\lambda_{\min}(P)\) and \(\lambda_{\max}(P)\) denote the minimum and maximum eigenvalue of \(P\), respectively, and \(k_{4}>0\). It follows immediately from Lemma 2 that the equilibrium point of the zero dynamics (51) is semi-globally asymptotically stable over \(\Omega{=\left\{x\in R^{3}\middle|\left|x_{1}\right|\leq\frac{\mathcal{T}}{2}- \varepsilon\right\}}\).