Open access peer-reviewed chapter - ONLINE FIRST

Hierarchical Sliding Mode Control for a 2D Ballbot That Is a Class of Second-Order Underactuated System

By Dinh Ba Pham, Soon-Geul Lee, Thi Hang Bui and Tien Phat Truong

Submitted: October 4th 2021Reviewed: December 1st 2021Published: January 13th 2022

DOI: 10.5772/intechopen.101855

Downloaded: 4


2D Ballbot is an actual under-actuated system with second-order nonholonomic velocity constraints and input coupling case where only control input is employed to control two outputs of the system. Controlling such a system is not easy because it faces many changelings including nonlinearities, external disturbances, and uncertainties. This study proposed a robust control system for a Ballbot mobile robot. The proposed control scheme is constructed using the hierarchical sliding mode control technique. The kinematics and dynamics of the Ballbot are derived. A Lyapunov function is used to prove the stability of the closed-loop control system. The stabilizing and transferring problems are investigated through several simulations and experiments by using the actual Ballbot platform.


  • sliding mode control
  • Ballbot
  • under-actuated system
  • Lyapunov analysis
  • stabilizing and transferring

1. Introduction

Ballbot has a body that balances on a single spherical wheel (ball). The robot uses a drive mechanism consisting of three omnidirectional wheels (OWs) for a ball [1] to ensure both stabilizing and transferring. The Ballbot can free travel in any direction on plat plane, even if the robot is crowded with people in a common human-coexisting environment.

An inherent property of the Ballbot system is a naturally nonlinear underactuated multi-input multi-output system, in which the number of the control input signal is less than the number of output signals. This property introduces the challenge related to Ballbot control design. Several control designs were accomplished using a simplified model (linear model) to overcome the complexities of the mathematical equations. The linear model is the first way to deal with the complexity of the mathematical equation of the Ballbot system. Reference [2] designed a control system based on a state feedback controller to control stabilizing and transferring. The experimental results showed the ability to stabilize and travel with loads in any direction. However, it can be led only to small external disturbances. Studies in [3, 4] employed a double-loop linear control system to stabilize a Ballbot. Their control system had two controllers: a PI inner-loop controller and a linear quadratic regulator (LQR) outer-loop controller. Kantor et al. [5] proposed a double-loop control system. Both inner-loop and outer-loop controllers were PID controllers. Sukvichai and Parnichkun [6] used a linear controller based on an LQR control scheme for a double-level Ballbot.

The second way to deal with the complexity of the mathematical equation of the Ballbot system is to use nonlinear and intelligent controls such as partial feedback linearization control (FLC), sliding mode control (SMC), or fuzzy control. Lotfiani et al. [7] employed an SMC controller along fuzzy trajectory planning to control a Ballbot to track the desired trajectory. Moreover, a collocated PFL method [8] was introduced for a Ballbot. The open-loop trajectory generation with the collocated PFL controller was simulated which showed a low position error.

Some researchers have studied intelligent control techniques. Reference [9] suggested an intelligent tracking control system combined with a dual Mamdani-type fuzzy control strategy and supervisory control technique for an omnidirectional spherical mobile platform. The experiment results showed the position tracking response of the robot. A fuzzy wavelet cerebellar-model-articulation controller [10] was proposed for a team of multiple Ballbots.

SMC is a well-known and robust nonlinear control scheme. To enhance robustness for both actuated [11] and under-actuated [12, 13, 14, 15, 16, 17, 18, 19] systems, several controllers have been employed the SMC control method. The application of SMC for Ballbot control can be found in several previous studies. Ching-Wen et al. [20] introduced a hierarchical SMC based on backstepping to control stabilizing and agile trajectory tracking of a Ballbot with exogenous disturbance. Reference [21] enhanced Ching-Wen’s backstepping SMC using interval type 2 fuzzy neural networks for motion control of a Ballbot with a four-motor inverse mouse ball-diving mechanism. However, these studies only presented numerical simulations.

As mentioned, the Ballbot is naturally an under-actuated system in which the number of the control inputs is less than the number of the outputs. The Ballbot system is nonlinear. Moreover, the control design problem also faces uncertainties, un-modeling, and disturbances. Thus, the SMC control scheme is a suitable approach for the Ballbot system.

