1 Introduction

Day-by-day, the usage of biped robots are increasing enormously in real time applications due to their superior mobility than their wheeled counter-parts. Keeping this fact in mind many researchers are concentrating on the development of balanced walk of the biped robot in the past few decades. To develop dynamically balanced gaits for the robot, suitable trajectories are to be assigned for the swing foot and hip joint of the biped robot. Once the trajectories are assigned, care should be taken while generating the gait that can produce the zero moment point (ZMP) with in the foot support polygon. The ZMP is helpful to know the dynamic balance margin of the biped robot. To solve these problems, several researchers had worked on the dynamically balanced gait generation of the biped robot in the last decade. Juricic and Vukobratovic [1] developed a semi-inverse method to generate the trunk motion of the biped robot on a flat surface for the prescribed zero moment point (ZMP) trajectory. Moreover, Sano and Furusho [2] obtained a stable walking pattern for the biped robot by using the concept of angular momentum. They developed a walking control method that divides the generated gait into sagittal and frontal plane gaits, and controlled by the concept of angular momentum and motion control, respectively. It was observed that the authors had only corrected the ankle torque with the help of proportional controller. Further, Pandu et al. [3] developed a gait generation algorithm for a 7-DOF biped robot, while ascending and descending the staircase after using the concept of zero moment point. In that work, the authors had not used any controller to control the generated gait. In [4], Hernandez-Santos et al. proposed a new procedure to generate the gaits of 16-DOF biped robot by using proportional-derivative (PD) control algorithm with gravity compensation for attaining desired trajectories for each joints. Konstantin and Gunter [5], achieved a stable walk for the biped robot without using any pre-computed trajectories. They merged trajectory generation and ZMP control algorithms to achieve the online stable walking of the biped robot.

It is important to note that the efficiency of the controller mainly depends on the gains of the controller. Once the controller is developed, it is laborious and time-consuming task to tune parameters of the controller. For tuning the gains of the PID controller researchers had used various tuning algorithms such as, nonlinear model reference PID (NMRPID) controller for a seven degrees of freedom biped robot [6], 3-link [7] and 4-link [8] robotic manipulators, respectively. They used manual tuning procedure to tune the gains of the PID controllers. Finally, they tested these controllers in computer simulations. It is also important to note that the manual tuning of the gains (that is, Kp, Kd and Ki) of the PID controller is a trial and error method and the solutions obtained are non-optimal in nature. Therefore, in the last few decades, researchers started using non-traditional optimization algorithms to tune the gains of the PID controller for obtaining better performance. Further, researchers had used multi-objective genetic algorithm [9] for a 2-DOF robotic manipulator and fuzzy PID controller [10] for a five degrees of freedom robotic arm. In [11], Hassan developed a Self-Organising Proportional Integral and Derivative (SOF-PID) controller to obtain the gains of the PID controller for a robotic arm having revolute joints. The SOF-PID controller had produced a faster raise time, small steady state error and in significant overshoot for the step input trajectory, when compared with the ordinary PID controller.

