# Valkyrie—Design and Development of Gaits for Quadruped Robot Using Particle Swarm Optimization

^{1}

^{2}

^{3}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Kinematic Modeling of the Quadruped Robot

#### 2.1. Forward Kinematics

#### 2.2. Inverse Kinematics

## 3. Stability Analysis of the Quadruped Robot

- The moment of stability should be a minimum of the sum of the moment of all four legs.
- The center of gravity (CoG)/center of mass (CoM) should be within the area of support polygon.

#### 3.1. Moment of Stability (${M}_{stab}$)

- ${M}_{stab}>0$
- ${M}_{stab}=Min\left[{M}_{L1}{M}_{L2}{M}_{L3}{M}_{L4}\right]$

#### 3.2. Center of Gravity (CoG)

#### 3.3. Center of Mass (CoM)

## 4. Gait Development Using PSO

- A.
- Walk Gait Implementation

- B.
- Pace Gait Implementation

- C.
- Trot Gait Implementation

#### 4.1. Particle Swarm Optimization (PSO)

_{best}) as well as according to the experience of neighbouring particles (global best or G

_{best}). The equations for updating the velocity and position of the particle are as follows [21].

#### 4.2. Mathematical Formulation of Fitness Function

- Center of mass (CoM) and center of gravity (CoG)—For the robot to stay stable during static and dynamic conditions, the CoM and CoG of the robot must stay within the support polygon.
- Maximum angle of links of the robot—It must be ensured that the legs do not cross the maximum angle so that the CoM and CoG of the robot lie within the polygon.

_{i}is a set of possible joint angles subjected to the following constraints.

_{1}, X

_{2}......X

_{n}) This position is compared with the target position, X

_{t}. Hence, the fitness function, f is given as the Euclidean distance between the target position and the obtained robot position.

#### 4.3. PSO Algorithm Implementation and its Significance

_{best}and G

_{best}through repetitive iterations to obtain the optimal joint variables. The pseudo code of the developed PSO algorithms is given as Algorithm 1 below.

Algorithm 1 PSO Algorithm Implementation | |

## 5. Experimental Results and Discussions

_{1}, C

_{2}) define the magnitude of the influence on the particles velocity in the directions of the local and the global optima. To have a better balance of search space between local and global exploration, it is good to assign a value between 1.0 and 2.0. Similarly, inertia weight (ω), plays a major role in determining the proportional relationship between local and global convergence. Since a larger inertia weight tends to facilitate global exploration, whereas a smaller inertia weight facilitates local exploration, the value is set to be 0.5. Using Pyswarms’s built-in optimizer function, the objective function (Equation (15)) is optimized, and the constraints are passed as its arguments.

^{−14}and [13.34, 17.29], respectively. Figure 4a,b shows the movement of the swarm towards the global best (marked in the red cross) where the x and y-axis correspond to the joint variables ${\theta}_{1}$ and ${\theta}_{2}$ in degrees, respectively, and Figure 5 shows the experimental setup. In addition, a graph between the number of iterations and cost is shown in Figure 6, where the best cost was found to decrease.

^{−14}for the target value of (10,0,0) and 1.00 for (20,0,0), respectively. This ensures that the algorithm was able to achieve global convergence.

_{T}and d

_{E}are the distance traveled by the robot estimated in theoretical and experimental, respectively. For this investigation, the robot was made to travel a distance of 10 cm, 20 cm, 100 cm, and 200 cm as tabulated in Table 5, and the actual distance traveled by the robot is noted. It can be found that the robot was not able to exactly reach the target position. This error can be due to the slippage or loose ground contact during the motion. In particular, it can be seen that a maximum error of 5.2 % on average was produced by the walk gait, while the trot and pace gait was found to produce a minimum error of 1.31 and 3.31%, respectively. These results support the statement that trot gait is the most stable and improves the dynamic characteristics of the robot. Since walk is a very slow gait, the robot might be prone to errors reducing the efficiency. Overall, the robot was able to achieve the gait patterns with a maximum error of only 10%, which can be further reduced, improving the stability and foot-ground contacts. Furthermore, the time taken to reach the target was found to determine the velocity of the robot. It can be seen that the velocity of the robot is not constant during all the gaits. On average, the walk gait had a velocity of 0.246 cm/s, the trot gait had 0.42 cm/s velocity, and the pace gait was 0.307 cm/s. Thus, it is understood that since walk gait is the slowest of the three, it has the lowest velocity, while trot has the highest velocity. But, however, it should be taken into consideration that the time taken for the robot to reach the targets in all three gaits is high, which in turn results in low speed. The sequence of the robot performing the three gaits is presented below in Figure 7.

