Biped Robot Walking using Particle Swarm

Optimization
Behzad Nikbin, Mohammad Reza Ranjbar, Behrooz Shafiee Sarjaz, and Hamed
Shah-Hosseini

Abstract maintaining stability of a high degree of freedom biped robot is a complex problem. One of the efficient methods to address this complexity is to utilize power of computer
hardware in order to find optimized values. This paper describes a novel walking algorithm
based on inverse kinematics for a biped robot. The proposed algorithm uses the PSO (Particle
Swarm Optimization) algorithm in order to find optimized values for the five walking algorithm parameters. The proposed approach is tested on a Simulated NAO robot in the RoboCup
soccer simulation environment. Simulation results reveal that using the PSO algorithm with
an efficient fitness function can significantly reduce learning time. Moreover, a considerable
fast walking speed is achieved.

1 Introduction
Humanoid robot locomotion is an exciting challenge for many researchers. In the recent years,
a significant body of research and development was performed in this area. The two main classifications of biped robot walking are static and dynamic balance. In Static balance approach,
the center of mass (COM) of the robot is kept within the support area of the feet. Similarly in
Dynamic balance methods, Zero Momentum Point (ZMP) should be kept inside the support
area. Early biped walking of robots involved static walking with a very low walking speed
[1,2]. Hereby, the projected point of COM onto the ground always falls within the supporting
polygon that is made by two feet. During the static walking, the robot can stop the walking
motion any time without falling down. The disadvantage of static walking is that the motion
is too slow and wide for shifting the COM. Researchers thus began to focus on dynamic
walking of biped robots [3-5]. This approach is much faster than static balance. However,
if the inertial forces generated from the acceleration of the robot body are not suitably controlled, a biped robot easily falls down. In addition, during dynamic walking, a biped robot
may fall down from disturbances and cannot stop the walking motion suddenly. Hence, the
notion of ZMP (Zero Moment Point) was introduced in order to control inertial forces [6,7].
The proposed algorithm in this paper, belongs to the dynamic balance methods, and utilizes
Behzad Nikbin, Mohammad Reza Ranjbar, Behrooz Shafiee Sarjaz, and Hamed Shah-Hosseini
Faculty of Electrical and Computer Engineering, Shahid Beheshti University, G.C., Tehran, Iran e-mail:
{behzad.nikbin, ranjbar.m1, shafiee01}@gmail.com, tasom2002@yahoo.com

1

optimization of walking parameters is discussed. conversely. The hips vertical movement (across the Z-axis) is ignored. hips height will be fixed during a specific walk pattern. A walking loop or gait is started by a half-loop whether by left or right leg.1. in section 5 the conclusion is presented. HalfLoop1left are discussed.2. after defining all the parameters. first. Fig.In section 3. Therefore. the entire walk loop can be easily constructed with a HalfLoop for each leg. through building one half-loop. The proceeding parts of this paper are classified as follows: in section 2. HipHeight is illustrated in Fig. Experimental results are demonstrated in section 4.1 is that all the movements across the Y-axis are ignored. the Particle Swarm Optimization (PSO) algorithm is utilized to find best values for them. In the following. the proposed walking algorithm is presented. 1: World Coordinates The noticeable point in Fig. Mohammad Reza Ranjbar. Moreover. This restriction leads to using five distinct parameters and merely three constants to model the walking process of NAO. Behrooz Shafiee Sarjaz. In addition. we have used the PSO algorithm in order to maximize the efficiency of our algorithm. constants are determined based on the physical specification of the robot. which use fixed classical complex equation to find the best values for their algorithms. Finally.2 Behzad Nikbin. Hal f Loop1right = Hal f Loop2le f t . The second assumption is that at the beginning of the HalfLoop1. the right leg is in front of the left leg. Parameter1: HipHeight HipHeight is the height of the hip joint during the walk process. We imagine the world coordinate system as depicted in Fig. unlike most of the previous works. 2 Proposed Walking Algorithm Biped-Walking is a periodic process with its period termed half-gait or half-loop. In the proceeding sections. . and is finished by another half-loop by the opposite leg. Finally. it can vary in different walk patterns. Thus. The outcomes of our simulations indicate that using the PSO to adjust walking parameters leads to a considerable fast walking speed with a negligible learning time. Hal f Loop1le f t = Hal f Loop2right As a result of this symmetry. calculation of each parameter is explained in detail. and Hamed Shah-Hosseini ZMP criteria in order to maintain the stability of a biped robot. HalfLoop1right and then. the walking can be constructed as a result of repetition of one half-loop after another.

