You are on page 1of 6

Modeling and fuzzy control of a four-wheeled

mobile robot
István Kecskés*, Zsuzsanna Balogh**, Péter Odry**
*Appl-DSP, Palić, Serbia
** Subotica Tech, Subotica, Serbia
kecskes.istvan@gmail.com, balogh.zsuzsanna7@gmail.com, podry@vts.su.ac.rs,

space, or C space, denoted by C and q ∈ C. We also say


Abstract — In case of the movement of led robots a four- that the train has one degree of freedom since q is a
wheeled car is one of the most commonly used and preferred scalar.
models. In the modeling, it can be assume that the motion is The train also has one actuator that propels it forwards
in a two-dimensional space, and the object can be driven
or backwards along the rail. It can be seen that the train is
with forward or backward motion. We built a kinematic
unable to move by side. Similarly this can be observed in
bicycle model of four-wheeled robot car. Fuzzy control was
applied, because it was more customizable compared to the case of cars, boats, airplanes. However it is not
simple PID control. In the foreseen task, the robot must impossible that these vehicles could enter into a lateral
reach a target point by some predefined specific control position. You can think of the car parking or mooring of
requirements. The book [1] contains such a kinematic model the ship in port. A suitable route and maneuvers should be
and a P regulator solution. But we did not use the simplified followed in order to move sideways [1].
model, but the general solution, and added an example of a
The configuration of a car in a specific plane can be
fuzzy controller to the model. We performed a comparison
between the solution in [1] and our results for a case. We described by three generalized coordinates sq=(x,y,θ).
concluded that it is worthwhile to deal with the development The car has only two actuators, one less than its degrees
of fuzzy control. of freedom, and it is therefore an under-actuated system.
This imposes limitations on the way in which it can move.
One disadvantage is that the vehicle cannot directly get to
I. INTRODUCTION
any point of the configuration space with shortest direct
Nowadays a large number of land, water and air robots route, but it needs to follow some other path. Despite the
have been implemented. Any robot structure may be in limitations the car is simplest and efficiently controlled
focus, one of the most important tasks are the appropriate land vehicle.
moves of robot in the space. For this it is always In robotics a car is described as a non-holonomic
important to consider the number of degrees of freedom, vehicle. It means that the motion of the car is subject to
in which the object can move. The number of drives that one or more non-holonomic constraints. A non-holonomic
can be assigned to a robot, will determine its degrees of constraint can only be written in terms of the derivatives
freedom. If we equip a robot with as many drives, as its of the configuration variables and cannot be integrated to
number of degrees of freedom, then it can achieve all the a constraint in terms of configuration variables [1].
possible directions for movement. In many cases there is
The wheel is one of the most important key elements
no need to assign each drive for every freedom, because
of the car. The traditional, well known wheel can be
the robot works equally well with less drives. For
excellently controlled. In case if a cornering friction
example, it is the case with this car which we study in this
occurs between the wheel and the road, that is very
paper. This vehicle has three degrees of freedom, but is
effectively counteracted by the centripetal acceleration
only equipped with two drives. In many cases gravity is
which otherwise would require a separate drive.
counted as an additional drive.
As an example, the train travels along the rails,
forward or backward. Each configuration corresponds to a
situation that can be described by a scalar quantity q. The
set of all possible configurations is the configuration

1
II. THEORETICAL KINEMATIC MODEL base.. The mechanical steering angle γ is limited, and the
OF BICYCLE maximum value of this dictates the minimum value of R1.
The scheme of theoretical kinematic m model of a Note that R2 > R1 which means the front wheel must
bicycle can be seen in Figure
igure 1. The structure of car was follow a longer path and therefore rotate more quickly
marked with light gray, while the structure of the bicycle than the back wheel. When a four-wheeled
four vehicle goes
with dark gray, the local coordinate system with red, and around a corner thee two steered wheels follow circular
the global coordinate system with blue. The angle of paths of different radius and therefore the angles of the
steering wheel is gamma ( γ ), the rear wheel speed v in steered wheels γ L and γ R should be very slightly
direction xv. The direction of axis of two wheels are different. This problem is easy to solve with the
marked with dotted lines, they intersect at point ICR ( frequently used Ackermann steering mechanism, which
Instantaneous Centre of Rotation), the distance between drives wheels with different speeds [1].
the rear and the front wheel from the ICR point are R1 In the global coordinate system the robot system can
and R2. The bicycle rear wheel is attached to the body, be written in the following equations, the kinematic
while the front wheel can be steered [1]. model:

x& = v cos θ (3)


