Design and Simulation of Legged Walking Robots in MATLAB ® Environment

It is well known that legged locomotion is more efficient,speedy, and versatile than the one by track and wheeled vehicles when it operates in a rough terrain or in unconstructed environment. The potential advantages of legged locomotion can be indicated such as better mobility, obstacles overcoming ability, active suspension, energy efficiency, and achievable speed (Song & Waldron, 1989). Legged walking robots have found wide application areas such as in military tasks, inspection of nuclear power plants, surveillance, planetary explorations, and in forestry and agricultural tasks (Carbone & Ceccarelli, 2005; Gonzalez et al., 2006; Kajita & Espiau, 2008). In the past decades, an extensive research has been focused on legged walking robots. A lot of prototypes such as biped robots, quadrupeds, hexapods, and multi-legged walking robots have been built in academic laboratories and companies (Kajita & Espiau, 2008). Significant examples can be indicated as ASIMO (Sakagami et al., 2002), Bigdog (Raibert, 2008), Rhex (Buehler, 2002), and ATHLETE (Wilcox et al., 2007). However, it is still far away to anticipate that legged walking robots can work in a complex environment and accomplish different tasks successfully. Mechanical design, dynamical walking control, walking pattern generation, and motion planning are still challenge problems for developing a reliable legged walking robot, which can operate in different terrains and environments with speedy, efficient, and versatility features. Mechanism design, analysis, and optimization, as well as kinematic and dynamic simulation of legged walking robots are important issues for building an efficient, robust, and reliable legged walking robot. In particular, leg mechanism is a crucial part of a legged walking robot. A leg mechanism will not only determine the DOF (degree of freedom) of a robot, but also actuation system efficiency and its control strategy. Additionally, it is well understood that a torso plays an important role during animal and human movements. Thus, the aforementioned two aspects must be taken into account at the same time for developing legged walking robots. Computer aided design and simulation can be considered useful for developing legged walking robots. Several commercial simulation software packages are available for performing modeling, kinematic, and dynamic simulation of legged walking robots. In particular, Matlab® is a widely used software package. It integrates computation, visualization, and programming in an easy-to-use environment where problems and solutions are expressed in familiar mathematical notation. By using a flexible programming environment, embedded functions, and several useful simulink® toolboxes, it is relative

easy and fast to perform kinematic and dynamic analysis of a robotic mechanical system (Matlab manual, 2007).Additionally, motion control and task planning algorithms can be tested for a proposed mechanism design before implementing them on a prototype.In this chapter, the applications of Matlab® tool for design and simulation of legged walking robots are illustrated through three cases, namely a single DOF biped walking robot with Chebyshev-Pantograph leg mechanisms (Liang et al., 2008); a novel biologically inspired tripod walking robot (Liang et al., 2009(Liang et al., & 2011)); a new waist-trunk system for biped humanoid robots (Carbone et al., 2009;Liang et al., 2010;Liang & Ceccarelli, 2010).In details, the content of each section are organized as follows.
In the first section, operation analysis of a Chebyshev-Pantograph leg mechanism is presented for a single DOF biped robot.The proposed leg mechanism is composed of a Chebyshev four-bar linkage and a pantograph mechanism.Kinematic equations of the proposed leg mechanism are formulated and programmed in Matlab® environment for a computer oriented simulation.Simulation results show the operation performance of the proposed leg mechanism with suitable characteristics.A parametric study has been carried out to with the aims to evaluate the operation performance as function of design parameters and to achieve an optimal design solution.In the second section, a novel tripod walking robot is presented as inspired by tripod gaits existing in nature.The mechanical design problem is investigated by considering the peculiar requirements of leg mechanism to have a proper tripod walking gait.The proposed tripod walking robot is composed of three leg mechanisms with linkage architecture.The proposed leg mechanism is modeled for kinematic analysis and equations are formulated for simulation.A program has been developed in Matlab® environment to study the operation performance of the leg mechanism and to evaluate the feasibility of the tripod walking gaits.Simulation results show operation characteristics of the leg mechanism and feasible walking ability of the proposed tripod walking robot.In the third section, a new torso design solution named waist-trunk system has been proposed for biped humanoid robots.The proposed waist-trunk system is composed of a six DOFs parallel manipulator and a three DOFs orientation parallel manipulator, which are connected in a serial chain architecture.In contrast to the traditional torso design solutions, the proposed new waist-trunk system has a high number of DOFs, great motion versatility, high payload capability, good stiffness, and easy-operation design features.A 3D model has been built in Matlab® environment by using its Virtual Reality (VR) toolbox.Kinematic simulations have been carried out for two operation modes, namely walking mode and manipulation mode.Operation performances have been evaluated in terms of displacements, velocities, and accelerations.Simulation results show that the simulated waist-trunk system can be very convenient designed as the torso part for humanoid robots.