In addition to the above methods, Patrizio [12] developed an adaptive proportional derivative (PD) controller for point-to-point path tracking of a robotic manipulator. Later on, a fuzzy logic-based PID controller was developed by Visioli [13] and in that work they compared the performance of the standard PID controller with many controllers, namely incremental fuzzy expert PID controller (IFE), Fuzzy self-tuning of a single parameter (SSP), Fuzzy gain scheduling (FGS), Fuzzy set-point weighting (FSW) and Fuzzy PID controllers. In [14,15,16,17,18,19,20,21,22,23,24,25,26] the authors had used various non-traditional algorithms, such as GA, SA, PSO, BFO, ACO, hybrid stochastic fractal search and local unimodal sampling and adaptive fuzzy algorithms to optimize the gains of the PID controller. They compared the results of the non-traditional algorithms with the conventional PID controller tuned by Ziegler–Nichols (Z–N) method, and it was observed that the evolutionary algorithms tuned PID controllers are found to perform better than the Z–N tuning method in terms of overshoot and steady state error. Later on, Ibtissem et al. [27] proposed a multi-objective ACO-based tuning method to tune the gains of the PID controller. It was observed that the ACO algorithm was seen to provide better performance in terms of step response when compared with GA based tuning of the controller. Further, Navid and Mohsen [28] proposed a new optimization algorithm i.e. Invasive weed optimization (IWO) algorithm to tune the parameters of PID controller of the hydro-turbine generator. In [29, 30], the authors used IWO algorithm to tune the parameters of the antenna for getting highest directivity and compared with PSO algorithm. They observed that the PSO algorithm was struck in the local minima because of its boundary conditions and the maximum velocity of the particle. Moreover, Abedinia et al. [31] utilized a modified invasive weed optimization (MIWO) algorithm to tune the parameters of fuzzy PID controller in multi-machine power system. It was observed that MIWO fuzzy controller worked effectively, when compared with other methods.

From the literature, it has been observed that some researchers had used ZMP based control algorithms [4,5,6] for the control of biped robots. It is important to note that the ZMP based PID controller is an indirect method of controlling the motor, as the error signal between the obtained and reference ZMP trajectory is used to design the gaits for various links of the biped robot. In this process, the controller may suggest some dynamically balanced postures which may not be kinematically feasible. Moreover, finding the most appropriate gait for the biped robot that fulfils the sequence oriented criterion and repeatability conditions is difficult to achieve. Very few had attempted to design a torque-based controller for the biped robot by controlling either ankle or torso joint. The torque-based PID controller consider 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. Further, researchers had also used recent non-traditional optimization algorithms to optimize the gains of the PID controller for various industrial applications. However, none of the authors had tried to implement the chaotic nature in IWO algorithm that helps in distributing the seeds in a wider spread and to enhance the search space. To improve the performance of the algorithm in the present research, the authors have added two new variables, namely cosine and chaotic variables. The cosine variable is used to increase the search space and the chaotic variable is used to push the solution directly into global optimum position. The convergence criterion of the newly developed algorithm has been tested with the help of known benchmark problems. Finally, the performance of the developed algorithm has been compared with another nature inspired algorithm such as PSO. Once the optimal PID controllers are obtained, the performances of the algorithms are compared in terms of ZMP and DBM of the biped robot. Further, the gait obtained using the optimal PID controllers is tested on a real biped robot and found that the robot has successfully executed its gaits on the flat terrain.

2 Dynamics of the biped robot

The present research work is focused on the design of a suitable PID controller that can generate dynamically balanced gaits for the 18-DOF biped robot (ref. to Fig. 1) on a flat surface. Once the gait is generated, the dynamic balance margin of the biped robot is verified by using the concept of zero moment point (ZMP) [32]. Further, the parameters such as linear and angular velocity of the joints are very important for locomotion of the biped robot. It is important to note that Jacobian is used to determine the linear \(\left( {{J_{vi}}~} \right)\) and angular \(\left( {{J_{\omega i}}~} \right)\) velocity of the joints of the biped robot.

Fig. 1
figure 1

Schematic diagram showing the 18-DOF biped robot a stick diagram b real 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]$$
(1)

The dynamics of the biped robot is determined with the help of Lagrange–Euler formulation, which is given below.

$${\tau _{i,the}}=\sum\limits_{{j=1}}^{n} {{M_{ij}}} \left( q \right)\mathop {{q_j}}\limits^{{ \bullet \bullet }} +\sum\limits_{{j=1}}^{n} {\sum\limits_{{k=1}}^{n} {{C_{ijk}}} } \mathop {{q_j}}\limits^{ \bullet } \mathop {{q_k}}\limits^{ \bullet } +{G_i}\quad i,j,k=1,2 \ldots n$$
(2)