## 6. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Informed Consent Statement

## Conflicts of Interest

## References

- Böttcher, S. Principles of robot locomotion. In Proceedings of Human Robot Interaction Seminar; 2006; Available online: http://users.dimi.uniud.it/~antonio.dangelo/Robotica/2012/helper/leggedRobot/RobotLocomotion.pdf (accessed on 12 August 2021).
- Zhai, K.; Li, C.A.; Rosendo, A. Scaffolded. Gait Learning of a Quadruped Robot with Bayesian Optimisation. arXiv
**2021**, arXiv:2101.09961. [Google Scholar] - Xin, G.; Xin, S.; Cebe, O.; Pollayil, M.J.; Angelini, F.; Garabini, M.; Vijayakumar, S.; Mistry, M. Robust Footstep Planning and LQR Control for Dynamic Quadrupedal Locomotion. IEEE Robot. Autom. Lett.
**2021**, 3, 4488–4495. [Google Scholar] [CrossRef] - Raheem, F.A.; Flayyih, M.K. Quadruped robot creeping gait stability analysis and optimisation using PSO. In Proceedings of the 2nd Al-Sadiq International Conference on Multidisciplinary in IT and Communication Science and Applications (AIC-MITCSA), Baghdad, Iraq, 30–31 December 2017; pp. 79–84. [Google Scholar]
- Golubovic, D.; Hu, H. Evolving locomotion gaits for quadruped walking robots. Ind. Robot. Int. J.
**2005**, 32, 259–267. [Google Scholar] [CrossRef] - Song, S.M.; Waldron, K.J. Machines that Walk: The Adaptive Suspension Vehicle; MIT Press: Cambridge, MA, USA, 1989. [Google Scholar]
- Mishra, A.K. Design, Simulation, Fabrication and Planning of Bio-Inspired Quadruped Robot; Requirement of the Degree of Master of Technology; Indian Institute of Technology Patna: Bihar, India, 2014. [Google Scholar]
- Estremera, J.; Gonzalez de Santos, P. Free gaits for quadruped robots over irregular terrain. Int. J. Robot. Res.
**2002**, 21, 115–130. [Google Scholar] [CrossRef] - Wang, P.; Song, C.; Li, X.; Luo, P. Gait planning and control of quadruped crawling robot on a slope. Ind. Robot. Int. J. Robot. Res. Appl.
**2019**, 47, 12–22. [Google Scholar] [CrossRef] - Xi, W.; Yesilevskiy, Y.; Remy, C.D. Selecting gaits for economical locomotion of legged robots. Int. J. Robot. Res.
**2016**, 35, 1140–1154. [Google Scholar] [CrossRef] - Yang, X.S. Nature-Inspired Metaheuristic Algorithms; Luniver Press: Bristol, UK, 2010. [Google Scholar]
- Winkler, A.W.; Farshidian, F.; Neunert, M.; Pardo, D.; Buchli, J. Online walking motion and foothold optimisation for quadruped locomotion. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), Singapore, 29 May–3 June 2017; pp. 5308–5313. [Google Scholar]
- Focchi, M.; Orsolino, R.; Camurri, M.; Barasuol, V.; Mastalli, C.; Caldwell, D.G.; Semini, C. Heuristic planning for rough terrain locomotion in presence of external disturbances and variable perception quality. In Advances in Robotics Research: From Lab to Market; Springer: Berlin/Heidelberg, Germany, 2020; pp. 165–209. [Google Scholar]
- Shen, W.; Li, M.; Wang, J.; Chai, C.; Zheng, W. An Algorithm for Quadruped Robot’s Inverse Kinematic Problems Based on PSO. In Proceedings of the 37th Chinese Control Conference (CCC), Wuhan, China, 25–27 July 2018; pp. 5152–5157. [Google Scholar]
- Rong, C.; Wang, Q.; Huang, Y.; Xie, G.; Wang, L. Autonomous evolution of high-speed quadruped gaits using particle swarm optimisation. In Robot Soccer World Cup; Springer: Berlin/Heidelberg, Germany, 2008; pp. 259–270. [Google Scholar]
- Sen, M.A.; Bakircioglu, V.; Kalyoncu, M. Inverse Kinematic Analysis of a Quadruped Robot. Int. J. Sci. Technol. Res.
**2017**, 6, 285–289. [Google Scholar] - Wettergreen, D.; Thorpe, C. Gait generation for legged robots. In Proceedings of the IEEE International Conference on Intelligent Robots and Systems, Raleigh, NC, USA, 7–10 July 1992. [Google Scholar]
- Abourachid, A. A new way of analyzing symmetrical and asymmetrical gaits in quadrupeds. Comptes Rendus Biol.
**2003**, 326, 625–630. [Google Scholar] [CrossRef] - A Guide to Quadruped Robot’s Gaits. Available online: https://www.animatornotebook.com/learn/quadrupeds-gaits (accessed on 19 May 2021).
- Laskari, E.C.; Parsopoulous, K.E.; Vrahatis, M.N. Particle Swarm Optimisation for Integer Programming. In Proceedings of the 2002 Congress on Evolutionary Computation, Honolulu, HI, USA, 12–17 May 2002; Volume 2, pp. 1582–1587. [Google Scholar]
- Kennedy, J.; Eberhart, R. Particle Swarm Optimisation. In Proceedings of the ICNN’95–International Conference on Neural Networks, Perth, WA, Australia, 27 November–1 December 1995; Volume 4, pp. 1942–1948. [Google Scholar]

