An Experiment of Two-Wheeled Self-Balancing Scooter

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/280597628

An Experiment of Two-wheeled Self-Balancing Scooter

Conference Paper · November 2011

CITATIONS READS

0 4,767

4 authors, including:

Mai Tuan Dat Gia Minh Thao NGUYEN


KU Leuven Shimane University
22 PUBLICATIONS 162 CITATIONS 96 PUBLICATIONS 423 CITATIONS

SEE PROFILE SEE PROFILE

Ho Pham Huy Anh


Ho Chi Minh City University of Technology (HCMUT)
136 PUBLICATIONS 1,081 CITATIONS

SEE PROFILE

All content following this page was uploaded by Gia Minh Thao NGUYEN on 05 December 2016.

The user has requested enhancement of the downloaded file.


The 2011 ASEAN Symposium on Automatic Control

Proceedings

THE ASEAN SYMPOSIUM ON AUTOMATIC CONTROL

ASAC 2011

November 8-9, 2011


Ho Chi Minh City, Vietnam

Organized by
Faculty of Electrical and Electronics Engineering, Ho Chi Minh City University of Technology
Department of Electrical Engineering, Faculty of Engineering, Chulalongkorn University
The 2011 ASEAN Symposium on Automatic Control

An Experiment of Two-Wheeled Self-Balancing Scooter


Mai Tuan Dat ( 1 ) , Nguyen Gia Minh Thao ( 2 ) , Ho Pham Huy Anh ( 3 ) , Huynh Thai Hoang ( 4 )
Faculty of Electrical and Electronics Engineering
HoChiMinh City University of Technology (HCMUT)
HoChiMinh City, Vietnam
(1)
tuandat.mai@hcmut.edu.vn, (2) ngmthao@hcmut.edu.vn , (3) hphanh@hcmut.edu.vn, (4)
hthoang@hcmut.edu.vn

Abstract – This paper presents methods to design hardware and micro-controller (MCU) MC9S12XDP512. The operations of
controller of the two-wheeled self-balancing scooter. It focuses on the scooter (upright and balance, moving forward, moving
hardware construction, sensor signal processing and embedded backward, etc.) can be set from buttons on the control panel of
controller design. The signals from angle sensors are filtered by a the scooter.
discrete Kalman filter before being fed to the embedded
controller. The main objective of the proposed controller is
regulation of the pitch angle of the scooter. In this paper, two
proposed controllers for the scooter are the Pole-placement
controller and the Backstepping pitch angle tracking controller.
Simulations and experimental results show that the proposed
control system has good performances.
Keywords – Two wheeled self-balancing scooter, Discrete
Kalman filter, Pole palcement control, Backstepping control.

I. INTRODUCTION
Two-wheeled self-balancing scooter is a multivariable
uncertain nonlinear system [1], [2], [7], [8], [9]. The
performance of the scooter depends heavily on the mechanical
model, the signal processing technique and the control method
in use. The designed scooter is given in Figure 1. Signals from
angle sensors are filtered by a discrete Kalman filter before
being fed to the embedded controller. The purposes of the
controller are to stabilize the scooter and keep the motion of
the scooter flexibly.
This paper presents two proposed controller for the scooter, Figure 1. The prototype two-wheeled self-balancing scooter
the Pole-placement controller and the Backstepping controller.
The Pole-placement controller [7], [8], [9] is a popular control
method for the nonlinear system after the state equations of the
system are linearized. And the Backstepping approach [4], [5],
[6] which is a nonlinear control approach based Lyapunov
theories, provides a powerful design tool for nonlinear system.
Therefore, it is feasible to use Pole-placement control method
and Backstepping approach to design compatible controllers
for two-wheeled self-balancing scooter when the mathematical
model of the scooter is identified.
The responses of the control system with two proposed
controllers (Pole-palcement controller and Backstepping
controller) are shown in simulations for comparision. In the
current research, the Pole-placement algorithm is first
implemented into the experimental scooter and the designed
scooter has good performances.