where \({\tau _{i,the}}\) indicates the theoretical torque required at joint \(i\) (N-m), \(q,\mathop {{q_j}}\limits^{.}\) and \(\mathop {{q_j}}\limits^{{..}}\) represent the displacement, velocity (rad/s) and acceleration (rad/sec2) of the joint, respectively. Further, the expanded form of inertia term (\({M}_{ij}\)), Coriolis/centrifugal forces (\({C}_{ijk}\)) and gravity terms (\({G}_{i}\)) are given below.

$${M_{i,j}}=\sum\limits_{{p=\text{max} (i,j)}}^{n} {Tr\left[ {{d_{pj}}{I_p}d_{{pi}}^{T}} \right]} \quad i,j=1,2 \ldots n$$
(3)
$${C_{i,j,k}}=\sum\limits_{{p=\text{max} (i,j,k)}}^{n} {Tr\left[ {\frac{{\partial \left( {{d_{pk}}} \right)}}{{\partial {q_p}}}{I_p}d_{{pi}}^{T}} \right]} \quad i,j=1,2 \ldots n$$
(4)
$${G_i}= - \sum\limits_{{p=i}}^{n} {{m_p}g{d_{pi}}{}_{e}^{p}\overline {{{r_p}}} } \quad i,j=1,2...............n$$
(5)

where \({I}_{p}\) and \({}_{e}{}^{p}{\stackrel{-}{r}}_{p}\) represents mass moment of inertia (kg-m/s2) tensor and mass center (m) of pth link, respectively and \(g\) denotes acceleration due to gravity in (m/s2). 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 Eq. (6), and is given below.

$$\begin{aligned} \mathop {q_{j} }\limits^{{ \bullet \bullet }} & = \sum\nolimits_{{j = 1}}^{n} {M_{{ij}} } \left( q \right)^{{ - 1}} \left[ { - \sum\nolimits_{{j = 1}}^{n} {\sum\nolimits_{{k = 1}}^{n} {C_{{ijk}} } } \mathop {q_{j} }\limits^{ \bullet } \mathop {q_{k} }\limits^{ \bullet } - G_{i} } \right] \\ & \quad + \left( {\sum\nolimits_{{j = 1}}^{n} {M_{{ij}} } \left( q \right)^{{ - 1}} \times \tau _{{i,the}} } \right)\quad i,j,k = 1,2 \ldots n \\ \end{aligned}$$
(6)

Now by considering the term

$$\sum\limits_{{j=1}}^{n} {{M_{ij}}} {\left( q \right)^{ - 1}} \times {\tau _{i,the}}=\hat {\tau }$$
(7)

2.1 Design of PID controller for the biped robot\(e\)

The Proportional-Integral Derivative (PID) controllers are widely used to control the motors of the biped robot in various applications. The expression for the joint based PID controllerthat is used in this study is mentioned below.

$${\tau _{act}}={K_p}e+{K_d}\mathop e\limits^{ \bullet } +{K_i}\int edt$$
(8)

where \({K_p}\), \({K_d}\) and \({K_i}\) represents proportional, derivative and integral gains of the controllers, respectively. The expanded form of the above equation after including the meaning of and \(\mathop e\limits^{.}\) obtained from Eq. (9) is given below.

$$e\left( {{\theta _i}} \right)={\theta _{if}} - {\theta _{is}}$$
$${\tau _{i,act}}={K_{pi}}\left( {{\theta _{if}} - {\theta _{is}}} \right) - {K_{di}}\mathop {{\theta _{is}}}\limits^{ \bullet } +{K_{ii}}\int e\left( {{\theta _{is}}} \right)dt\quad i=1,2,\ldots n$$
(9)

where \({\tau _{i,act}}\) represent the actual torque supplied by the controller to individual joints to move from an initial angular position \(\left( {{\theta _{is}}} \right)\) to final angular position \(\left( {{\theta _{if}}} \right)\). Further, the integral terms in the above equation need to be substituted by its state variables, namely\({\dot{x}}_{i}\) and its meaning is given below.