In this study, we designed a robust controller to control a Ballbot. The proposed control scheme is a basis of the hierarchical SMC technique to execute two main tasks including stabilizing the body on the top of the ball and maneuvering the ball on the floor.


2. System model

2.1 Kinematic model

The general kinematics of the Ballbot is a relationship between ϕ̇k=φ̇xφ̇yφ̇zT, the angular velocity of the ball relative to the body frame, and ψ̇i(i=1,2,3), the angular velocities of the three OWs relative to the reference frame of the body. The kinematics relationship of dual-row OWs was discussed in [22]. For the Ballbot, the three OWs, a kind of single-row OW, are mounted on the body of the robot. The driving axes are separated by 120° in the x-yplane and each driving axis is sloped downward by α.

The main assumptions for simplification of the system are:

  1. Body and floor are absolute solids.

  2. No slippage occurs on the surfaces of the ball-floor and the ball-OW.

  3. The points of contact of the ball-ground and the OWs-ball are points of contact.

The non-slip condition of the surface of the ball-OWs is met by requiring that the projection of velocities of the ball at all contact points in the actuation direction of the OW be the same and expressed mathematically as


where Piis the position vector from the center of the ball to the contact point ibetween the ball and the ith OW in the body frame as indicated in Figure 1, uwiis the vector of direction cosines of the ith OW contact point velocities in the actuation directions, and rwis the radius of the OW.

Figure 1.

Sketch of decomposed angular velocities of three OWs and a ball.

Therefore, the angular velocities of the OWs are expressed as


As shown in Figure 1, the position vector of the contact point Pican be defined by


Furthermore, the direction cosine vectors that provide the corresponding direction of the speed at the contact point between the OWs and the ball are defined by


Substituting (3a), (3b), (4a) and (4b) into (2) yields


where Jαis the Jacobian matrix of the system


The Jacobian matrix (6) represents the effect of the zenith angle on the motion relationship between the ball and three single-row OWs.

2.2 Dynamic model

Figure 2 presents the planar model of the Ballbot. The system of the Ballbot is modeled as a rigid cuboid on top of a ball to get a simple calculation of the system parameters. The ball mass mkand OW mass mware considered as point masses concentrated at their centers. marepresents the equivalent mass of all components including the body, drive mechanism, and other parts. Chosen generalized coordinates of the Ballbot system include xkt, ykt, θxt, and θyt, here, xkt, yktdenote the position of the, θxt, and θytare the orientation of the body around the x- and y-axes. The control input is the resultant moment of the three actuators, whose xand yterms are τxand τy.

Figure 2.

Planar model of the main driving system of the Ballbot.

The Ballbot system dynamics are described by obtaining the kinetic and potential of the ball, body, and OWs. For the ball,


where rkis the ball radius and Ikis the ball momentum inertia.

The OWs are attached to the body of the Ballbot. Thus, only the rotational motion of the OWs has to be calculated, that is,


where rwis the radius of each OW, αrepresents the zenith angle, and Iwindicates the momentum inertia of each OW.

For the body,


where Ixis the body momentum inertia around the x-axis, lrepresents the distance from the ball center to the body mass center, and gdenotes the gravitational acceleration.

In the y-zplane, the generalized coordinates of the Ballbot system are defined as qx=ykθxTand the friction vector


where byand brxare the viscous damping coefficients that model the ball-floor friction and ball-body friction in the y-zplane, respectively.

The Lagrangian function Lxis expressed as


The Euler-Lagrange equation that describes the motion of the Ballbot is


From (12), the dynamic equations on the y-zplane are expressed as follows:


where a1=mk+Ikxrk2+ma+3Iwcos2α2rw2, a2=mal2+3Iwrk2cos2α2rw2+Ix, a3=mal, a4=3Iwcos2α2rw2rk, a5=magl, Ikrefers to the ball momentum inertia, Iwis the OW momentum inertia, Ixdenotes the body momentum inertia about the x-axis, byand brxare the viscous damping coefficients.

Then, (13) and (14) can be rewritten as follows:


