1

DESIGNING A NEURO PD WITH GRAVITY COMPENSATION FOR
SIX LEGGED ROBOT

Efrén Gorrostieta Hurtado
Instituto Tecnológico de Quéretaro, México
efren.hurtado@usa.net
Alberto Aguado Behar
ICIMAF, Cuba
aguado@icmf.inf.cu
Emilio Vargas
Centro de Ingeniería y Desarrollo Industrial
Querétaro, México
emilio@cidesiqueretaro.com

Abstract. In this work it is shown the design of a neuro PD control with gravity compensation for
the generation of leg trajectories of a six-legged robot. The paper is divided in three parts. In the first
part the dynamic model for the robot’s leg is introduced, the second part shows the control law
designed by considering the gravity effect and the dynamic parameters, finally in the third part we
discuss the experimental results obtained by computer simulation.

Keywords. Walking machine, control trajectory, hexapod robot.


1. INTRODUCTION
The design of the control system in a walking
robot plays an important role for efficient walking
manner. Several problems have to be solved to
obtain an automatic locomotion behavior. Some
of these problems are the stability control during
the walking process, the working space restriction
to avoid crashing impacts between legs or body,
the force distribution in the robot and the adaptable
way to walk on different terrains. At the time,
several ways exist to make easy the walking
locomotion with a kind of adaptability but more
research is needed.

Fig. 1. Configuration of the walking robot.
We focus our attention in the validation of a PD
control law considering the gravity effect of the
legs as a way to increase the locomotion speed and
reduce the energy consumption. A neural
component is included aimed to add some
adaptability capacity to the control scheme. Figure
1 shows the robot design; the morphology of the
robot is similar to the given in [1].

2. DYNAMIC MODEL OF THE LEG
The design of the control law is based in the
dynamic model of the robot’s leg. Each leg of the
robot consists of a basic configuration of three
degrees of freedom as is shown in figure 2. The
variables and parameters that conform the
mathematical model of the robot are the following:
θ
1
, θ
2
, θ
3
are the relative angles between the links,
which are independent; l
2
and l
3
are the effective
longitude for the link 2 and link 3; m
1
, m
2
, m
3
and
J1, J2 and J3 are the mass and the inertia for link 1,
link2 and link3, respectively.


2

Fig. 2. Parameter and variables used in the leg
modelling.

We consider each link, as a rigid body. From and
energetic point of view, the Lagrange technique is
used to obtain the dynamic model for the legs.
Equation 1 is a fundamental relationship between
internal and external energy. K represents the
kinetic energy of the mechanical system and U
represents the potential energy.

(1) U K L − =

Equation 2 is the fundamental relationship to
determine the external torque for each generalized
coordinate.

τ =
θ ∂


|
|
.
|

\
|
θ ∂

n n
L L
dt
d
&
(2)

The mathematical dynamic model for the legs is
expressed by equation 3, the system can be
reasonably represented as a second order
differential equation.