$${x_i}=\int e\left( {{\theta _{is}}} \right)dt \Rightarrow \mathop {{x_i}}\limits^{ \bullet } ={\theta _{if}} - {\theta _{is}}\quad i=1,2, \ldots n$$
(10)

The final control equation that represents the control action for all joints is given below.

$$\begin{aligned} \mathop {q_{j} }\limits^{{ \bullet \bullet }} & = \sum\limits_{{j = 1}}^{n} {M_{{ij}} } \left( q \right)^{{ - 1}} \left[ { - \sum\limits_{{j = 1}}^{n} {\sum\limits_{{k = 1}}^{n} {C_{{ijk}} } } \mathop {q_{j} }\limits^{ \bullet } \mathop {q_{k} }\limits^{ \bullet } - G_{i} } \right] \\ & \quad + K_{{pi}} \left( {\theta _{{if}} - \theta _{{is}} } \right) - K_{{di}} \mathop {\theta _{{is}} }\limits^{ \bullet } + K_{{ii}} x_{i} \\ \end{aligned}$$
(11)

2.2 Formulation as an optimization problem

The design of controller for the biped robot to achieve a dynamically balanced gait on the flat surface can be considered as an optimization problem as explained below. The controllers has to supply the torque that is required by the joint to move from an initial position to final position. Further, the torque supplied by the controller will be able to reduce the positioning error with certain limits on the range of the gain values of the controller. Moreover, the positional error related to the both swing leg and stance leg is also to be considered. Then it may be posed as an optimization problem as given below:

For Swing Leg


Minimize Z1: \({e_1}=\sum\nolimits_{{i=1}}^{6} {e\left( {{\theta _i}} \right)} .\)


Subjected to constraints: \(\begin{gathered} {K_{pi,\text{min} }} \leq {K_{pi}} \leq {K_{pi,\text{max} }} \hfill \\ {K_{di,\text{min} }} \leq {K_{di}} \leq {K_{di,\text{max} }} \hfill \\ {K_{ii,\text{min} }} \leq {K_{ii}} \leq {K_{ii,\text{max} }}\quad i=1,2, \ldots 6. \hfill \\ \end{gathered}\)


For Stand Leg


Minimize Z2: \({e_2}=\sum\nolimits_{{j=7}}^{{12}} {e\left( {{\theta _j}} \right)} .\)


Subjected to constraints: \(\begin{gathered} {K_{pj,\text{min} }} \leq {K_{pj}} \leq {K_{pj,\text{max} }} \hfill \\ {K_{dj,\text{min} }} \leq {K_{dj}} \leq {K_{dj,\text{max} }} \hfill \\ {K_{ij,\text{min} }} \leq {K_{ij}} \leq {K_{ij,\text{max} }}\quad j=7,8, \ldots 12. \hfill \\ \end{gathered}\)where \({e_1}\) and \({e_2}\) are the total error in the angular position of all the joints of the swing and stand leg, respectively. The \(e\left( {{\theta _i}} \right)\) and \(e\left( {{\theta _j}} \right)\) are the error at the individual joints of the both legs and rest of the terms carries their usual meaning.

3 Proposed optimization algorithm

In the present research, a non-traditional optimization algorithm, namely MCIWO is used to tune the gains of the PID controller and compared with another established nature inspired optimization algorithm such as, PSO. The explanation related to the developed approach is given below.

3.1 Modified chaotic invasive weed optimization algorithm

Invasive weed optimization (IWO) is a stochastic optimization algorithm developed by Mehrabain and Lucas in 2006 [33] and the algorithm is inspired from the colonizing behaviour of the weeds. In a crop field the weeds are randomly dispersed and live in between them. After randomly placing these weeds, they take the unused resources in the cropping field and grows to a flowering weed plant and produce new seeds.

