You are on page 1of 6

Methods and algorithms for motion control of walking mobile robot

with obstacle avoidance


TEFAN ADRIAN DUMITRU, DAN BUCUR, DOINA MARIN
Robotics and Mechatronics Department,
Institute of Solid Mechanics of the Romanian Academy
15 C-tin Mille, Sector 1, Bucharest,
ROMANIA
dan.bucur@ymail.com , dumitru_sa@yahoo.com, marin_doina@yahoo.com
Abstract: In this paper we intend to find a control method for an autonomous hexapod walking robot. The
proposed algorithm transforms the captured image into a binary one, which, after partitioning, is analyzed by a
neural network. The imposed trajectory is changing, depending on the optimum angle of rotation to avoid the
obstacle. This angle represents the neural networks output. Also we want to find the optimal solution for
moving a leg (the leg has three degrees of freedom). This movement has to be with less energy consumption. To
achieve this, we started from inverse kinematics and we apply a genetic algorithm. For determining the fitness
function values we consider the importance of three factors (Precision, Movement and Friction) on each
sequence of step. To find the coefficients which determine the order of these factors we use the Analytical
Hierarchy Process.
Key-Words: Genetic Algorithm, Analytical Hierarchy Process, Vision, Robot Navigation, Neural Network
1 Introduction
The problem approached is to design a robot able to
move and avoid obstacles in real time in an arbitrary
environment. To this problem were given different
solution, many considering it a problem of artificial
intelligence, fuzzy logic or data fusion from sensors.
Previous research on the movement of a robot in
an arbitrary environment have used genetic
algorithms and fuzzy methods applied on data
collected from a sonar to calculate distances from
the robot to obstacles in the environment [1,2,3].
Techniques have also been used to calculate the
fractal dimension on the values obtained from an
infrared proximity sensor and to use the results as
input data into a neural networks that drives robots
motors [4]. Kyung-Joong Kim and Sung-Bae Cho
chose to use neural network based on cellular
automata to develop an autonomous robot. It is able
to explore the environment using distance and light
sensors considering that the recharge area must be
reached before battery discharge [5,6]. There are
also used statistical methods that rely on the
information collected from the sonar and inertial
sensors to make a prediction on the trajectory based
on a predetermined distribution [7].
Recently, artificial vision attracted many
researchers. There are several control techniques
developed for this procedure. Among them we can
list several alternatives: stereoscopic method that
uses two fixed cameras, placed to a predetermined
distance, to appreciate the depth of the object in
video capture. These methods can be used to
provide high precision to the placement of a robotic
arm [8] or to study the depth of a surface texture
[11].
Monocular version implies a single video
camera. M. Mazo, FJ. Rodriguez, E. Santiso and
M.A. Sotelo have developed a system using this
principle that follows a road [9]. Mixed systems
were also developed, in which the artificial vision
has been combined with other sensors. Such a
system was developed within the EU project:
Integrated quality assurance of chilled food fish at
sea. This system uses a camera and a laser to
estimate the weight of fish on a conveyor belt [12].
In this paper we also intend to find the optimal
position of the leg after performing a step, given the
influence of three factors (accuracy, motion and
friction) on its motion. Thus we apply inverse
kinematics to find the angles of each joints. These
values represent the input of a genetic algorithm
with these values we generate algorithms initial
population. The genetic algorithm is used to obtain
optimal values for the angles of joints, taking into
account the three factors. They are introduced in the
algorithm using the fitness function and their eights
are determined using the Analytical Hierarchy
Process.
2 Robot control algorithm
Driving a walking robot means applying the
algorithm shown in figure 1 at each step. This
algorithm consists of four modules. The first
module, image processing algorithm, captures and
processes an image to obtain input values for the
neural network from the neural controller module. It
processes the data received and provides the rotation
angle of robot to output.
Fig.1 Robot control algorithm
The third module, Bezier interpolation,
calculates the deviation from the old path so the
robot avoids the obstacle. Next step assumes finding
the positions coordinates of the point necessary to
take a new step.
Image processing algorithm. Images are
captured using a video camera to calculate the
rotation angle that robot has to make in order to
avoid an obstacle. Captured image is converted into
a binary picture with a resolution of 640480 pixels.
Fig.2 Sample of image processing
To increase the speed calculation, only third-
lower part of the image is processed. This part is
divided into 24 blocks, each block of 5380 pixels
(fig. 2).
Neural Controller. The neural network
implemented is shown in figure 3 and has 24 input
neurons, 4 neurons in the hidden layer and one
output neuron. Input neurons receive information
about the gray level of each corresponding block of
the captured image.
The activation of input units, scaled between 0
and 1, is obtained from the average of levels of gray
of all pixels within the correspondent block of the
partition. The hidden and output units use logsig
activation function:
i
x
i
e
y

