Professional Documents
Culture Documents
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
Figure 1.
Figure 2.
Hardware description
HARDWARE DESCRIPTION
0
A=
0
Pinitial
1
0
angle
; B = ; X =
; R = 0.15
0
0
g yro
0
1 0
0.001
; Q=
; H = [1 0 ]
=
0.004
0 1
0
Figure 5.
Figure 3.
III.
IV.
Figure 4.
Figure 6.
Pk = APk 1 AT + Q
(2)
Kk = P H
(HP
+R
xWL = WL R
1
JWL = M WL R 2
2
(9)
WL WL
(3)
x k = x + K k z k Hx
(4)
Pk = ( I Kk H ) Pk
(5)
TL
(7)
(8)
(10)
x + xWR
xB = L sin B + WL
yB = L (1 cos B )
(12)
M B
xB = H L + H R
(13)
(6)
M W
xWL = H TL H L
M W
yWL = VTL VL M W g
J = C H R
x k = Ax k 1 + Bu k
(11)
0.75 g ( sin x1 )
D f1 ( x1 ) =
0.75 ( M w R + M B L ( cosx1 ) ) ( cosx1 )
1
M
M
L
2
+
(
)
W
B
2
( x2 )
( 2M W + M B ) L
D f2 ( x1 , x2 ) =
0.75 ( M w R + M B L ( cosx1 ) ) ( cosx1 )
1
2
M
M
L
+
(
)
B
W
0.75 1 + ( sin x )2
1
0.75 ( cosx1 )
+
2
M BL
( 2 M W + M B ) RL
D g1 ( x1 ) =
0.75 ( M w R + M B L ( cosx1 ) ) ( cosx1 )
1
( 2M W + M B ) L
D f3 ( x1) =
M B
yB = VL + VR M B g + FC
= VL + VR M B g +
( CL + CR )
(14)
sin B
(15)
( H L + H R ) Lcos B ( C L + C R )
1
J B = M B L2
3
= B
(16)
(17)
( M L(sinx )( x ) )
2
2
0,75( M R+M L( cosx ) ) 1+( sin x )
B
w
1
1
1
MBL2
R
D g2 ( x1) =
D f4 ( x1, x2 ) =
+
M
M
L
L
2
( 2MW + MB ) L
(
)
W
B
0,75( cos )
+
+
C
MBL2
( 2MW +MB ) RL
+
x =
D2MW + MB
L
L
B
2
w
1
+ MBL( sin ) +
+ C
MBL
R
()
(18)
()
V.
x1 = x2
x = f x + f x , x + g x C
2 1 ( 1) 2 ( 1 2 ) 1 ( 1)
x3 = x4
x4 = f3 ( x1 ) + f4 ( x1, x2 ) + g2 ( x1 ) C
Where:
D C = CL + C R
(19.1)
(19.2)
(19.3)
(19.4)
(19)
Figure 7.
= k1e1 + c1 z1 + x1ref
where
Step 1b:
The derivation of
c1 2 1 2
z1 + e1
2
2
(21)
V1 :
V1 =
Step 2a:
(20)
Figure 9.
(22)
e2 = x2
x2 of (19.2) as
e2 :
e2 = x2
= ( k1e1 + c1e1 +
x1ref ) ( f1 ( x1 ) + f2 ( x1, x2 ) + g1 ( x1 ) C )
= k1 ( k1e1 c1z1 + e2 ) + c1e1 +
x1ref f1 ( x1 ) f2 ( x1, x2 ) g1 ( x1 ) C
Figure 10.
Step 2b:
(26)
1
V2 = V1 + e22
2
Compute the derivation of
(27)
V2 as
For making
(28)
(29)
(30)
(1+ c k ) e + ( k + k ) e k c z + x
=
1
2
1
1 1 1
1ref
f1 ( x1 ) f2 ( x1, x2 )
g1 ( x1 )
(31)
VI.
A.
Simulations
Figure 8.
Figure 11. The robot maintains at equilibrium with small initial pitch angle
( 0 = 5 [deg])
Controller
Backstepping Balance
PD Position
PI Rotation
Figure 12.
Parameters
k1 = 110.5; k2 = 21.4; c1 = 3
KP = 60 ; KD = 7.5
KP = 47.5 ; KI = 5
Figure 15.
Figure 13.
= 5 [deg])
Figure 14.
B.
ref
Experimental Results
Parameters of the proposed PID Backstepping
controller are shown in Table IV.
Figure 16.
VII.
Figure 17.
Figure 18.
CONCLUSION
VIII.
[1]
REFERENCES