The number of seeds produced by each flowering weed depends on the fitness of each flowering weed plant. These seeds will develop new weeds in the field, and they have better adaption in the environment and take more resources that are unused in the field. They grow very fast and produce more number of seeds from each weed plant. This process will continue until the maximum number of weeds grow in a field by using the limited resources. The flow chart given in Fig. 2 explains the operation of MCIWO algorithm. Initially, the seeds that represent the N- dimensional solution space of the problem will be generated at random.

Fig. 2
figure 2

Flow chart showing the operation of MCIWO algorithm

In the present study, the gains of the PID controller are considered as the solution space of the problem. Once the initial seeds grow into flowering plants after using the unused resources, the fitness of each plant will be evaluated. In the present problem, the fitness in terms of average angular positional error of the PID controllers are considered as the fitness of the plant. Once the fitness is determined, the process of reproduction starts to determine the number of seeds produced by the plant. The equation that represents the reproduction scheme is given in Eq. (12).

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

where (\({f_{\text{min} }}\), \({f_{\text{max} }}\)) and (\({S_{\text{min} }}\), \({S_{\text{max} }}\)) denotes the minimum and maximum fitness of the colony and minimum and maximum seeds produced by the plant, respectively. Then the newly produced seeds are randomly distributed using normal distribution with mean zero and variance \(\left( {{\sigma ^2}} \right)\) in the search space.

To improve the performance of the algorithm, in the present research two terms namely chaotic variable and cosine variable [34,35,36] are added during reproduction. Here, the function of chaotic variable is to minimize the chances of the solution to trap in the local optimum point by increasing the spread of the new seed dispersion area. It is derived by using chebyshev map and is represented by the expression given below.

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

Moreover, the value of standard deviation (\({\sigma _{Gen}}\)) that is used to define the position of the seed is given as follows.

$${\sigma _{Gen}}={\frac{{\left( {Ge{n_{\text{max} }} - Gen} \right)}}{{{{\left( {Ge{n_{\text{max} }}} \right)}^n}}}^n} \times \left| {\cos \left( {Gen} \right)} \right| \times \left( {{\sigma _{initial}} - \sigma {}_{{final}}} \right)+{\sigma _{final}}$$
(14)

where \(Ge{n_{\text{max} }}\) is the maximum number of generations, n is the modulation index i.e. integer number, \({\sigma _{initial}}\) and \(\sigma {}_{{final}}\) is the initial and final value of the standard deviation. The term \(\left| {\cos \left( {Gen} \right)} \right|\) not only helps in determining the global optimal solution, but also enhances the search space by utilizing the minimum resources. It can be observed that after modification, the algorithm explores more search space compared to standard IWO algorithm. Once the new seeds are obtained from the reproduction scheme, their fitness is also being evaluated and ranked along with the parent plants. It is important to note that the maximum number of plants should not exceed Pmax. Then competitive exclusion is performed to remove the lower ranked plants. This process will continue until the maximum number of iterations are reached.

4 Results and discussions

In the present paper, an attempt is made to tune the gains of the PID controller with the help of a manual tuning method and two non-traditional optimization methods, namely PSO and MCIWO algorithms. The role movement of the leg (i.e joint 1 and 7) and the pitch movement of the swing foot (i.e joint 6 and 12) are not considered in the present study. The parameters of 18-DOF biped robot considered in this study is given in Table 1.

Table 1 Parameters related to the humanoid robot

4.1 Performance tests

Once the MCIWO algorithm is developed, the performance tests are conducted with the help of a statistical software that is, SPSS on a PC operated on Windows 7 with a 2 GB RAM capacity. A set of ten benchmark functions (ref. to Table 2) available in the literature [37], and one real life problem (that is, solved in the present research paper) are considered to validate the newly proposed algorithm.

Table 2 Benchmark functions used in the present work

