# Balance Control of a Configurable Inverted Pendulum on an Omni-Directional Wheeled Mobile Robot
## 2 Mathematical Modeling
### Model of an Omni-Directional Wheeled Mobile Robot  
Here is a mathematical model derived for an omni-directional wheeled mobile robot using [PERSON]'s laws [24]. This mobile robot consists of a rigid circular chassis and three omni-directional wheels labeled 1, 2, and 3. The wheels were arranged at an equal distance from the center of the robot chassis and equally spaced at 120\({}^{\circ}\). All wheels are assumed to roll without slip. Figure 2 illustrates the basic features of an omni-directional wheeled mobile robot from the top view. Figure 2: The omni-directional wheeled mobile robot from the top view. The system variables and parameters are defined as below:  
\[\hat{O}_{W},\hat{X}_{W},\hat{Y}_{W} : \text{world coordinate system.}\] \[\hat{O}_{M},\hat{X}_{M},\hat{Y}_{M} : \text{body coordinate system with the origin attached to the center of mass}\] \[\text{of the mobile robot, and the }\hat{Y}_{M}\text{-axis is aligned to wheel 1.}\] \[M_{t} : \text{mass of the mobile robot with the pendulum.}\] \[f_{1},f_{2},f_{3} : \text{reaction force applied by the ground to the omni-directional wheel,}\] \[L_{c} : \text{radius of the mobile robot.}\] \[R_{w} : \text{radius of the omni-directional wheels.}\] \[\delta_{c} : \text{angle between wheel 2 and the }\hat{X}_{M}\text{-axis of the mobile coordinate system; the value is fixed to 30\lx@math@degree.}\] \[I_{czz} : \text{the mobile robot's moment of inertia about the }\hat{Z}_{M}\text{-axis.}\] \[\hat{O}_{W},\hat{X}_{W},\hat{Y}_{W} : \text{world coordinate system.}\]0 \[\hat{O}_{W},\hat{X}_{W},\hat{Y}_{W} : \text{world coordinate system.}\]1 \[\hat{O}_{W},\hat{X}_{W},\hat{Y}_{W} : \text{world coordinate system.}\]2 \[\hat{O}_{W},\hat{X}_{W},\hat{Y}_{W} : \text{world coordinate system.}\]3  
The dynamic and kinematic equations of the omni-directional wheeled mobile robot are given by  
\[\left[ \begin{array}{c}\dot{x}_{W}\\ \dot{y}_{W}\\ \dot{\phi}\end{array} \right]=\left[ \begin{array}{ccc}M_{t}&0&0\\ 0&M_{t}&0\\ 0&0&I_{y}\end{array} \right]\left[ \begin{array}{ccc}\cos\phi&-\sin\phi&0\\ \sin\phi&\cos\phi&0\\ 0&0&1\end{array} \right]\left[ \begin{array}{ccc}1&-\frac{1}{2}&-\frac{1}{2} \\ 0&\frac{\sqrt{3}}{2}&-\frac{\sqrt{3}}{2}\\ L_{c}&L_{c}&L_{c}\end{array} \right]\left[ \begin{array}{c}f_{1}\\ f_{2}\\ f_{3}\end{array} \right] \tag{1}\]  
\[\left[ \begin{array}{c}\dot{\theta}_{1}\\ \dot{\theta}_{2}\\ \dot{\theta}_{3}\end{array} \right]=\left[ \begin{array}{c}\omega_{1}\\ \omega_{2}\\ \omega_{3}\end{array} \right]=\frac{1}{R_{w}}\left[ \begin{array}{ccc}1&0&L_{ c}\\ -\frac{1}{2}&\frac{\sqrt{3}}{2}&L_{c}\\ -\frac{1}{2}&-\frac{\sqrt{3}}{2}&L_{c}\end{array} \right]\left[ \begin{array}[] {ccc}\cos\phi&\sin\phi&0\\ -\sin\phi&\cos\phi&0\\ 0&0&1\end{array} \right]\left[ \begin{array}{c}\dot{x}_{W}\\ \dot{y}_{W}\\ \dot{\phi}\end{array} \right] \tag{2}\]  
Because the electrical time constant of a motor is usually far less than the mechanical time constant, the relationship between the motor torque \(\tau_{m}\) and control voltage \(u\) is hence based on the reduced-order model of a DC motor and is given blow  
\[\tau_{m}=\frac{K_{t}}{R_{a}}u-\frac{K_{t}^{2}}{R_{a}}\omega_{m}, \tag{3}\]  
where \(R_{a}\) is the armature resistance, \(K_{t}\) is the motor torque constant, \(u\) is the control voltage and \(\omega_{m}\) is the angular velocity of the motor. These unmodeled dynamics of the motor can then be considered as the matched uncertainty [16; 17] in the control design. The relationship between the motor torque and the wheel force \(f\) acting on the robot is given by  
\[f=\frac{1}{R_{w}}\tau_{m}. \tag{4}\]  
The three motors used in this mobile robot are assumed to be identical. Therefore, combining (3) and (4), the relationship between \(f\), \(u\), and \(\omega\) of three motors are given by  
\[\left[ \begin{array}{c}f_{1}\\ f_{2}\\ f_{3}\end{array} \right]=\frac{nK_{t}}{R_{w}R_{a}}\left[ \begin{array}{c}u_{1} \\ u_{2}\\ u_{3}\end{array} \right]-\frac{n^{2}K_{t}{}^{2}}{R_{w}R_{a}}\left[ \begin{array}[] {c}\omega_{1}\\ \omega_{2}\\ \omega_{3}\end{array}