1 Introduction

The ZMP (Zero Moment Point) principle applied for humanoid robot to stably walking requires that ZMP point must locate inside the foot-base of the support leg [1]. Then, WPG (Walking Pattern Generator) applied to guide the real ZMP tracking a pre-set referential ZMP curve [2]. Nevertheless, a disadvantage during tracking a pre-selected ZMP curve relates to the fact that the biped will be unable to recover from an abrupt push.

In reality, human shows easily re-balance against an unexpected push, via realizing a quick step in the same direction acted with the push. Nevertheless, humans are not possible to know how this complex reaction can handle, how step positions selected, how reactive state was determined, and/or how biases were calculated. Regarding to humanoid, this procedure designed in several ways. Numerous methods used to humanoid push recovery often make a fast step in the same direction of the force acted [3].

Nowadays, there were several interesting published studies focused on the disturbance rejection for biped robots, which includes the biped push recovery problem. Raibert's jumping robot [4, 5] used an adjustment rule to control the step position scaling to the deviation from its desired speed with measured value. In case jumping robot is pushed, it senses a variation in the measured speed and changes its step position relative to the deviation from its desired speed with measured value. Liu et al. in [6] (2021) introduced a new biped disturbance rejection control method based on deep reinforcement learning. Xu et al. [7] suggested a new disturbance rejection method for biped robots during walking and running using control moment gyroscopes. A captured point is a node on the ground that biped can step to without the robot falling. Fischman et al. [8] (2022) presented a novel perturbation rejection and active fall recovery approach for biped robots based on the captured point dynamics. This captured point concept using inverted pendubot models was now increasingly applying in Sarcos humanoid [9], and other biped robots [10, 11] as to guarantee humanoid push recovery.

Despite, the technique of applying captured region permits almost bipeds to keep stably stepping, as to mimic men gait gestures, this technique seems not satisfied. Such as in case, an acrobat keeps walking on a balancing bar and then, misses his balance, he will exert simultaneously his upper body combined with his moving leg to restore his balance. Unfortunately, this process opposed against the tactics of exerting a fast step. Pratt et al. [12] proposed a novel LIPM (Linear Inverted Pendulum Model) scheme based on the resulted momentum flywheel COM (Center Of Mass). Stephens [13] and Kasaei et al. [14] suggested that LIPM used to determine the critical areas which contain tactics available (including hip, feet, etc.) used to recover humanoid balance with respect to unexpected push impact.

In above-mentioned analysis, biped walking recovery against unexpected push using controller that shows too complicated, in which push only acted in the biped locomotion direction. To overcome this restriction, in this paper, a flywheel integrated to the humanoid upper body controlled to provide angle torque opposed to the unexpected horizontal force acted to humanoid body. Consequently, the humanoid robot can continue stably stepping within the required ZMP curve.

The contributions of this study are tri-fold with the following main advantages: First, create angular rotational trajectories for the joints of the biped robot, so that the robot walks stably with the desired ZMP trajectory, using an adaptive evolutionary neural model [15]. Second, perform a dynamic model for the biped robot in order to recover biped stable walking from the horizontal push. Finally, design a controller with two tasks: control the joint angles at the two legs of the robot according to the rotation angles calculated in the first step, and control the direction and rotation speed of the flywheel based on measured data. The information read from IMU (Inertial Measurement Unit), which is positioned on the biped upper part, which helps the humanoid steadily stepping accurately on ZMP trajectory even in case it occurs an unexpected push on the biped horizontally.

The remainder of this paper structures with Sect. 2 presenting the method for biped stepping recovery from unexpected horizontal push. Sections 3 and 4 introduce and analyze the simulation and experimental results, respectively, when verifying the suggested method for the real humanoid HUBOT-5. Section 5 eventually includes the conclusions.

2 Proposed dynamics flywheel-based method for biped stepping recovery from unexpected horizontal push

In order for the biped robot to perform stable gait as well as the ability to recovery unexpected horizontal push during walking, a full scheme is proposed and presented in Fig. 1. Section 2.1 presents the generator model for biped robot to walk stably, and Sect. 2.2 and Sect. 2.3 present the dynamic model and controller of a two-legged robot when there is a sudden horizontal force acting on the biped.

Fig. 1
figure 1

The full scheme of suggested method

2.1 Walking pattern generation