To check the reliability, robustness and effectiveness of the developed algorithm (that is, MCIWO), its performances are compared with the help of the recently developed nature inspired optimization algorithms such as IWO and PSO. Initially, the standard performance measures [38] such as the mean and standard deviation (SD) of all the said algorithms are determined and reported in Table 3. The average runs and maximum number of iterations used to obtain the values presented in the said table are kept equal to 30 and 2000, respectively. The results of SD suggest that MCIWO has performed better than IWO and PSO algorithms for 3, 6, 7, 8 and 9 test functions. But the PSO algorithm is seen to perform slightly better than other two algorithms for 1, 2, 4, 5 and 10 benchmark problems. It has also been observed that the mean for all the benchmark functions is found to be superior for MCIWO when compared with the other two standard algorithms.

Table 3 Experimental results of MCIWO, IWO and PSO

4.2 Normality test

A normality test has been applied over a sample that can indicate the presence or absence of condition of normality in the observed data. In the present research paper, two types of normality tests such as, Kolmogorov–Smirnov (K–S) and Shapiro–Wilk (S–W) are used to test the normality. In this study, the value of level of significance is kept fixed at 0.05. So, if the value of p is seen to be greater than the significance value, then only bit is said that the condition of normality is fulfilled. Table 4 shows the results related to the normality tests using K–S and S–W methods.

Table 4 Test of normality of Kolmogorov–Smirnov (K–S) and Shapiro–Wilk (S–W)

Here, the symbol “+” indicates that the function is not satisfied with the normality condition. It has been observed that the functions 1, 6, 8, 9 and 10 in MCIWO, 1, 6, 8 and 10 in IWO, and 5, 7 and 8 in PSO algorithms are found to satisfy the normality condition for both the testing methods (that is, K–S and S–W). It is interesting to note that the function 8 has satisfied the normality condition for both the testing methods for all the three algorithms. Moreover, the function 3 has not satisfied the normality condition in any algorithms. Further, the graphical representations of histograms and normal Q–Q plots for the normal and non-normal distributions of few test functions are shown in Figs. 3 and 4, respectively.

Fig. 3
figure 3

Results showing the normal distribution for function 2 using MCIWO algorithm. a Histogram, b normal Q–Q plot

Fig. 4
figure 4

Results showing the non-normal distribution for function 2 using IWO algorithm. a Histogram, b normal Q–Q plot

4.3 Parametric and non-parametric tests

In the present research work, an attempt has also been made to conduct both the parametric (that is, paired t-test) and non-parametric (that is, Wilcoxon signed ranks test) tests to verify the pairwise statistical significance between the MCIWO and the other two nature inspired optimization algorithms such as, standard IWO and PSO. While conducting the tests, the significance value is chosen 0.05 for both the paired t-test and Wilcoxon signed ranks test. The results related to both the tests are reported in Table 5. In this study, the null hypothesis H0: there is no difference in terms of performance between the algorithms, whereas, an alternative null hypothesis H1: there is difference in terms of performance between the said algorithms are considered. For more details, the interested readers are requested to refer [39].

Table 5 p- Values for paired t-test and Wilcoxon test

It can be observed that for the functions 1, 2, 3, 4, 6, 7, 8, 9 and 10, the value of p is found to be less than the significance values and its satisfies the Wilcoxon signed rank test. Moreover, for function 5, the p value is seen to be greater than the significance value and it has not satisfied the Wilcoxon test. When conducting the paired T-test for MCIWO with standard IWO, the value of p is observed to be lower than the significance value for the functions 1, 4, 6, 8, 9 and 10.While, the p values corresponding to the paired T-test between MCIWO and PSO for functions 7, 8, 9 and 10 are found to less than the significance value and they satisfy the condition. Interestingly, the value of p for function 10 is less than 0.05 in all the cases. Once the developed MCIWO algorithm is verified for its convergence criterion with the help of the benchmark functions, this algorithm has been applied to solve a real world problem related to the tuning of the gains of the torque-based PID controller for a biped robot moving on a flat terrain. Further, the effectiveness of this algorithm in terms of performance measures of the biped robot has been compared with the help of the PSO based PID controller.