**Figure 4.**(

**a**) Initial location of the swarm; (

**b**) Final location of swarm after convergence (https://drive.google.com/file/d/1c50Om2ocqiqzBCHhs6DjpV4Vy83q07HK/view, accessed on 10 August 2021).

Parameters | Specifications |
---|---|

Robot body dimension | 150 mm × 90 mm × 30 mm |

Link length (${a}_{1}$ and ${a}_{2}$) | 70 mm |

DoF | 2/Leg |

Weight | 1.5 kg |

Material | Polyethylene terephthalate (PET) and acrylic |

Joint constraints | $0\le {\theta}_{1}\le +20$ $0\le {\theta}_{2}\le +20$ |

Link | θ | $\mathit{d}$ | $\mathit{a}$ | A |
---|---|---|---|---|

1 | ${\theta}_{1}^{*}$ | 0 | ${a}_{1}$ | 0 |

2 | ${\theta}_{2}^{*}$ | 0 | ${a}_{2}$ | 0 |

Parameter | Value |
---|---|

No. of particles (or) swarm size | 20 |

Dimension of a particle | 2 ([${\theta}_{1}$, ${\theta}_{2}$]) |

Max iterations | 1000 |

Learning rates (C_{1}, C_{2}) | 1.5 |

Inertia weight ω | 0.5 |

Target (mm) | Best Cost | Joint Variables (Degrees) | Distance (mm) | Runtime (Seconds) |
---|---|---|---|---|

(10,0,0) | 1.14 × 10^{−14} | [13.34156399 17.29916917] | 10 | 1.81 |

1.14 × 10^{−14} | [13.34156399 17.29916917] | 10 | 1.85 | |

1.14 × 10^{−14} | [13.34156399 17.29916917] | 10 | 1.79 | |

1 × 10^{−14} | [19.62354122 17.29984651] | 15 | 1.84 | |

1.14 × 10^{−14} | [13.34156399 17.29916917] | 10 | 1.75 | |

(20,0,0) | 1.00 | [18.84955593 18.84955591] | 20 | 1.80 |

1.00 | [18.84955593 18.84955591] | 19.5 | 1.81 | |

1.00 | [18.84955594 18.84955589] | 19 | 1.79 | |

1.00 | [18.84955593 18.84955591] | 20 | 1.79 | |

1.00 | [18.84955594 18.84955589] | 20 | 1.81 |

Gait | Target (cm) | Distance Travelled | Error (%) | Time Taken (s) | Velocity (cm/s) | |
---|---|---|---|---|---|---|

Theoretical (cm) | Experimental (cm) | |||||

Walk | 10 | 10 | 9 | 10 | 32 | 0.312 |

20 | 20 | 19 | 5 | 71 | 0.281 | |

100 | 100 | 94.4 | 5.6 | 515 | 0.183 | |

200 | 200 | 198.9 | 0.55 | 943 | 0.210 | |

Trot | 10 | 10 | 9.8 | 2 | 20 | 0.500 |

20 | 20 | 19.5 | 2.5 | 54 | 0.370 | |

100 | 100 | 99.6 | 0.4 | 298 | 0.334 | |

200 | 200 | 199.3 | 0.35 | 414 | 0.481 | |

Pace | 10 | 10 | 9 | 10 | 27 | 0.370 |

20 | 20 | 19.7 | 1.5 | 63 | 0.317 | |

100 | 100 | 98.9 | 1.1 | 437 | 0.226 | |

200 | 200 | 198.7 | 0.65 | 623 | 0.318 |

Symbols | Full Form |
---|---|

CoM | Center of mass |

DoF | degrees of freedom |

CoG | center of gravity |

GA | genetic algorithm |

ACO | ant colony optimization |

PSO | particle swarm optimization |

PET | polyethylene terephthalate |

${a}_{1}$ and ${a}_{2}$ | length of links 1 and 2 |

${\theta}_{1}\mathrm{and}{\theta}_{2}$ | joint variables |

$V\left(t\right)$ | velocity of a particle at a given time |

$X\left(t\right)$ | position of a particle at a given time |

${P}_{best}$ | best position reached by a particle in a swarm |

${G}_{best}$ | best position reached by the swarm |

${C}_{1}$ and ${C}_{2}$ | acceleration co-efficients |

$ran{d}_{1}$ and $ran{d}_{2}$ | random numbers from 0 to 1 |

ω | inertial weight |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Srinivas, T.; Madhusudhan, A.K.K.; Manohar, L.; Stephen Pushpagiri, N.M.; Ramanathan, K.C.; Janardhanan, M.; Nielsen, I.
Valkyrie—Design and Development of Gaits for Quadruped Robot Using Particle Swarm Optimization. *Appl. Sci.* **2021**, *11*, 7458.
https://doi.org/10.3390/app11167458

**AMA Style**

Srinivas T, Madhusudhan AKK, Manohar L, Stephen Pushpagiri NM, Ramanathan KC, Janardhanan M, Nielsen I.
Valkyrie—Design and Development of Gaits for Quadruped Robot Using Particle Swarm Optimization. *Applied Sciences*. 2021; 11(16):7458.
https://doi.org/10.3390/app11167458

**Chicago/Turabian Style**

Srinivas, Taarun, Adithya Krishna Karigiri Madhusudhan, Lokeshwaran Manohar, Nikhit Mathew Stephen Pushpagiri, Kuppan Chetty Ramanathan, Mukund Janardhanan, and Izabela Nielsen.
2021. "Valkyrie—Design and Development of Gaits for Quadruped Robot Using Particle Swarm Optimization" *Applied Sciences* 11, no. 16: 7458.
https://doi.org/10.3390/app11167458