WheeledKinematicsusing Matlab
WheeledKinematicsusing Matlab
WheeledKinematicsusing Matlab
AbstractA young designer of the wheeled mobile robot has to answer a wide range of questions before making a final decision to build a prototype. The basic problem is to define an appropriate drive and type of construction. At this stage, the young designers usually duplicate ready-made solutions, however, in general uses an inappropriate drive. The robot behaves correctly only after several failed designs. Unfortunately, the construction of several versions of the robot takes a long time and involves significant costs. The authors suggest how to help and accelerate the robot design process. Following these suggestions the young designer can develop his knowledge how to model and simulate in the MATLAB/Simulink environment. The first part of the article contains a basis for mathematical modeling of the wheeled mobile robots. As an example, a complete mathematical model of the selected robot type is developed. The second part presents methods of verification and validation the prepared model. After selecting the appropriate drive parameters (e.g. maximum torque, maximum speed, etc.) user is able to perform a simulation of the designed robot. In addition, the effects of simulation can be seen in the visualization and a designer is able to assess if the design of robot meets the established requirements. Keywords-mobile robot, mathematical modeling, simulation
wish to win the competition. Motors parameters (max. torque, max. current, nominal rpm. etc.) are very significant for a good design. We can select the appropriate drive for at least two ways: Perform an experiments with different motors Prepare a mathematical model of a mobile robot and perform simulation with different parameters of the motor
The first method requires the preparation of several versions of the same robot. It takes a lot of time and involves costs, but is easy. The designer does not need to know the mathematical model. Second method requires knowledge and tools for modeling and simulation. This method is dedicated to people who want to improve their knowledge about the modeling of mobile robots. Principles of modeling of mobile robots will be presented in the second part of the paper. II. PRINCIPLES OF MODELING OF MOBILE ROBOTS
I.
INTRODUCTION
A. Kinematics and simulation of two-wheeled mobile robot The most popular design among the mobile robots is two-wheeled robot with differential drive [1], [6], [3]. The configuration of this robot is shown in Fig.1
Robotics is a very popular field of knowledge. Since many years human beings have tried to build an autonomous robot. Thanks to the development of a new technologies dreams of human beings become realistic. Robotics attracts ordinary people not only those educated in this domain. There are more and more complex robots constructed. They are equipped with built-in computers therefore they become autonomous system. A perfect example is the Lego Mindstorms NXT [7]. With the ingenuity of engineers from the MIT Media Lab, the schoolage children can build their own robot designs and they can write the first control programs with using a simple graphical software. However, for a young designers that is not enough. They use more advanced technologies and build more complex robots. The most popular designs are the wheeled mobile robots. Usually, robots of this type are used during competitions [1] (e.g. a micromouse, a line-follower, a sumo fight etc.). Designers of the mobile robots typically create their projects with the use of arbitrary elements: e.g. DC motors from damaged audio-video devices, encoders from old type computer mouse, optical sensors from broken printers etc. The parameters of these elements usually are unknown, but it seems to be not important to inexperienced developers. They simply
Two independent DC motors are the actuators of the left and right wheels and one free wheel caster is used to keep the
platform stable. This configuration uses independent linear velocities: vL for the left wheel and vR for the right wheel to move to a desired point (x,y) and desired orientation . The linear left(right) wheel velocity vL(vR) is directly proportional to the angular velocity of the left(right) wheel (1), where rw is the wheel radius.
v(t ) =
vL (t ) + vR (t ) , 2
(t ) =
vR (t ) vL (t ) rc
(2)
vL = rw L vR = rw R
(1)
(3)
The relation between the linear v(t) and angular (t) speeds of the platform depend on the linear velocity of left and right wheel (2). Parameter rc is a robot chassis radius. It was assumed that the wheels move on the plane without slip.
One of the best tools for modeling and simulation is MATLAB/Simulink package [7]. The Simulink model of robot kinematics (3) with velocity relation (2) is presented in Fig.2.
vL vR u
plot_Robot
x y theta
Generalized Position
Signal Builder
Velocity relation
kinematic 2-wheeled
Generalized Velicities
To simulate kinematic model we should prepare a desired velocity signal. A simple signal is shown in Fig.3 and is divided into three parts: velocities vL and vR are equal robot should move forward, vL is smaller then vR robot should turn left, vR is smaller then vL robot should turn right.
velocity [m/s]
0.2
0.15
0.1
0.05 0
5 time [s]
10
Initial parameters are as follows: robot chassis radius rc=0.15m, initial position (xini,yini) = (-0.5[m],-0.5[m]) and initial orientation = 0 [rad]. The behavior of the simulated robot is shown in Fig. 4. In the first part of simulation the orientation is equal to zero. This means that the robot moves forward. The x position changes linearly and y position remains unchanged. In the second part, when vL is smaller then vR , the orientation increases linearly. This means, in accordance with the coordinate system (Fig.1), that the robot turns left. In the last part, when vR is smaller then vL , the orientation decreases linearly robot turns right.
1.5
B. Modeling of the DC motor The mobile robots that take part in competitions are powered by DC motors. The model of DC motor [5], [1] one can describe as a linear second order system. The motor torque M(t)[Nm] is related to the armature current i(t)[A], by a constant K [Nm/A] (4).
position [m],[rad]
M (t ) = K i (t )
(4 )
0.5
The back electromotive force VEMF is proportional to the angular velocity of DC motor (5)
VEMF (t ) = e(t ) = K (t ) = K
d dt
(5 )
-0.5 0
5 time [s]
10
Based on the Newtons law combined with the Kirchoffs law we can write the equation (6), where u(t) is the input voltage, R is a resistance and L is a inductance of the armature, J is a moment of inertia of the rotor, MF is a damping ratio of the mechanical system.
When we have the robot (x,y) position on the surface, and his orientation , we can prepare the simple visualization of the movement of the mobile robot (Fig.5). The robot is represented by a rectangle. The shortest edges are the wheels and the center of rectangle is the generalized robot position. At each step of simulation a new position and orientation of the robot are calculated and plotted. Visualization of the position of the robot can be helpful in interpreting the charts. Observing the motion of the robot at visualization, one can quickly determine the accuracy of movement.
1
M (t ) = K i (t ) = M F (t ) + J di(t ) u (t ) = e(t ) + R i (t ) + L dt
d (t ) dt
(6 )
The transfer function of system (6) from the input voltage u(t) to angular velocity (t) is as follows (7):
Gv ( s ) =
(s)
u( s)
K ( L s + R)( J s + M F ) + K 2
(7 )
1i 1 u L.s+R 1/(Ls+R)
K K
1 J.s+MF 1/(Js+MF)
e K K_
-0.8 -0.6 -0.4 -0.2 0 0.2 X position [m] 0.4 0.6 0.8 1
1 current
Figure 6. Simulink model of the DC motor
2 omega
III.
When we have a model of a mobile robot and model of a DC motor we can simulate a behavior of the whole system. First we can define parameters of the DC motor: R=1[], L=0.5[H], K=0.05[Nm/A], J=0.0025[kgm2]
The control signals and time of the experiments are the same as in the previous simulation. In the Fig.9a we can observe that the robot moves faster than the robot showed in Fig.9b. The final robot position and orientation are different, too. In this way we can quickly determine whether the DC motor corresponds with our requirements. IV. CONCLUSIONS
uL uR
vL vR u
plot_Robot
Control voltage
v(t)
0.1
vL
vL
v(t)
v(t)
v(t)
x y theta xp yp thetap
DC motor L
left_wheel_radius
omega(t)
Generalized Position
Signal Builder
u omega(t)
0.1
vR
vR
om ega(t)
kinematic 2-wheeled
DC motor R
Generalized Velicities
Figure 7. The Simulink model of the mobile robot with the DC motors
The paper presents some modeling aspects of the wheeled mobile robots. Inexperienced designers (e.g. students) usually make robots and they does not consider whether used components will be sufficient. The study shows that with the appropriate software for modeling and simulation one can test the operation of any robot. In this case, the software MATLAB/Simulink with the right tools and libraries is used. With this solution the designer can expand their knowledge of robotics, and saves time and money. The presented modeling aspects should be taken as an introduction to more advanced analysis of the behavior of mobile robots in the future. Also, the described aspects are going to be implemented as a modeling introduction of the students robotic workshop.
The voltage control signals and the corresponding robot position and orientation are presented in Fig.8. As in the previous simulation experiment that signals are divided into three parts, but now simulation results taken into consideration the dynamics of the motors. The orientation of the robot changes smoothly after implementation of the motor dynamics.
0.14 0.13 0.12 0.11 Left wheel voltage control Right wheel voltage control
REFERENCES
[1] W.P. Aung, Analysis on Modeling and Simulink of DC Motor and its Driving System Used for Wheeled Mobile Robot, Proceedings Of World Academy Of Science, Engineering And Technology, vol. 26, pp. 299-306, December 2007 T. Brunl, Research relevance of mobile robot competitions, IEEE Robotics and Automation Magazine, vol. 6, no. 4, pp. 3237 , December 1999 (6) G. Dudek, M.Jenkin, Computational principles of mobile robotics. Cambridge, Cambridge University Press 2000 M. J. Giergiel, Z. Henzel, W. ylski, Modelowanie i sterowanie mobilnych robotw koowych. Warszawa, Wydawnictwo Naukowe PWN, 2002. M. Pauluk, Projektowanie algorytmw sterujcych w ukadach sterowanych napiciowo i prdowo, Miesicznik Naukowo-Techniczny PAR Pomiary, Automatyka, Robotyka, vol. 12, pp. 37-45, Warszawa 2005 K. Tcho, A. Mazur, I. Dulba, R. Hossa, R. Muszyski, Manipulatory i roboty mobilne. Warszawa, Akademicka Oficyna Wydawnicza PLJ, 2000 http://www.mathworks.com http://mindstorms.lego.com
[2]
position [m],[rad]
voltage [V]
[3] [4]
0.5
5 time [s]
10
-0.5 0
[5]
1 2 3 4 5 time [s] 6 7 8 9 10
Figure 8. The voltage control signals and the position and orientation of the mobile robot.
[6]
The model is prepared to perform the simulation with many different DC motors parametres. For example, Fig.9 presents visualization of the robots with two types of the DC motors. The first type has the torque motor constant K=0.05[Nm/A]. The second type has the constant K equal to 0.1[Nm/A].
a)
1 0.8 0.6 0.4 Y position [m]
[7] [8]
b)
1 0.8 0.6 0.4 Y position [m] 0.2 0 -0.2 -0.4 -0.6 -0.8 -1 -1
-0.8
-0.6
-0.4
0.4
0.6
0.8
-0.8
-0.6
-0.4
0.4
0.6
0.8
Figure 9. Visualization of the robot position for different motor parameters: a) K=0.05[Nm/A], b) K=0.1[Nm/A]