A PID Backstepping Controller For Two-Wheeled Self-Balancing Robot Nguyen Gia Minh Thao ) 1 ( , Duong Hoai Nghia ) 2 ( , Nguyen Huu Phuc (3) Faculty of Electrical and Electronics Engineering HoChiMinh city University of Technology (HCMUT) HoChiMinh city, VietNam (1) ngmthao@hcmut.edu.vn , (2) dhnghia@hcmut.edu.vn , (3) nhphuc@hcmut.edu.vn Abstract – This paper presents a method to design and control a two-wheeled self-balancing robot and it focus on hardware description, signal processing, discrete Kalman filter algorithm, system modelling and PID backstepping controller design. In the system, signals from angle sensors are filtered by a discrete Kalman filter before being fed to the PID backstepping controller. The objectives of the proposed controller are to stabilize the robot while try to keep the motion of robot to track a reference signal. The proposed PID backstepping controller has three control loops, in which the first loop uses a backstepping controller to maintain the robot at equilibrium, the second loop uses a PD controller to control the position of robot and the last uses a PI controller to control the motion direction. Simulations and experimental results show that the proposed control system has good performances in terms of quick response, good balance, stability . Keywords – Two wheeled self-balancing robot, Discrete Kalman filter, Backstepping control, PID control, Embedded system. I. INTRODUCTION Two-wheeled self-balancing robot is a multi-variable and uncertain nonlinear system [1],[2],[7],[8], so that the performance of the robot depends heavily on the signal processing and the control method in use. In recent years, the number of researches on backstepping control have increased [4],[5],[6]. The backstepping approach provides a powerful design tool for nonlinear system in the pure feedback and strict feedback forms. So it is of great interest and feasible to use backstepping approach to design a compatible controller for two-wheeled self-balancing robot when the mathematical model of robot is identified. The designed two-wheeled self-balancing robot is given in Figure 1. Signals from angle sensors are filtered by a discrete Kalman filter before being fed to the PID Backstepping controller. The purposes of the controller are to stabilize the robot and keep the motion of the robot to track a reference signal. The proposed PID Backstepping controller has three control loops (Figure 7). The first loop is a nonlinear controller based on backstepping approach, it maintains the tracking error of the pitch angle at zero. The second loop uses a PD controller to control the position of the robot, and the last loop uses a PI controller to control the direction of motion. The remainder of this paper is organized as follows. Section II describes hardware and sensor signals processing of the designed robot. Section III presents the discrete Kalman filter algorithm. Section IV shows the mathematical model of the robot. Section V presents the method to design the proposed PID Backstepping controller. Section VI shows the simulation results and experimental results of the proposed control system. Section VII includes conclusions and direction of future development of this project. Section VIII is the list of reference documents used for this paper. II. HARDWARE DESCRIPTION A. Hardware of the Designed Robot [10], [11], [12] Figure 1 and Figure 2 show the prototype design of the robot. The designed robot has an aluminum chassis, two 24V-30W DC-Servo motors for actuation, an accelerator and a gyroscope for measuring pitch angle and angular velocity of the body of robot, two incremental encoders built in motors for measuring the position of the wheels. Two serial 12V-3.5Ah batteries make a 24V-3.5Ah power which supplies energy for two DC-Servo motors. Another 12V-1.5Ah battery supplies energy for the central control module. Some operations of the robot (upright and balance, moving forward, moving backward, turning left, turning right,…) which can be controlled from buttons on the central control module or the RF remote control. Signals processing and control algorithm are embedded in a two-core micro-controller (MCU) MC9S12XDP512 which is a 16-bit MCU of FreeScale. Figure 1. The prototype two-wheeled self-balancing robot Figure 2. Hardware description B. Sensor Signals Processing [1] The angle sensor module includes an accelerator and a gyroscope, two incremental encoders which provide full state