A single DOF biped robot
A suvery of existing biped robots shows that most of their leg mechanisms are built with an anthropomorphic architecture with three actuating motors at least at the hip, knee, and ankle joints.These kinds of leg mechanisms have an anthropomorphic design, and therefore they show anthropomorphic flexible motion However, mechanical design of these kinds of leg systems is very complex and difficult.Additionally, sophisticated control algorithms and electronics hardware are needed for the motion control.Therefore, it is very difficult and costy to build properly a biped robot with such kinds of leg mechanisms.
A different methodology can be considered such as constructing a biped robot with reduced number of DOFs and compact mechanical design.At LARM, Laboratory of Robotics and Mechatronics in the University of Cassino, a research line is dedicated to low-cost easyoperation leg mechanism design.Fig. 1 shows a prototype of a single DOF biped robot fixed on a supporting test bed.It consists of two leg mechanisms with a Chebyshev-Pantograph linkage architecture.The leg mechanisms are connected to the body with simple revolute joints and they are actuated by only one DC motor through a gear box.The actuated crank angles of the two leg mechanisms are 180 degrees synchronized.Therefore, when one leg mechanism is in non-propelling phase another leg mechanism is in propelling phase and vice versa.A big U shaped foot is connected at the end of each leg mechanism with a revolute joint equipped with a torsion spring.The torsion spring makes the foot contact with the ground properly so that it has adaptability to rough terrain and the walking stability of the biped robot is improved.

Mechanism description
The built prototype in Fig. 1 consists of two single DOF leg mechanisms, which is composed of a Chebyshev four-bar linkage LEDCB and a pantograph mechanism PGBHIA, as shown in Fig. 2. The Chebyshev mechanism LEDCB can generate an ovoid curve for the point B, so that the leg mechanism can perform a rear-forth and up-down motion in sagittal plane with only one actuation motor.In Fig. 2, the crank is LE, the rocker is link CD, and the coupler triangle is EDB.Joints at L, C, and P are fixed on the body of the biped robot.The offsets a, p, and h between them will greatly influence the trajectory shape of point A. The pantograph mechanism PGBHIA is used to amplify the input trajectory of point B into output trajectory with the same shape at point A. In particularly, unlike the traditional design solution, the point P is fixed on the body of the robot instead of the point B in order to have a more compact robust design.However, drawbacks will exist and in this work the aim is to maintain them within certain limits.The amplify ratio of the pantograph mechanism depends on the length of link HI and link IA or the ratio of PA and PB.

A kinematic analysis
A kinematic analysis has been carried out in order to evaluate the operation performance of the single DOF leg mechanism by using Matlab® programming.Actually, the pantograph mechanism amplifies the input motion that is produced by the Chebyshev linkage, as well as parameters p and h affect location and shape of the generated ovoid curve.A kinematic study can be carried out separately for the Chebyshev linkage and pantograph mechanism.A scheme of the Chebyshev four-bar linkage LEDCB with design parameters is shown in Fig. 2. When the crank LE rotates around the point L an output ovoid curve can be traced by point B. Assuming a reference frame XY fixed at point L with X axis laying along in the direction of straight line LC, it is possible to formulate the coordinates of point B as a function of input crank angle α in the form, (Ottaviano et al., 2004), where www.intechopen.comand a B=cosαm (3) The five design parameters a, m, c, d, and f characterize the Chebyshev four-bar linkage, which have a fixed ration with each other as reported in (Artobolevsky, 1979).A numerical simulation can be carried out by using Eqs.( 1), (2), and (3) with proper value of the design parameters.The pantograph mechanism PGBHIA with design parameters is shown in Fig. 2. The point P is fixed and point B is connected to the output motion that is obtained by the Chebyshev four-bar linkage.The transmission angles γ 1 and γ 2 are important parameters for mechanism efficiency.A good performance can be ensured when |γ i -90º|< 40º (i=1, 2) according to practice rules for linkages as reported in (Hartenberg and Denavit, 1964).Referring to the scheme in Fig. 2, kinematic equations of the pantograph mechanism can be formulated after some algebraic manipulation in the form, (Ottaviano et al., 2004), Consequently, from Fig. 2 transmission angles γ 1 and γ 2 can be evaluated as γ 1 =φ 1 +φ 2 and γ 2 =π-θ-φ 1 , respectively.The coordinates of point A can be given as By using Eqs.(4), the transmission angles γ 1 and γ 2 can be computed to check the practical feasibility of the proposed mechanism.By derivating Eqs. ( 6), the motion velocities of point A can be easilty computed.Accelerations can be also computed through a futher derivative of the obbtained equations of velocities.Similarly, the velocities and accelerations at point B can be computed through the first and second derivatives of Eqs.(1), respectively.By using velocity and acceleration analysis for the generated ovoid curve, kinematic performance of the proposed leg mechanism can be evaluated.

