**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.

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

### **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.*

*Hierarchical Sliding Mode Control for a 2D Ballbot That Is a Class of Second-Order… DOI: http://dx.doi.org/10.5772/intechopen.101855*

**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.*

**Figure 8.**

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

### **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.*

*Hierarchical Sliding Mode Control for a 2D Ballbot That Is a Class of Second-Order… DOI: http://dx.doi.org/10.5772/intechopen.101855*

### **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.*

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)**.

### **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.

### **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.

**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.*

*Hierarchical Sliding Mode Control for a 2D Ballbot That Is a Class of Second-Order… DOI: http://dx.doi.org/10.5772/intechopen.101855*

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.

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