1 Introduction

Recently, the usage of biped robots are growing in various applications such as industry, houses, offices and hospitals. Based on the utility of the biped robots, most of the research is focussed on the development of human friendly features which are partially inspired by the growth in the technology. The major challenge in the area of biped robotics is to generate dynamically balanced gaits for the robot in an unknown environment. Further, for the past few decades, many researchers were working on the development of various types of linear and non-linear controllers that generate dynamically balanced walking gaits for the biped robot. Up to now, most of the research is focused on the generation of dynamically balanced gaits only in the sagittal plane. In the present research work, the gait of the biped robot is considered in both the sagittal and frontal planes and designed a torque based PID controllers while walking on the flat surface.

Some of the literature related to the generation of dynamically balanced gaits of a biped robot is presented below. A semi-inverse method was proposed by Juricic and Vukobratovic [1] to determine the trunk motion of a biped robot. In that work, initially the ZMP position was defined, and then the trunk motion was calculated based on the defined position of ZMP. In [2], Furusho and Masubuchi introduced a new reduced order model based on the concept of local feedback of the system to develop a stable locomotion. The said reduced order model was derived after considering the effect of motion of the body and swing leg of the biped robot. Further, Seo and Yoon [3] conducted several simulations for the biped robot on various terrain conditions and designed a robust dynamic gait based on the concept of ZMP and DBM. Moreover, Lum et al [4] developed computed torque control scheme and variable structural control law to control a 5-DOF biped robot. The performance of the developed method was tested on a real robot and found that it could walk on a horizontal surface and climb a stair case. For achieving dynamic walking, Kim et al [5] used distributed control architecture to control all the joints of the robot in a smooth way. The architecture was reduced to limit the computation effect of the main controller on the system. Further, a servo motor was used as the sub-controller for the inertia sensor and a 3-axis force/torque sensor used in the sensory system. The results of simulation was tested on KHR-2, a 41-DOF humanoid robot. Pandu et al developed dynamically balanced gait generation algorithm for a 7- DOF biped robot on different terrains i.e., stair case [6] and slope surface [7] after using the concept of zero moment point. In that work, the authors had not used any controller to control the robot, and the degrees of freedom of the robot is limited. In [8], Hernandez et al designed a PD control algorithm with gravity compensation on a 16- DOF biped robot for obtaining desired trajectories, and to determine the torque required at each joint. Later on, to generate smooth walking gaits of the biped robot in both single and double support phase, Al-Shuka et al [9] proposed an algorithm that induce smooth transition from SSP to DSP and vice versa by using three methods i.e., LIPM, LPM and COG. Further, they also implemented different foot trajectories in DSP to improve the stability of the biped robot. Katic and Vukobratovic [10] developed an intelligent control technique after using genetic algorithm (GA), neural network (NN) [11], fuzzy logic controller (FLC) and their hybrid versions, such as neuro genetic, neuro-fuzzy networks and fuzzy genetic algorithms in the area of biped robotics.

In addition to the above methods, Patrizio [12] developed an adaptive PD controller for controlling the robotic manipulators. The controller was shown to be globally convergent and the simulations were conducted on a 3-DOF robot. From the results of simulation, it was observed that the performance of the adaptive PD controller had hardly influenced by the initial error, although the performance of the PID control law deteriorated considerably as the error was increased. A tuning procedure was proposed by Rafael [13] to tune the controller of a robotic manipulator. They utilized Lyapunov function together with the LaSalle invariance principle to obtain the required tuning procedure. For tuning the PID controller by using these approaches, in depth knowledge over the inertia matrix and gravitational torque vectors was required. Further, Khoury et al [14] developed a fuzzy PID controller for a 5-DOF robotic arm and the performance of their controller was compared with the help of the computed torque control method and direct adaptive control method. Moreover, to tune the PID controller parameters of a 4-DOF spatial and planar manipulators, Ravi and Pandu [15] utilized manual tuning procedure. The performance of these controllers were tested in computer simulations. Further, to control the multiple inputs and outputs of a robotic arm, Hassan [16] developed a self-organising fuzzy PID controller. It was observed that the output trajectories of the SOF-PID controller path was closer and smoother than the output trajectories of the SOFC and PID controller. Later on, Aulia et al [17] used Reinforcement learning (RL) algorithm with Q-Learning approach to tune the PID control parameters of the soccer robot. Finally, they compared the results of the approach with Ziegler–Nichols tuning method. The response of RL algorithm was 1.5 times faster than the Ziegler– Nichols tuning method. Jeong et al [18] used a non-parametric estimation method based on particle swarm optimization (PSO) to search the parameters used in the central pattern generator of the two legged robot. Moreover, Helon et al [19] proposed a multi-objective genetic algorithm (that is, NSGA-II) to tune the gains of the PID controller of the robotic manipulator. It was observed that the performance of the NSGA-II was good at reference tracking and provides robust solutions for the robotic manipulator. In [20], Mohd et al discussed the tuning of PID controller parameters using differential evolution (DE) and genetic algorithm (GA). The performance of these algorithms were compared with the standard Ziegler-Nichols method. Further, Ravi et al [21] developed a tuning procedure for the PID controller of a 3-DOF planar robotic manipulator after using GA and PSO algorithms. It was observed that the PSO algorithm was seen to be performed better than GA in terms of error in the joint angle and torque required at various joints. Moreover, Geetha et al [22] implemented a virtual feedback controller to control the state variables of the continuously stirred tank chemical reactor and used extended kalman filter in the feedback mechanism. They used GA, PSO [23] and ACO algorithms for determining the optimal PID parameters. It was found that the PSO algorithm was seen to perform better than the other methods. Joel et al [24] developed adaptive neural network controller for tracking the trajectory of a 2-DOF manipulator. The Lyapunov control function was used for analysing the stability of the tracking error, and the PID approach was used to determine the control law.