The walking pattern generation in Fig. 1 will receive the desired ZMP trajectory and then, use the nonlinear auto-regressive with exogenous (NARX) model in conjunction with the evolutionary algorithm artificial neural network (EA-ANN) model to find the trajectories of the rotations of the joints of the robot's legs, through three orbital generators of the hip and two ankles, combined with the kinematic model and the balance stability criterion for the biped robot. [15]

Figure 2 illustrates the block diagram of the WPG for a humanoid, using the newly proposed neural NARX structure, optimized with evolutionary IDE optimization technique.

Fig. 2
figure 2

Block diagram of the walking pattern generator

Called \(x_{{{\text{zmp\_ref}}}} \left( k \right),\;y_{{{\text{zmp\_ref}}}} \left( k \right)\) which represent required ZMP point position and \(x_{{{\text{zmp\_real}}}} \left( k \right),\;y_{{{\text{zmp\_real}}}} \left( k \right)\) which represent real ZMP point position, the neural NARX model description, shown in Fig. 2, is described in mathematical formula (1) as,

$$y_{i} \left( {k,\lambda } \right) = F_{i} \left( {\sum\limits_{j = 1}^{q} {v_{ij} f_{j} \left( {\sum\limits_{l = 1}^{m = 4} {w_{jl} \varphi_{l} \left( k \right) + w_{j0} } } \right) + v_{i0} } } \right);\quad i = 1,...,n = 4$$
(1)

where, the neural NARX model is a fully connected 3-layer neural network; yi represents ith output of the output layer; q represents the number of hidden layer nodes; n represents the number of output layer nodes; m represents the number of input layer nodes; z is the backward time shift operator defined as \(z^{ - 1} \cdot x_{{{\text{zmp\_real}}}} \left( k \right) = x_{{{\text{zmp\_real}}}} \left( {k - 1} \right)\) and \(z^{ - 1} \cdot y_{{{\text{zmp\_real}}}} \left( k \right) = y_{{{\text{zmp\_real}}}} \left( {k - 1} \right)\); \(w_{jl}\) represents the weight of input layer, \(w_{j0}\) denotes the weight of bias input layer, \(v_{ij}\) is the weight of hidden layer, \(v_{i0}\) represents the weight of bias hidden layer; \(f_{j}\) is sigmoid function at hidden layer and \(F_{i}\) denotes linear activation function at output layer; the dimension number D is the sum of the number of weights and thresholds of the neural NARX model; with \(\varphi \left( k \right)\) representing the regression vector and \(\lambda\) denoting the weights vector, defined by formulas (23).

$$\begin{gathered} \varphi \left( k \right) = \left[ {\varphi_{1} \left( k \right),\;\varphi_{2} \left( k \right),\;\varphi_{3} \left( k \right),\varphi_{4} \left( k \right)} \right]^{T} \hfill \\ \quad \quad \; = [x_{{{\text{zmp\_real}}}} \left( {k - 1} \right),\;y_{{{\text{zmp\_real}}}} \left( {k - 1} \right),\;x_{{{\text{zmp\_ref}}}} \left( k \right),\;y_{{{\text{zmp\_ref}}}} \left( k \right)]^{T} \hfill \\ \end{gathered}$$
(2)
$$\begin{gathered} \lambda = [{\text{w}}_{jl} ,{\text{w}}_{j0} ,{\text{v}}_{ij} ,{\text{v}}_{i0} ]^{T} ;\;j = 1,...,q;l = 1,...,n = 4;i = 1,...,m = 4 \hfill \\ \;\;\, = [w_{1} ,...,w_{D} ];\;\;D = \left( {n + 1} \right) \times q + \left( {q + 1} \right) \times m;\,\,n = m = 4 \hfill \\ \end{gathered}$$
(3)

The mathematical model of the hip P5 and ankle P1 co-ordinate trajectory of the support-leg, along with the ankle P10 co-ordinate trajectory of the moving-leg, respectively, relies on 4 principal (S- stepping distance, H-foot raising, h- kneeled leg, n- hip moving) values in terms of the frontal (coordinates) and sagittal (coordinates) profile. The three selected P1, P5, P10 parameters are defined as sinus-timing dependent and illustratively presented in formulas (4). (consulted [16])