where Fx1qxq̇x=Ax1a3cosθxa4a5sinθxbrxθ̇xa2a3θ̇x2sinθx+byẏk,


In the x-zplane, the mathematical equations describe the Ballbot system dynamics as follows:


where b1=mk+Ikrk2+3Iwcos2α2rw2+ma, b2=3Iwrk2cos2α2rw2+mal2+Iy, b3=3Iwcos2α2rw2rk, b4=mal, b5=magl, Iyrepresents the body momentum inertia about the y-axis, bxand bryare the viscous damping coefficients.

In the x-zplane, minimal coordinates of the Ballbot system denotes qy=xkθyT, then (17) and (18), are rewritten as follows:


where Fy1qyq̇y=Ay1b2b4sinθyθ̇y2bxẋk+b3b4cosθyb5sinθybryθ̇y,


3. Control system design

3.1 Hierarchical sliding mode control design

It can be assumed that all state variables are measurable. To design this controller in the y-zplane, first we introduce a suitable pair of SMSs


where cx1and cx2are positive constants, ex1and ex2are tracking errors


where ykd=constdenotes the desired position of the ball and θxdis the desired tilt angle about the x-axis of the body.

When the Ballbot balances, it means that the desired tilt angle θxd=0. Then, (21) can be rewritten as


Let ṡx1=0and ṡx2=0, the equivalent control laws of the two subsystems can be gotten as


The hierarchical SMC law is deduced as follows. The first layer SMS is defined as Sx1=sx1. For the first layer SMS, the SMC law and the Lyapunov function are defined as




where τxsw1is the switch control part of the first layer SMC. Differentiate Vx1twith respect to time t




where kx1and ηx1are positive constants.

The first layer SMC law can be deduced from Eqs. (26) and (27), that is,


The second layer SMS is constructed based on the first layer SMS S1and s2, as shown in Figure 3.

Figure 3.

Structure of hierarchical sliding mode surfaces.


where αxis the sliding mode parameter.

For the second layer SMS, the SMC law and the Lyapunov function are defined as




where τxsw2is the switch control part of the second layer SMC.

Differentiating Vx2twith respect to time tyields




where kx2and ηx2are positive constants.

The total control law of the presented hierarchical SMC can be deduced as follows:


Similarly, the total control law of the hierarchical SMC in the x-zplane also given as


3.2 Stability analysis

Theorem 1: If considering the total control law (36) and the SMSs (23) and (31) for the system dynamics (15) and (16), then SMSs, Sx1and Sx2are asymptotically stable.

Proof: Integrating both sides (34) with respect to time obtains




It can be found that


Therefore, it can be achieved that


By using Barbalat’s lemma [23], we can obtain that if tthen ηx2Sx2+kx2Sx220. Then, limtSx2=0.

By applying Barbalat’s lemma, we can getlimtSx2=0.

Thus, both Sx1and Sx2are asymptotically stable.

Theorem 2: If considering the control law (36) and the SMSs of (23) for the system dynamics (15) and (16), then SMSs, sx1and sx2, are also asymptotically stable.

Proof: From Theorem 1, the SMS of the ball subsystem dynamics is asymptotically stable.

Now, we will prove that the SMS of the body subsystem dynamics is asymptotically stable. Limiting of both sides of (31) obtains


The result of (41) shows limtsx2=limtSx2=0. It demonstrates that the SMS of the body subsystem dynamics is asymptotically stable. Thus, the all SMSs of the subsystems are asymptotically stable.

Theorem 3: If considering total control law (36) and the SMSs (23) for the system dynamics (15) and (16), assuming that all the state variables are equivalent infinitesimal, then the parameter boundary of the SMS is 0<cx1<limx0Fx1qxq̇xẏkand 0<cx2<limx0Fx2qxq̇xθ̇x, where x=qxq̇x.

Proof: By solving sxi=0, the lower boundary of cxican be obtained


The eigenvalue of (42) should be negative for meeting the system stability. Thus, the lower boundary of cxiis cxi>0.

The upper boundary of cxican be gotten from ṡxi=0




Further, it can be got


