Abstract
To maintain human-like active balance in a humanoid robot, this article proposes a dynamic priority-based multitask algorithm to avoid self-collision during highly complex robotic whole-body motions and rebalance after external disturbance using momentum compensation strategies. On the one hand, the conflict between self-collision and self-balance constraints in task-space merging with end-effector tracking tasks are considered in the multitask algorithm to improve the robot’s balance. On the other hand, for self-balance during the robot’s movement, momentum compensation is considered as one task and utilized to reject unknown disturbances. Two strategies are put forward to restrain the sudden change in momentum. One is to calculate the correction in the joint space with the resolved momentum control (RMC) method; the other is to add an end-effector tracking motion in the task space. Simulations and experiments on a full-body humanoid robot validate the effectiveness of the proposed method. Experiments on both a simulation and a full-body humanoid are designed to validate the task-prior algorithm. With the proposed method, the humanoid robot succeeds in avoiding self-collision during movement and is able to rectify itself to the preplanned steady stance while encountering undefined external forces.
Introduction
Robust locomotion is fundamental for a humanoid robot to maneuver in an unstructured and undetermined human environment. To realize the biped robust walking, multimodal data fusion technologies, 1 –7 the trajectory online generation methods, 8 –10 and the online optimization strategies are all needed to be integrated to realize maximum degree of biped walking robustness. Currently, humanoid walking is commonly realized by planning the center of mass (CoM) trajectories so that the resultant zero moment point (ZMP) 11,12 trajectory follows a desired ZMP trajectory. For real-time implementation, a humanoid robot was represented by a mass-concentrated model, whereas a simplified dynamics model is generally used. 13,14 However, while these control methods can realize humanoids walking in an ideal environment, small irregularities of terrain or a change in the mass distribution of the CoM may cause the robots to lose balance during walking. To realize adaptive walking in unknown conditions, disturbances from the external environment, such as pushes and terrain irregularities, and self-collision with the robot itself need to be considered.
The state of the art balance control of biped robots has solved different problems of movement tasks. However, there is no complete control framework that embraces different conditions, including stand balancing, walking balance with disturbance, self-collision avoidance, and reactive stepping from standing position.
In task-space-based robot motion control, the priority of the subtasks is often fixed. However, when the number of subtasks in the robot motion control is large and the coupling of each subtask is complicated, this simple static priority strategy can no longer be applied to the cooperation among the control tasks. For example, on the one hand, in humanoid robot walking control, the walking foot of the robot needs to complete the tracking task of the scheduled walking track, and on the other hand, it can be used to generate the momentum compensation movement needed to improve the balance of the humanoid robot while walking. However, a higher priority of the trajectory tracking task does not always exist. When the robot is in the bipedal support stage, it is of course necessary for the footrest to satisfy the constraint requirement that the relative support foot has no movement and is in close contact with the ground. During the robot support stage, the control of the robot’s foot is only concerned with its position and position tracking during the rising and falling phases and does not care about the movement of the foot in the swing phase. At this time, the swing foot can be used to complete the more important task of momentum compensation. Therefore, a more reasonable strategy in robot motion control is that the control subtasks can dynamically switch priorities according to the current control needs during the movement of the robot and realize more flexible multitask cooperative control. Therefore, presenting a frame of the robot motion task space control method with dynamic priority switching is very necessary. In the dynamic priority robotic task space control framework, the system first determines the priorities of each subtask dynamically according to the current requirements of robot motion control and ranks the tasks according to the priority order. The underlying task first maps the motion control output to the zero space of the upper layer task control according to the differential motion control and the corresponding Jacobian matrix and then merges the mapped control output into the upper-layer task control output. The process is iterated step by step and, with the additional constraints (such as robot joint clipping, joint movement speed and collision constraints and other constraints), eventually produces the joint motion of the robot command to complete the robot’s integrated motion control.
In this article, a novel online active balance control framework based on a dynamic priority-based multitask algorithm is presented. The current balance strategies can be treated as subtasks in the dynamic multitask algorithm, whereas the self-collision avoidance, foot position compensation, and momentum compensation strategies are treated as tasks in the dynamic priority-based multitask algorithm. In this work, we pay attention to the self-collision avoidance and momentum compensation strategies during standing and walking balance with external disturbances. For self-avoidance in humanoid robots during whole-body movement, such as swinging arms, three steps are applied to address the problem: first, to construct bounding segments of the robot according to 3-D geometry; second, to select candidate pairs through prior knowledge, and finally, to achieve the task of avoiding self-collision. For the momentum compensation strategies, from the perspective of momentum, the robot falling down equals a dramatic increase in angular momentum if one of the feet is regarded as a fulcrum. The humanoid’s base angle is utilized as the feedback signal to compensate for angular momentum. Meanwhile, if the disturbance causes a deviation of the CoM, linear momentum needs to be compensated as well. The resolved motion rate control (RMRC) method/differential inverse kinematics (DIK) is introduced to solve the redundant problem. 15 The null-space method is utilized to address task priority. 16 The influences of external perturbations on robots can be regarded as the offset of CoM and the change in momentum. The prior-based dynamic multitasking system is used to switch and merge the trajectory tracking task and the momentum compensation task.
This article is organized as follows: The related work about how to improve biped walking stability and maintain balance is introduced in the second section. Third section elaborates on the basic theory, including redundant kinematics and the multitask mechanism; gait generation based on linear inverted pendulum mode (LIPM); and the resolved momentum control method. Self-collision constraints are explained in the fourth section. The presented momentum compensation strategy is introduced in the fifth section. Sixth section verifies the validity of the multitask mechanism with self-collision avoidance and momentum compensation algorithms by simulation experiments. We conclude this study and suggest future work in the seventh section.
Related work
Self-collision is an important physical constraint on whole-body motion planning for a humanoid robot. During task operating, the swing arm may collide with the leg during biped walking, which will affect the balance of walking. Therefore, self-collision is an unavoidable problem in humanoid robot balancing and needs to be considered during adaptive walking. Kwon et al. 17 extended the research area from traditional collision between the robot and the external environment to self-collision with the robot itself. If several tasks are to be executed at the same time, task space methods can be applied to the multitask problem under redundant joint space, which has a low time cost and divides complicated tasks into uncomplicated tasks to represent a complex joint space. Nakanishi et al. 18 implemented multiple tasks under a task space by priority allocation. Sugiura et al. 19 proposed that self-collision can be described as a task in a task space and gives the function of collision avoidance, but this was based on partial coordinates. Cheng et al. 20 invented the concept of self-collision avoidance, with a focus of interest on dynamically predicting and selecting link pairs to be checked.
To improve biped walking stability and maintain balance, some strategies as to how to effectively use the whole body to improve walking ability have been proposed. 21 –24 For example, arm-swing strategies 25,26 are used during biped walking to compensate for the movements of the swing leg and stabilize robot posture. Currently, although several types of arm-swing strategies have been proposed, they are difficult to execute simultaneously. Kobayashi et al. 27 proposed a two-stage integration method of the two arm-swing strategies for bipedal walking to enhance both stability and efficiency.
To achieve external environment disturbance rebalancing, different strategies have been proposed to compensate for nonzero variations in momentum, 22,28,29 regulate CoM, or online adjust the foot position through sensory feedback control. 30 –35 Considering humanoid momentum compensation, Englsberger and Ott 28 invented a walking methodology based on a capture point, which integrates CoM vertical motion and angular momentum change. Ugurlu et al. 22 created a strategy to rotate a humanoid’s upper body to compensate for undesired yaw movement when the robot walks. Chang et al. 29 estimated the robot state and regulated the angular momentum of CoM and steps to recover from a push, but pushes from left or right side were not examined.
Dynamically adjustable foot positioning is an effective strategy for active balance. In our previous work, 30,31 a foot-positioning compensator was proposed to dynamically adjust the foot positioning of a humanoid robot according to the real-time state of the robot’s CoM. Castano et al. 32 proposed a new online walking control that replanned the gait pattern based on foot placement control using the actual CoM state feedback. The analytical solution of foot placement is formulated based on the LIPM to recover the walking velocity and reject external disturbances. For the disturbance rejection of continuous walking, Wieber et al. 33,34 proposed an online walking gait generation approach, with both adjustable foot positioning and step duration based on the linear model predictive control scheme. However, only simulated experiments were developed, and no supporting area constraint was considered. Based on the preview control scheme, Nishiwaki and Kagami 35 proposed strategies to adjust future foot positioning and ZMP trajectory. Several typical experiments were developed on a real full-body humanoid robot to validate the effectiveness of their methods. Similar works also included foot positioning adjustment based on a feasible region and avoidance behavior from external forces for a human-carrying biped. 36,37 Stephens 38 utilized an integral control method to maintain standing balance and viewed the disturbance as impulsive. Liu and Atkeson 39 studied the balance of a robot standing based on a trajectory library, which is time consuming. These researchers only considered a robot’s balancing under a static state rather than a dynamic steady state. Graf and Röfer 40 presented a robust closed-loop gait, which allowed the robot to react to external perturbations. Urbann and Hofmann 41 presented a reactive stepping algorithm based on the generation of walking motions with sensor feedback. The closed-form calculation of foot placement modifications, such as disturbances of the CoM position, could be balanced with negligible ZMP deviations.
As shown in the aforementioned related works, the state-of-the-art balance control of biped robots has solved different problems of the movement tasks. However, there is no complete control framework that embraces different conditions, including stand balancing, walking balance with disturbance, self-collision avoidance, and reactive stepping from standing position.
Algorithms
A dynamic priority-based multitask mechanism and the related algorithms, including gait generation based on LIPM and the resolved momentum control method, are introduced in this section. Multitasks are merged in the way of a null-space projection according to their priorities. Self-collision avoidance and momentum compensation are considered as tasks and utilized to reject robot itself and external disturbances.
Redundant kinematics and multitask mechanism
The relationship between task space and joint space in the robot system can be described by a nonlinear function as follows
where
The RMRC method is adopted to control the velocities of joints instead of directly controlling the joints. The differential kinematics and inverse kinematics of the robot system can be expressed as follows
where J(θ) is the Jacobian matrix and
If N > M in equation (1), the robot system is redundant. Using a pseudo-inverse matrix instead of the inverse Jacobian matrix provides the following
To avoid the singular problem, the damped least squares (DLS) method can be applied to construct the pseudo-inverse matrix
where λ is the damped constant value, which will ensure Jacobian matrix J# is full rank.
Null space is defined as the linear combination of certain joints that will not make a difference in the motion of the end-effector, which can be expressed as
With the help of a null-space projection operator, multitasks with different priorities can be executed at the same time, which can be described as follows
where task T1 is prior to task T2, and T2 has no influence on T1 through a null-space projection. The block diagram of the dynamic multitask mechanism based on priority is shown in Figure 1, where the higher priority task will be projected onto the null space of its lower priority task; finally, by linear superposition and an inverse kinematics calculation, the robot joint space can be configured.