Further, Dusan et al [25] implemented some nature-inspired optimization algorithms, such as GA, PSO, Bat Algorithm (BA) [26], Hybrid Bat Algorithm (HBA), DE and Cuckoo Search (CS) algorithms to obtain the optimal parameters for the PID controller. They applied these algorithms for the online response of the PID controller by applying sudden loads, and observed a quick response. In [27], the authors had developed an optimal adaptive PID controller based on fuzzy rules and introduced a sliding mode controller to control the multi input and multi output chaotic nonlinear systems. A multi objective GA was used to optimize the parameters of the proposed controller. No work is reported on the usage of invasive weed optimization algorithm in the area of the proposed research. However, this algorithm was used to optimize the gains of the PID controller in other engineering applications. Navid and Mohsen [28] used invasive weed optimization (IWO) and Artificial Bee Colony (ABC) algorithms to tune the gains of the PID controller for hydro-turbine generator. The results of the simulation revealed that IWO algorithm had performed better than the ABC algorithm at different load conditions of the power system. Further, Abedinia et al [29] used a modified version of IWO algorithm to tune the parameters of fuzzy PID controller used in multi machine power system. A Bacterial Foraging Optimization algorithm (BFO) was also used by Latha and Rajinikanth [30] to tune the parameters of PID controller used in a 2-DOF manipulator. The robustness of the algorithm was tested by introducing uncertainty in the model parameters. In addition to the above algorithms, Nikhileshwar and Amith [31] used GA to tune the parameters of the PID controller that was in the position control of a DC motor. Recently, another optimization algorithm called Antlion optimizer [32] was also used to tune the gains of the PID controller used in automobile cruise control system. Later on, Naidu and Ojha [33] developed a hybrid version of IWO with quadratic approximation, and compared with standard invasive weed optimization algorithm. In [34], [35] the authors discussed the applicability of invasive weed optimization algorithm in electromagnetic applications. Further, various new optimization algorithms such as chemical reaction optimization [36] and fireworks optimization [37] algorithms were developed by various authors to estimate the optimal parameters related to different engineering problems.

Based on the above literature, it has been observed that most of the researchers had used ZMP based PID controller to control the motors of the biped robot while executing the motion. It is important to mention that the ZMP based governing is an indirect method of controlling the motors in which the error signal between the obtained and reference ZMP trajectory is used to design the gaits for various links of the biped robot. During the said process, the controller may suggest some dynamically balanced postures which may not be kinematically feasible. Further, finding the most appropriate gaits of the biped robot that fulfils the sequence oriented criterion and repeatability conditions is challenging to achieve. Whereas torque-based PID controller considers the error signal of each joint of the biped robot, and try to design the gains of the controller by minimizing the error between two consecutive gait angles of each joint of the biped robot. With the best of the author’s knowledge, no work is reported on the design of torque based PID controller for the biped robot. Moreover, none of the researcher had tried to implement the chaotic nature in IWO algorithm that helps in distributing the seeds in a wider spread that helps in enhancing the search space. In the present paper, an attempt is made to develop an appropriate torque-based PID controller for all the joints of the lower limbs of a biped robot to achieve stable walk. Further, the gains of the PID controllers are tuned with the help of a modified non-traditional optimization algorithm i.e., MCIWO developed in this research. Once the optimal PID controllers are designed, the effectiveness of the algorithm is compared with the existing DE tuned PID controller in terms of dynamic balance margin of the biped robot. Further, the gaits obtained using the best optimal PID controller are tested on a real robot and found that the robot has successfully performed its walk on flat terrain.

The rest of the paper is organised as follows. Section 2 explains the formulation of the problem that includes the kinematics, dynamics and design of PID controller. Section 3 discusses the formulation of the optimization problem. The description related to the non-traditional optimization algorithms are given in section 4. The results of simulation and experimentation are presented and discussed in section 5. Further, the conclusions of the said work and scope for future work are provided in section 6 and 7, respectively.

2 Formulation of the problem

The problem solved in the present research may be detailed as follows: A torque-based PID controller will be developed for the 18-DOF biped robot (figure 1) walking on the flat surface after maintaining the balance of the robot in both sagittal and frontal planes. The kinematics, dynamics and design of the torque-based PID controller for the said robot are explained below. The gains of the proposed PID controller are optimized with the help of a non-traditional optimization algorithm, MCIWO developed in this study.

Figure 1
figure 1

A schematic diagram showing the full body of biped robot: (a) stick diagram and (b) real robot.

2.1 Inverse kinematics of the biped robot

The concept of inverse kinematics is used to determine the included angles made between the lower and upper limbs of the swing leg of the biped robot. The mathematical expressions used for obtaining the joint angles of swing leg θ4 and θ3 in sagittal plane are given below.