y& = v sin θ (4)
v
θ& = tan γ (5)
L
The rate of change of heading θ& is referred to as turn
rate, the heading rate or yaw rate and can be measured by
a gyroscope. It can also be deduced from the angular
velocity of the wheels on the left-
left and right-hand sides of
the vehicle.
Figure 1. Theoretical scheme of bicycle/car [1] Equation (3, 4, 5) captures some other important
characteristics of a wheeled
eled vehicle. When v = 0 then
The xv direction of local coordinate system is the
θ& = 0, that is, it is not possible to change the
progress direction of vehicle,, while the starting point is at
vehicle’s orientation when it is not moving. As we know
the middle of rear shaft (V or B point). The configuration
from driving we must be moving in order to turn. If the
of the vehicle can be described with three coordinates in
the global coordinate system q =(x, y, θ ). The speed of steering angleis π then the front wheel is
2
the vehicle in yv direction is zero because the wheels
orthogonal to the back wheel, the vehicle cannot move
cannot slip sideways, see equation (1).
forward and the model enters an undefined region [1].
v x& = v, v y& = 0 (1)
III. BUILDING KINEMATIC MODEL
The dashed lines show the direction along which the
Figure 2 shows a kinematic model of the bicycle,
wheels cannot move, the lines
implementation in Simulink based on equations (3), (4)
of no motion, and these intersect at a point known and (5).. There are two inputs: the wheel speed (v) and
as the ICR. The reference point of the vehicle thus steering angle (gamma). There a lower and upper limit for
follows a circular path and its angular velocity is each input is defined. This is built into Subsystem that
tha is
v named “Bicycle”, and block mask was also used with the
θ& = (2) following parameters: Xstart[m], Ystart[m], Vmin[m/s],
R1
Vmax[m/s], ShaftDistance[m], GammaMin[rad],
From equation (2) the turning radius R1 = L / tan (γ ) , GammaMax[rad].
can be defined, where L is the shaft distance or the wheel Publication
ublication [1] contains a simplified kinematic model
of the bicycle (Figure 3), but ut this model of ours is

2
completed. On figure 3 it can be seen that the model does IV. DRIVING OF THE MODEL
not correspond to equation (5). The tangent of the angle
Following the establishment of a robot can achieve a
calculation and the division with shaft distance (L) are
number of regulation options. The goal can be to reach a
missed.
certain point, trajectory tracking, tracking a moving
target, tracking a line, turning into a predetermined
direction (angle), etc. In addition, you can choose one
from the number of controllers. We chose the example of
reach a target point driving, and with Fuzzy controller.
Figure 5 shows the realization of it in Simulink.

Figure 5. Fuzzy controlling of kinematic model


Figure 2. Kinematic model of the bicycle in Simulink

This is a feedback system to ensure that the vehicle


heads for the specified target, according to the conditions
specified in the fuzzy controller. It compares x and y
outputs of the bicycle kinematic model with the xD and yD
(desired) target coordinates. The results of subtraction are
xE and yE (error) which shows how far away the robot is
from the goal:
Figure 3. Bicycle model in [1]
xE = xD − xB (6)
Figure 4 shows an example where the simulation runs yE = yD − yB (7)
with the same parameters on imperfect and perfect model.
The controller needs to know to how much the
Because in our example, the shaft distance L=0.5 m, then
distance is between the currently located vehicle and the
the bike turns a different route.
target, therefore the distance in equation 10, needed to be
calculated. We also need to know the deviation between
the angle of robot’s direction and the proper angle which
leads to the goal. Formulae (8) and (9) can be written with
the help of diagram in Figure 6.

Figure 4. Example of difference between result of approximate


(imperfect) and perfect model

Figure 6. Presentation of angular deviation ( ϕ)

3
 yE 
α = tan−1  (8)
 xE 
ϕ = θ −α (9)

d= xE + y E
2 2 (10)

The block CompareToConstant in the model check the


distance is greater than the specified tolerance value
(goaltol). If distance is smaller, then it gives zero as
output, which is immediately reset speed to zero. If you
disable this lock, the robot will also reach the finish line,
but will go further.
Figure 8. “d”input
V. BUILDING FUZZY CONTROLLER
The second input is the “phi” angle with the following
value domain: [-pi, + pi]. This is the angle, which shows
how much the deviation is between the target and the
orientation of the car. There are three values: right, left, or
straight. Thus indicating that relative to target car is in
right, in left or in straight. The following rules are set up:
• If the robot-car is turning left, the speed to slow and
turn to right direction.
• If the robot-car is turning right, the speed should be
slower and turn to left.
• If the robot-car towards the target, then move forward
with high-speed.

Figure 7. FIS Editor

There are two inputs as can be seen in Figure 7: “d” as