Simulation results
A simulation program has been developed in Matlab® environment to study kinematic performance of the proposed leg mechanism, as well as the feasible walking ability of the single DOF biped robot.Examples of simulation results of one leg mechanism are shown in Fig. 3.When the input crank LE rotates around point L with a constant speed, the motion trajectories of point A and point B can be obtained in the form of ovoid curves.A scheme of the zoomed view of the ovoid curve in Fig. 3(a) is shown in Fig. 3(b) in which four characteristic angles of the input crank actuation are indicated.The dimension of the ovoid curve is characterized by the length L and height H.The generated ovoid curve is composed of an approximate straight-line and a curved segment with a symmetrical shape.The straight-line segment starts at the actuation angle α=90 degs and ends at α=270 degs.Actually, during this 180 degs interval the leg mechanism is in the non-propelling phase and it swings from rear to forth.During the next 180 degs interval the actuation angle goes from α=270 degs to α=90 degs corresponding to the coupler curve segment.In this period, the foot grasps the ground and the leg mechanism is in the propelling phase.The leg mechanism is in a almost stretched configuration when α=0 deg just as the leg scheme shows in Fig. 3(a).Fig. 4 shows simulation results of the biped robot when it walks on the ground.In Fig. 4, the right leg is indicated with solid line when in contact with the ground and the crank actuation angle is at α=0 deg, the left leg is indicated with dashed line when the crank is at angle α=180 degs and it swings from rear to forth.The trajectories of points A and point B are also plotted as related to the non-propelling phase.It is noted that at the beginning and the end of the trajectory, the density of the points is higher than in the middle segment.
Since the time periods are same between each plotted points, the velocity of the swinging leg mechanism in the middle is higher than that at the start and end of one step.Referring to Fig. 5(a), when the leg mechanism is in a non-propelling phase, it swings from rear to forth and the supporting leg propels the body forward.The swinging leg mechanism has a relative swing motion with respect to the supporting leg mechanism.Therefore, the velocity of point B1 in a non-propelling phase with respect to the global inertial frame is larger than that during a supporting phase.This is the reason why the size of curve a-b-c is larger than that the size of curve c-d-e in Fig. 5(b) even if the Chebyshev mechanisms produce the motion with only 180 degs phase differences at the points B1 and B2.In Fig. 7(a), the acceleration of point A at the end of leg mechanism is computed between -1 ms 2 to 10 m/s 2 along X axis and between -10.5 m/s 2 to -3.5 m/s 2 along Y axis.The acceleration along X axis reaches the maximum value when the input crank angle is at t=0.5 s (α=20 degs) and the minimum value when it is at t=7.3 s (α=325 degs).In Fig. 7(b), the acceleration at point P is computed between -2.3 m/s 2 to 9 m/s 2 along X axis and between -10.2 m/s 2 to -0.2 m/s 2 along Y axis.The acceleration in X axis reaches the maximum value when one leg mechanism is in the middle of supporting phase and acceleration in Y axis reaches the minimum value, correspondingly.The acceleration in X axis reaches the minimum value during the transition phase of leg mechanisms and the negative value shows that the biped robot in a double supporting phase and produces a back sliding motion.The size of the walking step can be modified by changing the parameter a only.- The size of height of swinging leg motion can be modified by changing the parameter h only.Therefore, an optimized mechanical design for leg mechanism and an efficient walking gait for minimizing input crank torque can be determined by selecting proper design parameters.

A biologically inspired tripod walking robot
Legged locomotion in walking robots is mainly inspired by nature.For example, biped robots mimic the human walking; quadruped robots perform leg motion like dogs or horses and eight legged robots are inspired to spider-like motion (Song & Waldron, 1989;González et al., 2006).Most of animals have an even number of legs with symmetry character.With this important character animals can move easily, quickly and stably.However, among legged walking robots, biped walking robots are the human-like solutions but sophisticated control algorithms are needed to keep balance during operation (Vukobratovic, 1989).Multi legged robots have a good stable walking performance and can operate with several walking gaits.However, the number of motors increases together with legs.How to coordinate control the motors and gaits synthesis are still difficult problems.Actually, there are some tripod walking experiences in nature, even around our daily life.A significant example of tripod walking can be recognized in old men walking with a cane.Two human legs and a walking cane as a third leg can produce a special tripod walking gait.With this kind of tripod walking gait, old people with aged or illness nervous system can walk more stably since they always keep two legs in contact with the ground at the same time.Additionally, a standing phase is more stable since there are three legs on the ground and forms a rigid triangle configuration.By talking into account of the advantages of a tripod walking gait, a novel tripod walking robot has been proposed as shown in Fig. 11.In Fig. 11, the tripod walking robot consists of three single DOF Chebyshev-Pantograph leg mechanisms, a body frame, and a balancing mechanism, which is mounted on the top of body frame.Three leg mechanisms are installed on the body frame in a triangle arrangement with one leg mechanism ahead and two leg mechanisms rear in the same line.The main specifications of the designed model are listed in Table .2. Step size 300 mm/step Walking cycle 1 sec/step Table 2. Main specifications of the 3D model for the tripod walking robot in Fig. 11 The tripod walking robot is developed for payload transportation and manipulation purposes.The proposed design of the tripod walking robot will be capable of moving quickly with flexibility, and versatility within different environments.Therefore, in the mechanical design, particular attentions have been focused to make the tripod walking robot low-cost easy-operation, light weight, and compact.Particularly, commercial products have been extensively used in the designed model to make it easy to build.Aluminum alloy is selected as the material of the tripod walking robot since it has proper stiffness, mass density, and cheap price.

