Modelo Matematico de Pendulo Invertido
Modelo Matematico de Pendulo Invertido
I. I NTRODUCTION [6], [7]. The majority of these studies have their individual
focus on trying to implement new control methods which have
For nearly two decades research and development of self- not been tested yet for self-balancing robots. For development
balancing vehicles is taking place. In 2001 the Segway, a self- of such a robot numerous further issues like motor drive and
balancing transportation system controlled by balance shift sensor characteristics also need to be considered in overall
of the driver, was introduced and got commercially available control design. Also the complexity of the control algorithms
[1]. It has been noticed by the broad public as a modern, is important for efficient implementation on small microcon-
futuristic vehicle. Although the Segway evolved over the last troller systems.
years as some kind of lifestyle product it was originally In this paper an in-depth overview, beginning with basic the-
designed as a serious transportation system in urban areas. oretical considerations and ending with a ready-to-implement
With the upcoming availability of low-cost, high performance control system, is given. In Section II a mathematical model is
MEMS sensor technology, the use of inertial sensors was derived, using Lagrangian mechanics. For stabilization a well-
no longer restricted to high end applications like avionics or proven linear state space control is used and for state variable
space missions and the self-balancing concept also arrived at acquisition a novel gyroscope-accelerometer sensor fusion
robotics. method is proposed in Section IV. The model parameters of
Even though a two-wheeled self-balancing robot is an inher- a real prototype robot are determined by using specifically
ently unstable system which needs to be stabilized by elec- designed measurement proceedings. The control is designed
tronic means, the two-wheeled movement can have also several in Section V based on these model parameters. Finally the
benefits. Because of the reduced wheel count the robot can control system is implemented in the prototype robot to verify
provide low footprints, compared to traditional systems and is the effectiveness and robustness of the control strategy and
also capable of turning around stationary for constricted area state variable acquisition.
applications. Equipped with loading platforms or manipulators
self-balancing robots, working in human controlled or even
completely autonomous operation, might be used in industrial II. M ATHEMATICAL M ODEL
autnomous transportations systems or warehouses in the future. A. Overview
From a more technical standpoint, a two-wheeled self-
balancing robot is representing a mobile inverted pendulum, A two-wheeled self-balancing robot usually consists of the
which is a classic problem in dynamics and control theory. two wheels connected to a body frame holding the motor drive,
One of the early day robots was Joe by Grasser et al., the power and control electronics as well as some kind of
which used state space control based on a linear model derived battery. In order to keep the robots behavior predictable by
with Newtonian mechanics [2]. In recent years intensive and analytical means some abstractions of reality have to be made.
diverse research is going on in this field and numerous robot Especially the nonuniformly distributed mass within the body
concepts and control strategies have been proposed, ranging has to be reduced to point masses.
from linear state space controllers with pole placement [2] Figure 1 shows the mechanical model of the robot used in
and LQR controller design [3], [4], to nonlinear and intelligent this paper. It consists of the two point masses mH and mL
control methods like sliding mode control [5] or fuzzy control connected to each other, having the distance l. The lower point
4199
State space control estimation structure. The acquisition of the necessary state
kT variables for the robot is covered in section IV.
A. Linearization reducing the order of the dynamic system by the motor current.
So including the motors current in state space control is not
In order to use linear control techniques, the mathematical needed in most cases and therefore measurement of the motor
model of the robot needs to be linearized at its upper rest current can be neglected.
position. The system state functions (11), (12), (13), and (14)
have the form x = f (x, u), where the vector x represents the
state variables (, , v, i) and the vector u represents the input D. Speed and Steering Control
signal (uM ).
In most scenarios drive speed and direction is commanded
By linearizing the system, an equivalent linear model (16) can
by some kind of higher-level or manual control. With the
be obtained,
full state feedback applied, the robot will stay in an upright
x = A[x x0 ] + B[u u0 ] position and control deviation will be reduced but not brought
(16) zero. In order to achieve the set speed and direction two PI-
y = C[x x0 ] + D[u u0 ]
controllers on top of the state feedback are applied, as also
where the matrices A, B, C, D result from the Jacobians of the shown in Figure 3.
nonlinear state functions evaluated at the upper rest position Steering of the robot is done by controlling the differential
of the robot (0 = 0 = v0 = i0 = uM,0 = 0). speed of the two wheels. Beside the control of driving turns,
this is also necessary for driving straight ahead. In this case
B. State Space Control although the same voltage is applied to both motors they will
typically run at slight different speeds leading the robot to
Without any kind of control mechanism the robot shows drive unwanted curves.
inherently unstable behavior, because its center of mass
is above its pivot point. This can also be examined by
determining the eigenvalues of the system matix A in (16). E. Curve radius
As long as the upper mass mH is different from zero the
In automotive engineering a common way of describing
system matrix has eigenvalues with positive real part and so
turns is the curve radius. For software implementation a
the system is unstable.
relationship between the wheels speed difference and the curve
A common method for stabilizing such a system is the use of
radius is useful. Assuming the robot is driving along a curve
a state space control. For stabilizing the robot in an upright
with the radius rc and the right wheel is at the inside of the
position, full state feedback is used in this paper to place
curve and the two wheels having the distance b, the angular
the closed loop poles, corresponding to eigenvalues of the
velocity around the centre of the curve is then given by
system at desired locations in the s-plane. Full state feedback
is accomplished by weighted feedback of the state variables v vl vr
x as shown in the following equation. c = = b
= b
(19)
rc rc + 2 rc 2
4200
v
Sensor
az
I
ay
d
ax
PI DT1 DT1
Sensor model
ax
a x d/dt
dv/dt
4201
state vector x = [D , i]T and the input vector u = [uM ] the
motor/wheel system is given by the matrices
" #
JcR kM
JR 0
A= and B = 1 (25)
LkM
M
RM
LR LM
4202
[]
2
[uM ] V
90
0
-2
45
20
compensated 10
[]
uncompensated
0 0
0 2 4 6 8 10 12 14 16 -10
[t] s
-20
1
Fig. 7. Compensation of the angle drift caused by gyro offset 0.5
[v] m/s
0
-0.5
reduction and drift compensation, for the prototype robot.
Figure 7 shows the angle obtained through integration of the -1
0 1 2 3 4 5 6 7 8
angular velocity measured by the gyroscope with and without [t] s
drift compensation when tilting the robot by 90 degrees.
Fig. 8. Simulation and measured step response of stabilized robot
D. State space controller design
Evaluating the linearized robot model (16) with the deter- of 2m/s in about 1s, and also strong manual disturbance or
mined model parameters from Table 1 gives the system matrix uneven terrain (e.g. lawn) are handled without problems. So
the deployed control strategy can also be used in applications
0 1 0 0 where high dynamics and robust behavior is required.
119.1 0.4206 17.22 27.01 For further improvement of the driving dynamics the impact of
A = 7.699 0.0457 2.244 2.938 . (28)
driving curves on the stabilization process is beeing analyzed.
0 6.68 119.3 50.4 Therefore a more sophisticated model is needed, which also
The system matrix has the eigenvalues 1 = 29.1 + j5.06, takes upright rotations of the robot and movement in three-
2 = 29.1 j5.06, 3 = 3.25, and 4 = 8.38, with 4 dimensional space into account. Another starting point for
being unstable. improvements would be the capability of the robot on adapting
State space controller design was done by manual pole place- to different payloads for transporting goods. Such an adaptive
ment. Main goal of the controller design was to stabilize the control could maybe implemented by some higher level fuzzy
robot, changing the overall system dynamics was not intended logic, adjusting the state control parameters.
at this point. Placing the poles at
R EFERENCES
p1 = 30s1 ; p2 = 30s1 ; p3 = 6s1 ; p4 = 3s1
(29) [1] Segway Inc. Website. [Online]. Available: http://www.segway.com/
led to satisfying results in terms of stabillity and response [2] F. Grasser, et al., JOE: a mobile, inverted pendulum, IEEE Transactions
on Industrial Electronics, vol. 49, pp. 107-114, Feb. 2002.
time with the prototype robot. Using Ackermanns formula
the following feedback weighting coefficients were obtained: [3] V. Kongratana, et al., Servo State Feedback Control of the Self Balanc-
ing Robot using MATLAB, 12th International Conference on Control,
k = 15.3; k = 1.49; kv = 6.33; ki = 0.4 (30) Automation and Systems (ICCAS), pp. 414-417, Oct. 2012.
[4] K. Peng, et al., Dynamic Model and Balancing Control for Two-
Figure 8 finally shows the response of the stabilized prototype Wheeled Self-Balancing Mobile Robot on the Slopes, 10th World
robot on a step sequence, compared to the model simulation. Congress on Intelligent Control and Automation (WCICA), pp. 3681-
3685, Jul. 2012.
It should be noted, that there are some oscillations occuring on
[5] F. Dai, et al., Development of a Coaxial Self-Balancing Robot Based on
the prototype robot after sudden changes of direction. This is Sliding Mode Control, International Conference on Mechatronics and
caused by backlash of the gearboxes, which is also bringing the Automation (ICMA), pp. 1241-1246, Aug. 2012.
robot to continuously slight oscillations during standstill. The [6] C.-H. Huang, et al., Velocity control realisation for a self-balancing
deviations occouring between 3s and 5s are mainly caused by transporter, IET Control Theory & Applications, vol. 5, issue 13, pp.
nonlinear friction and slipping effects between floor and tire 1551-1560, Feb. 2011.
after drive reverse, which are not taken into account by the [7] J. Wu, W. Zhang, Design of Fuzzy Logic Controller for Two-wheeled
mathematical model. Self-balancing Robot, 6th International Forum on Strategic Technology
(IFOST), vol. 2, pp. 1266-1270, 2011.
[8] H.-W. Lee, Optimal posture of Mobile Inverted Pendulum using a single
VI. C ONCLUSION gyroscope and tilt sensor, ICROS-SICE International Joint Conference,
pp. 865-870, Aug 2009.
In this paper a mathematical model and control strategy
for a self-balancing robot was proposed. Despite the large [9] H.-J. Lee, S. Jung, Gyro Sensor Drift Compensation by Kalman Filter to
Control a Mobile Inverted Pendulum Robot System, IEEE International
number of model parameters, the output of the simulated Conference on Industrial Technology, pp. 1-6, 2009.
model corresponds fairly well with the measured results of the [10] L. Meirovitch, Methods of Analytical Dynamics, pp. 72-91, New
real robot, as shown exemplarily in Figure 8. This indicates York: McGraw-Hill, 1970.
that the model proposed is capable of describing the robots [11] J. Ackermann, Der Entwurf linearer Regelungssysteme im Zustand-
dynamic behavior in an appropriate way. sraum, Regelungstechnik, vol. 20, pp. 297-300, 1972, in German.
The prototype robot is able to accelerate to its maximum speed
4203