A simple model for a walking robot
By A. H. Haji
Some robot applications include necessity of motions similar to human walking. These robots, classified as a branch of mobile robots, are introduced for a wide range of functionalities such as house keeping services, rescuing maneuvers in high risk impassable situations for human beings, artificial legs improvement, etc. However in order to simulate the human walking using current robotics knowledge there are some difficulties which should be noted briefly.

Fig. 1: A fixed robot model for walking simulation can be achieved assuming the hip bone is fixed and the ground is moving in the opposite direction of the real movement.
The first problem we encounter is the modeling scheme. Modeling a mobile robot generally has more difficulties than a fixed robot. Several approaches have established for this case for instance one can use the modified formulation of fixed robots for mobile robots which is however relatively complex.
Another solution is to assume the mobile robot as a fixed robot on a moving ground. In the case of low acceleration motions like slow walking we can suppose the hipbone as the base hinge.
The next crucial point which should be regarded in walking simulation is the number of degrees of freedom (DOF) we would like to enter the model. As a complex natural behavior, the human walking process has a large number of DOF. Several issues including the feet, stomach, chest, back, arms, hands, neck and head cooperate interactively to continue a dynamic equilibrium.
Also each of these issues is much more complicated than a combination of mechanical parts like a mass – spring – damper model. However in this project we have considered a simple case shown in Fig.2: a 3 – linkage mechanism. The construction of the model, path design, inverse kinematics, forward dynamics, inverse dynamics and control are described in the following.

Fig. 2: The Thigh – shank – foot linkage model
Constructing the virtual model
The robot is made using the Robotics Toolbox for MATLAB, Release 6 by Peter I. Corke, (pic@cat.csiro.au,http://www.cat.csiro.au/cmst/staff/pic/robot ). This toolbox introduces fine capabilities for robotic design and analysis with MATLAB. Using this toolbox the construction of the robot shown in Fig.2 can be defined including Denavit-Hartenberg link parameters, each link's mass, inertia matrix, location of the center of mass, joint type, gear ratio and inertia of the driving motor.
Path design and inverse kinematics
The complexities of the walking simulation not only include the body nature but also extend to the path design. In fact the path and motion generations in the walking process are parts of the whole body activities to maintain the dynamic equilibrium. Hence the selection of the walking style depends on several factors like the anatomy of the body, the geometry of the pathway and obstacles, the desired velocity, etc.
A simple algorithm for forward stepping is to track the paths A and B (Fig. 3) such that the foot (link number 3) remains parallel to the ground surface. Fig.4. shows this algorithm schematically
. The path design and inverse dynamics for each part of this motion needs the following steps in the Robotics Toolbox for MATLAB:

Fig. 3: A simple heel path during a gait comprising of two sub paths A and B.

Fig. 4: Four typical states of the robot during a gait. The heel is constrained to track the path
and the foot sole should be always parallel to the ground.
| | Obtaining the transformation matrix of the starting and ending points ( |
| | Determining the trailing time as a vector ( |
| | Using the 'jtraj' command to create a partition in the local joint coordinate ( |

Fig. 5: A 7th order polynomial used for generation of a normalized partition
| | Using the 'ctraj' command to create the path points between the starting point transformation matrix, the ending point transformation matrix and the previously generated normalized partition |
includes the transformation matrices of all of the path's so – generated points.
| | Obtaining |
| | Obtaining the velocities and the accelerations using 'jtraj'. ( |
Using an auxiliary robot
As described in the path design section, the motion we want to generate includes a definite angle for link number 3 relative to the ground surface but the path so far described does not have this information. In other words following the steps noted in the previous section leads only the foot tip to track the path shown in Fig.4 rather than the whole foot.
One solution for this problem is to employ an auxiliary robot comprising of the links number 1 and 2 i.e. the thigh and the leg. The inverse kinematics problem will be solved for this robot where the end point of link number 2 tracks the path of Fig.4. Then the joint coordinate number 3 will be determined using this relation:
![]()
The above relation with the equivalent form of
obliges that the foot angle relative to the earth surface is always zero.
Applying the contact force on the foot link
For the inverse dynamics problem, we should determine the external force on the foot (link number 3). The command 'rne' which uses the recursive Newton – Euler algorithm for inverse dynamics accepts the following format for the external force exerting on the final link:
where
is the external force and
the external moment applied on the end point (tip) of the final link and stated in the link coordinate frame. So if we assume that the distributed external load on the foot sole can be replaced equivalently (for static analysis) by a concentrated force on the middle of the sole, this force can further more be replaced by an equivalent force and a moment on the foot tip in the proper format for the command 'rne'.(Fig. 6)

Fig. 6: The distributed contact force on the foot sole can be equivalently (for static analysis) replaced by a concentrated force and moment on the tip.
Uncontrolled motion simulation
The uncontrolled motion is simulated by applying the torques obtained from inverse dynamics solution to the joints. Obviously we do not expect the desired motion to be generated this way.
In this simulation the acceleration is obtained using the 'accel' command. Then assuming a constant acceleration during each time step, the velocity and acceleration in the next step are achieved.
Controlled motion simulation
In this project an inverse dynamics + gravity compensation control is implemented through the following formulation:
or
where the index
refers to the desired case. Also the
and
are the derivative and proportional gains.
The
and
are available by the 'inertia' and 'rne' commands. Finally the acceleration and velocity are obtained by the method described in the previous section.
Sample run
The above procedures are collected in the m – file 'walk1'. This code after running the simulation of the desired motion, the uncontrolled motion and the controlled motion, drives the robot graphically to show that motion. Also in order to provide a graphical comparison, the path of the foot heel (the end point of link number 2) and the foot angle will be presented for these motions. Fig. 7 and Fig. 8 show the heel path and foot angle for these three motions when
and
. As we see the inverse dynamics control has a remarkable effect on both the heel path and the foot angle.

Fig. 7: the heel paths in the three motions (desired, uncontrolled and controlled)
Fig. 8: the foot angles in the three motions (desired, uncontrolled and controlled)