When the state of the subsystem keeps sliding on its SMS and converges to the neighborhood of the control objective, the system can be treated as an autonomous one. Thus, τxeqi=0and the following inequation is gotten 0<cx1<limx0Fx1qxq̇xẏkand 0<cx2<limx0Fx2qxq̇xθ̇x.

The block diagram of the control system is shown in Figure 4. With the real motor torques τ1, τ2, and τ3as functions of the equivalent torques about the x- and y-axes, τxand τy, in matrix form, yield [24].

Figure 4.

Block diagram of the control system.


The corresponding simulation and experiment results will be given in the subsequent sections.


4. Simulation result

A numerical simulation investigates the stabilize, robustness, and transfer of the proposed controller for the Ballbot. The decoupled dynamics (15) and (16), and (19) and (20) with the proposed control schemes (36) and (37) are modeled in Matlab/Simulink real-time environment with ODE45 and a sampling time of 0.01 seconds.

The parameters of the Ballbot for both simulation and experiment are shown in Table 1. For the numerical simulation, the control parameters are tuned by the trial-and-error method and then selected as in Table 1.

System parametersControl gains
ma=116kg, Ix=16.25kgm2, Iy=15.85kgm2, rw=0.1m, l=0.23m, Iw=0.26kgm2, rk=0.19m, mk=11.4kg, Ik=0.165kgm2, bx=by=5Ns/m, brx=bry=3.68Nms/rad, α=56°.cx1=0.01, cx2=35, αx=0.05, ηx2=0.1, kx2=10; cy1=0.01, cy2=17, αy=0.05, ηy2=0.1, ky2=10

Table 1.

System parameters and control gains.

Various simulations are conducted by considering the stabilizing controls with an initial nonzero tilt angle and with external disturbances and tracking control.

4.1 Stabilizing control with nonzero initial tilt angles

In this simulation, the tilt angles about x- and y-axes are initialized as 6.3° and −6.5°, respectively for checking the behavior. Simulation results are shown in Figure 5. The tilt angles responses and the angular velocities are depicted in Figure 5(a) and (b), respectively. The position of the ball is shown in Figure 5(c). Figure 5(d) shows the curves of the control inputs.

Figure 5.

Simulation results of stabilizing while station-keeping. (a) Tilt angles of the body. (b) Angular velocities of the body. (c) Trajectory of the contact point between the ball and the floor. (d) Control inputs.

These numerical results demonstrate that the proposed robust controller enables to maintain stabilizing of the Ballbot.

4.2 Stabilizing control with external disturbances

In the second simulation, the stabilizing control of the Ballbot is investigated under an external disturbance. An external force of 300 N is applied to the Ballbot system at the sixth second while the Ballbot is stabilizing on the floor. As the results, the body tilt angles and angular tilt angles are depicted in Figure 6(a) and (b), respectively. Under the external disturbance, The Ballbot cannot maintain its original position of xkyk=00. Instead, the robot has traveled to a new position of xkyk=7.4cm3.1cmas shown in Figure 6(c). The control inputs by the proposed control are converged to zeros after 2 seconds, as depicted in Figure 6(d).

Figure 6.

Simulation results of robustness control. (a) Tilt angles of the body. (b) Angular velocities of the body. (c) Trajectory of the contact point between the ball and floor. (d) Control inputs.

4.3 Tracking control

In the third simulation, the Ballbot is commanded to track a rectangular trajectory with a dimension of 75 cm × 90 cm in 40 s. The system responses of the tilt angles of the body are shown in Figure 7(b). As indicated in Figure 7(a), the proposed control system performs well in tracking desired rectangular trajectory.

Figure 7.

Simulation results of tracking a rectangular path. (a) Trajectory of the contact point between the ball and floor. (b) Tilt angles of the body.


5. Experiment result

In this section, several experiments on the actual Ballbot platform (Figure 8) are implemented to further verify the performance of the proposed control system. Especially, experiment for the robustness of the controller is executed under external disturbances.

Figure 8.

The real Ballbot that is running. (a) Schematic design. (b) Without the cover. (c) Ballbot running. (d) Ballbot running.