$$\left\{ \begin{gathered} P_{1x} \left( t \right) = P_{1y} \left( t \right) = P_{1z} \left( t \right) = 0 \hfill \\ P_{5x} \left( t \right) = \frac{{\text{S}}}{4}\sin \left( {\frac{\pi }{{T_{c} }}\left( {t - \frac{{T_{c} }}{2}} \right)} \right) \hfill \\ P_{5y} \left( t \right) = n\sin \left( {\frac{\pi }{{T_{c} }}\tau } \right).\left[ {u\left( \tau \right) - u\left( {\tau - \frac{{T_{c} }}{2}} \right)} \right] \hfill \\ \quad \quad \quad \quad \quad \quad + n\cos \left( {\frac{\pi }{{T_{c} }}\left( {\tau - \frac{{T_{c} }}{2}} \right)} \right).\left[ {u\left( {\tau - \frac{{T_{c} }}{2}} \right) - u\left( {\tau - T_{c} } \right)} \right] \hfill \\ P_{5z} \left( t \right) = \left( {d_{1} + d_{2} + d_{3} - {\text{h}}} \right) \hfill \\ P_{10x} \left( t \right) = \frac{{\text{S}}}{2}\sin \left( {\frac{\pi }{{T_{c} }}\left( {t - \frac{{T_{c} }}{2}} \right)} \right) \hfill \\ P_{10y} \left( t \right) = - w \hfill \\ P_{10z} \left( t \right) = {\text{H}}\sin \left( {\pi \left( {\frac{{P_{10x} \left( t \right)}}{{\text{S}}}} \right) + \frac{1}{2}} \right) \hfill \\ \end{gathered} \right.\quad \quad \quad$$
(4)

with, Tc denotes the step-time of biped, w represents the length from 2 feet,\(\tau = \left\{ \begin{gathered} t\quad \quad \quad if\quad 0 \le t < T_{c} \hfill \\ t - T_{c} \quad \,{\text{otherwise}} \hfill \\ \end{gathered} \right.\) and \(u\left( t \right) = \left\{ \begin{gathered} 0\quad \quad \quad if\quad t < 0 \hfill \\ 1\quad \,\,\quad \;\,\,{\text{otherwise}} \hfill \\ \end{gathered} \right.\).

The 12 angle-joint (θ1, θ2, θ3, θ4, θ5, θ6, θ7, θ8, θ9, θ10, θ11, θ12) trajectories within the 2 biped-legs in one walking-cycle are to be described from P1 = [P1x, P1y, P1z], P5 = [P5x, P5y, P5z] and P10 = [P10x, P10y, P10z] using the biped inverse kinematics. The geometric method based on the biped robot rotary joints will be presented, as described in the formulas (5), and represent the inverse kinematic parameters (see additional works [17]). For straight walking, θ11 = θ12 = 0.

$$\left\{ \begin{gathered} \theta_{11} \left( t \right) = 0,\quad \theta_{12} \left( t \right) = 0, \hfill \\ \theta_{1} \left( t \right) = \arctan \left( {\frac{{y_{l} \left( t \right)}}{{z_{l} \left( t \right)}}} \right),\quad \theta_{5} \left( t \right) = - \theta_{1} \left( t \right), \hfill \\ \theta_{10} \left( t \right) = \arctan \left( {\frac{{y_{r} \left( t \right)}}{{z_{r} \left( t \right)}}} \right),\quad \theta_{6} \left( t \right) = - \theta_{10} \left( t \right), \hfill \\ \theta_{3} \left( t \right) = \pi - \theta_{A} \left( t \right),\quad \theta_{8} \left( t \right) = \pi - \theta_{C} \left( t \right), \hfill \\ \theta_{4} \left( t \right) = \frac{\pi }{2} - \theta_{A} \left( t \right) + \theta_{B} \left( t \right) - \arcsin \left( {\frac{{x_{l} \left( t \right)}}{{l_{l} \left( t \right)}}} \right), \hfill \\ \theta_{7} \left( t \right) = \frac{\pi }{2} - \theta_{C} \left( t \right) + \theta_{D} \left( t \right) - \arcsin \left( {\frac{{x_{r} \left( t \right)}}{{l_{r} \left( t \right)}}} \right), \hfill \\ \theta_{2} \left( t \right) = \theta_{3} \left( t \right) - \theta_{4} \left( t \right),\quad \theta_{9} \left( t \right) = \theta_{8} \left( t \right) - \theta_{7} \left( t \right). \hfill \\ \end{gathered} \right.\quad \quad \quad$$
(5)

The actual ZMP trajectory of the bipedal robot is calculated through formula (6a) [18].

$$\left\{ \begin{gathered} x_{ZMP\_real} = \frac{{\sum\nolimits_{i = 1}^{n} {m_{i} \left( {\ddot{P}_{{{\text{zi}}}} + g} \right)P_{{{\text{xi}}}} - \sum\nolimits_{i = 1}^{n} {m_{i} \ddot{P}_{{{\text{xi}}}} P_{{{\text{zi}}}} - \sum\nolimits_{i = 1}^{n} {I_{iy} \ddot{\theta }_{{{\text{iy}}}} } } } }}{{\sum\nolimits_{i = 1}^{n} {m_{i} \left( {\ddot{P}_{{{\text{zi}}}} + g} \right)} }} \hfill \\ y_{ZMP\_real} = \frac{{\sum\nolimits_{i = 1}^{n} {m_{i} \left( {\ddot{P}_{{{\text{zi}}}} + g} \right)P_{{{\text{yi}}}} - \sum\nolimits_{i = 1}^{n} {m_{i} \ddot{P}_{{{\text{yi}}}} P_{{{\text{zi}}}} - \sum\nolimits_{i = 1}^{n} {I_{ix} \ddot{\theta }_{{{\text{ix}}}} } } } }}{{\sum\nolimits_{i = 1}^{n} {m_{i} \left( {\ddot{P}_{{{\text{zi}}}} + g} \right)} }} \hfill \\ \end{gathered} \right.$$
(6a)

where, \(m_{i}\) denotes the ith link mass; (Pxi, Pyi, Pzi) represents the center coordinates of the ith link; \(I_{ix}\),\(I_{iy}\) denote components of the inertial momentum; \(\ddot{\theta }_{{{\text{ix}}}}\), \(\ddot{\theta }_{{{\text{iy}}}}\) represent the accelerating features of rotating angle regarding to x- and y-axis at the ith joint center; \(g\) represents gravitation force; \(\ddot{P}_{{{\text{xi}}}}\),\(\ddot{P}_{{{\text{yi}}}}\) is the acceleration of link ith in x- and y-direction, respectively; (xZMP_real, yZMP_real) denote the ZMP coordination.

The position of each link, Pi = (Pix, Pyi, Pzi), is calculated from the rotating angular values (θ1, θ2, θ3, θ4, θ5, θ6, θ7, θ8, θ9, θ10) at one time in one step with the original coordination at the center of the supporting foot by direct kinematics (see [16]). The angle speed \(\dot{\theta }_{{\text{i}}} \left( t \right)\) and acceleration \(\ddot{\theta }_{{\text{i}}} \left( t \right)\) will be determined via differentiating \(\theta_{{\text{i}}} \left( t \right)\) with respect to time once and twice, respectively. The speed \(\dot{P}_{{\text{i}}} \left( t \right)\) and the acceleration \(\ddot{P}_{{\text{i}}} \left( t \right)\) of link can be determined by differentiating \(P_{{\text{i}}} \left( t \right)\) with respect to time once and twice, respectively. In simulation tests of this paper, the speed and acceleration of link and angle components using the approximation function as formula (6b). If the position and rotation measurements are noisy, then a low-pass filter is applied to mitigate the noise.

$$\left\{ \begin{gathered} \dot{P}_{ix} \left( t \right) = \frac{{P_{ix} \left( t \right) - P_{ix} \left( {t - 1} \right)}}{\Delta t};\;\ddot{P}_{ix} \left( t \right) = \frac{{\dot{P}_{ix} \left( t \right) - \dot{P}_{ix} \left( {t - 1} \right)}}{\Delta t} \hfill \\ \dot{P}_{iy} \left( t \right) = \frac{{P_{iy} \left( t \right) - P_{iy} \left( {t - 1} \right)}}{\Delta t};\;\ddot{P}_{iy} \left( t \right) = \frac{{\dot{P}_{iy} \left( t \right) - \dot{P}_{iy} \left( {t - 1} \right)}}{\Delta t} \hfill \\ \dot{P}_{iz} \left( t \right) = \frac{{P_{iz} \left( t \right) - P_{iz} \left( {t - 1} \right)}}{\Delta t};\;\ddot{P}_{iz} \left( t \right) = \frac{{\dot{P}_{iz} \left( t \right) - \dot{P}_{iz} \left( {t - 1} \right)}}{\Delta t} \hfill \\ \dot{\theta }_{i} \left( t \right) = \frac{{\theta_{i} \left( t \right) - \theta_{i} \left( {t - 1} \right)}}{\Delta t};\;\ddot{\theta }_{i} \left( t \right) = \frac{{\dot{\theta }_{i} \left( t \right) - \dot{\theta }_{i} \left( {t - 1} \right)}}{\Delta t} \hfill \\ \end{gathered} \right.$$
(6b)

As to ensure the humanoid to stably walking in required ZMP curve, it needs to optimize the suggested neural-NARX in order to Eq. (7) obtains a minimal magnitude.

$$E_{N} \left( \lambda \right) = \sum\limits_{k = 1}^{N} {\left( {\left( {x_{{{\text{zmp\_ref}}}} \left( k \right) - x_{{{\text{zmp\_real}}}} \left( k \right)} \right)^{2} + \left( {y_{{{\text{zmp\_ref}}}} \left( k \right) - y_{{{\text{zmp\_real}}}} \left( k \right)} \right)^{2} } \right)}$$
(7)

where N represents the amount of samples in each test.

Table 1 presents the biped stepping pattern recognition algorithm for a pre-set ZMP biped robot using the IDE algorithm. In this gait generation method, the robot only walks forward. However, this method can generate a multidirectional gait by changing the desired ZMP trajectory and choosing appropriate expressions for θ11 and θ12 in (5) [17]. The values of the parameters S, H, h, and n in (4) will further change, requiring a re-execution of the training process.

Table 1 IDE optimization technique for identifying the neural NARX structure

2.2 Dynamic model for biped robot aimed at recovery horizontal push

In this part, a biped model with an integrated flywheel will be fully presented. We see that based on frontal profile, a hybrid humanoid-flywheel shows instinctively similar to a flywheel inverted pendulum model (flywheel IP model).

By considering the humanoid robot stepping, it is clear to see that the biped upper body shows parallel to the ground. Then, when an external force is applied to the robot horizontally, the biped upper body will be deflected from the horizontal. Here, humanoid robot will be investigated likely a flywheel located on the upper part of inverted pendulum, namely flywheel IP model. In the above model, the flywheel IP body is also deflected from the vertical, as illustrated in Fig. 3.

Fig. 3
figure 3

Hybrid humanoid-flywheel equivalent to a flywheel inverted pendulum model (frontal plane)

Given \(\theta = \left( {\theta_{p} ,\theta_{w} } \right)^{T} \in \,\Re^{2}\) representing the setting-up vector of the flywheel IP model, M represents the inertial vector whose components can be described as follows:

$$m_{11} = m_{p} \left( {\frac{{l_{p} }}{2}} \right)^{2} + m_{w} l_{p}^{2} + I_{p} + I_{w}$$
(8)
$$m_{12} = m_{21} = m_{22} = I_{w}$$
(9)

where \(m_{p}\) represents the pendulum mass; \(m_{w}\) represents the flywheel mass; \(l_{p}\) denotes the pendulum length; \(I_{p}\) represents the pendulum moment of inertia; \(I_{w}\) represents the flywheel moment of inertia.

The kinematic and potential power of flywheel IP plant is described in (10) & (11),

$$K = \frac{1}{2}\dot{\theta }^{T} M\dot{\theta }$$
(10)
$$U = \left( {m_{p} l_{p} + m_{w} \frac{{l_{p} }}{2}} \right)g_{0} \cos \left( {\theta_{p} } \right) = m_{0} \cos \left( {\theta_{p} } \right)$$
(11)

where, \(m_{0} = \left( {m_{p} l_{p} + m_{w} \frac{{l_{p} }}{2}} \right)g_{0}\) and \(g_{0}\) relates to the gravitation and kinetic energy of the plant with respect to rotating kinetic profile only.

The Lagrange expression of the flywheel IP plant is presented in (12):

$$L\left( {\theta ,\dot{\theta }} \right) = \frac{1}{2}\dot{\theta }^{T} M\dot{\theta } - m_{0} \cos \left( {\theta_{p} } \right)$$
(12)

This Lagrange description for a multi-body system is induced by selecting a suite of generalized frames, qi, along with applying general forces,\(\tau_{i}\). Then, the locomotion description is expressed in (13):

$$\frac{d}{dt}\left( {\frac{\delta L}{{\delta \dot{q}_{i} }}} \right) - \frac{\delta L}{{\delta q_{i} }} = \tau_{i}$$
(13)

The fact is that there are 2 angle-based co-ordinates q1 = θp, q2 = θw, along with a push τ1 = Fy thrusting horizontally on the flywheel IP and then, a momentum τ2 = τ impacting on it; thus, we can calculate Euler–Lagrange motion equation as follows:

$$\frac{d}{dt}\left( {\frac{\delta L}{{\delta \dot{\theta }_{p} }}} \right) - \frac{\delta L}{{\delta \dot{\theta }_{p} }} = F_{y}$$
(14)
$$\frac{d}{dt}\left( {\frac{\delta L}{{\delta \dot{\theta }_{w} }}} \right) - \frac{\delta L}{{\delta \dot{\theta }_{w} }} = \tau$$
(15)

By using the function L in formula (12), Euler–Lagrange expression is achieved as:

$$m_{11} \ddot{\theta }_{p} + m_{12} \ddot{\theta }_{w} = \phi \left( {\theta_{p} } \right) + F_{y}$$
(16)
$$m_{21} \ddot{\theta }_{p} + m_{22} \ddot{\theta }_{w} = \tau$$
(17)

where, \(\phi \left( {\theta_{p} } \right) = m_{0} \sin \theta_{p}\).

Solution of the flywheel IP plant (16), (17) can be described in (18) and (19):

$$\ddot{\theta }_{p} = \frac{{m_{22} \phi \left( {\theta_{p} } \right)}}{{m_{11} m_{22} - m_{12} m_{21} }} - \frac{{m_{12} \tau }}{{m_{11} m_{22} - m_{12} m_{21} }} + \frac{{m_{22} F_{y} }}{{m_{11} m_{22} - m_{12} m_{21} }}$$
(18)
$$\ddot{\theta }_{w} = - \frac{{m_{21} \phi \left( {\theta_{p} } \right)}}{{m_{11} m_{22} - m_{12} m_{21} }} + \frac{{m_{11} \tau }}{{m_{11} m_{22} - m_{12} m_{21} }} - \frac{{m_{21} F_{y} }}{{m_{11} m_{22} - m_{12} m_{21} }}$$
(19)

2.3 Controller implementation

In this section, we design a controller to perform horizontal recovery push when the biped robot is walking. The controller consists of two separate controllers, a gait controller and a recovery push controller.

The first controller is installed with its input concerning the rotating joint-angular values of the biped legs that will be optimally identified using the intelligent neural NARX scheme. These rotation angles are then fed to servomotors located at the joints of the robot's legs.

The second controller designed with the following steps. At first, recognize the deflected angular value of the biped compared to the vertical (θp) via IMU that lied in the biped upper part; second in case an unexpected push is acted on the humanoid, this controller immediately guides the flywheel to move in the direction appropriate as to provide momentum necessary to compensate the applied thrust.

The optimal PD controller is designed here using the difference e1(t) between the θp_ref = 0 with measured θp(t) value and the 2nd optimal P controller is installed using the e2(t) deviation between the \(\dot{\theta }_{{w\_{\text{ref}}}} = 0\) with the measured \(\dot{\theta }_{w} \left( t \right)\) value, then minimally optimize the e(t) = e1(t) + e2(t) by regulating online u(t) which is described in (20):

$$u\left( t \right) = K_{p1} e_{1} \left( t \right) + T_{d} \frac{d}{dt}\left( {e_{1} \left( t \right)} \right) + K_{p2} e_{2} \left( t \right)$$
(20)

with Kp1 represents the proportional gain of e1; Td represents the derivation gain of e1; Kp2 represents the proportional gain of e2.

Parameters Kp1, Td, Kp2 are optimized by a multi-objective (MO) Jaya optimization algorithm with two goals of optimally minimizing the Integral Time Multiplied Squared Error (ITSE) criterion of e1 and e2. Then, the constraint-based MO Jaya-based optimization task can be eventually described in (21) [19]:

$$\begin{aligned} & \min \quad {J_1}\left( {{K_{p1}}_,{T_d}_,{K_{p2}}} \right) = \int\limits_0^T {t \cdot e_1^2\left( t \right)} \cdot dt\\ & \min \quad {J_2}\left( {{K_{p1}}_,{T_d}_,{K_{p2}}} \right) = \int\limits_0^T {t \cdot e_2^2\left( t \right)} \cdot dt\\ & {\rm{s}}{\rm{.t}}\quad {e_1} = {\theta _p}\left( t \right) - {\theta _{p\_ref}};\quad {e_2} = {{\dot \theta }_w}\left( t \right) - {{\dot \theta }_{w\_ref}}\\ & & {K_{p1,\min }} \le {K_{p1}} \le {K_{p1,\max }};\;{K_{d,\min }} \le {K_d} \le {K_{d1,\max }};\;\\ & {K_{p2,\min }} \le {K_{p2}} \le {K_{p2,\max }};\end{aligned}$$
(21)

3 Simulation results and analysis

3.1 Model of experiment biped robot

The humanoid HUBOT-5 composes of upper and lower parts, illustrated in Fig. 4. The links of biped are all made by lightweight aluminum, so they contribute very little to the overall mass or inertia of the link. The overall mass or inertia of the links then is determined based on the position and weight of the actuators. Then, the mass of link is assumed concentrated at joints located at the distal end [17]. Therefore, HUBOT-5 contains ten links possessing the same mass mi = 70 g and m0 = 200 g for the upper part. These links are designed with following sizes (cm): d1 = 5.6, d2 = d3 = 6, d4 = 4, d0 = 9, w = 6.3.

Fig. 4
figure 4

Photograph and structure of the experiment biped

The biped upper part consists of a gait control board (Arduino) and a flywheel. The latter is implemented as a separate module, composes of a recovery thrust control Arduino board (MCU ATmega328P-AU), an IMU (MPU-6050), a gearless DC actuator (Servo 12 V–24 V 10W) and a propeller whose radius equal 8 cm. The propeller installed in the upper part center and its axis of rotation is aligned in order to help it passes across the mass center of the robot, namely the rotor. This rotor directly controlled by DC motor, for higher response speed and smaller mass. The flywheel positioned at the upper part center plays the role of biped gait recovery from unexpected thrust, via the fact that, nascent momentum will be augmenting or lowering through the rotating velocity variation of the flywheel in order to keep the biped steadily walking gait. Such as, in case a humanoid is pushed in horizon direction with a right momentum, the flywheel should improve its rotating velocity rightward as to provide leftward momentum as to equalize the biped walking gait. In practice, to obtain a larger counter-torque, the rotor inertia designed to be as large as possible. Therefore, to the design of the robot unchanged, the material of the flywheel selected as brass [20].

The biped lower part composes of 2 legs and a hip linked via 10 drive actuators, supplying the simultaneous torque for the humanoid to robust stepping.

3.2 Simulation results for steady gait generation

Using the subSect. 2.1, the coefficients of the proposed neural NARX model are selected with the number of hidden layer nodes q = 8; the amount of samples in each test N = 202; the activating equation for hidden nodes is sigmoid; the activating equation for output nodes is linear. Further, for identifying optimally the coefficients of the proposed neural NARX model, the IDE technique is used with mutant rate F \(\in\)[0.3: 1.0] and cross-over factor CR \(\in\) [0.6: 1.0].

Figure 5 illustrates the convergence rate of the objective function during the training process. Figure 6 shows comparative results between the desired ZMP trajectory with the obtained ZMP trajectory after performing the identified coefficient optimization of the proposed neural NARX structure based on IDE technique. Table 2 presents the optimal value of the weights of NARX + ANN model. Figure 7 presents the ten rotating joint-angular values of the 2 biped legs.

Fig. 5
figure 5

The speed of LMS convergence during training process

Fig. 6
figure 6

Illustrated results of comparative estimated and ideal ZMP trajectories

Table 2 The best parameters of vij and bias of NARX-ANN model trained by IDE
Fig. 7
figure 7

Rotating angular trajectories of biped joint-angles

The 10 rotating joint-angle responses, illustrated in Fig. 7, applied to perform gait simulations and evaluate the stability of HUBOT-5 locomotion as shown in Fig. 8.

Fig. 8
figure 8

Simulated gait result of biped HUBOT-5

From the identification and simulation results of the walking pattern generator for HUBOT-5, it is evident to note that all specific requirements have been satisfactorily responded.

3.3 Simulation results of biped recovery horizontal push

Based on subSects. 2.2 and subSects. 2.3, the coefficients of the pseudo-biped flywheel IP structure are adequately presented in Table 3. This flywheel IP scheme modeled in Simulink is shown in Fig. 9.

Table 3 Pseudo-biped flywheel IP model parameters
Fig. 9
figure 9

Simulink setup of pseudo-biped flywheel IP model for simulations

The first made simulations in MATLAB and Simulink in order to prepare for actual experiments later. The IMU and flywheel measured velocity has been added disturbance as to mimic the real test. The configuration of coefficients is tabulated in Table 3 along with the initiated values for the investigated flywheel IP plant are:

\(\theta_{0} = \left[ {\begin{array}{*{20}c} {\theta_{p0} } & {\dot{\theta }_{p0} } & {\dot{\theta }_{w0} } \\ \end{array} } \right]^{T} = \left[ {\begin{array}{*{20}c} {\frac{\pi }{20}} & 0 & 0 \\ \end{array} } \right]^{T}\).

The proposed optimal controller described in (20) (have Kp1 = 30, Td = 7.5168, Kp1 = 0.1) is applied to recover the flywheel IP back to the straight equalized posture in which \(\theta_{p\_ref} = 0\) and \(\dot{\theta }_{w\_ref} = 0\).

Figure 10 illustrates the trajectories of flywheel IP deflected angle θp; rotating speed of flywheel IP deflected angular value \(\dot{\theta }_{p}\); rotating speed of flywheel \(\dot{\theta }_{w}\) and control response u. Figure 10a and b presents the state responses of θp,\(\dot{\theta }_{p}\),\(\dot{\theta }_{w}\), u using proposed control regardless and regarding to disturbance, respectively. State responses of θp,\(\dot{\theta }_{p}\),\(\dot{\theta }_{w}\), u in Fig. 10b have spikes. These are the instants where the disturbances are applied.

Fig. 10
figure 10figure 10

a State responses of θp,\(\dot{\theta }_{p}\),\(\dot{\theta }_{w}\), u using proposed control. b State responses of θp,\(\dot{\theta }_{p}\),\(\dot{\theta }_{w}\), u using proposed control and added disturbance

Figure 11 investigates the response of a flywheel IP model affected with a unexpected horizontal thrust acting on biped using proposed controller. At t = 1 s, the unexpected push F acting on biped horizontally, then the proposed controller well responds the sudden push and the flywheel IP model quickly gets back to straight equalized posture with the angular velocity of the flywheel \(\dot{\theta }_{w}\) converging back to zero.

Fig. 11
figure 11

State responses of θp,\(\dot{\theta }_{p}\),\(\dot{\theta }_{w}\), u with adaptive control applied on θp and \(\dot{\theta }_{w}\) in case pendulum is pushed

4 Experimental results applied to biped HUBOT 5

Using 10 resulted trajectories of rotation angle obtained in Sect. 3.2 and the proposed controller in Sect. 3.3, to survey the actual walking process of HUBOT-5 with different cases. Figure 12 presents the results of the biped HUBOT-5 in showing a robust step-cycle walking when there is no sudden horizontal force on the robot. Figure 13 presents the results in case unexpected push acting on biped in both of opposed directions. The experimental tests demonstrate that the suggested method fruitfully applied to the biped robot. (If readers want to see the test videos, visit the following websites [21, 22]:).

Fig. 12
figure 12

Photographs of experiment biped robot in steadily stepping

Fig. 13
figure 13

Photographs of experiment biped robot in steadily stepping with respect to unexpected thrust

5 Conclusions

A novel method for humanoid stepping recovery from horizontal push using flywheel dynamics suggested in this paper. A humanoid dynamic structure used to walking restoring from unexpected push is fruitfully implemented based on the Euler–Lagrange formulation. This model enhanced with the adaptive control applied on θp and \(\dot{\theta }_{w}\) angular variables was successfully designed in Simulink to confirm that the humanoid converges to a vertical equalized gait regarding to a unexpected thrust acting on biped in horizontal profile. A humanoid WPG for biped stable walking to follow the required ZMP curve installed using the neural NARX model optimally identified by enhanced IDE method. These two combined models experimentally apply to the real HUBOT-5. Eventually, the experiment for the biped robot demonstrates the suggested method is efficient and well-performed. In the next study, we will continue to experiment this method with humanoid robots.