II. HARDWARE DESCRIPTION


A. Hardware of the Designed Scooter
Figure 2. Hardware description of the designed scooter
The prototype design of the scooter is shown in Figure 1
and Figure 2. It has an stainless steel chassis, two 36V-100W B. Sensor Signals Processing
brushless DC (BLDC) motors for actuation, an acceleration An acceleration sensor (named ADXL202A), a gyroscope
sensor and a gyroscope sensor for measuring the pitch angle sensor (named LISY300AL) and two hall sensors built in
and the angular velocity of the body, two hall sensors for BLDC motors provide full state of the scooter . The signals
measuring the speed of the wheels. The signal processing and from the acceleration sensor and the gyroscope sensor are
control algorithm are embedded in a 16-bit two-core filtered by a discrete Kalman filter [3] before being fed to the

20
The 2011 ASEAN Symposium on Automatic Control

embedded controller (see Figure 3). The comparision of The state equations of two-wheeld self-balancing scooter are:
filtered and unfiltered angle which is shown in Figure 4,
­ § 0,75 MwRMBL cosT cosT · 0,75g sinT 0,75MBL sinT cosT  2
proves the using of Kalman filter is very necessary. °¨ 1¸T  T 
°©¨ 2MW MB L ¸ L 2MW MB L
¹
°
° § 0,75 1 sinT 2 ·
0,75 cosT ¸
° ¨  C
° ¨¨ MBL2 2MW MB RL¸¸
° © ¹
®
°§ 0,75 MwRMBL cosT cosT · 0,75g MwRMBL cosT sinT
°¨¨2MW MB  ¸x
¸

°© L ¹ L
°
° § 0,75 M RM L cosT 1 sinT 2 ·
° 
MBL sinT T 
2
¨ w B


C
Figure 3. Kalman filter for measuring the pitch angle
° ¨¨ MBL2 R¸¸
¯ © ¹
6
Signal With Kalman Filter (1)
4
Signal Without Kalman Filter
Let x1 T , x2 T, x3 x , x4 x . The state equations
2
of the scooter is rewritten as
­ x1 x2 (2.1)
ANGLE [degree]

0
° x f x  f x , x  g x C
° 2 1 1 2 1 2 1 1 (2.2)
-2
® (2)
°x3 x4 (2.3)
-4
°¯ x4 f3 x1  f4 x1, x2  g2 x1 C (2.4)
-6

where: C CL  CR
-8
0 1 2 3 4 5 6
TIME [sec] § 0.75 g sin x1 ·
Figure 4. Comparision between filtered and unfiltered angle measurement ¨ ¸
f1 x1 © L ¹
§ 0.75 M w R  M B L cosx1 cosx1 ·
III. MATHEMATICAL MODEL OF THE SCOOTER ¨  1¸
¨ 2M W  M B L ¸
The coordinate system of the scooter is shown in Figure 5. © ¹
The mathematical model of the scooter is derived based on § 0.75M B L sin x1 cosx1 2·
Newton’s 2nd law of motion [1], [2], [7], [8]. ¨¨ x2 ¸¸
© 2M W  M B L ¹
f 2 x1 , x2
§ 0.75 M w R  M B L cosx1 cosx1·
¨  1¸
¨ 2M W  M B L ¸
© ¹
§ 0.75 1  sin x 2
·
¨ 1 0.75 cosx1 ¸