4.4 PSO based PID controller

Initially, a parametric study has been conducted by varying one parameter of the algorithm at a time for determining the optimal parameters of the PSO algorithm. These optimal parameters of the PSO are responsible for the evaluation of optimal gains (that is, Kp,Kd and Ki) of the PID controller. To conduct this study, the parameters, such as weight value, constants C1 and C2 and number of generations are kept equal to 0.9, 2, 1.5 and 30, respectively. The result of parametric study is shown in Fig. 5. The optimal parameters, such as population size and number of generations of the PSO algorithm obtained after the study are seen to be equal to 50 and 80, respectively.

Fig. 5
figure 5

Parametric study for PSO based PID controller a population size vs fitness, b generations vs fitness

4.5 MCIWO based PID controller

Here a systematic study is also conducted to determine the optimal parameters of the MCIWO algorithm. For conducting parametric study (ref. to Fig. 6) the initial parameters of the algorithm i.e final value of standard deviation (σfinal), minimum (Smin) and maximum (Smax) no. of seedsand initial and maximum population size, nonlinear modulation index and generations are kept equal to \(0.00001,{\text{~}}0,{\text{~}}5,{\text{~}}10,{\text{~}}25,{\text{~}}2{\text{~and~}}30\) respectively. The final optimal parameters obtained after the parametric study are given below.

Fig. 6
figure 6

Parametric study for MCIWO based PID controller a initial standard deviation vs fitness, b modulation index vs fitness, c maximum number of population vs fitness d maximum number of seeds vs fitness and e generations vs fitness

Initial standard deviation (σinitial) = 4%, exponent value (n) = 2, maximum no. of population size (npopmax) = 10, maximum no. of seeds (Smax) = 3 and maximum no. of generations or iterations (MaxIt) = 90.

The final converge graph for IWO, PSO and MCIWO are shown in Fig. 7. It can be observed that MCIWO has shown better performance in convergence when compared with the IWO algorithm. Therefore, only MCIWO along with PSO are used in the further study to compare the performances of the controllers.

Fig. 7
figure 7

Graph showing the convergence of the fitness with different optimization algorithms

4.6 Comparative study

The values of the gains (that is, Kp,Kd and Ki) of the PID controller obtained using the three methods, namely manual, PSO-based and MCIWO-based PID controllers are given in Table 6.

Table 6 Optimal tuning parameters

Once the optimal PSO and MCIWO tuned PID controllers are evolved, the performances of these controllers are tested in simulation on a biped robot walking on flat surface. The total cycle is divided in to eight equal time intervals and the time required to reach each position is kept fixed at 5 milliseconds. The performance of these controllers are compared in terms of error in angular position and torque required at each joint of the biped robot. The plots showing the error in angular position for the joints of swing and stance leg of the biped robot are given in Figs. 8 and 9, respectively. From these graphs, it can be observed that there are spikes in the error of the angular position at the beginning of the interval, and it is brought down to study state after a certain amount of time. Moreover, both the PSO and MCIWO based PID controllers are found to converge the error to the steady state. It has also been observed that MCIWO-based controller is seen to converge quickly when compared with the PSO-based PID controller. It may be due to the enhanced search capability of the MCIWO algorithm when compared with the PSO-based algorithm.

Fig. 8
figure 8

Variation of error of the swing leg a joint 2, b joint 3, c joint 4 and d joint 5

Fig. 9
figure 9

Variation of error of the stand leg a joint 8, b joint 9, c joint 10 and d joint 11