The proposed mechanical design
The mechanism design problem can be started by considering a concept of a tripod waking robot model as shown in Fig. 12(a).The scheme of the mechanism in Fig. 12(a) is a simplified structure with two DOFs that can perform a required back and forth, up and down movement in saggital plane.Actuation motors are fixed at the point C1, C2 and C3.Two feet grasp the ground at point A1 and point A2 while the third leg swings from back to www.intechopen.com forth.The two legs in contact with the ground together with the robot body form a parallel mechanism.
A scheme of the proposed leg mechanism for tripod walking robot is shown in Fig. 12(b).
The tripod walking robot is mainly composed of three one-DOF leg mechanisms.The three leg mechanisms are the same design which is installed on the robot body to have a triangle configuration in horizontal plane.All the three legs are fixed on the body and actuated by DC motors.The leg mechanism is sketched with design parameters in Fig. 12(b).
The basic kinematics and operation characters of the proposed leg mechanism are investigated in the work (Liang et al., 2009).This one-DOF leg mechanism is composed of a Chebyshev four-bar linkage CLEDB and a pantograph mechanism BGMHIA.Points L, C and M are fixed on the body.The Chebyshev mechanism and pantograph mechanism are jointed together at point B through which the actuation force is transmitted from the Chebyshev linkage to the pantograph leg.Linkage LE is the crank and α is the input crank angle.The transmission angles γ1 and γ 2 of the leg mechanism are shown in the Fig. 12(b).
When the crank LE rotates around point L, an ovoid curve with an approximate straight line segment and symmetry path as traced by foot point.Each straight line segment has a 180º phase in the crank rotation input.The straight line segment represents the supporting phase and the curve segment represents the swinging phase.When the leg mechanism operates in a supporting phase it generates a horizontal motion to points L, C and M which are fixed at the body.Therefore, the body of the robot is propelled forward without force conflict between two legs contacting the ground.
In a tripod walking gait each leg must has 2/3 period of time in supporting phase and another 1/3 time in swinging phase.In order to avoid the problem of force conflict between legs, a solution is that the two legs on the ground can produce a straight line motion in horizontal plane with the same speed and without waving in vertical direction.A careful analysis will help to define a propel operation of the leg mechanism.
A feasible solution requires that the actuation speed of the input crank is twice during swinging phase as compared with supporting phase.Ai (i=1, 2, 3) are the end points of three leg mechanisms.They trace the same ovoid curve but with 90ºactuation phase differences in supporting phase.Therefore, there will be always two legs in contact with the ground and another leg swings in the air.

Simulation results
Simulations have been carried out in the Matlab® environment with suitable codes of the proposed formulation.The design parameters of the mechanisms for simulation are listed in Table .3.The rotation velocity of the input crank actuation angle is set at 270 degs/s.Each step lasts in 1/3 second for each leg, and numerical simulation has been computed for 2 seconds to evaluate a walking behavior in a stationary mode.
Chebyshev mechanism (mm) Pantograph mechanism (mm) Leg location (mm)  In Fig. 13, the tripod walking robot is given at initial configuration with the input crank angles α 1 =180 degs, α 2 =90 degs, and α 3 =270 degs.At this initial time, the three legs are on the ground with two legs in supporting phase and the third leg is about to get into swinging phase.
In Fig. 14, a sequence of snapshots are shown for the tripod walking robot walks in three dimension space as computed in the numerical simulation.The trajectories of points A i (i=1,2, 3) of the feet are depicted with small curves.In Fig. 15, the movements of the legs for tripod walking robot are shown in saggital plane.The positions of three feet are also shown in horizontal plane as referring to the computed snapshots.
As shown in Fig. 15, at each step, there are always two legs contacting the ground.Actually, a balancing mechanism can be installed on the body of the robot to adjust the gravity center between the two legs, which grasp the ground at each step.A simple rotation mechanism with a proper mass at end is likely to be installed on the body of robot as a balancing mechanism.Therefore, with a very simple control algorithm and specially sized balancing mechanism the tripod walking robot can walk with a static equilibrium even while it is walking.Dimension of the length and height for each step are depicted as L and H, respectively.These two dimension parameters are useful to evaluate walking capability and obstacles avoidance ability for the tripod walking robot.They have been computed as L=300 mm and H=48 mm for each step.
A tripod walking gait is composed of three small steps.Fig. 18(b) shows the positions of points of C i (i=1, 2, 3) in saggital plane.It can be noted that the trajectories are approximate straight lines with very small waving.Therefore, the body of the tripod walking robot has a very small movement of less 5 mm in vertical direction and can be seem as an energy efficiency walking gait.It is computed that the body of robot is propelled forward 100 mm for each leg step.Therefore, the body is propelled forward 300 mm in a cycle of tripod walking gait.The walking speed can be computed as 0.3 m/s.However, there is a period of time that points C 2 and C 3 do not maintain the rigid body condition, but they move very slightly with respect to each other.Actually, this happens because the propelling speeds of two supporting legs are different.Therefore, a small difference of the motions between points C 2 and C 3 have been computed in the simulation of the walking gait.It can be noted that the velocity reaches the maximum value when the legs move to the highest point in a swinging phase in X axis.At the same point the velocity in Y axis is zero and the sign of velocity is changed.In the supporting phase because points A i (i=1, 2, 3) are on the ground, the velocity is zero.Since the input crank speed is twice time in swinging phase than that in supporting phase, the plots are discontinuous at the transition point.Actually, this can be modeled as an impact between feet and ground that can be smoothed by the above mentioned differences in the paths of C i points.
Matlab® programming has been suitable and indeed efficient both for performance computation and operation simulation by using the formulated model for the design and operation of the proposed tripod walking robot.