¨¨ M B L2 2 M W  M B RL ¸¸
g1 x1 © ¹
§ 0.75 M w R  M B L cosx1 cosx1 ·
¨  1¸
¨ 2M W  M B L ¸
© ¹
§ 0,75g MwR  MBL cosx1 sin x1 ·
¨ ¸
¨ L ¸
f3 x1 © ¹
§ 0,75 MwR  MBL cosx1 cosx1 ·
¨ 2MW  MB  ¸
¨ L ¸
Figure 5. Free body diagram of the chassis and the wheels © ¹
2
Where, T : Pitch angle [rad] ; G : Yaw angle [rad].
MBL sin x1 x2
f4 x1, x2
M W : Mass of wheel, 7.2 [kg] ; M B : Mass of body , 90 [kg]. § 0,75 MwR MBL cosx1 cosx1 ·
¨2MW  MB  ¸
R : Radius of wheel, 0.2[m]. ¨ L ¸
© ¹
L : Distance between the centre of the wheels and the
scooter’s centre of gravity, 0.8[m]. § 0,75 M R  M L cosx 1 sin x 2
·
¨ w B 1 1


D : Distance between the contact patches of the wheels,0.6[m] ¨¨ MB L2 R ¸¸
g : Acceleration of gravity, 9.8 [ms-2]. © ¹
g2 x1
CL , CR : Input torque for left and right wheels [Nm]. § 0,75 Mw R  MB L cosx1 cosx1 ·
¨ 2MW  MB  ¸
¨ L ¸
VTL ,VTR , HTL , HTR , H L , H R , VL ,VR : Reaction forces [N]. © ¹

21
The 2011 ASEAN Symposium on Automatic Control

IV. CONTROLLERS DESIGN Define the virtual control D such that limt of e1 (t ) 0 , as

In this paper, the Pole-placement controller (see Figure 6) D k1e1  c1 z1  x1ref (5)

³e
and the Backstepping pitch angle tracking controller (see where k1 , c1 are positive contants and z1 W dW .
1
Figure 7) are presented as a main controller for the scooter,
respectively. The first Lyapunov function is defined as
c1 2 1 2
A. Pole Placement Controller Design . V1 z1  e1 (6)
2 2
The derivation of V1 :
V1 c1 z1 z1  e1e1 c1 z1e1  e1e1 e1 c1 z1  e1 (7)
Define the error between the virtual control D and
input x2 of (2.2) as e2 D  x2
(2.1) is rewritten as x1 D  e2 k1e1  c1 z1  x1ref  e2 (8)
Figure 6. The Pole-placement controller scheme From (8), we have e1 x1ref  x1 k1e1  c1 z1  e2 (9)
The derivation of e2 :
Linearation at equilibrium point ( T  1 [radian]), we have:
sin T | T ; sin T
2
| 0; cosT | 1 . e2 D  x2 k1e1  c1e1  
x1ref  f1 x1  f2 x1, x2  g1 x1 C
Therefore, (1) can be rewritten as: k1 k1e1  c1z1  e2  c1e1  
x1ref  f1 x1  f2 x1, x2  g1 x1 C
­ gM B Y
c1  k12 e1  k1c1z1  k1e2  
x1ref  f1 x1  f2 x1, x2  g1 x1 C
° T T C
° X X (3)
® § ·
(10)
°  § 4 gM · 4 LY 1
x  L B
 g ¸T  ¨  ¸C
Substituting (9) into (7), we obtain
°¯ ¨© 3 X ¹ © 3X M B L ¹ V1 e1 c1 z1  k1e1  c1 z1  e2 k1e12  e1e2 (11)
4 MB The second Lyapunov function is defined as
Where: X MBL  MBL  MWR
3 2M W  M B 1
V2 V1  e22 (12)
MB 1 2
Y  Compute the derivation of V2 as
2M W  M B R L
From (1) and (3) , we have the state-space equations of the V2 V1  e2e2 k1e12  e1e2  e2e2 (13)
scooter
For making V2 definite negative, we choose e2 as
ª 0 1 0 0º ª 0 º
ªTº « » ªT º « Y » e2 k2 e2  e1 ; with k2 t 0 (14)
gMB
« » « 0 0 0» « » «  »
«T » » «T »  « » Substituting (14) into (13), we obtain
« X X (4)
« x » « 0 »
0 0 1 « x» « 0 »C V2  k1e12  k2 e22 < 0 (15)
« » « »« » « »
(15) satisfies the stability condition based the Lyapunov theory
¬« 
x ¼» « 4 L gMB  g » ¬ x ¼ « 4LY 1 »
«¬ 3 X 0 0 0»
¼ « 3X  M L » From (10), (14) we have the equation of control signal as
¬ B ¼
1c1 k12 e1  k1 k2 e2 kc
1 1z1  x1ref  f1 x1  f2 x1, x2