GaitLength = Xn−1 AnkleLe f t − X0 AnkleLe f t (3) . MaxAnkleHeight = Max(Zi ankle ) = height( X0 ankle + Xn−1 ankle ) 2 (2) MaxAnkleHeight is shown in Fig. We assume this point in the middle of start and end points of HalfLoop1. HipOffset is demonstrated in Fig. Parameter5: GaitLength This parameter demonstrates the distance traversed during a Half-Loop. and MaxAnkleHeight Parameter4: NumOfSteps NumOfSteps defines the number of cycles (hardwares clock cycle) necessary to complete a Half-Loop.Biped Robot Walking using Particle Swarm Optimization 3 Parameter2: HipOffset HipOffset is the distance along X-axis between left hip and left ankle. HipO f f set = X0 HipLe f t − X0 AnkleLe f t (1) X0HipLeft and X0AnkleLeft are the X-values of the positions of the left hip and left ankle at cycle zero.3. Parameter3: MaxAnkleHeight MaxAnkleHeight indicates the height of ankle joint at the highest point. respectively. HipOffset.2. Fig. GaitLength is shown in Fig.2. 2: HipHeight.

4: Constant values of walking algorithm 3 Half-Loop In this section the relevant equations for a Half-Loop are presented. .02s Fig. First. Table 1: Constants for NAO Constant Thigh-Length Shank-Length Time of 1 Step(clock time of the robot) Value 14cm 11cm 0. 3: GaitLength and NumberOfSteps Constants All the constants in the walking process are determined according to the robot physical specification. Mohammad Reza Ranjbar. Fig.4 Behzad Nikbin. Behrooz Shafiee Sarjaz. and Hamed Shah-Hosseini Fig. calculation of each joint position during HalfLoop1 is explained.5 demonstrates the HalfLoop1 for the left leg. and will be fixed during any walk pattern.