Further, Fig. 10 shows the variation of torques at different joints of swing and stand legs of the biped robot, respectively. From these graphs, it can be observed that PSO based PID controller requires more torque when compared to MCIWO based PID controller. It may be due to the reason that in the PSO based PID controller, the error is more between different instances of tracking a particular joint. Due to the correction this error, it has consumed more torque when compared with MCIWO based PID controller. Moreover, it can also be observed that the torque required at the hip joint in both the swing leg (that is joints 2 and 3) and stand leg (that is joints 8 and 9) are seen to be more when compared with the other joints in both PSO and MCIWO-based PID controllers. This may be due to the reason that the hip joint is carrying the remaining links of the biped robot while moving from one point to the next.

Fig. 10
figure 10

Variation of torque at different joints a swing leg, b stand leg

In addition to the comparison of torque required at various joints of the biped robot, a study has also been conducted to study the variation of ZMP of the gait obtained (that is, actual) after the controller action. Figure 11 shows the variation of theoretical and actual position of ZMP for the developed controllers. It can be observed that the ZMP trajectories (refer to enlarged view of Fig. 11) obtained by MCIWO-based PID controller is seen to be more close to the centre of the foot when compared with the trajectory obtained by theoretical, IWO and PSO-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.

Fig. 11
figure 11

Variation of ZMP in X- and Y-directions

A comparative study has also been conducted in terms of average DBM in both X- and Y-directions for the developed PID controllers (ref. Fig. 12). From this figure, it can be observed that the MCIWO-based PID controller is found to generate more dynamically balanced gaits, when compared with the PSO-based controller. It may be due to the reason that the weeds that are reproduced without mating, and the fitter plants that produced more number of seeds might have led to the improvement in the convergence of the algorithm in the case of MCIWO algorithm. Further, Fig. 13 shows the real time execution of the gaits generated by the MCIWO-based PID controller on flat surface for swinging the left and right legs, respectively. It can be observed that the real-biped robot has successfully completed the task of while walking on flat surface.

Fig. 12
figure 12

Variation of theoretical and actual average DBM a X-DBM and b Y-DBM

Fig. 13
figure 13

Results showing the swing moment of the left and right leg

A robustness test has been conducted (ref. to Table 7) to study the performance of the optimal controllers. It is interesting to note that the inputs of the controller (that is, gains Kp1, Kd1, Ki1,… Kp12, Kd12, Ki12) are varied ± 4%. From the result, it can be observed that the maximum variation of DBM in X- and Y-direction is seen to be equal to 0.01 and 0.0097% in X- and y-directions.

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

4.7 Comparison with others’ work

Further, a qualitative comparision has been performed with other approaches provides in [3, 41,42,43,44,45,46]. They considered only a 7-DOF biped robot and used analytical approach to generate the gaits of the robot. In the present approach, the authors have considered not only the gait generation issues of the biped robot, but also designed a PID controller to execute the generated gait in a smooth manner. Moreover, in [4,5,6, 47,48,49,50,51], few researchers had developed a ZMP-based PID controllers, which is an indirect way of controlling the motors mounted on the joints of the robot, whereas in the present study, a torque based PID controller, which directly deal with the error in angular displacements of the motors.

5 Conclusions

In this paper, an attempt is made to design and develop an optimal torque based PID controller for the 18-DOF biped robot while walking on flat surface. The developed MCIWO algorithm is verified with the help of benchmark problems and found to fulfil the convergence criterion. Further, the MCIWO algorithm is used to optimize the gains of the torque-based PID controlled, and the performance of the algorithm is compared with PSO-based algorithm. The simulation results show that both the controllers are able to generate dynamically balanced gaits for the biped robot. It is observed that MCIWO is seen to converge quickly and required less torque when compared with the PSO-based controller. The better performance of MCIWO algorithm may be due to its enhanced search space in the error domain and less chance to reach local optimum solution, when compared with the PSO algorithm. Finally, the algorithms are tested in computer simulations as well as on real 18-DOF biped robot in our laboratory.