..
0 b b
b 0 b
0 0 0
a a 0
a a 0
0 0 a
2
3
2
2
2
1
32 31
23 21
3
2
1
33
32
23 22
11
+
(
(
(
(
¸
(

¸

θ
θ
θ
(
(
(
¸
(

¸

+
(
(
(
¸
(

¸

θ
θ
θ
(
(
(
¸
(

¸

&
&
&
& &
& &
& &


(
(
(
¸
(

¸

τ
τ
τ
=
(
(
(
¸
(

¸

(
(
(
¸
(

¸

+
(
(
(
¸
(

¸

θ θ
θ θ
θ θ
(
(
(
¸
(

¸

+
3
2
1
3
2
1
33
23 22
3 2
3 1
2 1
33
23 21
12 11
g m
g m
g m
f 0 0
f f 0
0 0 0
c 0 0
c 0 c
0 c c
& &
& &
& &

(3)

where:
3 3 3 32
3 2 3 2 3 2 3 32
3 2 3 2 3 2 3 23
3 3 2 2 2 22
3
2 2
3 3 3 2 3 2 3 2
2 2
2 3 1 11
J m l
4
1
) cos cos sen (sen l l m
2
1
) cos cos sen (sen l l m
2
1
l m l
4
1
J
cos l m
4
1
cos cos l l m
2
1
cos l m J
+ =
+ =
+ =
+ + =
+ + + =
a
a
a
m a
a
θ θ θ θ
θ θ θ θ
θ θ θ θ
(4)

) cos cos sen (sen l l m
2
1
2 sen
2
1
- sen cos l ( l m
2
1
b
) sen cos - cos (sen l l m
2
1
sen cos l l m
4
1
- ) sen2 m sen2 (m l
2
1
-
3 2 3 2 3 2 3 32
3 3 2 2 3 3 31
3 2 3 2 3 2 3 23
2 3 3 2 3 2 3 2 2
2
2 21
θ θ θ θ
θ θ θ
θ θ θ θ
θ θ θ θ
+ =
=
=
+ =
b
b
b
(5)

The Coriolis and centrifugal terms are defined by
the conjunction of square angular velocity effect
and the multiple coordination of the angular
velocities for each generalized coordinate.


) sen cos - cos sen ( l l m
2
1
) cos sen - sen cos ( l l m
2
1
) cos sen - sen cos ( l l m
2
1
) 2 sen l m
2
1
sen cos l l m
2
1
-(
) 2 sen l m
4
1
cos sen l l m
2
1
2 sen l -(m
3 2 3 2 3 2 3 33
3 3 3 2 3 2 3 23
3 3 3 2 3 2 3 21
3
2
3 3 3 2 2 3 3 12
2
2
2 2 3 2 3 2 3 2
2
2 3 11
θ θ θ θ
θ θ θ θ
θ θ θ θ
θ θ θ
θ θ θ θ
=
=
=
+ =
+ + =
c
c
c
c
c
(6)

Coefficients fij are the terms for the gravity effect
of the masses.

cos l
1
f =


cos l f =
(7)
cos l
1
f θ =
3 3 33
2 2 23
2 2 22
2
2
θ
θ

The numeric values used in the simulation of the
model can be seen in the Table I

TABLE I
m
1
0.0326 Kg. J
1
1.95x10
-3
Kgm
2

m
2
0.0726 Kg. J
2
2.95x10
-3
Kgm
2

m
3
0.0653 Kg. J
3
1.95x10
-3
Kgm
2

l
1
0 m ξ
1
0.03
l
2
0.12 m ξ
2
0.04
l
3
0.24 m ξ
3
0.02






3

3. Dynamic Control of the Robot’s Leg
Once constructed the dynamic model of the leg,
we can accomplish a simulation study that will
illustrate the behavior of the system. We focus our
attention to make the study considering the system
torques of each joint as the inputs and the joint
angles and velocities as the outputs of the model.
In order to describe the position of each leg in a
cartesian coordinate frame, a cinematic model to
transform the robot positions to cartesian positions
(X,Y,Z) was used. On the other hand, we design a
control law which uses the angle joints errors to
calculate the torques which must be applied to
each joint actuator, and then evaluate the dynamic
model to get new angles for the joints. Figure 3
shows the block diagram of the control law, this
scheme is well known as control with gravity
compensation which is represented by C(g) [2].



Fig. 3. Block diagram of the control law.

The control algorithm used to move a leg in the
simulations was a PD control law, which requires,
as it is known, to tune two constants by each
degree of freedom, proportional gain K and the
derivative gain Kd. In our intention to control the
position and velocity of each joint, we must tune a
total of 12 variables.


TABLE II
PD CONTROL CONSTANTS FOR POSITION
CONTROL
Constants K1 K2 K3 Kd1 Kd2 Kd3
Value
0.06 0.09 0.2 0.009 0.6 0.01




TABLE III
PD CONTROL CONSTANTS FOR VELOCITY
CONTROL
Constant K1 K2 K3 Kd1 Kd2 Kd3
Value
0.04 0.9 0.17 0.001 0.02 0.02


In tables II and III, values of proportional and
derivative gains for the cases of leg’s position and
velocity control which were the best obtained by
trial an error in the simulation study, are shown.
Position and velocity must follow trajectories
generated by the respective trajectory generators.

As will be seen in figures 7 to 12, those values of
the control constants guarantee that the the angle
positions move relatively smoothly until arriving
at the wished trajectories even when some
oscilations are observed, specially in the third
joint. However, the tracking of velocity
trajectories is very deficiently achieved, in fact, big
deviations of desired trajectoires can be observed.

To improve the performance of the PD controller,
adding an adaptive component which can cope
with the external disturbances, the multivariable
essence and the strong nonlinearities of the robot,
we propose a neural component which can correct
in real time the values of the proportional and
derivative gain coefficients. In the next section,
the derivation of the neural correction algorithm
will be presented.


4. Neuro-PD algorithm
In figure IV, an scheme of the neuro-PD controller
is presented. In the sake of clarity, only two nets
are depicted, even when 6 will be requiered for
every leg, one for each gain coefficiente (3 for
proportional and 3 for derivative constants).

The neural nets are of the perceptron type, with a
hidden layer which has only a neuron with a
sigmoid activation function. The output layer is
linear and has also a single neuron. The outputs of
the nets are respectively ∆K
p
and ∆K
v
, that is the
increments of proportional and derivative gains.
The inputs of all the neuronal networks are the
output errors and their first differences, that is:
| | ) t ( e ∆ ) t ( e ) t ( x
p p
= (8)
where
) t ( θ ) t ( θ ) t ( e
d p
− = (9)
represents the errors in the joints angles.

The neural networks are trained by means of
special backpropagation algorithm which will be


4
developed in detail for the case of proportional
gain changes. The derivative constants
modifications can be obtained in a similar way.

The objective function that must be minimized by
means of the neural nets is the quadratic function:
) t ( e
2
1
) t ( E
2
p ∑
= (10)



Figure 4 Neuro PD control structure.
The joint angles θ(t) are related with the input
torques by means of a supposed unknown non-
linear dynamic model that we denote by:
)) t ( τ ( R ) t ( θ = (11)
As can be seen, in (20) and (21) it appears the
partial derivative
τ
θ


, which can not be evaluated
under the assumption that the robot model is not
precisely known. Even in the case that we dispose
of a precise model, the evaluation would be very
time consumming for real time realization of this
algorithm. As it was shown in [ 7] and [8], under
some not very restrictive conditions, that partial
derivative, also known as the Jacobian or
equivalent gain of the process under control, can
be substituted by its sign. Then, equations (20) and
(21) can be simplified to:
The torques calculated by the controller are:
) t ( e k ) t ( e k ) t ( τ
v v p p
+ = (12)
The proportional gain will change as follows:
p p p
k ∆ k k + = (13)
vh k ∆
p
= (14)
where v

is the weight coefficient which connect
the hidden with the output neuron and h is the
output of the hidden neuron.
The inputs to the neurons of the hidden layer are
) t ( e ∆ w ) t ( e w s
p 2 p 1
+ = (15)
The activation function of the hidden neuron is:
s
e 1
1
h

+
= (16)
To apply the back propagation algorithm it is
necessary to calculate the gradient of the function
E
p
whit respect to the coefficient v and w, that is:

(
(
(
(
¸
(

¸





= ∇
j
1
w
) t ( E
v
) t ( E
) t ( E (17)
The partial derivatives which appear in equation
(17) can be calculated by means of the chain rule
of derivations, that is:

1
p
p
p
p
p
p 1
v
K ∆
K ∆
K
K
τ
τ
θ
θ
e
e
) t ( E
v
) t ( E












=


(18)
j
p
p
p
p
p
p
p j
w
s
s
h
h
K ∆
h
K ∆
K ∆
K
K
τ
τ
θ
θ
e
e
) t ( E
w
) t ( E


















=


(19)
After the sustitution of the partial derivatives
which appear in (18) and (19), we arrive to:
τ
θ
h ) t ( e
v
E
2
p
1
p


− =


(20)
j 1
2
p
1
p
x ) h 1 ( h v
τ
θ
) t ( e
v
E



− =


(21)

) R ( sign h ) t ( e
v
E
2
p
1
p
− =


(22)

j 1
2
p
1
p
x ) h 1 ( h v ) R ( sign ) t ( e
v
E
− − =


(23)
The function sign (R) is evaluated as +1 or –1
depending on the sign of the relation between the
angular position and the applied torque which can
be considered, for the case of the robot, as allways
positive.

Equations (22) and (23) can be used to derive the
adaptation equations for the weight coefficients of
the neural net, w and v, using the steepest descent
method as follows:
) R ( sign h ) t ( e η ) t ( v ) 1 t ( v
2
p 1 1
+ = + (24)


5
j 1
2
p j j
x ) h 1 ( h v ) R ( sign ) t ( e η ) t ( w ) 1 t ( w − + = +
(25)
The adaptive equations (24) and (25) can be
calculated easily in real time and serve to adapt the
values of proportional coefficients Kp, using
equations (13) and (14). A similar derivation can
be used to find the adaptation equations for
derivative coefficients K
d
.

The neural adaptive scheme can be used in a
permanent way, which achieve succesive
improvements of the control behavior.

In tables IV and V are shown the proportional and
derivative gains obtained after several simulations
of the neuro PD control algorithm, parting from
the values which appear in tables II and III

TABLE IV
PD CONTROL CONSTANTS FOR POSITION
CONTROL OBTAINED WITH NEURO
ADAPTATION
Constant K1 K2 K3 Kd1 Kd2 Kd3
Value
0.07 0.30 0.18 0.11 0.011 0.007

TABLE V
PD CONTROL CONSTANTS FOR VELOCITY
CONTROL OBTAINED WITH NEURO
ADAPTATION
Constant K1 K2 K3 Kd1 Kd2 Kd3
Value
0.05 1.70 0.18 0.014 0.0
22
0.0
23


5. Trajectory for the Leg
The primary target that is tried for the control
proposed in this paper is to follow a trajectory for
a leg step. This trajectory is parametrically
designed, and it can change according to the type
of land or application of the robot. Figure 5 shows
a parabolic type trajectory motion for the leg, and
Figure 6 shows a triangle trajectory [3][4] which is
tipical of the movement of some animals. In our
simulation study, however, it was used the
parabolic trajectory due to its simplicity. In this
case the equations for the three degrees of freedom
in the leg are described by th next equations [5]:





Fig. 5. Parabolic trajectory motion.

Fig. 6. Triangle trajectory motion.
(26)
) 1 ξ (cos χ A χ d θ
) 1 ξ (cos β A β d θ
) 1 ξ (cos γ A γ d θ
3
2
1
− − =
− − =
− − =
where dγ, dβ, dχ are the initial values of angles
θ1,θ2,θ3, respectively. Those values fix the initial
position of the leg in the space. Variable Aγ
defines the step lenght and Aβ, Aχ, define the
robot leg height; ξ is an angle which takes values
between 0 and π.

In equation 27, we show the values considering the
dimensions that are required in the generation of
steps for the walking robot of six legs.

(27)
10 χ A 310 χ d
15 β A 4 β d
20 γ A 70 γ d
= =
= =
= =


6. Simulation Results
After determining the type of movement and the
dynamic control law, we evaluate the leg step by
analyzing the motion of each degree of freedom.

One of the considerations we did in our
experiments was to generate smooth movements at
the beginning and the end of the trajectory, as is
shown in Figure 7 for angle θ
1
.



6
In the figures 7 to 12, the desired position and
velocity trajectories and those obtained with PD
and neuro PD control are shown. As can be seen,
for coordinate 2 and 3, the behavior obtained with
the neuro PD is substantially improved, specially
for the velocity trajectories where the oscillations
are supressed and the errors are considerably
diminished.


Fig. 7. Position trajectory for the first degree.


Fig. 8. Position trajectory for the second degree.


Fig. 9. Position trajectory for the third degree.

The leg step is constructed by using the
simultaneous movements of θ
1
, θ
2
and θ
3
. In
Figure 13 are shown, projected in a plane, the
desired and real step trajectories obtained with PD
and neuro-PD controllers. For this step generation
we simulate the altitude and step distance made for
the leg, which is essential information to design
algorithms oriented to adapt the step to the terrain,
according with the legs positions.

Fig. 10 Velocity trajectory for the first degree.




7

Fig. 11 Velocity trajectory for the second degree.


Fig. 12 Velocity trajectory for the third degree




Fig. 13. Step trajectory generation.



6. Conclusions and Future Work
The dynamic model described for a leg of a six-
legged robot is a highly nonlinear system,
obviously this complicate the design of the control
system; however a PD control with gravity
compensation was designed with satisfactory
results. A series of preliminary trajectories were
evaluated by simulation, considering a parametric
mathematical model to facilitate the walking
adaptation for the leg. We could use the
coefficients of the tables 2 and 3 to help us for the
design of a walking generator algorithm. We
continue this research by considering an intelligent
algorithm which includes six simple neural nets for
each leg which permit the adaptation of PD
coefficients and to improve the performance of the
robot. In the future, it is necessary also to research
about the flexibility of the working space area for
the legs which cause that the mobility of the robot
can be increased substantially. The determination
of the mobility for the robot and the stability
evaluation is possible by using a 3D graphic
simulator that is under construction.

ACKNOWLEDGMENT

The authors would like to thank to Dr. Guillermo
Rodríguez for his support of this research in the
Postgraduate Unit at the Industrial Development
and Engineering Center, CIDESI.

REFERENCES

[1] Solano. J, Vargas E, Gorrostieta E, Morales.
C. 2000 “Designing a Walking Robot of Six
Legs ” In Proceedings of International
Symposium on Robotics and Automation
ISRA’2000 (Monterrey N. L. , Mexico, Nov
10 – 12 ).
[2] Tomás Francisco Calyeca Sánchez, Sergio
Javier Torres Méndez, Germán Ardul Muñoz
Hernández . 2000 “PD control system whit
gravity compensation ” In Proceedings of
International Symposium on Robotics and
Automation ISRA’2000 (Monterrey N. L. ,
Mexico, Nov 10 – 12 ).
[3] Peter Nehaus and H Kazerooni. 2001.
“Industrial-Strength Human-Assisted Walking
Robots”, Robotics and Automation Magazine
of IEEE, Vol. 8, No.4 , December 2001.


8
[4] V. Feliu, A Garcia, J. A. Somolinos. 2001. “
Gauge-Base Tip Position Control of a New
Three-Degree- of – Freedom Flexible Robot”,
in The international Journal of Robotics
Research, Vol. 20 No. 8 August 2001.
[5] W. Ilg, T. Mühlfriedel, K. Berns, and R.
Dillmanm “Hybrid Learning Concepts for a
Biollogically Inspired Control of Periodic
Movements for Walking Machines” In Soft
Computing in Mechatronics. Germany 1999.
[6] Shaoping Bai, H Low and Weimiao Guo
“Kinematographic Experiments on The Leg
Movements and Body Trayectories of
Cockroach Walking on Different Terrain” In
Proceedings of International Conferences on
Robotics and Automation (San Francisco Cal,
April 2001)

[7] Aguado, A., Ordaz, A., Noriega, A. “Self-
tuning neural controller”. Proceedings of the
IFAC Symposium on Real Time Control
Architectures. Cancún, 1998.

[8] Cui, X., Chin, K.G. “Direct Control and
Coordination using Neural Networks” IEEE
Transactions on Systems, Man and
Cybernetics”, Vol. 23, No. 3, pp 686-697,
1992.

2. &2 0   θ1   θ 2  + .senθ 3 cosθ 3 ) 2 1 c23 = m3 l 2 l3 (cosθ 2 senθ 3 . From and energetic point of view. K represents the kinetic energy of the mechanical system and U represents the potential energy.0326 Kg. as a rigid body. the system can be reasonably represented as a second order differential equation.95x10-3 Kgm2 0.95x10-3 Kgm2 J3 1. d  ∂L  & dt  ∂θ n   ∂L −  ∂θ = τ n  (2) The mathematical dynamic model for the legs is expressed by equation 3. 1 1 c11 = -(m3 l 2 sen 2θ 2 + m 3 l 2 l3 senθ 2 cosθ 3 + m 2 l 2 sen 2θ 2 ) 2 2 2 4 1 1 2 c12 = -( m3 l3 l 2 cosθ 2 senθ 3 + m3 l3 sen 2θ 3 ) 2 2 (6) 1 c21 = m 3 l 2 l3 (cosθ 2 senθ 3 . m2 0. 1 l 2 cos θ 2 2 f 23 = l 2 cos θ 2 1 f 33 = l 3 cos θ 3 2 f 22 = a 11   0  0   c11 + c 21   0  0 a 22 a 32 c12 0 0   &&1   0 θ   θ a 23  && 2  +  b 21  θ   a 33  && 3   b 31  0 & & 0   θ1 θ 2  0 0   θ θ  + 0 f c 23   & 1 & 3   22 & & c 33  θ 2 θ3  0 0    0 0 b 32 (7) The numeric values used in the simulation of the model can be seen in the Table I m1 0. the Lagrange technique is used to obtain the dynamic model for the legs.04 ξ2 0.senθ 3 cosθ 3 ) 2 1 c33 = m3 l 2 l3 (senθ 2 cosθ 3 .m3 l 2 l3 cosθ 3 senθ 2 2 4 2 1 b23 = m3 l 2 l3 (senθ 2 cosθ 3 .95x10-3Kgm2 J2 2.02 ξ3 0   m1 g   τ1  f 23   m 2 g  =  τ 2      f 33   m 3 g   τ3      (3) where: . Parameter and variables used in the leg modelling.03 ξ1 0.cosθ 2 senθ 3 ) 2 1 1 b31 = m3 l3 (l 2 cosθ 2 senθ 3 .0726 Kg. Equation 1 is a fundamental relationship between internal and external energy.. b 23   & 2   &2 0  θ 3      Coefficients fij are the terms for the gravity effect of the masses.cosθ 2 senθ 3 ) 2 (1) Equation 2 is the fundamental relationship to determine the external torque for each generalized coordinate.24 m TABLE I J1 1. We consider each link.2 a11 = J1 + m 3 l 2 cos 2θ 2 + 2 a 22 = J 2 + a 23 = 1 1 2 m 3 l 2 l 3 cosθ 2 cosθ 3 + m 3 l 3 cos 2 θ 3 2 4 1 l 2 m 2 + l3 m3 4 1 m 3 l 2 l 3 (senθ 2 senθ 3 + cosθ 2 cosθ 3 ) 2 1 a32 = m 3 l 2 l 3 (senθ 2 senθ 3 + cosθ 2 cosθ 3 ) 2 1 a32 = l 3 m 3 + J 3 4 1 1 b21 = . l1 0 m l2 0.l 2 (m 2 sen2θ 2 + m3 sen2θ 2 ) .0653 Kg. m3 0.sen2θ 3 2 2 1 b32 = m3 l 2 l3 (senθ 2 senθ 3 + cosθ 2 cosθ 3 ) 2 (4) Fig.12 m l3 0. L=K−U (5) The Coriolis and centrifugal terms are defined by the conjunction of square angular velocity effect and the multiple coordination of the angular velocities for each generalized coordinate.

the tracking of velocity trajectories is very deficiently achieved. As will be seen in figures 7 to 12.2 0. To improve the performance of the PD controller. However. an scheme of the neuro-PD controller is presented.02 Value 3. The inputs of all the neuronal networks are the output errors and their first differences.06 0.09 0. In our intention to control the position and velocity of each joint.3 Constant K1 K2 K3 Kd1 Kd2 Kd3 0. Figure 3 shows the block diagram of the control law.Z) was used. in fact. Neuro-PD algorithm In figure IV. the multivariable essence and the strong nonlinearities of the robot. which requires. Position and velocity must follow trajectories generated by the respective trajectory generators. a cinematic model to transform the robot positions to cartesian positions (X.001 0. (9) The neural networks are trained by means of special backpropagation algorithm which will be .009 0. that is the increments of proportional and derivative gains. 3. only two nets are depicted. The control algorithm used to move a leg in the simulations was a PD control law. values of proportional and derivative gains for the cases of leg’s position and velocity control which were the best obtained by trial an error in the simulation study. We focus our attention to make the study considering the system torques of each joint as the inputs and the joint angles and velocities as the outputs of the model.04 0. that is: x ( t ) = e p ( t ) ∆e p ( t ) (8) [ ] where e p ( t ) = θ d ( t ) − θ( t ) TABLE III PD CONTROL CONSTANTS FOR VELOCITY CONTROL represents the errors in the joints angles. to tune two constants by each degree of freedom. one for each gain coefficiente (3 for proportional and 3 for derivative constants). The output layer is linear and has also a single neuron. even when 6 will be requiered for every leg.Y. Fig. On the other hand. we must tune a total of 12 variables. those values of the control constants guarantee that the the angle positions move relatively smoothly until arriving at the wished trajectories even when some oscilations are observed. Block diagram of the control law. with a hidden layer which has only a neuron with a sigmoid activation function. In the next section. we design a control law which uses the angle joints errors to calculate the torques which must be applied to each joint actuator. this scheme is well known as control with gravity compensation which is represented by C(g) [2]. we propose a neural component which can correct in real time the values of the proportional and derivative gain coefficients. we can accomplish a simulation study that will illustrate the behavior of the system. In order to describe the position of each leg in a cartesian coordinate frame. Dynamic Control of the Robot’s Leg Once constructed the dynamic model of the leg. as it is known. In the sake of clarity. big deviations of desired trajectoires can be observed. the derivation of the neural correction algorithm will be presented. proportional gain K and the derivative gain Kd. The outputs of the nets are respectively ∆Kp and ∆Kv.02 0. The neural nets are of the perceptron type. In tables II and III. are shown. and then evaluate the dynamic model to get new angles for the joints.6 0. adding an adaptive component which can cope with the external disturbances. specially in the third joint.01 Value 4. TABLE II PD CONTROL CONSTANTS FOR POSITION CONTROL K1 K2 K3 Kd1 Kd2 Kd3 Constants 0.17 0.9 0.

the evaluation would be very time consumming for real time realization of this algorithm. can be substituted by its sign. Then. using the steepest descent method as follows:  ∂E( t )   ∂v  ∇E ( t ) =  1   ∂E( t )   ∂w j    (17) v1 ( t + 1) = v1 ( t ) + ηe p ( t ) 2 h sign (R ) (24) . The joint angles θ(t) are related with the input torques by means of a supposed unknown nonlinear dynamic model that we denote by: θ( t ) = R ( τ( t )) (11) The torques calculated by the controller are: τ( t ) = k p e p ( t ) + k v e v ( t ) (12) The proportional gain will change as follows: = −e p ( t ) 2 h ∂θ ∂τ (20) (21) = −e p ( t ) 2 ∂θ v1h (1 − h ) x j ∂τ As can be seen. we arrive to: ∂E p ∂v1 ∂E p ∂v1 Figure 4 Neuro PD control structure. The objective function that must be minimized by means of the neural nets is the quadratic function: The partial derivatives which appear in equation (17) can be calculated by means of the chain rule of derivations. in (20) and (21) it appears the partial derivative ∂θ . w and v. also known as the Jacobian or equivalent gain of the process under control. As it was shown in [ 7] and [8]. which can not be evaluated ∂τ k p = k p + ∆k p ∆k p = vh (13) (14) where v is the weight coefficient which connect the hidden with the output neuron and h is the output of the hidden neuron. The derivative constants modifications can be obtained in a similar way. Equations (22) and (23) can be used to derive the adaptation equations for the weight coefficients of the neural net.4 developed in detail for the case of proportional gain changes. equations (20) and (21) can be simplified to: ∂E p h= 1 1 + e −s ∂v1 ∂E p = −e p ( t ) 2 sign (R ) v1h (1 − h ) x j ∂v1 = −e p ( t ) 2 h sign (R ) (22) (23) (16) To apply the back propagation algorithm it is necessary to calculate the gradient of the function Ep whit respect to the coefficient v and w. Even in the case that we dispose of a precise model. for the case of the robot. under some not very restrictive conditions. that is: The function sign (R) is evaluated as +1 or –1 depending on the sign of the relation between the angular position and the applied torque which can be considered. that is: E( t ) = 1 ∑ e 2 (t) p 2 (10) ∂E( t ) ∂E( t ) ∂e p ∂θ ∂τ ∂K p ∂∆K p = (18) ∂v1 ∂e p ∂θ ∂τ ∂K p ∂∆K p ∂v1 ∂E( t ) ∂E( t ) ∂e p ∂θ ∂τ ∂K p ∂∆K p = ∂w j ∂e p ∂θ ∂τ ∂K p ∂∆K p ∂h ∂∆K p ∂h ∂s ∂h ∂s ∂w j (19) After the sustitution of the partial derivatives which appear in (18) and (19). The inputs to the neurons of the hidden layer are s = w 1e p ( t ) + w 2 ∆e p ( t ) (15) The activation function of the hidden neuron is: under the assumption that the robot model is not precisely known. as allways positive. that partial derivative.

70 K3 0.θ3. which achieve succesive improvements of the control behavior.θ2. θ1 = dγ − Aγ(cos ξ − 1) θ 2 = dβ − Aβ(cos ξ − 1) (26) TABLE V PD CONTROL CONSTANTS FOR VELOCITY CONTROL OBTAINED WITH NEURO ADAPTATION Constant Value K1 0. Figure 5 shows a parabolic type trajectory motion for the leg. we show the values considering the dimensions that are required in the generation of steps for the walking robot of six legs. This trajectory is parametrically designed.18 Kd1 0. In this case the equations for the three degrees of freedom in the leg are described by th next equations [5]: (27) 6. Variable Aγ defines the step lenght and Aβ. Aχ. as is shown in Figure 7 for angle θ1. however.011 Fig.05 K2 1. define the robot leg height.007 0.30 0. and it can change according to the type of land or application of the robot.07 0. it was used the parabolic trajectory due to its simplicity. Simulation Results After determining the type of movement and the dynamic control law. dβ. and Figure 6 shows a triangle trajectory [3][4] which is tipical of the movement of some animals.0 22 Kd3 0. Fig. we evaluate the leg step by analyzing the motion of each degree of freedom.014 Kd2 0.11 0. A similar derivation can be used to find the adaptation equations for derivative coefficients Kd . Trajectory for the Leg The primary target that is tried for the control proposed in this paper is to follow a trajectory for a leg step. dγ = 70 Aγ = 20 dβ = 4 Aβ = 15 dχ = 310 Aχ = 10 5.18 0. 5. In tables IV and V are shown the proportional and derivative gains obtained after several simulations of the neuro PD control algorithm. In our simulation study. 6. The neural adaptive scheme can be used in a permanent way. respectively. Parabolic trajectory motion. parting from the values which appear in tables II and III TABLE IV PD CONTROL CONSTANTS FOR POSITION CONTROL OBTAINED WITH NEURO ADAPTATION Constant Value K1 K2 K3 Kd1 Kd2 Kd3 0. One of the considerations we did in our experiments was to generate smooth movements at the beginning and the end of the trajectory. Those values fix the initial position of the leg in the space.0 23 θ 3 = dχ − Aχ (cos ξ − 1) where dγ. . using equations (13) and (14).5 w j ( t + 1) = w j ( t ) + ηe p ( t ) 2 sign (R ) v1h (1 − h ) x j (25) The adaptive equations (24) and (25) can be calculated easily in real time and serve to adapt the values of proportional coefficients Kp. In equation 27. Triangle trajectory motion. ξ is an angle which takes values between 0 and π. dχ are the initial values of angles θ1.

Fig. Fig. Fig. Position trajectory for the second degree. the desired position and velocity trajectories and those obtained with PD and neuro PD control are shown. the desired and real step trajectories obtained with PD and neuro-PD controllers.6 In the figures 7 to 12. Position trajectory for the first degree. For this step generation we simulate the altitude and step distance made for the leg. 10 Velocity trajectory for the first degree. . As can be seen. 7. In Figure 13 are shown. Fig. the behavior obtained with the neuro PD is substantially improved. projected in a plane. 9. 8. Position trajectory for the third degree. according with the legs positions. θ2 and θ3. which is essential information to design algorithms oriented to adapt the step to the terrain. specially for the velocity trajectories where the oscillations are supressed and the errors are considerably diminished. for coordinate 2 and 3. The leg step is constructed by using the simultaneous movements of θ1 .

2000 “PD control system whit gravity compensation ” In Proceedings of International Symposium on Robotics and Automation ISRA’2000 (Monterrey N. however a PD control with gravity compensation was designed with satisfactory results. In the future. 11 Velocity trajectory for the second degree. Nov 10 – 12 ). Vargas E. Nov 10 – 12 ). Mexico. Robotics and Automation Magazine of IEEE. 8. 13. Guillermo Rodríguez for his support of this research in the Postgraduate Unit at the Industrial Development and Engineering Center. Conclusions and Future Work The dynamic model described for a leg of a sixlegged robot is a highly nonlinear system. Mexico. L. obviously this complicate the design of the control system. CIDESI. We continue this research by considering an intelligent algorithm which includes six simple neural nets for each leg which permit the adaptation of PD coefficients and to improve the performance of the robot. A series of preliminary trajectories were evaluated by simulation. We could use the coefficients of the tables 2 and 3 to help us for the design of a walking generator algorithm. Vol. ACKNOWLEDGMENT Fig. Germán Ardul Muñoz Hernández . 2001. Sergio Javier Torres Méndez. L. Fig. “Industrial-Strength Human-Assisted Walking Robots”. Gorrostieta E. The determination of the mobility for the robot and the stability evaluation is possible by using a 3D graphic simulator that is under construction. No. Morales. December 2001.7 6.4 . . C. [2] Tomás Francisco Calyeca Sánchez. 12 Velocity trajectory for the third degree The authors would like to thank to Dr. considering a parametric mathematical model to facilitate the walking adaptation for the leg. Fig. 2000 “Designing a Walking Robot of Six Legs ” In Proceedings of International Symposium on Robotics and Automation ISRA’2000 (Monterrey N. REFERENCES [1] Solano. [3] Peter Nehaus and H Kazerooni. . Step trajectory generation. . it is necessary also to research about the flexibility of the working space area for the legs which cause that the mobility of the robot can be increased substantially. J.

Mühlfriedel. X. Cancún. pp 686-697. Ilg. 23. “Direct Control and Coordination using Neural Networks” IEEE Transactions on Systems.. T. A. April 2001) [7] Aguado. Ordaz.. Noriega. [8] Cui. Dillmanm “Hybrid Learning Concepts for a Biollogically Inspired Control of Periodic Movements for Walking Machines” In Soft Computing in Mechatronics. No. K. and R.of – Freedom Flexible Robot”. in The international Journal of Robotics Research. A. A Garcia. A. Feliu. [5] W. Chin. 1998. H Low and Weimiao Guo “Kinematographic Experiments on The Leg Movements and Body Trayectories of Cockroach Walking on Different Terrain” In Proceedings of International Conferences on Robotics and Automation (San Francisco Cal. ..G. [6] Shaoping Bai. J.8 [4] V. 8 August 2001. A. Man and Cybernetics”. Somolinos. 2001. 3. Germany 1999. Vol. 20 No. 1992. “ Gauge-Base Tip Position Control of a New Three-Degree. Berns. Proceedings of the IFAC Symposium on Real Time Control Architectures. K. “Selftuning neural controller”. Vol.

Sign up to vote on this title
UsefulNot useful