Priority-based dynamic multitask frame.
Gait generation based on LIPM
In this section, a 3-D-LIPM is used to plan the CoM motion of the robot in order to generate a stable periodic gait. Then, the support foot and swing foot trajectories are designed according to the planned CoM. 40 The position and velocity of the CoM, relative to the origin of the inverted pendulum, are given by
where
To eliminate a double-support phase, the point in time for altering the support leg must be determined. First, the point in time t = 0 is defined as the time point for altering the support leg. When t = 0, the y-component of the velocity is 0(
If the swinging foot should be placed with a distance of

xy-cross section showing the step size
where te and
to compute
To cover a step size,
To make sure that the position of the origin of the inverse pendulum is optimal in the next phase, we designate that
After the CoM trajectory is known, the position of the support foot is given by the functions of
The swing foot should be repositioned to the origin of the next inverse pendulum during the single-support phase. The motion of the swing foot contains movement in the xy-direction and lift in the z-direction, which are defined relative to Q as follows
where
Resolved momentum control
The linear momentum,
where
If we divide
where i = 1 represents the left leg and i = 2 represents the right leg. Then, equation (20) can be rewritten as follows
Considering that the humanoid’s base is moving, the coordinate should be placed at a point free from the robot. If we choose the center between the two feet, which is fixed on the ground, as the coordinate origin and call this coordinate ΣF, the computation of a foot’s velocity has to be corrected as follows
where
If equation (26) is substituted into equation (24), the momentum formula can be rewritten as follows
where
With the equations above, if the reference momentum,
Self-collision constraints
When considering robot modeling, most researches simplify the robot to skeleton, but self-collision problem normally happens because of the 3-D geometry of robot. Self-collision means part of the robot may collide with other part of the robot. Collision-free path planning can be treated as an important constraint or task in robot motion planning and a necessary technique to maintain balance. To achieve this constraint, self-collision should first be detected. The whole architecture of the self-collision task is shown in Figure 3.

Main flow from building 3-D model to collision avoidance.
The first step constructs bounding segments of the robot according to 3-D geometry, then selects candidate pairs through prior knowledge, and finally achieves the task of self-collision avoidance. The state postures of the links are related to the transform matrix, which varies along with the configuration of the joint space state. We use object bounding boxes (OBBs) to describe the robot’s three-dimensional model (Figure 4) according to the joint connections of the robot. For a humanoid robot, the three-dimensional model of the robot can be divided into N segments. If si represents one segment, the whole three-dimensional model can be expressed as

3-D model represented by OBBs and distance between segment pair. OBB: object bounding boxe.
For the collision checking of the simple OBB geometry, the separate axis theorem (SAT) is applied for fast collision detection between polygon meshes. 42 Differential distance calculation, by obtaining the closest point pair (Figure 4), can be expressed as
Collision avoidance can be considered as a subtask, Tcoll, in the task space, which aims to enlarge the distance, di,j, between segment pair. Thus, the joint space configuration can be rewritten as
where Tcoll is the collision avoidance task, which has a higher priority than T2.
Momentum compensation strategy
Compensation setting
It is known that the process of a robot falling down when it encounters disturbances can be considered as a mutation of the trunk angle under ΣF. From the perspective of momentum, a robot falling down equals a dramatic increase in angular momentum if one of the feet is regarded as a fulcrum. Therefore, we need to detect the humanoid’s base angle, θB, with the help of the embedded inertial unit sensor. Then, θB is utilized as the feedback signal to compensate for angular momentum. Meanwhile, if a disturbance causes the deviation of the CoM, linear momentum needs to be compensated as well.
When the momentum is compensated with the proportional control method, the formula can be expressed as
where Kp1 and Kp2 are scaling factors of linear momentum and angular, respectively;
In the RMC method, we set
Dynamic multitask integration
If the foot i is executing a trajectory tracking task
When a robot encounters a strong disturbance, it may fail to adjust its stance promptly and avoid falling because of its intrinsic constraints, such as the limit of joint velocity. Therefore, we consider adding an extra momentum compensation task in the task space that is obtained by the RMRC method but not solved in the RMC manner. Compared with human actions, when an external force is received, it is found that a foot lift task opposite to the body tilt direction can be regarded as an effective solution to resisting an angular momentum change. In this way, when a robot’s body has sufficient tilt, a foot lift task is added to maintain balance. The foot lift task can be merged with the momentum compensation task as follows
where
Simulation and experiment
Experiment platform
To validate the proposed method, the robot NAO is used for the experiments (Figure 5(a)). The robot has 25 degrees of freedom (DOF), with 11 DOFs for the two legs. The height of this robot is approximately 50 cm during walking and its weight is 4.35 kg. The sensor data and the walking control module update at a rate of 50 frames per second. The difficulty in developing walking approaches on this robot lies in that each leg weighs almost the same as its body and the links of the robot are made of plastic, which makes the dynamics of the robot quite different from the simplified LIPM model. Additionally, disturbances brought with the deformation of the plastic links are also significant. To compute the local inertial tensor of each link of the body, the geometrical approximation of each part of the robot is given by the inertia tensor formula. As shown in Figure 5(b), the head of the robot is represented by a sphere of uniform quality, and the other parts are represented by rectangular parallelepipeds with uniform mass. The simulations are carried out under a physical simulation environment (Webots), as shown in Figure 5(c), and then dubbed to the real robot.

Humanoid robot platform. (a) NAO robot. (b) Approximate dynamic representation of each link of the robot. (c) The simulation environment (Webots).
Self-collision avoidance
In this section, we combine the arm swing task with a self-collision avoidance task. In the first experiment, the arm is designed to swing vertically with a shoulder pitch angle varying in the range of

Trajectory of right hand with and without collision avoidance.

Distance between and before and after works.

Vertical collision avoidance snapshots. Collides with (a) and successful collision avoidance (b).
Furthermore, if we add arm-swing motions during biped walking, collision avoidance should be considered in order to maintain balance. Assuming that the walking task has a higher priority than the arm-swinging task. The robot can walk forward on a flat terrain stably while swinging both arms forward and backward, alternatively, to avoid self-collision. As shown in Figure 9, the second experiment is set as including walking, bending forward, and arm swinging, which are then converted to motion planning tasks merged with self-balancing constraints.

Snapshots of the collision avoidance during biped walking. (a) Walking with arm swing. (b) Bending forward. (c) Horizontal collision avoidance during arm swing.
When bending forward, the robot is expected to maintain balance at the same time. We design the CoM to move forward and downward slightly with momentum control method. Also, we set robot’s feet standing on the ground and detect whether the CoM leaves the supporting polygon.
Momentum compensation while standing
Momentum compensation is applied under two circumstances in this experiment. One circumstance applies a sudden force to the robot when it is in a steady state, such as standing on the ground with double feet. The other creates disturbances while the robot is walking with a predefined fixed gait.
The robot is in a static state while standing on the ground, which means the reference momentum is zero. If a sudden force is applied to the robot, its trunk will lean to one side and a CoM error will be caused. If the standing state is to be maintained,
where
Under such dynamic multitask strategy, the robot will remain standing on the ground and perform the momentum compensation if it just slants slightly but will lift the opposite foot in the tilt’s direction and compensate momentum if the tilt exceeds the threshold. The body angle curve, the expected CoM versus measured CoM trajectories, and double feet trajectories are shown in Figures 10, 11, and 12, respectively (relative to ΣF). The experimental results show that the robot inclines to the left and lifts the right foot because of the applied force occurring at approximately t = 3s and then inclines to right, lifting the left foot and swaying backward and forward slightly due to the counterforce of the ground while putting down the right foot. At last, the robot returns to an upright state due to momentum compensation. Figure 13 demonstrates the snapshot sequences of the robot recovering from an external lateral disturbances, the largest force in this lateral disturbance rejection experiment almost with a maximum value of 10.8 N (this is just the maximum value in this simulation and not the maximum value for the NAO robot).

Body angle curve.

Trajectories of the expected CoM and measured CoM. CoM: center of mass.

Trajectories of left and right feet.

Snapshots sequences of NAO recovering from lateral external disturbance. (a) Small lateral disturbance from left hand. (b) Small lateral disturbance from right hand. (c) Larger lateral disturbance from left hand. (d) Larger lateral disturbance from right hand.
Momentum compensation during walking
In this section, the 3-D-LIPM is used to plan the CoM motion to generate a stable periodic gait; then, the support foot and swing foot trajectories are designed according to the CoM. Uncertain disturbances are applied to the robot during this dynamic steady process. The term
where TswF and TspF are the foot tracking trajectories of the walking task; TswFLift is the lift motion in the y–z plane added to the swing foot;
As is expressed in the equations above, a foot lift task will be added to the swing foot, which has a higher priority than its original swing task if the robot’s tilt is large enough. Meanwhile,

Sequences of robust walking. (a) Lateral disturbance from left hand. (b) Lateral disturbance from right hand.

Body attitude curve during walking.

Trajectories of the expected CoM and measured CoM. CoM: center of mass.

Trajectories of the left and right feet.
If the left-oriented disturbance is imposed on the robot, the robot inclines to the left. When the robot inclines a little, the RMC computed joint correction works and the walking task will not be terminated. With the growth of trunk tilt, the right foot lifts up and stretches out until the current single-support phase ends. In the next single-support phase, the right foot switches to the support foot and returns to its original position on the ground, while the left foot prepares to execute the swing foot task. The robot moves on to a normal walking state in approximately 3 s. When the right-oriented disturbance occurs, the right foot acts as the support foot, while the left foot plays the role of the swing foot and the robot recovers from the force attack exactly as it did in the left-oriented force disturbance restoration. In addition, the swing foot lift task may cause a tracking error of the CoM, swing foot task, and support foot task but is of great help in maintaining balance.
Conclusion and discussion
Walking is the basic skill of a humanoid robot. Most of the current walking control methods adopt predefined foot and center of mass trajectories and control the robot with simplified dynamics model. These methods usually cannot resist with external disturbance and lack adaptation to the environment changes and therefore can be hardly used in real on-field applications. In general, the current disturbance rejection methods are mainly divided into balance method based on local acceleration of the body and balance method based on modifying the supporting structure of the robot and environment. These methods can only be effective for small disturbances, or only in the simulation environment. On the other hand, most of the current approaches only use one balance skill, and the skill designed according to anticipate specific behavior. For humanoid, the complex and flexible balance ability is more dependent on a variety of balancing skills integrated application.
In this article, a priority-based dynamic multitasking frame is introduced under which multitasks are switched, merged, and executed. Collision avoidance can be considered as a subtask during highly complex robotic whole-body motions in the task space in order to avoid its influence on balance. A momentum compensation method was proposed, which explains that momentum changes caused by disturbances are suppressed by either joint correction computed with the RMC method or by a foot lift motion opposite to the robot’s tilt. The validity of the proposed method is verified through experiments on an NAO robot. The results illustrate that, with the introduced algorithm, the robot will adjust itself to the predesigned static or dynamic steady state if uncertain forces are applied. In the next step work, a preview controller can be utilized to estimate the robot state, and more effective momentum compensation tasks, other than foot lift motion, will be added in the dynamic multitasking frame to realize an improved ability of the disturbance rejection.
As we know, animals and humans in nature show the strange survival skills not only rely on long-term evolutionary process and genetic congenital acquisition, many behavioral skills are acquired through learning ability acquired. Even some seemingly innate skills are acquired through the practice and improvement can be applied to the current living environment. Such as humanoid balance skills, human needs to attempt many times to get the skills to prevent falling, like skating. Humans can still learn to adapt to walking ability. Another function of acquired learning is to improve the coordination of the various parts of the body and the simultaneous execution of various independent behaviors. As a result of repetitive exercises, we can accomplish tasks such as using the upper body part to complete the side water while balancing the walking. Therefore, to learn to change and improve the skills of humanoid robot is a flexible, robust, efficient, and essential to the ability to walk.
In the future work, the mechanism of the balancing skills in human walking will be studied and control methods of using active balancing skills to resist with external disturbance under unstructured and uncertain environment will be explored. Dynamics modeling of local acceleration balancing skills and supporting-polyhedron modification balancing skills will be designed and control architecture of multiple balancing skills cooperation will be investigated. The online skill learning algorithms will be explored in the future research. The work is targeted at exploring new theory and technology of humanoid walking control, breaking through the bottleneck of humanoid robot real application, and solving the basic and key problem of the adaptation of humanoid walking control. The result is critical for the production of new-generation humanoid robot, development of on-field and service robot, assisting robot and space robot, and so on.
Footnotes
Acknowledgements
The authors would like to express thanks to technicians in the Laboratory of Robotics and Intelligent Systems of Tongji University for their assistance during experiments.
Declaration of conflicting interests
The author(s) declared no potential conflict of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported in part by the National Natural Science Foundation of China (grant nos. 61673300 and 61573260) and the Fundamental Research Funds for the Central Universities, Basic Research Project of Shanghai Science and Technology Commission (grant no. 16JC1401200).