$$ \theta_{4} = \sin^{ - 1} \left( {\frac{{H_{1} l_{3} \sin \psi + L_{1} \left( {l_{4} + l_{3} \cos \psi } \right)}}{{\left( {l_{4} + l_{3} \cos \psi } \right)^{2} + \left( {l_{3} \sin \psi } \right)^{2} }}} \right) $$
(1)

where \( H_{1} = l_{4} \cos \theta_{4} + l_{3} \cos \theta_{3} ,L_{1} = l_{4} \sin \theta_{4} + l_{3} \sin \theta_{3} ,\psi = \theta_{4} - \theta_{3} = arc\cos ((H_{1}^{2} + L_{1}^{2} - l_{4}^{2} - l_{3}^{2} )/2l_{4} l_{3} ) \). Thus, \( \theta_{3} \) can be obtained from the equation\( \theta_{3} = \theta_{4} - \psi \). Similarly, the angles \( \theta_{9} \) and \( \theta_{10} \) are obtained by using the following mathematical expressions.

$$ \theta_{10} = \sin^{ - 1} \left( {\frac{{H_{2} l_{9} \sin \psi + L_{2} \left( {l_{10} + l_{9} \cos \psi } \right)}}{{\left( {l_{10} + l_{9} \cos \psi } \right)^{2} + \left( {l_{9} \sin \psi } \right)^{2} }}} \right) $$
(2)

where \( H_{2} = l_{9} \cos \theta_{9} + l_{10} \cos \theta_{10} ,L_{2} = l_{9} \sin \theta_{9} + l_{10} \sin \theta , \) \( \psi = \theta_{10} - \theta_{9} = arc\cos ((H_{2}^{2} + L_{2}^{2} - l_{10}^{2} - l_{9}^{2} )/2l_{10} l_{9} ) \). Thus, \( \theta_{9} \) can be obtained from the equation\( \theta_{9} = \theta_{10} - \psi \). The angle at ankle with respect to vertical axis is assumed to be equal to zero i.e., \( \theta \)6 = \( \theta \)12 = 0. The mathematical relationships used for determining the joint angles of both the legs in frontal plane are given below.

$$ \theta_{2} = \theta_{8} = \tan^{ - 1} \left( {{{f_{w} } \mathord{\left/ {\vphantom {{f_{w} } {H_{1} }}} \right. \kern-0pt} {H_{1} }}} \right) $$
(3)
$$ \theta_{5} = \theta_{11} = \tan^{ - 1} \left( {{{\left( {0.5*f_{w} } \right)} \mathord{\left/ {\vphantom {{\left( {0.5*f_{w} } \right)} {H_{2} }}} \right. \kern-0pt} {H_{2} }}} \right) $$
(4)

It is important to note that the joint angles in both the sagittal and frontal planes of the robot are needed to follow repeatability conditions for smooth transition from single support phase to double support phase and vice versa.

2.2 Dynamic balance margin of the biped robot

While walking, the gait generated by the biped robot should be dynamically balanced. For achieving dynamically balanced gait, the zero moment point should lie inside the foot support polygon. The foot-ground interaction model, in which the position of ZMP and forces acting on the foot of the biped robot are shown in figure 2.

Figure 2
figure 2

Schematic diagram showing the foot-ground interaction model.

The location of ZMP in both the directions i.e., Xzmp and Yzmp is calculated by using the following equations:

$$ x_{ZMP} = \frac{{\sum\nolimits_{i = 1}^{n} {\left( {I_{i} \dot{\omega }_{i} - m_{i} \ddot{x}_{i} z_{i} + m_{i} x_{i} (g - \ddot{z}_{i} )} \right)} }}{{\sum\nolimits_{i = 1}^{n} {\left( {m_{i} (\ddot{z}_{i} - g)} \right)} }} $$
(5)
$$ y_{ZMP} = \frac{{\sum\nolimits_{i = 1}^{n} {\left( {I_{i} \dot{\omega }_{i} - m_{i} \ddot{y}_{i} z_{i} + m_{i} y_{i} (g - \ddot{z}_{i} )} \right)} }}{{\sum\nolimits_{i = 1}^{n} {\left( {m_{i} (\ddot{z}_{i} - g)} \right)} }} $$
(6)

where \( \dot{\omega }_{i} \) and \( I_{i} \) denotes the angular acceleration (rad/s2) and mass moment of inertia (kg-m2) of the \( i^{th} \) link, g and \( m_{i} \) represents the acceleration due to gravity (m/s2) and mass (kg) of the link \( i \), \( {\ddot{\text{z}}}_{\text{i}} \) and \( {\ddot{\text{x}}}_{\text{i}} \) indicates the acceleration of the \( i^{th} \) link moving in z and x directions (m/s2), (\( {\text{x}}_{\text{i}} , {\text{y}}_{\text{i}} , {\text{z}}_{\text{i}} \)) signifies the coordinates of the \( i^{th} \) lumped mass.

It is important to note that, the ZMP should always lie inside the foot support polygon to ensure dynamically balanced gaits of a biped robot. The DBM, which is used to measure the amount of balance of the robot is defined as the distance between the ends of the foot support polygon to the point, where the ZMP is acting on the foot at the foot ground interaction. The following expressions are used to calculate the quantities \( x_{DBM} \) and \( y_{DBM} \) of the biped robot.