+

1
1
(1)
where the incoming activation for node i is:

j
j ji i
y w x
(2)
and j ranges over nodes with weights into node i and w
ij
is the weight matrix.

Fig.3 Implemented neural network
The networks output is the rotation angle of the
robot to realise the next step. This angle is obtained
after the processing of captured pictures. Negative
values mean clockwise rotation, while positive
values mean counter-clockwise rotation. If the
requested value is greater than the maximum angle

max
, then the step length changes.
Fig.4 Matlab model of Neural Network Architecture
In figure 4, the hidden layers receive values from
the previous layer through weights matrix w and
compare them with the bias values. The value
obtained is processed with logsig function and sent
to the next level.
The algorithms used for training and
performance evaluation of the neural network are
Levenberg-Marquardt backpropagation and Mean
Squared Error. Levenberg-Marquardt algorithm
modifies the weights and bias values using Newton-
Gauss interpolation and descending gradient
method, while Mean Squared Error is a statistical
estimator that measures the difference between
default and real values of the estimated quantity.
Given the input from the image processing module,
the network output, which is the rotation angle that
robot must make to avoid an obstacle, is directly
proportional to the average active pixels from the
binary image.
Bezier Interpolation. After the angle of rotation
is found, it has to recalculate the path so the robot
will avoid the obstacle. This is done using Bezier
Interpolation through curve parametrization,
according to the control polygon (fig. 5):
4
4
3
3
2
2 2
1
3
0
4
) 1 ( 4 ) 1 ( 6
) 1 ( 4 ) 1 ( ) (
P t P t t P t t
tP t P t t B
+ + +
+ +
(3)
4 3 2 1 0
, , , , P P P P P
are the control points of the
curve, respectively:
0
P is the robots current
position calculated as the center of gravity described
by the three legs that supports the robot,
1
P is the
point on the tangent in the point
0
P to trajectory at
distance of [ ]
4 0
, 3 / 1 P P from
0
P .
2
P is at the
distance of l 2 from the
4 0
P P

line,
3
P is the point
on the tangent in point
4
P at distance of -
[ ]
4 0
, 3 / 1 P P
from
4
P , respectively
4
P is the point
on the old path at distance of ) 4 , 4 max(
v
d l from
current point.
Fig.5 Bezier curve with 5 control points
Choosing these points ensures the obstacle
avoidance. Of course, if during the obstacle
avoidance is found that, the robot will collide with
the obstacle, the path will change using the same
principle but applied to the current point.
Step position generation. For each leg the
coordinates of current support points are computed
using the following formula:
initial current
poz
pas
R poz +
1
]
1