A New waist-trunk system for humanoid robots
Humanoid robots are designed as directly inspired by human capabilities.These robots usually show kinematics similar to humans, as well as similar sensing and behaviour.
Therefore, they can be better accommodated in our daily life environment (home, office, and other public places) by providing services for human beings (Kemp et al., 2008).This research field has attracted large interests since two decades and a lot of prototypes have been built in the laboratories or companies.Significant examples of biped humanoid robots can be indicated for example in ASIMO developed by HONDA Corporation (Sakagami et al., 2002), HRP series developed at AIST (Kaneko et al., 2004), WABIAN series at the Takanishi laboratory in the Waseda University, Japan (Ogura et al., 2006), HUBO series built at KAIST in Korea (Ill-Woo et al., 2007), and BHR series built in the Beijing Institute of Technology, China (Qiang et al., 2005).
A survey on the current humanoid robots shows that their limbs (arms and legs) are anthropomorphically designed as articulated link mechanisms with 6 or 7 DOFs.However, torsos of humanoid robots are generally treated as rigid bodies, which are passively carried by the biped legs.The torsos of the existing humanoid robots like ASIMO, HRP, and HUBO have almost a box shaped body with a small number of DOFs.A motivation of this kind of designs is that the torso is used to store the computer, battery, sensors, and other necessary devices, so that the whole system can be designed as compact, robust, and stiff.In addition, due to mechanical design difficulties and complexity of controlling multi-body systems, torsos have been designed by using serial mechanism architectures.However, this kind of designs introduces several drawbacks, which give limitations on the motion capability and operation performances for humanoid robots (Carbone et al., 2009).Therefore, it is promising to design an advanced torso for humanoid robots by adopting parallel mechanisms with a relative high number of DOFs.Actually, the human torso is a complex system with many DOFs, and plays an important role during human locomotion such as in walking, turning, and running.Humans unconsciously use their waists and trunks to perform successfully tasks like bending, pushing, carrying and transporting heavy objects.Therefore, an advanced torso system is needed for humanoid robots so that they can be better accommodated in our daily life environment with suitable motion capability, flexibility, better operation performances, and more anthropomorphic characteristics.
In the literature, there are few works on design and control issues of the torso system for humanoid robots.A humanoid robot named WABIAN-2R has been developed at Takanishi laboratory in the Waseda University with a 2 DOFs waist and 2 DOFs trunk, (Ogura et al., 2006).The waist and trunk of WABIAN-2R is a serial architecture and it is used for compensating the moment that is generated by the swinging legs when it walks, and to avoid the kinematics singularity in a stretched-knee, heel-contact and toe-off motion.A musculoskeletal flexible-spine humanoid robot named as Kotaro has been built at the JSK laboratory in the University of Tokyo.Kotaro has an anthropomorphic designed trunk system with several DOFs and a complicated sensor system, and it is actuated by using artificial muscle actuators.However, it is not able to walk, (Mizuuchi, 2005).A 3 DOFs parallel manipulator named as CaPaMan2 bis at LARM has been proposed as the trunk module for a low-cost easy-operation humanoid robot CALUMA with the aim to keep balance during walking and for manipulation movements, (Nava Rodriguez et al., 2005).However, these torso systems are fundamentally different from the proposed waist-trunk system.

A new waist-trunk system
Human torso is an important part of human body.It can be recognized as the portion of the human body to which the neck, upper and lower limbs are attached.Fig. 21(a) shows a scheme of the skeleton of human torso.It can be noted that the human torso consists of three main parts: thorax, waist, and pelvis (Virginia, 1999).The rib cages and spine column of the upper part contribute to thorax.In the thorax, the heart and lungs are protected by the rib cage.The human spine is composed of 33 individual vertebrae, which are separated by fibrocartilaginous intervertebral discs and are secured to each other by interlocking processes and binding ligaments.In particular, the lumbar spine, which is the waist segment, is the most important and largest part of human spine.The main function of the lumbar spine is to bear the weight of the human body.The spine is connected with the pelvis by sacrum and the pelvis is connected with two femurs in the lower part.
Additionally, there are hundred pairs of muscles, flexible tendons, and ligaments, complex blood and nervous system with different functions to make a human torso an important part of the human body.Since the human torso is composed of three portions, namely the thorax, waist, and pelvis.In Fig. 21(a), three black rectangles have been indicated on the skeleton of the human torso as reference platforms for the thorax, waist, and pelvis, respectively.The proposed model in Fig. 22(a) is composed of three rigid bodies namely thorax platform, waist platform, and pelvis platform, from the top to the bottom, respectively.The thorax platform can be connected together to the waist platform by using parallel mechanism with suitable DOFs, which has been named as the trunk module.The thorax platform is expected to imitate the movements of human thorax.Arms, neck, and head of humanoid robots are assumed to be installed a connected to the thorax platform.The pelvis platform is connected to the waist platform with suitable mechanism, which has been named as the waist module.Two legs are expected to be connected to pelvis platform.The proposed waist-trunk system is illustrated in Fig. 22(b) as a kinematic model that has been elaborated in Matlab® environment.The design sizes of the proposed waist-trunk system are close to the human torso dimensions as reported in (Kawuchi and Mochimaru, 2005).In Fig. 22(b), upper part of the proposed waist-trunk system is named as trunk module, which consists of a thorax platform, a waist platform, and six identical leg mechanisms to obtain a 6 DOFs parallel manipulator structure.Actually, the proposed trunk module has the same structure of a Stewart platform (Tsai, 1999;Ceccarelli, 2004).
In the trunk module, each leg mechanism is composed of a universal joint, a spherical joint, and an actuated prismatic joint.The trunk module has six DOFs with the aim to imitate the function of human lumbar spine and thorax to perform three rotations (flexion-extension, lateral-bending, and transverse-rotation movements) and three translation movements.In particular, head, neck, and dual-arm systems can be installed on the thorax platform in a humanoid robot design The lower part in Fig. 22(b) is named as waist module, which consists of a pelvis platform, a waist platform, and three identical leg mechanisms to obtain a 3 DOFs orientation parallel manipulator structure.This 3 DOFs orientation parallel platform is a classical parallel mechanism, which has been designed as the hip, wrist, and shoulder joints for humanoid robots as reported in a rich literature (Sadjadian & Taghirad, 2006).The waist module shares waist platform with the trunk module but the leg mechanisms are installed on the counter side in a downward architecture.
The pelvis platform is connected to the waist platform with three leg mechanisms and a passive spherical joint.There are six bars connected with the passive spherical joint with the waist platform and pelvis platform with the aim to make it very stiff.The waist module is an orientation platform and has three rotation DOFs for yaw, pitch, and roll movements.The rotation center is a passive spherical joint, which plays a role like the symphysis pubis in the human pelvis to carrry the weight of the human body.The waist module is aimed to imitate the function of human pelvis during walking, running, and other movements.In particular, a biped leg system can be connected to the moving pelvis platform.