Z)i hip right = (X. 5: Positions of left leg joints during HalfLoop1 3. The position of right hip is always equal to that of the left hip because both hips are connected to each other and move along each other. Z)i hip le f t 0 ≤ i ≤ n − 1 (4) The position of right ankle is fixed during HalfLoop1 and its position can be easily calculated.7 demonstrates the HalfLoop1 for the right leg. 6: Calculating knee position 3. In addition. The intersection of these two circles generates two result points.Biped Robot Walking using Particle Swarm Optimization 5 Fig.2 Right Leg Fig.6. the knee position is calculated by intersection of Ci1 and Ci2 as illustrated in Fig. The point with greater X-value will be answer because the knee angle of a human or robot is always positive. (X. Ci1 (x) = a circle centered to LeftHipi and radius of Thigh-Length Ci2 (x) = a circle centered to LeftAnklei and radius of Shank-Length Fig. GaitLength − HipO f f set 2 Zi ankle right = 0 0 ≤ i ≤ n−1 Xi ankle right = The knee position of right leg is calculated similar to left knee. A.1 Left Leg All the variables for the left hipand ankle are defined in the Appendix. (5) (6) .

α i demonstrates the angle of hip joint. These angular velocities are the final output of our algorithm and are sent directly to the robot motors. each joint angle can be simply calculated during each cycle of walk loop. j = θi. each joint angular velocity at each cycle can be determined as well. j − θi−1. Mohammad Reza Ranjbar.8 demonstrates the correspondent angles of hip. Fig. Behrooz Shafiee Sarjaz. β i indicates the angle of knee joint. αi = Zi hip − Zi knee π − arctan( ) 2 Xi hip − Xi knee (7) Zi knee − Zi ankle π )− Xi knee − Xi ankle 2 (8) γi = arctan( βi = −αi − γi (9) To this point. 7: Positions of right leg joints during HalfLoop1 3. and ankle In Fig. all of the joints angles at each cycle are calculated. j T (10) . and γ i represents the angle of ankle joint at cycle i. knee. These parameters can be easily calculated with respect to the line slopes. then. 8: Calculating angles of hip. Fig. consequently.3 Joints Angle Calculation After calculating all joints positions.6 Behzad Nikbin. the angular velocities can be calculated as follows: ωi. If the clock cycle time of robot be T. and Hamed Shah-Hosseini Fig. knee. and ankle joints.8.

As a result. 4 Optimization of Parameters In order to find the best values for the walking parameters. 9: A toolkit for manipulating parameters and running the PSO algorithm The PSO algorithm was selected because it can solve problems with less population density and less iteration in comparison with similar algorithms like Genetic algorithm. At each run. In most of the optimization algorithms. In order to easily manipulate these parameters. a robot in a simulated world is run.9. to use efficient initial values. In general. to reduce the number of populations. and ω i.2: Table 2: Parameters limitation Joint name Lower bound Upper bound HipHeight 11cm 25cm HipOffset 1cm 10cm MaxAnkleHeight 1mm 4cm Steps 3 14 GaitLength 1cm 30cm . there are two main solutions to reduce the convergence time: first. and the program waits for the walk results. Fig. This toolkit helped us reach proper initial values for the PSO algorithm. Therefore.j shows angular velocity of joint j at cycle i. To make PSO convergence faster. Each iteration must be run to complete the experiment.Biped Robot Walking using Particle Swarm Optimization 7 where θ i. which is a time consuming process. we limit the parameters as presented in Table. an efficient initial value for parameters plays a crucial role in the reduction of convergence time. we developed a visual toolkit as shown in Fig. we used the PSO algorithm. second. the convergence time significantly was reduced.j stands for the angle of joint j. experimenting with a great number of populations is not practical.

If the projection of this point on the ground is inside the support area. support area is the area between these two foots. the following function was used as the fitness function: n → − → − ∑ | Zi − Ci |2 (11) i=1 Where Zi is ZMP. n−1 → − −−→ (12) ∑ |Ci − Ci+1 |2 i=1 . Behrooz Shafiee Sarjaz.3 Fitness function In order to achieve the minimum deviation of ZMP and center of support area. another fitness function to combine with this function is required. it is clear that the best case is when the robot does not move (fitness=0).2 Zero Momentum Point Zero Momentum Point (ZMP) is originally a point at which sum of all momentums around it is zero [9]. Therefore.8 Behzad Nikbin.1 Fitness Function Another critical factor in optimization algorithms is fitness function. and Hamed Shah-Hosseini 4.1. the robot will be stable. Mohammad Reza Ranjbar. By means of these concepts. and when just one foot touches the ground. 4.1 Support Area The support area is the area between the two legs [8]. otherwise the robot may fall down. 4. 10: (a) support area in double support phase (b) support area in single support phase 4.1. When both legs touch the ground. the support area and zero momentum point were utilized. Ci stands for the center of support area at cycle i. the robots stability can be measured effectively. On the other hand. support area is the area under that foot.10. ZMP formulas are presented in appendix B. In order to reach an effective fitness function. The areas in both cases are demonstrated in Fig.1. and n shows the number of simulation cycles. Fig.

the final formula which tries to minimize Eq. Table 3 shows the PSO algorithms parameters.04 with OpenJDK 6. Rcssserver3d. The platform used to run the proposed Fig. We observed that by choosing W=0. JSwarm is an open source implementation of PSO algorithm in java.4GHz with 8GB of physical memory. the robot will traverse a longer path in a specific time (n cycles) period. In summary.6 the robot can achieve a relatively fast and stable walking.11. A screenshot of Rcssserver3d and the developed toolkit are both presented in Fig. of Particles Inertia Particle Increment Global Increment 30 20 0. Since the PSO is a stochastic algorithm. we performed 10 different runs. In order to find the appropriate value for W parameter of the fitness function in Eq. the experiments are executed in Ubuntu Linux 10. 11: Rcssserver3d and the developed toolkit to find the initial parameters algorithm is a Pentium IV core i7 2. We tried different values for the W with initial values for PSO algorithm. and this value was used during PSO runs. 5 Experimental Results In order to experiment the proposed algorithm in action.Biped Robot Walking using Particle Swarm Optimization 9 With maximizing this function. we used the RoboCup Soccer Simulation Server. Rcssserver3d implements a simple internal event model that immediately executes every action received from an agent. 13 and proper initial values for PSO algorithm.98 0. After spending nearly 130 minutes in each run. 11 and maximize the Eq.01 . 12 becomes as follows: n − → − → f = w ∑ | Zi − Ci |2 + i=1 1−w → − −−→ 2 ∑n−1 i=1 | Ci − Ci+1 | (13) In this equation w can be manipulated to choose between stability and speed. we used our visual toolkit before running PSO algorithm. The JSwarm library [10] was used to implement PSO algorithm.01 0. Moreover. of Iterations No. the deviations in the output of Table 3: PSO algorithm parameters No.

an average speed of 0. 6 Conclusion and Future works In this paper. Mohammad Reza Ranjbar. We believe that this increase in the average speed and significant time reduction is the result of using an accurate fitness function and the PSO algorithm both.3cm 17. Therefore.57m/s. Fig.2m during 10 seconds. joints positions are shown. they claim that by arm swing and their increasing speed technique they could improve walking speed to 0. which is equal to 0. they did not report about the stability of Robot and the mechanism which measure their estimation of robots stability. which was done during four hours of learning in a simulated environment with a genetic algorithm [11].13. In [12] the authors use PSO algorithm to find optimized value for their TFS (Truncated Fourier Series) based gait generation method. Using PSO with the TFS. In a similar work. We believe that through manipulating the W parameter higher speed can achieve. In addition.9cm The NAO robot of the best particle could traverse 6. however. Fig. the algorithm was ceased. of steps MaxAnkleHeight HipOffset HipHeight 19. and the best fitness value in 10 runs. and Fig.44m/s was achieved. and Hamed Shah-Hosseini fitness function were insignificant. First. In Fig. an inverse kinematic approach was used to estimate the position of each robot joint .77m/s. Behrooz Shafiee Sarjaz.0cm 8.14 presents the correspondent generated angle of each joint.12 shows the average fitness value after each iteration for 10 runs.3cm 8 3. the optimized values of parameters are presented in Table4. This relatively short convergence time was the result of using the PSO algorithm and an accurate fitness function. but there is a tradeoff between stability and speed.62m/s on average. On the other hand.10 Behzad Nikbin. we presented a dynamic balance walking algorithm using the PSO algorithm. 12: Fitness values in 30 iterations Table 4: Optimized parameters (best particle of PSO) GaitLength No. they could achieve 0.

Takanishi: Development of a bipedal humanoid robot control method of whole body cooperative dynamic biped walking. Fujiwara. 14(1): 41-48 (1994) 2. E. Paper presented . K. B. H. Takenaka: The development of Honda humanoid robot. 2003 6. C. Y. the proposed algorithm should be altered to a dynamic approach which can maintain the robot stability more effectively. Michigan. M. Borovac. Hirukawa: Biped walking pattern generation by using preview control of Zero-Moment Point. Belgium. the proposed algorithm should consider the non-straight trajectories. Harada. K. A. andCybernetics. W. Inoue: Online generation of humanoid walking motion based on fast generation method of motion pattern that follows desired ZMP. D. Stokic: Biped locomotion. K. Yokoi. Kagami. an Omni-directional approach will be considered. Taiwan. J. Springer-Verlag (1990) 7. Inaba. We have two main goals to follow as the future works. Taipei. K. Soga. Yamaguchi. IEEE Transactions on Systems. Kanehiro. Paper presented at the IEEE international conference on robotics and automation. 13: Positions of left and right leg during the walk Fig. S. Paper presented at the IEEE international conference on robotics and automation. T. Kajita. the PSO algorithm was utilized to find the best values for parameters which generate the least deviation of robot ZMP from the robot support area. F. H. Shih: Ascending and descending stairs for a biped robot. 14: Angles of each joint and the correspondent angles. L. 10-15 May 1999 4. References 1.Vukobratovic. S. K. Kaneko. In addition. therefore. Surla. Miller III: Real-time neural network control of a biped walking robot. Inoue. IEEE Control Systems Magazine. Kuniyoshi. S. Leuven. 14-19 Sep. 29(3): 255-268 (1999) 3. Detroit. Paper presented at the IEEE international conference on robotics and automation. Hirai. M. Nishiwaki. K. T.Biped Robot Walking using Particle Swarm Optimization 11 Fig. First. D. Then. Hirose. Man. 16-20 May 1998 5. M.

2007. Mohammad Reza Ranjbar. http://jswarm-pso. 30 Sep.Mohammad. Bamberski: Analysis of stability of the human gait. P. Behzad Nikbin.V. 2007 JSwarm. Chew. Mrozowski. T. Aslani. Last Access Oct. L. M. Robotica (2007) volume 25. Appendix B xzmp = ∑ni=1 mi (Z¨i + g)xi − ∑ni=1 mi x¨i zi − ∑ni=1 mi Iiy Ω¨ iy ∑ni=1 mi (Z¨i + g) ∑ni=1 mi (Z¨i + g)yi − ∑ni=1 mi y¨i zi − ∑ni=1 mi Iix Ω¨ ix ∑ni=1 mi (Z¨i + g) zzmp = 0 yzmp = . and Hamed Shah-Hosseini at the IEEE/RSJ international conference on intelligent robots and systems. Behrooz Shafiee Sarjaz. C.sourceforge. Zielinska. 2011. Berlin. Yang.12 8. pp. Reis. MaxAnkleHeight) points. Appendix A Left hip X0 hip le f t = HipO f f set i ∗ GaitLength Xi hip le f t = X0hiple f t + 2 ∗ (n − 1) Zi hip le f t = HipHeight 0 ≤ i ≤ n − 1 Left ankle X0 ankle le f t = 0 Xn−1 ankle le f t = X0 ankle le f t + GaitLength Z0 ankle le f t = 0 Zn−1 ankle le f t = 0 i ∗ GaitLength Xi ankle le f t = X0 ankle le f t + n−1 Zi ankle le f t = C(Xi ankle le f t ) 1 ≤ i ≤ n − 2 C(X): The circle which passes through the (X0 ankle left . X +X and ( 0 ankle left 2 n-1 ankle left . 549565. April. S. 2002 J. 6556. 324-335. 91-98. vol. L. N.net. Lau: Biped Walking using Coronal and Sagittal Movements based on Truncated Fourier Series. Shafii.Javadi. March 19. 9. pp. 2011. Zn-1 ankle left ). Springer LNAI / LNCS. pp. 12. RoboCup-2010: Robot Soccer World Cup XIII. (Xn-1 ankle left . Poo:A uniform biped gait generator with offline optimization and online adjustable parameters. S. Z0 ankle left ). 45. 11. H. 10. Azizi. Journal of Theoretical and Applied Mechanics. Vol. Switzerland. 1. no. 5 Oct. N. N.P. 2009. J. O.S. Shafii.Iran Open Symposium. Nezami: Robust Humanoid walking using Truncated Fourier Series gait generator. Lausanne. Awrejcewicz. A.