Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
usmanasad01@hotmail.com
AbstractIn this paper modeling and control of a two wheeled
balancing autonomous robot is reported. The main focus is on
developing efficient control algorithms required to enable the robot
to perceive and act in real time for a dynamically changing world.
The prototype relies on a multi-sensor system consisting of i) two
optical incremental encoders and ii) a three axis accelerometer
which is used as a tilt sensor. The information from the sensory
system is provided to the robot controller. The performance and
reliability of controller is then simulated in MATLAB as a
platform. Finally, the solution is verified on a real physical model
controlled by means of a single chip AT89C52 microcontroller.
Keywords Simulation, dynamics, inverted pendulum mobile
robot, state space control
I. INTRODUCTION
Effective and efficient control system designs provide the
robot with the ability to control itself and operate autonomously.
Two wheeled robots are one variation of robot that has become
a standard topic of research and exploration for young engineers
and robotic enthusiasts. They offer the opportunity to develop
control systems that are capable of maintaining stability of an
otherwise unstable system. This type of system is also known as
an inverted pendulum [1].
Two wheeled balancing robot is a classic engineering problem
based on inverted pendulum and is much like trying to balance a
broom on the tip of your finger. The word balance means the
inverted pendulum is in equilibrium state, which its position is
like standing upright 90 degrees. However, the system itself is
not balance, which means it keeps falling off, away from the
vertical axis. Therefore, a sensor is needed to provide the angle
position of the inverted pendulum or robot base and input into
the microcontroller, which the program in itself is a balancing
algorithm. The microcontroller will then provide a type of
feedback signal through PWM control to the H-bridge circuit to
turn the motor clockwise or anticlockwise, thus balancing the
robot [2].
This project implements a self-sustaining, two-wheeled,
balancing robot capable of balancing on level surfaces. The
robot maintains its balance by implementing a Proportional
Integral Derivative (PID) algorithm, which determines the
amount of wheel rotation required to keep the robot upright. The
robot is able to remain balanced indefinitely regardless of small
outside disturbances, and is able to move forwards, backwards,
TABLE 1
PARAMETER OF ROBOT
Quantity
3
2
1
2
kg
1.19
0.65
0.35
1.5
x
..
.. =
(6)
wh r=x,
wh r
x.
.
. .
(7)
wh r=x , wh =
r
For the right wheel,
C J
M wh
x= r wh
x-H r
(8)
r r2
For the left wheel,
C J
M wh
x= l wh
x-H l
r r2
A. Wheel Modelling
(9)
2 M wh+ J wh
r2
C C
x= l + r - ( Hl +H r )
r
r
(10)
B. Chassis Modelling
Chassis modelling parameters is shown in Fig 4. Sum of
forces perpendicular to the chassis or pendulum,
xcos rc
Fperpendicular =M rc
(11)
..
-M rcl rc -M rc gsin rc =M rc
xcos rc
Sum of the forces in the horizontal direction
x
Fhorizontal =M rc
d rc
2 = 0.
dt
The linearising equation representing the whole system is,
..
2 ..
(18)
J rc rc + C r+ Cl M rc gl + M rcl rc
C
C
..
2 M wh+ 2J wh + M rc
x= l + r + M rcl rc
2
r
r
(19)
M rcgl
..
rc =
Fig.4 Inverted pendulum free body diagram
x=
=-M rcl
xcos rc
(15)
Substitute equation (14) into above equation to eliminate (Pr+Pl)
and (Hr+Hl) term and rearranging the same term,
..
2 ..
J rc rc + C r+ Cl + M rc glsin rc + M rcl rc
(16)
= -M rcl
xcos rc
To eliminate (Hr+Hl) term from the second equation, equation
(12) is inserted into equation (10) and rearranging the same
terms,
C
C
..
2J
2 M wh+ wh + M wh
x= l + r + M rcl rc cos rc
2
r
r
(17)
r
.2
+ M rc l rc sin rc
Equation (16) and (17) are non-linear equations, and to get
linear equations, some linearising or assumption are taken.
J rc + M rcl
M rcl
J rc + M rcl
M rc l
(Cr+Cl )
J rc + M rcl
..
2
J
wh
2 M wh +
+ M rc
2
( Cr +Cl )
r 2 M wh + 2 J wh + M rc
2
(20)
. 0
x
x
=
. 0
..
0
1
0
0
0
M
1
rcl
+
2
r
J rc + M rcl
M rcl
1
r
0
x
rc
.
J rc + M rcl 2
x
0
1
2
2
.
M rcgl
0
M2 l 2
J rc rc + M rcl 2
M 2rcgl
M2 l
M rcl Cr
1
r J + M l 2 Cl
rc
rc
M rcl
1
r
where = 2M wh +
2 J wh
r2
+ M rc and output of
(21)
Mwh
Mrc
l
x
1 0 0 0 x.
y=
0 0 1 0
.
(22)
r
[0.145kg]
[3.694kg]
[0.165m]
[0.053m]
0 x
. 0
0 2.27 0 x
+ 14.68
0 0
1
1.786
0 65.61 0 .
1
0
Cr
14.68
C
1.786 l
(24)
Symbol
TABLE 2
PARAMETER OF ROBOT
Parameter
Value [unit]
x
x
x..
Linear Displacement
Linear velocity
Linear acceleration
[m]
[ m/sec]
[m/sec2]
rc
[rad]
[m/sec]
[m/sec2]
[m/sec]
[m/sec2]
..
rc
rc
..
wh
wh
Cl
Cr
Pl, Pr
Hl, Hr
Hfl, Hfr
g
Jrc
Jwh
error (t ) dt Ts error ( k )
k =1
derror (t )
dt
Fig.9 Impulse response with PID controller k=1, kd=1, ki=1
error ( k ) error ( k 1)
Ts
u ( k ) K p error ( k )+
Ts
T
error ( k )+ D (error ( k )error ( k 1))
TI k =1
Ts
where
KI =
TpTs
TI
KD =
K pTD
Ts
u ( k ) = K p error ( k )
+ K I error ( k ) + K D (error ( k ) error ( k 1))
K =1
0
1
0
1
0
1
1
1
Stop
Forward
Backward
Stop
B. Accelerometer
The Hitachi H48C Tri-Axis Accelerometer is an integrated
module that can sense gravitational (g) force of 3g on three
axes (X, Y, and Z). The module contains an onboard regulator to
provide 3.3-volt power to the H48C, analog signal conditioning,
and an MCP3204 (four channel, 12-bit) analog-to-digital
converter to read the H48C voltage outputs. All components are
mounted on a 0.7 by 0.8 inch module. Acquiring measurements
from the module is simplified through a synchronous serial
interface. With the BASIC Stamp series, for example, this is
easily handled with the SHIFTOUT and SHIFTIN commands.
Features: Measure 3 g on any axis Uses MEMS (Micro
Electro-Mechanical System) technology Onboard regulator and
high-resolution ADC for simple connection to microcontroller
host SPI communications compatible with BASIC Stamp 2
series SHIFTOUT and SHIFTIN commands Free-fall output
indicates simultaneous 0g an all axes Small, breadboard-friendly
package Key Specifications: Power Requirements: 5 VDC
Communication: Serial SPI Dimensions: 0.7 x 0.8 x .45 in (17.8
x 20.3 x 11.4 mm) Operating Temperature: -13 to +167 F (-25
to +75 C) [12].
The accelerometer board is shown in Fig. 14.
Fig.13 Root Locus sketch with PID control k=100, kd=80, ki=45
V. HARDWARE DESIGN
The hardware of the robot consists of motor interface board,
accelerometer and microcontroller board
[5]
[6]
[7]
[8]
[9]
[10]
Fig. 15 Motor interface circuit
[11]
[12]
VI. CONCLUSION
In this paper, an effective and pragmatic approach to the
modeling and control of two wheeled balancing robot using low
cost components is presented. Sensory system of the robot
consists of accelerometer and encoders which gives the tilt and
the displacement information respectively. A linear PID
controller has been developed that helps the robot to balance