$$ x_{DBM} = \left( {\frac{{f_{s} }}{2} - \left| {x_{ZMP} } \right|} \right) $$
(7)
$$ y_{DBM} = \left( {\frac{{f_{w} }}{2} - \left| {y_{ZMP} } \right|} \right) $$
(8)

where\( f_{s} \) and \( f_{w} \) represent the length and width of the foot support, respectively. It is important to note that in the present research the orientation of the swing foot is parallel to the ground.

2.3 Dynamics of the biped robot

The parameters, such as linear and angular velocity of the joints are very important for the locomotion of the biped robot. The Jacobian method is used to determine the linear (\( J_{vi} ) \)and angular (\( J_{\omega i} ) \)velocity of the joints of the biped robot.

$$ J_{i} = \left[ {\begin{array}{*{20}c} {J_{vi} } \\ {J_{\omega i} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {Z_{i - 1} \times \left( {O_{n} - O_{i - 1} } \right)} \\ {Z_{i - 1} } \\ \end{array} } \right] $$
(9)

Once the angular velocity and angular acceleration are evaluated, the dynamics of the biped robot is determined with the help of Lagrange-Euler formulation, which is given below.

$$ \tau_{i,the} = \sum\nolimits_{j = 1}^{n} {M_{ij} } \left( q \right)\ddot{q}_{j} + \sum\nolimits_{j = 1}^{n} {\sum\nolimits_{k = 1}^{n} {C_{ijk} } } \dot{q}_{j} \dot{q}_{k} + G_{i} \quad i,j,k = 1,2 \ldots n $$
(10)

where \( \tau_{i the} \) indicates the torque required at joint \( i \) (N-m), \( q_{j, } \dot{q}_{j } \)and \( \ddot{q}_{j} \) represent the displacement, velocity (rad/sec) and acceleration (rad/sec2) of the joint, respectively. While controlling the joint, the acceleration of the link plays a major role. Therefore, the expression in terms of acceleration will be obtained by rearranging the terms of equation (10), and is given below.

$$ \ddot{q}_{j} = \sum\nolimits_{j = 1}^{n} {M_{ij} } \left( q \right)^{ - 1} \left[ { - \sum\nolimits_{j = 1}^{n} {\sum\nolimits_{k = 1}^{n} {C_{ijk} } } \dot{q}_{j} \dot{q}_{k} - G_{i} } \right] + \left( {\sum\nolimits_{j = 1}^{n} {M_{ij} } \left( q \right)^{ - 1} *\tau_{i,the} } \right)\quad i,j,k = 1,2 \ldots n $$
(11)
$$ {\text{now}}\,{\text{by}}\,{\text{considering}}\,{\text{the}}\,{\text{term}}\,\sum\nolimits_{j = 1}^{n} {M_{ij} } \left( q \right)^{ - 1} *\tau_{i,the} = \hat{\tau } $$
(12)

the torque required can be obtained by using the equation (13), which is given below.

$$ \tau_{i,the} = \sum\nolimits_{j = 1}^{n} {M_{ij} \left( q \right)} *\hat{\tau } $$
(13)

2.4 Design of PID controller for biped robot

After solving the dynamics of the biped robot, the PID controllers are employed to control the motors of all the joints of the biped robot. The main aim of the PID controller is to diminish the error between the actual process variable to the reference of the system. The equation for the joint based PID controller that is used in this study is given below as in eq. (14).

$$ \tau_{act} = K_{p} e(t) + K_{d} \frac{de(t)}{dt} + K_{i} \int {e(t)dt} $$
(14)

where \( e(t) \) represent the error in the displacement of joint and \( K_{p} \), \( K_{d} \) and \( K_{i} \) indicate proportional, derivative and integral gains for the controller, respectively. The expanded form of the above equation after including the meaning of \( e(t) \) is given below.

$$ e\left( {\theta_{i} } \right) = \theta_{if} - \theta_{is} $$
(15)
$$ \tau_{i,act} = K_{pi} \left( {\theta_{if} - \theta_{is} } \right) - K_{di} \mathop {\theta_{is} }\limits^{.} + K_{ii} \int e\left( {\theta_{is} } \right)dt\quad i = 1,2, \ldots n $$
(16)

where \( \tau_{i, act} \) represent the actual torque supplied by the controller to individual joints to move from an initial angular position (\( \theta_{is} ) \) to final angular position (\( \theta_{if} ) \). The final control equation that represents the control action for all joints is given below.

$$ \ddot{q}_{j} = \sum\nolimits_{j = 1}^{n} {M_{ij} } \left( q \right)^{ - 1} \left[ { - \sum\nolimits_{j = 1}^{n} {\sum\nolimits_{k = 1}^{n} {C_{ijk} } } \dot{q}_{j} \dot{q}_{k} - G_{i} } \right] + K_{pi} \left( {\theta_{if} - \theta_{is} } \right) - K_{di} \dot{\theta }_{is} + K_{ii} \int e\left( {\theta_{is} } \right)dt $$
(17)

Further, the integral terms in the above equation need to be substituted by its state variables, and is given below.

$$ x_{i} = \int e\left( {\theta_{is} } \right)dt \Rightarrow \dot{x}_{i} = \theta_{if} - \theta_{is} \quad i = 1,2, \ldots n $$
(18)

3 Formulation as an optimization problem

In the present study, the biped robot has to move on the flat terrain with the help of dynamically balanced gaits obtained from the torque-based controller, whose gains are optimized with an objective to minimize the error in angular displacement of the swing and stand legs. There are several entities such as, links of the robot, orientation of the foot, structure of the body, nature of the surface, walking with single or double support phases and the nature of the gait in both the sagittal as well as frontal planes, etc. influence the balance of the biped robot in real time and unique when compared with the other mobile robots. The improper planning and lack of coordination among these entities lead to decrease in the balance of the robot and the gait may fail also. To maintain proper balance of the biped robot while walking on flat terrain it is necessary to control the motors mounted on the joints in an appropriate manner. Minimization of error in angular displacement of the motors mainly depend on various constraints related to the controller. The major constraints include the proportional, derivative and integral gains of the controllers that are used to control the motors mounted on swing and stand legs. The problem aims at evolving the gains of the controllers that minimizes the error in angular displacement of both the swing and stand leg. The various assumptions and notations considered while developing the model are explained below.

3.1 Assumptions

  1. (1)

    The double support phase is instantaneous and is used to exchange the leg support.

  2. (2)

    The friction between the foot and ground is sufficient enough for the robot to avoid slipping while walking on the floor.

  3. (3)

    Free movement for upper body of the biped robot is considered for proper balancing of the biped robot.

3.2 Notations

In the present research, i and j are used as two sets/indices that are used to represent number of joints in the swing and stand leg, respectively. The parameters and decision variables used in this study are given in tables 1 and 2, respectively.

Table 1 The parameters used in the problem.
Table 2 The decision variables used in the problem.

3.3 Objective function

The overall objective of the present model is to minimize the total error which comprises of error in angular displacement of both the swing and stand legs and is formulated [38 and 39] as follows:

Minimize total error = Error in angular displacement for swing leg + Error in angular displacement for stand leg

The description of the objective functions is given by Equations (19) and (20), respectively.

$$ {\text{Error}}\,{\text{in}}\,{\text{angular}}\,{\text{displacement}}\,{\text{for}}\,{\text{swing}}\,{\text{leg}}\,\left( {e_{1} } \right) = \sum\nolimits_{i = 1}^{6} {(\theta_{if} - \theta_{is} )} $$
(19)
$$ {\text{Error}}\,{\text{in}}\,{\text{angular}}\,{\text{displacement}}\,{\text{for}}\,{\text{stand}}\,{\text{leg}}\,\left( {e_{2} } \right) = \sum\nolimits_{j = 7}^{12} {(\theta_{jf} - \theta_{js} )} $$
(20)

Subject to constraints: The bounds on various design variables related to the problem are given below.

$$ \begin{array}{*{20}c} {K_{pi,\hbox{min} } \le K_{pi} \le K_{pi,\hbox{max} } } \\ {K_{di,\hbox{min} } \le K_{di} \le K_{di,\hbox{max} } } \\ {K_{ii,\hbox{min} } \le K_{ii} \le K_{ii,\hbox{max} } } \\ \end{array} \quad i = 1,2, \ldots 6 $$
(21)

The constraints provided in Eq. (21) restricts the variation of proportional, derivative and integral gains, to minimize the error in the angular displacement of various joints of the swing leg at various instances of time.

$$ \begin{array}{*{20}c} {K_{pj,\hbox{min} } \le K_{pj} \le K_{pj,\hbox{max} } } \\ {K_{dj,\hbox{min} } \le K_{dj} \le K_{dj,\hbox{max} } } \\ {K_{ij,\hbox{min} } \le K_{ij} \le K_{ij,\hbox{max} } } \\ \end{array} \quad j = 7,8, \ldots 12 $$
(22)

Eq. (22) restricts the gains of the PID controller to minimize the error in the angular displacement of various joints of the stand leg at various instances of time. The design of PID controller is a highly non-linear problem that involves modelling the dynamic behaviour of the biped robot. Therefore, the authors of the manuscript is decided to use evolutionary algorithms to tackle the problem of tuning the gains of the PID controller.

4 Proposed algorithms

To solve the aforementioned optimization problem related to the tuning of the torque based PID controller, two non-traditional optimization algorithms, namely modified chaotic invasive weed optimization and differential evolution algorithms are used. The explanation related to the proposed algorithms are given in the subsequent sub-sections.

4.1 Modified chaotic invasive weed optimization algorithm

The Invasive weed optimization (IWO) algorithm is a numerical stochastic optimization algorithm inspired from the colonizing behavior of weeds introduced by Mehrabain and Lucas [40] in 2006. The algorithm (figure 3) works based on the following principle. The weeds invade the unused resources in the cropping system (that is, field) by means of dispersal and occupy the opportunity spaces between the crops. The invaded weeds (that is, parents) grow to flowering weeds after using the unused resources in the crop and produce new seeds. These seeds are dispersed randomly in a field and grow to a new flowering weed (that is, children). The step-by-step procedure used in the implementation of MCIWO is given below.

  • Choose the number of parameters of the problem and assign the minimum and maximum values of each parameter. A finite number of seeds are dispersed randomly in an N-dimensional solution space and each seed occupies a random position called initial solution.

  • Based on the usage of unused resources in the field, each initial seed grows to a flowering plant and produce new seeds on the fitness value of each plant. The number of seeds (S) produced by each plant in reproduction process is calculated by using the equation (23). The goodness of this algorithm is that it allows all generated weeds to contribute towards reproduction process. This is advantageous under certain situations, that the weed with worst fitness value also gives some useful information to participate through the evolutionary process.

Figure 3
figure 3

Flow chart showing the operation of MCIWO algorithm.

$$ S = Floor\left[ {S_{\hbox{min} } + \frac{{f - f_{\hbox{min} } }}{{f_{\hbox{max} } - f_{\hbox{min} } }} \times S_{\hbox{max} } } \right] $$
(23)

where Smin and Smax are the minimum and maximum production by each plant, respectively and \( f_{max} \) and \( f_{min} \) indicate the maximum and minimum fitness value in the colony, respectively.

  • The newly produced seeds are scattered randomly after following normal distribution over the entire search space. The mean of normal distribution is equal to the position of the parent plants and the standard deviation (SD) is determined by following the below expression.

$$ \sigma_{Gen} = \frac{{\left( {Gen_{\hbox{max} } - Gen} \right)}}{{\left( {Gen_{\hbox{max} } } \right)^{n} }}^{n} \times \left( {\sigma_{initial} - \sigma {}_{final}} \right) + \sigma_{final} $$
(24)

where \( {\text{Gen}}_{ \hbox{max} } \) is the maximum number of generations, n represents the modulation index i.e., real number and \( {\upsigma }_{\text{Initial}} \) and \( {\upsigma }_{\text{Final}} \) denote the initial and final value of the standard distribution, respectively (figure 3).

Normal IWO algorithm confirms that all possible candidate solutions would contribute in the reproduction process. But, in most of the meta-heuristic algorithms, less fit individuals are not allowed to form the new off spring. Moreover, IWO algorithm is straight forward and it takes less computational time compared to other methods. On the other hand, some problems require more number of seeds to explore outsized search space. This leads to a drastic increase in the computational time. In order to overcome the limitations of IWO algorithm, in the present research work the authors incorporated two new terms, namely cosine and chaotic variables [41,42,43,44] to improve the performance of the IWO algorithm. The main idea of adding cosine variable is to increase the search space for exploring the better solutions. Moreover, the introduction of chaotic variable helps in reducing the chances of the solution to trap in the local optimum. Due to the greater scanning and search capabilities of the modified algorithm, the maximum number of seeds that participate in the search process are more, and the computational cost of the overall algorithm is less. The chaotic variable that is used in this algorithm is derived from the Chebyshev map, and the expression is given in the following equation.

$$ X_{k + 1} = \cos \left( {k\cos^{ - 1} \left( {X_{k} } \right)} \right) $$
(25)

The main goal of the present modification is not only to get the global optimum solution, but also to obtain the best possible outcome after utilizing minimum resources. After introducing the cosine term, the equation (24) will be modified to the following form.

$$ \sigma_{Gen} = \frac{{\left( {Gen_{\hbox{max} } - Gen} \right)}}{{\left( {Gen_{\hbox{max} } } \right)^{n} }}^{n} \times \left| {\cos \left( {Gen} \right)} \right| \times \left( {\sigma_{initial} - \sigma {}_{final}} \right) + \sigma_{final} $$
(26)

After the new seeds occupy their position in the search area, they grow and become flowering plants and they are also assigned with a rank along with their parent plants. Then these plants are arranged from the lower rank to higher rank based on the fitness value of each plant. The lower ranked plants are eliminated, once the colony reaches its maximum number of plants i.e., Pmax. This procedure continues until the maximum number of iterations are reached.

4.2 Differential evaluation algorithm

DE is a vector based stochastic optimization algorithm developed by Storn and Price in 1995 [45]. The flow chart shown in figure 4 explains the operation of DE algorithm. In DE, the populations (NP) are vectors in a D-dimensional search space. Some crucial control parameters namely scaling factor (F) and crossover rate (CR) are used to improve the convergence performance of DE. The initial population in the search space is generated with the help of the following equation.

$$ x_{j,i,0} = x_{j,\hbox{min} } + rand_{i,j} \left[ {0,1} \right]*\left( {x_{j,\hbox{max} } - x_{j,\hbox{min} } } \right) $$
(27)
Figure 4
figure 4

Flow chart showing the operation of DE algorithm.

Once the population is initialized, DE employs the mutation operator to bring changes in the vectors that represent parameter space. It is to be noted that the parent vector in the current generation (\( {\text{X}}_{i, G} \)) and vector obtained after mutation operation (\( {\text{V}}_{i, G} \)) are called target vector and mutant vector, respectively. In each generation, the target vector is associated with the mutant vector \( {\text{V}}_{i, G} = \left\{ {v_{1, i, G} , v_{2, i,G} , v_{3, i, G} , v_{4, i,G} \ldots v_{D, i, G} } \right\} \) and can be generated after using a certain mutation strategy. In the present paper, DE/rand/1 strategy has been used to implement the mutation strategy.

$$ {``\text{DE}}/{\text{rand}}/1\hbox{''}:\quad V_{i,G} = X_{{r_{1}^{i} ,G}} + F*\left( {X_{{r_{2}^{i} ,G}} - X_{{r_{3}^{i} ,G}} } \right) $$
(28)

The parameters \( r_{1}^{i} , r_{2}^{i} and r_{3}^{i} \)indicates three integers generated randomly once for each mutant vector in the range of [1, NP] and the term \( F \) represent the scaling factor. Once the mutation is over, crossover operation is implemented on the mutant vector to generate the trail vector: \( {\text{U}}_{i, G} = \left[ {u_{i,G}^{1} , u_{i,G}^{2} , u_{i,G}^{3} \ldots u_{i,G}^{D} } \right] \). In the present problem, binomial crossover is used to perform the operation and is given below:

$$ u_{i,G}^{j} = \left\{ {\begin{array}{*{20}c} {v_{i,G}^{j} , } \\ {x_{i,G}^{j} ,} \\ \end{array} } \right. \begin{array}{*{20}c} {if rand \left( {0,1} \right) \le CR or (j = j_{rand} )} \\ {rand \left( {0,1} \right) > CR} \\ \end{array} \quad j \, = \, 1, \, 2, \, 3 \ldots ,D $$
(29)

where CR represents the crossover rate and is a constant within the range of [0, 1], which controls the parameter values chosen from the mutant vector. The term \( j_{rand} \) is integer randomly chosen in the range [1, D]. The binomial crossover operator selects the jth parameter of the mutant vector \( ({\text{V}}_{i, G} ) \) to the corresponding element in the trail vector \( {\text{U}}_{i, G} \) \( if\,rand \left( {0,1} \right) \le CR\,or\,(j = j_{rand} ) \). Otherwise, it is copied from the corresponding target vector \( {\text{X}}_{i, G} \).

If the parameters generated from the new trail vector is not within the corresponding lower and upper limits of the parameters, re-initialization has to be done with in the specified range of the parameters and their objective function is to be evaluated. The functional value of each trail vector \( f\left( {{\text{U}}_{i, G} } \right) \) and the corresponding functional value of the target vector \( f\left( {{\text{X}}_{i, G} } \right) \) of the current population are compared. If the functional value of the trail vector is less than or equal to the objective function value of the corresponding target vector, the trail vector will replace the target vector and enter in to the next generation. Otherwise the same target vector will be copied to the next generation.

$$ {\text{X}}_{i, G + 1} = \left\{ \begin{array}{ll} {\text{U}}_{i, G} & \quad if\,f\left( {{\text{U}}_{i, G} } \right) \le f\,\left( {{\text{X}}_{i, G} } \right) \\ {{\text{X}}_{i, G} } & \quad {otherwise} \\ \end{array} \right. $$
(30)

5 Results and discussions

In the present study, two non-traditional optimization algorithms, namely MCIWO and DE are used to tune the gains of the torque based PID controller. Table 3 shows the parameters of the biped robot used in the study to carry out the simulations.

Table 3 Parameters related to the biped robot.

5.1 MCIWO based PID controller

As the performance of the MCIWO algorithm depends on its parameters, namely initial standard deviation, exponent value, maximum population size, maximum number of seeds and number of generations, a detailed parametric study has been conducted to determine the optimal parameters. It is to be noted that the final standard deviation, minimum number of seeds and initial population size are kept equal to 0.00001, 0 and 10, respectively. The results related to the parametric study are shown in figure 5.

Figure 5
figure 5

Results of parametric study to determine the parameters of MCIWO: (a) Initial standard deviation vs best fitness, (b) exponent vs best fitness, (c) maximum number of population vs best fitness, (d) maximum number of seeds vs best fitness and (e) generations vs best fitness.

The optimal values obtained for the initial standard deviation, exponent value, maximum population size, maximum number of seeds and number of generations are found to be equal to 4%, 2, 10, 3 and 100, respectively. These optimal parameters of the MCIWO are responsible for deriving the optimal gains of the PID controller i.e., Kp, Kd and Ki are given in table 4.

Table 4 Optimal tuning parameters

5.2 DE based PID controller

Here also, a parametric study has been conducted to determine the optimal parameters, namely cross over rate, population size and generations of the DE algorithm. It is to be noted that the minimum and maximum scaling factor are kept equal to 0.2 and 0.8, respectively. The results of the DE-parametric study are shown in figure 6. The optimal values of DE parameters are found to be as follows:

Figure 6
figure 6

Results of parametric study to determine the parameters of DE: Crossover vs best fitness, (b) pop size vs best fitness, (c) generations vs best fitness.

  1. (i)

    Cross over rate = 0.7

  2. (ii)

    Population size = 30

  3. (iii)

    Maximum no. of generations = 100

The above optimal values of the DE algorithm are useful to tune the gains of the PID controller. The optimal gains obtained by using DE are given in table 4.

Further, figure 7 shows the final converge graph for IWO, DE and MCIWO algorithms. It can be observed that MCIWO has shown a better performance in convergence when compared with the IWO algorithm. Therefore, only MCIWO along with DE are used in the further study to compare the performances of the torque based PID controllers used by the biped robot.

Figure 7
figure 7

Results showing the convergence of the fitness comparison with different optimization algorithms.

5.3 Comparative study

Once the optimal PID controllers are evolved, a comparative study has been conducted between MCIWO and DE-tuned controllers in terms of variation of joint error, torque required, variation of ZMP and DBM of the biped robot. Table 4 shows the comparison of optimal gains (that is, Kp, Kd and Ki) obtained using the manual, MCIWO and DE based tuning of the PID controller.

Further, the performances of the optimal MCIWO and DE-based PID controllers are tested in computer simulations. The graphs 8 (a), (b), (c) and (d) show the variation of error in angular position for the swing leg joints. Initially, the magnitude of the error is very high and it slowly reached to the study state. Moreover, it has also been observed that both the MCIWO and DE-based PID controllers are found to reach the steady state error by exhibiting a similar trend. Further, it has also been observed that the MCIWO tuned PID controller converges quickly when compared with DE tuned PID controller. It may be due to the enhanced search space created in MCIWO algorithm due to the introduction of cosine and chaotic terms, when compared with the DE algorithm. Similarly, figures 9 (a), (b), (c) and (d) show the error in angular position of the stand leg of the biped robot, and both the controllers have shown the similar trend as explained for the joints of the swing leg.

Figure 8
figure 8

Results showing the variation of joint error of the swing leg: (a) Joint 2, (b) Joint 3, (c) Joint 4 and (d) Joint 5.

Figure 9
figure 9

Results showing the variation of joint error of the swing leg: (a) Joint 8, (b) Joint 9, (c) Joint 10 and (d) Joint 11.

In addition to the above result, a comparative study has also been conducted for the aforementioned torque based PID controllers in terms of average torque required by the biped robot to perform the walk on the flat surface (ref. figure 10). It can be observed that the MCIWO tuned PID controller required less torque to execute the walk on the flat surface by the biped robot when compared with the DE tuned PID controller.

Figure 10
figure 10

Comparison of average torque required to complete one cycle: (a) MCIWO, (b) DE tuned based PID controllers.

Further, a study has also been conducted to see the variation of actual ZMP (that is, after controller action) in X and Y-directions with that of the theoretical ZMP (that is, obtained by gait generation algorithm) in X and Y-directions. It can be observed that the ZMP trajectories (refer to enlarged view of figure 11) obtained by MCIWO-based PID controller is seen to be more close to the center of the foot when compared with the trajectory obtained by IWO and DE based PID controllers. It may be due to the reason that in the case of controllers, they might have introduced a correction for the angular position of the link at the end of each interval that pushes the position of ZMP towards the end of the foot support polygon. Finally, the gait obtained is found to be balanced in nature as the ZMP is lying inside the foot support polygon.

Figure 11
figure 11

Schematic diagram showing the variation of ZMP in X and Y-directions.

Along with ZMP trajectory, a comparative study has also been conducted on DBM of the biped robot in both X- and Y-directions (ref. to figure 12). It can be observed that MCIWO based PID controller has produced more dynamically balanced gaits when compared with the theoretical, IWO and DE based PID controllers.

Figure 12
figure 12

Schematic diagram showing the variation of DBM: (a) X-DBM and (b) Y-DBM.

5.4 Robustness test

A robustness test has been conducted to study the performance of the controller after providing some variation in the controller parameter. Table 5 shows the results related to the robustness test conducted by using the aforementioned algorithms. It has been observed that a maximum of -0.01% and 0.0097% variation in the values of DBM is obtained for MCIWO and DE-based PID controllers, respectively for a ±4% variation in the values of the gains of the controller. From this test, it can be observed that both the controllers are robust enough to accommodate small change in the gains of the controller for generating the dynamically balanced gaits of the biped robot.

Table 5 Results of robustness test for the developed optimal control algorithms

5.5 Experiments with real robot

From the simulations, it has been observed that the MCIWO tuned PID controller is found to perform better than DE tuned PID controller. Then the gait angles obtained using MCIWO tuned torque based PID controller is fed to the real robot. Figures 13 and 14 show the results of swing moment of left and right legs, respectively of the biped robot while moving on the flat surface. From the images it can be observed that the biped robot has successfully walked on the flat surface.

Figure 13
figure 13

Results showing the swing moment of the left leg.

Figure 14
figure 14

Results showing the swing moment of the right leg.

6 Conclusions

An attempt has been made to develop the torque based PID controller for the biped robot while moving on the flat surface. Two non-traditional optimization algorithms, namely MCIWO and DE algorithms are used to tune the gains of the controller. The simulation results show that both the developed controllers are able to generate the dynamically balance gaits for the biped robot on the flat terrain. It has been observed that the MCIWO-based PID controller converged quickly and average torque required is less when compared with the DE-based controller. It is interesting to note that the MCIWO-based algorithm has developed more dynamically balanced gaits than the DE and manual tuning methods. It may be due to the reason that in MCIWO algorithm, the search space is more enhanced in the error domain and the chances of trapping the solution in the local minima is less, when compared with DE algorithm. Further, the algorithms are tested in computer simulations and found to perform in a satisfactory manner. Moreover, the gait angles obtained using the MCIWO tuned PID controller are fed to the real robot and found that the robot has successfully negotiated the terrain.

7 Scope for future work

In this manuscript, the performances of the developed controllers are tested only on flat surface. However, it will be more interesting to test the aforementioned controllers on stair case and slope (ascending and descending) surfaces. Further, an adaptive algorithm i.e., MCIWO-NN, PSO-NN algorithms and recently developed chemical reaction and firework optimization algorithms may also be used in future to solve the said problems. At present the authors are working on these issues.