C (16)
To ensure the transient responses and stability (overshoot, g1 x1
response time, steady time and steady error) of the
two-wheeled scooter, stable poles of the control system can be
V. SIMULATIONS, EXPERIMENTAL RESULTS
choosen as V=[-0.7+i;-0.7-i;-8.2+3*i;-8.2-3*i]. The optimal
gain (Kopt) of the Pole-placement controller is calculated by A. Simulations
the Ackerman formula.
The parameters of two proposed controllers are defined in
Kopt = [-44.6979; -51.6130; -408.7307; -77.7115] Table I. Responses of the pitch angle of the scooter is shown
Figure 8 to Figure 11 .
B. Backstepping Pitch Angle Tracking Controller Design
TABLE I. PARAMETERS OF THE PROPOSED CONTROLLERS

Controller Parameters
Pole – Kopt =
Placement [-44.6979;-51.6130;-408.7307;-77.7115]
Figure 7. The Backstepping pitch angle tracking controller scheme Backstepping k1 = 20 ; k2 = 5 ; c1 = 0.2
Define a tracking error as e1 x1ref  x1
x The scooter maintains at equilibrium and doesn’t move
where x1ref Tref is the reference value for pitch angle T ( T ref 0 [degree], xref 0 [m])

22
The 2011 ASEAN Symposium on Automatic Control

Figure 8 shows the response of the scooter with small T ref 20 [degree], it means that the scooter moves
initial pitch angle ( T 0 10 [degree]), and Figure 9 backward.
illustrates the response of the scooter with large initial
angle ( T 0 20 [degree]). Both the pitch angle and the 20
Backstepping
position of the scooter converge to zero in two 18

conditions. These results demonstrate that the scooter 16


can keep balance well.
14
10

ANGLE [degree]
12
Pole-Placement
Backstepping
8 10

8
6
6
ANGLE [degree]

4 4

2
2

0
0 1 2 3 4 5 6 7 8
0
Time [sec]

Figure 10. The pitch angle of the scooter is controlled to track the
-2
T ref 18 [degree] (the scooter moves forward).
-4
0 1 2 3 4 5 6 7 8 0
Time [sec] Backstepping
Figure 8. The scooter maintains at equilibrium with small initial pitch angle
T 0 10 > deg ree @ -5

20
ANGLE [degree]

Pole-Placement -10
Backstepping
15

10 -15
ANGLE [degree]

5
-20

-25
-5 0 1 2 3 4 5 6 7 8
Time [sec]

-10 Figure 11. The pitch angle of the scooter is controlled to track
T ref 20 [degree] (the scooter moves backward).
-15
0 1 2 3 4 5 6 7 8
Time [sec]
B. Experimental Results
Figure 9. The scooter maitains at equilibrium with large initial pitch angle
T0 20 > deg ree @ In (16), the backstepping control equation has many
nonlinear functions ( f1 x1 , g1 x1 , f 2 x1 , x2 ) and it is
From results shown in Figure 8 and Figure 9 , we can also complex for embedded programming.
observe that both proposed controllers stablize the scooter Furthermore, because of the simplify of calculation, in the
well and the Backstepping controller has better background research stage as this paper, the proposed
performances in terms of settling time and overshoot than Pole-placement controller could be chosen to implement into
the Pole-placement controller. the experimental scooter. In fact, the designed scooter which is
implemented with Pole-placement controller, can keep balance
x The scooter moves forward and moves backward. well, move forward, move backward and turn left-right
( T ref z 0 [degree]) flexibly. Moreover, this scooter can transport a person whose
In these simulations, because responses of the weight is up to 70[kg]. Operations of the designed scooter are
Pole-placement controller are bad, only the Backstepping shown in Figure-12.
pitch angle tracking controller is used for the scooter (see
Figure 10 and Figure 11). In the Figure 10, the pitch x A demo operation video of the scooter :
angle of the scooter is tracked to T ref 18 [degree], it http://www.youtube.com/watch?v=IKCKmoTsMa4
means that the scooter moves forward. On the other hand,
in the Figure 11, the pitch angle of the scooter is tracked to