0
) ( (4)
where poz
current
and poz
initial
are the coordinates of
current support point and, respectively, of initial
support point, pas represents step length, and R()
is the rotation matrix.
1
]
1

) cos( ) sin(
) sin( ) cos(
) (


R (5)
P
c
is the point that follows the predefined
trajectory and is located at the intersection of
segments that connect the suspension points of the
legs.
3 Step control of the robot.
Considering a hexapod robot with leg kinematic
shown in figure 7, a leg with three degrees of
freedom, where l
1
= l
2
= 250 mm and l
3
= 50mm, and
the robot platform that is at height of h=440 mm
from the surface. A normal step length is 560 mm.
We consider as starting point P
0
(0, 0, 0) and end
point will be P
1
(280, -440, -32.47). For each joint
we get two solutions.
Fig.6 System diagram
These solutions are used to generate initial
population for genetic algorithm. Fitness function
should be determined considering the three
constraining factors (accuracy, movement and
friction), for which is used Analytical Hierarchy
Process. The algorithm is repeated until new
population fits with what we want to achieve, in
which case the result is stored and the algorithm
stops.
Fig.7 The robot leg after performing the step.
Inverse kinematics. The robots platform is at
height of h from the surface. In a walking sequence
we want to move the leg according a given
trajectory, from the beginning point P
i
(x
i
,y
i
) to a
point P
i+1
(x
i+1
,y
i+1
) where it have to get after
performing the step, forming an angle named .
Inverse kinematics is applied using these data and
we obtain the following system:

'

+ +
+ + +
+ + +
3 2 1
3 2 1 2 1 1
3 2 1 2 1 1
sin ) sin( sin
cos ) cos( cos



l l l y
l l l x
(6)
where

,
_

+
+

,
_


h
pas pas
h
pas
i i i
2
2
tan
2
tan
1 1 1 1
(7)
and
i
pas
is the current step length, and
1 i
pas
is
the previous step length. Solving this system we get
two values for each angle :
04 . 10
15 . 45
,
11 . 35
11 . 35
,
63 . 77
51 . 42
3 2 1

(8)
Analytical Hierarchy Process. Analytical
Hierarchy Process is a structured technique used to
make complex decisions. Rather than describing a
correct decision, Analytical Hierarchy Process
helps us find the solution that best fits the problems
goal and understand its purpose it organize
decisions that people have already made [10].
Fig.8 Analytical Hierarchical Process Diagram
Based on mathematics and psychology,
Analytical Hierarchy Process provides a good and
rational framework for structuring a decision
making problems, for representing and quantifying
its elements, to link those elements to the global
objectives and for evaluating alternative solutions.
Analytical Hierarchy Process is a method to obtain a
ratio scales from paired comparisons. The input data
can be derived from actual measurements as height
or price, as well as objective opinions, satisfaction
feelings or preferences. Ratio scale is obtained from
primary eigenvector and consistency index value
derived from their primary eigenvalue. In our case
the problem is finding the optimal solution for leg
movement in a walking sequence. From the many
factors influencing this movement, accuracy,
movement and friction were chosen. Because the
influence of these factors is reflected in the final
solution, we will use them in determining the fitness
function of the genetic algorithm. Analytical
Hierarchy Process introduces these factors into
fitness function.
Table 1. Influence of factors on angles
Factor
Influence of factors on angles

1

2

3
Precision 0.1932 0.1382 0.7225
Motion 0.7235 0.3579 0.1741
Friction 0.0833 0.5038 0.1033
Using
max
and its eigenvector, we obtain
04 . 3 ) ( , 74 . 2 ) 2 ( , 11 . 3 ) (
3 1

.
Thus, fitness function is given by:
) ( ) ( ) ( ) (
3 3 2 2 1 1
+ + x f
(9)
Genetic Algorithm. Genetic algorithms are part
of the numerical algorithms used for solving
optimization problems, being inspired by both
natural selection and from natural genetics.
Table 2. Initial Population and its fitness values
No. Chromosome Fitness Value
1. 42.51, 324.89, 45.15 1230.3
2. 42.51, 324.89, 10.04 1125.3
3. 42.51, 35.11, 45.15 366.7
4. 42.51, 35.11, 10.04 261.7
5. 77.63, 324.89, 45.15 1335.3
6. 77.63, 324.89, 10.04 1230.3
7. 77.63, 35.11, 45.15 471.7
8. 77.63, 35.11, 10.04 366.7
The method is a general one, able to be applied
to an extremely wide range of issues. Unlike some
particular approaches, genetic algorithms are
general techniques and are used to solve practical
problems on an ordinary basis. The results obtained
above for the angles are used to form the initial
population of genetic algorithm. Two values are
obtained for each angle applying inverse
kinematics. The six values form eight chromosomes
that form the initial population for genetic
algorithm.
4 Results and conclusions.
In this paper we present a hexapod robot, for which
we have the following characteristics: platform
length is m L 5 . 1 , platform width m l 1 ,
platform height is maintained at m h 44 . 0 ,
distance between the legs is
m l
p
56 . 0
, focusing
distance of the camera is m L d
v
25 . 2 5 . 1 ,
maximum step length is m p 56 . 0
max
, maximum
rotation angle at one step is 45
max
. The six
legs are RRRR robotic systems, where a rotation is
perpendicular to the platform and the other three are
parallel to it. The video camera is placed above the
center of gravity of the robot at height h
v
from the
ground. Captured image resolution is 640480.
Fig.9 Neural network training session
In order to evaluate the proposed control
algorithm, we design a work environment in which
the robot will move. In this environment the robot
must reach the given target point by avoiding
obstacles.
Data for network training were obtained
experimentally by successive attempts to achieve
the desired results. Effective training network has
provided us with data about the performance and
training sessions. (fig. 9).
To achieve an optimal movement of a leg, in a
step sequence, using the values from inverse
kinematic, we apply a genetic algorithm. After
running this algorithm twice we obtain the results
presented in table 3. Solving the mathematical
system we obtained the exact values of joint angles,
required to move the leg to the specified position.
After applying the algorithm we get some values
that place the leg somewhere near the desired point.
Table 3. Final Population and its fitness values
No. Chromosome Fitness Value
1. 52.75, 161.05, 45.23 772.89
2. 52.75, 161.05, 9.95 667.40
3. 66.83, 161.05, 45.23 814.99
4. 53.31, 161.05, 9.95 669.08
5. 53.31, 161.05, 45.23 774.56
6. 66.83, 161.05, 9.95 709.50
7. 67.39, 161.05, 45.23 816.66
8. 67.39, 161.05, 9.95 711.18
Fig.10 Trajectory when meeting the first and the
second obstacle
The target given to robot was point of coordinate
(50, 654) [cm] considering that its initial position is
the origin of Cartesian coordinate system. Imposed
initial trajectory of the robot is the line that connects
starting point to target point. In figure 10 is shown
the path which changes when the robot meets
obstacles in the environment. When an object enters
the visual field on the right, the output neuron gives
a positive rotation angle, so the next rotation will be
counterclockwise. Also, the size of step length is
changing depending on that angle. Thus when there
is no obstacle in the visual field the step length is
maximum, and when the angle exceeds the
maximum acceptable angle the step is shrinking.
The result of step length change is that the robot
avoids the obstacle even if it occupies entire left or
right visual field.
The results show that even when the object
occupies more than half of the left or right side of
the visual field, the robot finds a solution to avoid
the obstacle, reducing the step length up to zero.
Networks performances are not affected by
changing the architecture of work environment, the
robot being able to bypass the encountered obstacles
and move towards the target regardless of the
resulting deflection.
In future studies we have interest in studying
how the visual field and the number of partitions
affect network performances and developing one
able to make correct decisions in situations where
not all objects are fixed. Also we want to find a
method to control the robots leg movement to
achieve the desired position precisely with lower
energy consumption.
References
[1] J.Velagic, B.Lacevic, B.Perunicic, A 3-level
autonomous mobile robot navigation system
designed by using reasoning/search approaches,
Robotics and Autonomous Systems, Vol.54, 2006,
pp. 989-1004
[2] A.L.Nelson, E.Grant, Using direct
competition to select for competent controllers in
evolutionary robotics, Robotics and Autonomous
System, Vol.54, 2006, pp.840-857
[3] Vladareanu, L., Tont, G., Ion, I., Munteanu,
M. S., Mitroi, D., "Walking Robots Dynamic
Control Systems on an Uneven Terrain", Advances
in Electrical and Computer Engineering, ISSN
1582-7445, e-ISSN 1844-7600, vol. 10, no. 2, pp.
146-153, 2010, doi: 10.4316/AECE.2010.02026
[4] Md.Monirul Islam, K.Murase, Chaotic
dynamics of a behavior-based miniature mobile
robot: effects of environment and control structure,
Neural Networks, Vol.18, 2005, pp.123144
[5] Kyung-Joong Kim, Sung-Bae Cho, Evolved
neural networks based on cellular automata for
sensory-motor controller, Neurocomputing, Vol.69,
2006, pp.21932207
[6] A.L. Nelson, E. Grant, T.C. Henderson,
Evolution of neural controllers for competitive game
playing with teams of mobile robots, Robotics and
Autonomous Systems, Vol.46, 2004, pp.135150
[7] M.Knudson, K.Tumer, Adaptive navigation
for autonomous robots, Robotics and Autonomous
Systems, In Press, Corrected Proof, Available
online, 2011
[8] M.B. Lynch, C.H. Dagli, M.Vallenki, The
use of feedforward neural networks for machine
vision calibration, Int. J. Production Economics
Vol.60-61, 1999, pp.479-489
[9] M. Mazo, F.J. Rodriguez, E. Santiso, M. A.
Sotelo, Road Following By Artificial Vision Using
Neural Network, IFAC Artificial Intelligence in
Real Time Control, 1994
[10] Vladareanu L., Sandru O.I., Velea L. M.,
YU Hongnian, The actuators control in continuous
flux using the Winer filters, Proceedings of
Romanian Academy, Series A: Mathematics,
Physics, Technical Sciences, Informantion Science,
Volume: 10 Issue: 1 Pg.: 81-90, 2009, ISSN 1454-
9069
[11] K. Niranjan Prasad, B. Ramamoorthy, Tool
wear evaluation by stereo vision and prediction by
artificial neural network, Journal of Materials
Processing Technology, Vol.112, 2001, pp.43-52
[12] D. Marin, Dynamical system performance
of numerically controlled machine tools, Recent
Advances in Applied Mathematics Proceedings of
the American Conference on Applied Mathematics,
Harvard University, Cambridge, USA, 2010, pp.
367-372
[13 F.Storberck,B.Daan, Fish species recognition
using computer vision and a neural network,
Fisheries Research, Vol.51, 2001, pp.11-15

You might also like