The robot control algorithm is programmed with multithread tasks so that the control period is set to 15 ms. The program also consists of the torque conversion and kinematic model [1] to estimate the position and velocity of the ball.

An inertial measurement unit (IMU) is utilized to measure the orientation and angular rates of the Ballbot. The IMU includes an accelerometer and a gyro sensor. Three encoders with a resolution of 4000 counts/rev are also utilized to obtain the position of the ball. Full state variables of the Ballbot system can be obtained based on the kinematics and the sensor fusion.

The drive mechanism is equipped with brushless DC actuators with a continuous torque of 0.28 Nm and gearboxes with a ratio of 1:4 for driving the ball. Two 48 V lithium battery packs supply power for the actuators and other devices with a working time of several hours.

5.1 Stabilizing control with an initial nonzero tilt angle

This experiment investigates the stabilizing performance of the proposed hierarchical SMC with an actual Ballbot on the flat floor.

The initial position of the Ballbot is set as the origin point and the robot is set at 6.3° in roll angle and − 6.5° in pitch angle. The stabilizing responses of the control system are shown in Figure 9. The tilt angles of the body are presented in Figure 9(a) in which the steady-state is 1.5 seconds and the steady-state errors of the roll and pitch are 0.4° and 0.5°, respectively. While the angular rates of the body are shown in Figure 9(b). The proposed control system successfully controls the movement of the ball from an origin point to the new point of (xk, yk) = (−14 cm, 2 cm) as shown in Figure 9(c). The control input of the proposed control scheme is shown in Figure 9(d).

Figure 9.

Experiment results of stabilizing and station-keeping. (a) Tilt angles of the body. (b) Angular velocities of the body. (c) Trajectory of the contact point between the ball and floor. (d) Control inputs.

5.2 Stabilizing control under an external disturbance

The robustness performance of the proposed hierarchical SMC is evaluated by applying the external disturbances to the robot. The experimental scenario is set as: at the beginning, the robot is stabilizing at the origin position. Then the Ballbot is kicked. The amount of the kick is about 300 N.

The tilt angles and angular rate of the body are shown in Figure 10(a) and (b). Figure 10(c) shows the ball response along the x- and y-axes. Under the kick, the robot moves from the origin position of (xk, yk) = (0, 0) to the new position of (xk, yk) = (−0.92 cm, 1.65 cm) and then stabilizes at the new position. Torque control input responses are also shown in Figure 10(d) to keep the stabilizing of the Ballbot.

Figure 10.

Experiment results of robustness control performance. (a) Tilt angles of the body. (b) Angular velocities of the body. (c) Trajectory of the contact point between the ball and floor. (d) Control inputs.

5.3 Tracking control

In this experiment, the Ballbot is commanded to track the desired rectangular trajectory with a dimension of 75 cm × 90 cm within 40 seconds. The system response is presented in Figure 11. Figure 11(a) shows the trajectory of the ball on the floor. There is some error while the robot tries to track the rectangular desired trajectory. The position error occurs due to uncertainties, an un-modeling system.

Figure 11.

Experimental results of tracking a rectangular path. (a) Trajectory of the contact point between the ball and floor. (b) Tilt angles of the body.

The results demonstrate hierarchical SMC behaviors in stabilizing and transferring control of the Ballbot.


6. Conclusions

In this study, a 2D model of the Ballbot is obtained using the Euler-Lagrange equation and the decoupling method. A robust nonlinear controller based on the hierarchical SMC technique is designed for the Ballbot to control stabilizing and transferring. The capability of the closed-loop system with the hierarchical SMC is achieved using the Lyapunov function. The performance and robustness of the hierarchical SMC are examined under several tests in both simulation and experiment. The simulation and experimental results demonstrate the capabilities of the proposed controller for stabilizing and trajectory tracking.


chapter PDF

© 2022 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Dinh Ba Pham, Soon-Geul Lee, Thi Hang Bui and Tien Phat Truong (January 13th 2022). Hierarchical Sliding Mode Control for a 2D Ballbot That Is a Class of Second-Order Underactuated System [Online First], IntechOpen, DOI: 10.5772/intechopen.101855. Available from:

chapter statistics

4total chapter downloads

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us