distance and “phi” as the angle of direction error. Outputs
are “v” as velocity and “gamma” as angle of steering
wheel, with which the model is controlled. These will be
the input of kinematic model. We chose “trimf” as
membership functions for easy use and implementation.
Other parameters were left as default values, because
there was no purpose in their detailed study and
optimization. Figure 9. Velocity output
Two Membership Functions were created for the two
types of ratings determined of the distance (Figure. 8): or The output speed (v) can be slow or fast (Figure 9).
close to the goal (small) or away from the goal (big). The Based on the rules laid down the car's speed will take
two membership functions are set up in form as shown, so values in given [0 30] m/s range. The range of values in
that the “small” value can influence the output with a this case is just one example.
higher percentage, it is activated for 5 meters distance. The second output is the “gamma”, which is adjusted
This is necessary to have a more gradual decrease of to second input (phi) described with three membership
speed. We determined with rules that if the distance is functions: go left (goleft), go straight (straight) or go to
small, then the speed is reduced. the right (goright). Its limit is consistent with the
boundaries of steering wheel defined in model with

4
variables GammaMin and GammaMax. In this example it In the example shown, the initial parameters are as
is [-1 +1] radian. follows:
time = 5; vmin = 0;
The following rules set up for the fuzzy controller
xdes = -30; vmax = 40;
(Figure 10): ydes = 15; shaftd = 0.5;
xstart = 0; gammamin = -0.2;
ystart = 0; gammamax = 0.2;
goaltol = 0.3;
Figure 13 shows the paths taken by the vehicle to be
Figure 10. Fuzzy rules almost identical. With the difference that P control is not
sent to the finish during the given time (5 sec). This is
Figure 11 shows the Fuzzy’s surface of output in terms because the P controller always slows down the vehicle as
of speed. In the three-dimensional coordinate system the it approaches to the goal.
surface displays all the possible values of speed which
depend on two inputs: phi and d. The speed in phi angle
point of view is maximum value, when the car is moving
towards the goal line. The speed is less when more left or
right of the vehicle is turning away from the goal. The
rule of speed in terms of distance: greater distance effect
higher speed.

Figure 13. XY graph of path (P and FZZ)

Figure 11. surface of speed control

VI. COMPARING P AND FUZZY


CONTROLLER
For comparison we built P controller in given [1]
(Figure 12). The values of P controller (0.5 for speed and
4 for the angle) are not derived from the book, the author
set them empirically.

Figure 14. Controller curves

The angle changes very abruptly at P solution (Figure


14.). The fuzzy control is much finer change of the angle,
Figure 12. P controlling of bicycle, based on [1]

5
so softer turn to the target path. The Figure also shows requirements. The examples present the differences
that P controller affects faster speed at the beginning with between the two controllers, the advantages and
a short time, then slowly rolling towards the goal, but it disadvantages. Fuzzy Control shows better solution in
does not reach it. The fuzzy keep slowly during object terms of speed, because the reality is closer to its
turning towards the target, but as more find the right behavior. Fuzzy advantage is that better can be
angle, more and more fast. At the end of the road it will customized the desired behavior with set the rules. Of
slow down as it is pre-determined with rules. course, Fuzzy needs more calculation than the P
controller.
VII. CONCLUSION We carried out a fitness analysis of current example,
We were building the bicycle kinematic model on [1], which can be calculated from measurement of driving
which is completed. We used the published P control for parameters (Table I.). The fuzzy achieved better value by
comparison purpose. In addition we have developed this evaluation too.
Fuzzy controller which operates in accordance with our
TABLE I. – FITNESS EVALUATION OF P AND FUZZY DRIVING EXAMPLE
P Fuzzy
Property of driving Description Formula controller controller
completion time Driving is better if completion time shorter t C = t | d ≤ 0 .5 m 8.76 2.48

∫ v (t )dt
1 tC
average speed Magnitude of speed normalize the other properties v= 4.51 15.52
tC t =0

1  dv(t ) 
2

t ∫  dt 
mean square of acceleration Driving is better if acceleration are smaller and without peaks e=   dt 2095 779.6

105
Fitness function The value which indicate goodness of driving or controlling F= 1.207 3.324
tC ⋅ v ⋅ e

REFERENCES
[1] Peter Corke: Robotics, Vision and Control; Fundamental
Algorithms in MATLAB, ISBN 978-3-642-20143-1, Springer-
Verlag Berlin Heidelberg, 2011
[2] Jacky Baltes, Robin Otto: „A Fuzzy logic controller for car-like
Mobile Robot”
http://www4.cs.umanitoba.ca/~jacky/Robotics/Papers/baltes99_fuz
zy_logic_contr_car_like_mobil_robot.pdf
[3] Istvan Kecskes, Peter Odry: „Fuzzy Controlling of Hexapod
Robot Arm with Coreless DC Micromotor“, XXIII. MicroCAD,
Miskolc, 2009 march 19-20
[4] Prof. Katie Byl: Mobile Robot Kinematics,
http://www.ece.ucsb.edu/courses/ECE179/179D_S12Byl/pdf/Mobi
leRobotKinematics.pdf

You might also like