23
The 2011 ASEAN Symposium on Automatic Control

controller) can’t keep balance well while pitch angle of the


scooter is larger than 25[degree]. Therefore, in the next
research of this project, the Backstepping pitch angle tracking
controller would be implemented to improve the stability and
flexibility of the scooter.

VII. REFERENCES
[1] F. Grasser, A. D’Arrigo, S. Colombi, A. Ruffer , “JOE: A Mobile
Inverted Pendulum”, IEEE Trans. Electronics, vol. 49, no 1, Feb 2002,
pp. 107-114.
[2] S.W. Nawawi, M.N. Ahmad, J.H.S. OBacksteppingan , “Development
of Two-Wheeled Inverted Pendulum Mobile Robot”, Proceedings of
SCOReD07, Dec 2007, pp. 153-158.
[3] G. Welch, G. Bishop, “An Introduction to the Kalman Filter”,
Proceedings of Siggraph Conference 2001, pp. 8-14.
[4] Tatsuya Nomura , Yuta Kitsuka, Hauro Suemistu, Takami Matsuo ,
“Adaptive Backstepping Control for a Two-Wheeled Autonomous
Robot”, Proceedings of ICROS-SICE International Joint Conference
2009, Aug. 2009, pp 4687 - 4692.
[5] Xiaogang Ruan , Jianxian Cai , “Fuzzy Backstepping Controller for
Two-Wheeled Self-Balancing Robot”, Proceedings of 2009
International Asia Conference on Informatics in Control, Automation
and Robotics.
[6] Arbin Ebrahim, Gregory V.Murphy, “Adaptive Backstepping Controller
(a) Stand up (b) Keep balance Design of an Inverted Pendulum”, Proceedings of the Thirty-Seventh
Southeastern Symposium on, 2005, pp. 172-174.
[7] D. Y. Lee , Y. H. Kim, B. S. Kim, Y. K. Kwak , “Dynamics and
Control of Non-holonomic Two Wheeled Inverted Pendulum Robot”,
Proceedings of the 8th International Symposium on Artificial Life and
Scooterics, 2003, pp. 415–418.
[8] J. Li, X. Gao, Q. Huang, “Controller design of a two-wheeled inverted
pendulum mobile robot”, Proceedings of Mechatronics and Automation
Conference,2008, pp.7-12
[9] S.W. Nawawi, M.N. Ahmad, J.H.S. OBacksteppingan, A.R. Husain,
M.F. Abdollah, “Controller Design for Two-wheels Inverted Pendulum
Mobile Robot”, Proceedings of 4th Student Conference on Research and
Development, 2006, pp. 194 – 199.
[10] Segway co., “The simply moving scooter”, www.segway.com

(c) Go forward (d) Go backward


Figure 12. Operations of the experimental scooter

VI. CONCLUSION
This paper presented two controller schemes for the
two-wheeled self-balancing scooter. From simulations, we can
conclude that the proposed controllers (Pole-placement
controller and Backstepping pitch angle tracking controller)
are compatible for the scooter. These results also show that the
Backstepping controller has better responses (in terms of
settling time and overshoot) than the Pole-placement
controller.
In the first research stage as this paper, the Pole-placement
controller was implemented into the designed scooter, and
the experimental scooter has good performances. However, the
designed scooter (implemented with Pole-placement

24
View publication stats

You might also like