A kinematic simulation
Simulations have been carried out with the aim to evaluate the operation feasibility of the proposed waist-trunk system for a biped humanoid design solution.In Fig. 23(a) a biped humanoid robot with the proposed waist-trunk system has been modeled in Matlab® virtual reality toolbox environment by using VRML language (Vitual Reality Toolbox Users ' Manual, 2007).VRML is a standard file format for representing 3D interactive vector graphics, which has been extensively used in robotic system simulation applications (Siciliano and Khatib, 2008).OpenHRP® is a simulation software package developed for performing dynamic simulation of the famous HRP series humanoid robots by using VRML language (Kanehiro et al., 2004).In a VRML file, the geometric sizes and dynamics parameters of the humanoid robot can be defined as a text-based format.
In Fig. 23(a), the modeled biped humanoid robot is composed of several balls, cuboids, and cylinders with the aim to avoid the complex mechanical design of a humanoid robot.In Fig. 24, a simulation procedure of the biped humanoid robot in Matlab® virtual reality toolbox is shown in several steps as described in the following: Step 1. Movements of the moving platforms are computed according to assigned tasks.For a walking mode, motion trajectory of the waist platform is determined as based on the prescribed ZMP (zero momentum point) and COM (center of mass) trajectories.
The movements of the pelvis platform are functions of the walking gait parameters.For a manipulation mode, the movements of waist platform and thorax platform depend on the locations of the manipulated objects.
Step 2. The prescribed movements are the inputs of a motion pattern generator, where walking pattern or manipulation pattern is generated for the simulated biped humanoid robot.
Step 3. The computed reference trajectories of the actuated joints are the inputs of a direct kinematics solver.By solving the direct kinematics of the biped humanoid robot, positions and orientations of each component can be computed.
Step 4. The position and orientation for each component of the VRML model are updated for each step of simulation.The computed movements of the simulated biped humanoid robot are shown in animations, which are stored as videos in AVI format.Therefore, two different operation modes of the proposed waist-trunk system can be simultated and its operation performances can be conveniently characterized by using elaborated codes included in the CD of this book.Fig. 24.A scheme for a simulation procedure of the biped humanoid robot in Matlab® virtual reality toolbox simulation environment

Simulation results
In this section, simulation results of the simulated VRML biped humanoid robot are illustrated for a walking task and a bending-manipulation task.The movements of the waistrunk system are prescribed with suitable equations according to the assigned tasks.Operation performances of the simulated waist-trunk system have been characterized in terms of displacement, velocity, and acceleration.Simulation results show that the proposed waist-trunk system has satisfied operation characteristics as a mechanical system and has a capability of well imitating different movements of human torso.

Simulation of the walking mode
For a walking mode of the wais-trunk system, the waist platform is assumed to be the fixed base.Thus, positions and orientation angles of the thorax platform and the pelvis platform can be conveniently prescribed.During a normal walking, the movements of the pelvis platform and thorax platform can be prescribed by using the equations listed in Table 4.In Table 4, A φ (v, h) is the magnitude of the rotation angle around roll axis as function of the walking parameters that can be determined by the walking speed v and step height l.A θ is the magnitude of the rotation angle around pitch axis as function of the slope angle α of the ground.In particular, for a flat ground it is A θ (α) =0.A (v, l) is the magnitude of the rotation angle around yaw axis as function of the walking parameters of the walking speed v and step length l. φ W,0 and W,0 are the initial phase angles.=π/T s is the walking frequency.T s is the time period for one step of walking.The expressions in Table 4 can describe the periodical motion of the walking.A similar motion generation method is also presented in (Harada et al., 2009).The motion trajectories of the thorax platform can be prescribed similarly but in opposite motion direction in order to have a counter rotation with respect to the pelvis movements.This is aimed to preserve the angular monument generated by the lower limbs for walking stability.Particularly, only the orientation angles have been prescribed in the trunk module in the reported simulation.However, the position can be prescribed independently since the thorax platform has 6 DOFs.

Positions (mm)
Orientation angles (degs) Waist platform Thorax platform Z T = 0 T = -A (v, l)sin( t+ T,0 ) Table 4. Prescribed movements for the moving platforms in a walking mode Simulation time has been prescribed in 1.5s to simulate the function of waist-trunk system in a full cycle of humanoid robot normal walking (Ts=0.75s/step).An operation has been simulated with 150 steps.In general, the range of motion of human pelvis is between 5 degrees and 20 degrees, and therefore, the orientation capability of the waist module has been designed within a range of 25 degrees.Thus, the waist module can imitate different movements of human pelvis through proper operations.Fig. 25 shows the movements of the simulated biped humanoid robot, which have been simulated for two steps of walking in Matlab® environment by using the computed data in the previous analysis.The inverse kinematics analysis results have been imported to actuate the VRML model in Fig. 23.It is convenient to output the characterization values and annimations by using the flexible programming environment in Matlab®.The simulated humanoid robot shows a smooth motion which well imitates the movements of human thorax and pelvis during a walking task.In addition, it can be noted that the proposed waist-trunk system shows suitable motions to imitate the movements of the human torso during a normal walking.

Simulation of the manipulation mode
The movements of the waist module and trunk module are combined together in a manipulation mode.The waist-trunk system is a redundant serial-parallel structure with totally 9 DOFs.The inverse kinematics and motion planning are challenge issues for this peculiar serial-parallel structure.The pelvis platform has been assumed to be the fixed base, and the motion trajectories of the center point of the thorax platform and waist platform have been prescribed independently.A simulation has been carried out for a bendingmanipulation procedure in order to evaluate the operation performance for a simultaneous action of the two parallel manipulator structures.The movements of the moving platforms have been prescribed by using the equations in Table 5. Fig. 31 shows a sequence of snapshots of the simulated biped humanoid robot performing a bending-manipulation movement.The biped humanoid robot bends his torso and tries to manipulate the object that is placed on the top of a column on the ground.The doubleparallel architecture gives a great manipulation capability for the biped humanoid robot, which is a hard task for current humanoid robots to accomplish.From the motion sequences in Fig. 31, it can be noted that the proposed waist-trunk system shows a suitable motion which well imitates the movements of a human torso during a bending-manipulation procedure.It is remarkable the smooth behaviour of the overall operation that makes the waist-trunk system to show a human-like motion characteristic and it can be very convenient designed as the torso part for humanoid robots.From the reported simulation results, it is worth to note that a complex mechanical system such as a humanoid robot can be conveniently modeled and evaluated in Matlab® environment due to its flexible programming environment and its powerful toolbox.

Conclusion
In this chapter, design and simulation issues of legged walking robots have been addressed by using modeling and simulation in Matlab® environment.In particular, Matlab® is a powerful computation and simulation software package, which is quite useful for the design and operation performances evaluation of legged robotic systems.Three examples are illustrated and they have been studied for motion feasibility analysis and operation performances characterizations by taking advantages of Matlab® features.Contributions of this chapter can be indicated as follows.
A kinematic study of a Chebyshev-Pantograph leg mechanism has been carried out, and equations are formulated in the Matlab® environment.From the reported simulation results, it shows that the practical feasible operation performance of the Chebyshev-Pantograph leg mechanism in a single DOF biped robot.Additionally, a parametric study has been developed by using the elaborated Matlab® analysis code to look for an optimized mechanical design and to determine an energy efficient walking gait.
A novel biologically inspired tripod walking robot is proposed by defining suitable design and operation solution for leg mechanism.Simulation results show the proposed design performs a tripod walking gait successfully.Operation performance of the leg mechanisms and the tripod walking robot are reported and discussed by using results from Matlab® simulations.
A new waist-trunk system for humanoid robots has been proposed by using suitable parallel architectures.The proposed system shows an anthropomorphic design and operation with several DOFs, flexibility, and high payload capacity.Simulation results show

Fig. 1 .
Fig. 1.A prototype of a single DOF biped robot with two Chebyshev-Pantograph leg mechanisms at LARM

Fig. 2 .
Fig. 2. A kinematic scheme of the single DOF Chebyshev-Pantograph leg mechanism

Fig. 3 .
Fig. 3. Simulation results of one leg mechanism: (a) computed trajectories of points A and B; (b) generated ovoid curve at point A A scheme of the biped motion and trajectories of critical points are shown in Fig. 5(a).Referring to Fig.5(a), when the leg mechanism is in a non-propelling phase, it swings from rear to forth and the supporting leg propels the body forward.The swinging leg mechanism has a relative swing motion with respect to the supporting leg mechanism.Therefore, the velocity of point B1 in a non-propelling phase with respect to the global inertial frame is larger than that during a supporting phase.This is the reason why the size of curve a-b-c is larger than that the size of curve c-d-e in Fig.5(b) even if the Chebyshev mechanisms produce the motion with only 180 degs phase differences at the points B1 and B2.

Fig. 4 .Fig. 6 .
Fig. 4. Simulation results for motion trajectories of the leg mechanisms during biped walking Fig. 5(b) shows the trajectories of points A1, A2, B1, and B2 in a biped walking gait.The trajectories are plotted with solid lines for the right leg mechanism and with dashed lines for the left leg mechanism, respectively.The motion sequences of points B1 and A1 are indicated with alphabet letters from a to e and a' to e', respectively.In Fig. 5(b), the trajectory segments a-b-c of point B1 and a'-b'-c' of point A1 are produced by the right leg mechanism while it swings from rear to forth.The trajectory segments c-d-e are produced while the right leg is in contact with the ground.Correspondingly, c', d', and e' are at the same point.The trajectories of points A2 and B2 for left leg mechanism are similar but have 180 degs

Fig. 7 .
Fig. 7. Computed accelerations during one biped walking gait: (a) accelerations of point A in X and Y axes; (b) accelerations of point P in X and Y axesAn optimal design of the leg mechanism can perform an efficient and practical feasible walking gait.By using the flexibility of Matlab® environment with the elaborated simulation codes.A parametric study has been proposed to characterize the operation performance of the proposed single DOF biped robot as function of its design parameters.Actually, the lengths of the linkages determine a proper shape and size of the generated ovoid curve that is produced by the Chebyshev linkage through an amplification ration of the pantograph mechanism as shown in Fig.2.Therefore, only three parameters a, p, and h can be considered as significant design variables.In Fig.8, results of the parametric study are plotted as function of parameter a as output of Matlab® m files.By increasing the value of parameter a, size of the ovoid curve is decreased in X axis and is increased in Y axis as shown in Fig.8(a).Particularly, the ovoid curve with an approximately straight line segment is obtained when a=0.05 m.Fig.8(b)shows the corresponding trajectories of COG (center of gravity) and the feet of swinging leg when the other leg mechanism is in contact with the ground.The step length L decreases and step height H increases as function of the value of parameter a, as shown in Fig.8(b).In Fig.9, results of parametric study are plotted as function of parameter p.In Fig.9(a), by varying parameter p the ovoid curve generated at point A has only displacements along X Fig. 11.A 3D model of the proposed tripod walking robot in SolidWorks® environment

Fig. 12 .
Fig. 12.The proposed tripod walking robot: (a) configurations of three leg mechanisms; (b) a scheme of one leg mechanism with design parameters

Fig. 16 .
Fig. 16.The transmission angles of the three leg mechanisms during a simulated walking as function of time; (a) transmission angle γ 1 ; (b) transmission angle γ 2

Fig. 21 .
scheme of the skeleton of human torso.It can be noted that the human torso consists of three main parts: thorax, waist, and pelvis(Virginia, 1999).The rib cages and spine column of the upper part contribute to thorax.In the thorax, the heart and lungs are protected by the rib cage.The human spine is composed of 33 individual vertebrae, which are separated by fibrocartilaginous intervertebral discs and are secured to each other by interlocking processes and binding ligaments.In particular, the lumbar spine, which is the waist segment, is the most important and largest part of human spine.The main function of the lumbar spine is to bear the weight of the human body.The spine is connected with the pelvis by sacrum and the pelvis is connected with two femurs in the lower part.Additionally, there are hundred pairs of muscles, flexible tendons, and ligaments, complex blood and nervous system with different functions to make a human torso an important part of the human body.Since the human torso is composed of three portions, namely the thorax, waist, and pelvis.In Fig.21(a), three black rectangles have been indicated on the skeleton of the human torso as reference platforms for the thorax, waist, and pelvis, respectively.Fig.21(b)shows the corresponding positions of these three parts on the human spine.Therefore, a simply model with three rigid bodies has been proposed as shown in Fig.22(a), which is expected to imitate the function of human torso during difference human movements.
Fig. 22.A new waist-trunk system for humanoid robots: (a) a model for imitating the movements of human torso; (b) the proposed new waist-trunk system as modeled in Matlab® environment Fig. 23.3D models in VRML: (a) a biped humanoid robot; (a) modeling details of the waisttrunk system

Fig. 25 .
Fig. 25.Simulation snapshots of the movements of a biped humanoid robot in a walking procedure The prescribed orientation angles of the trunk module and waist module are shown in Fig. 26(a) and Fig. 26(b).The solid and dashed lines represent rotation angle around the roll axis and yaw axes, respectively.The rotation magnitudes have been set as 20 degs and 10 degs, respectively.The dot-dashed line represents the rotation angle around the pitch axis, which has been set as a small value to avoid the computation singularity problem in the ZYZ orientation representation.The computed displacements of the prismatic joints L i (i=1,…,6) of the trunk module are shown in Fig. 27.Fig.28shows the computed displacements for the prismatic joints S k (k=1,2,3) of the waist module.Fig.29and Fig.30show the computed velocities and accelerations for the waist and trunk modules, respectively.It can be noted that the characterization plots are quite smooth.The proposed waist-trunk system shows a human-like behaviour for an assigned walking task because of the smooth time evaluation of the motion characteristics.The maximum velocity has been computed as 58 mm/s along Y axis for the trunk module and 120 mm/s along Y axis for the waist module.The maximum acceleration has been computed as 240 mm/s 2 along Y axis for the trunk module and 460 mm/s 2 along Y axis for the waist module.These values are feasible in proper regions for the operation of both the parallel manipulators and they properly simulate the operation of the human torso.Particularly, it can be noted that the velocity and acceleration curves of the trunk module and waist module have different signs, as an indication of the counter rotation of thorax platform and pelvis platform.

PositionsFig. 31 .Fig. 32 .Fig. 33 .
Fig. 31.Simulation snapshots of the movements of a biped humanoid robot in a bendingmanipulation procedure The elaborated code in m files are included in the CD of this book.Design parameters of the simulated leg mechanism are listed in Table1.

Table 3 .
Simulation parameters of the single DOF leg mechanism for the tripod walking robot www.intechopen.com