A Novel Balance Control Strategy Based on Enhanced Stability Pyramid Index and Dynamic Movement Primitives for a Lower Limb Human-Exoskeleton System

The lower limb exoskeleton is playing an increasing role in enabling individuals with spinal cord injury (SCI) to stand upright, walk, turn, and so on. Hence, it is essential to maintain the balance of the human-exoskeleton system during movements. However, the balance of the human-exoskeleton system is challenging to maintain. There are no effective balance control strategies because most of them can only be used in a specific movement like walking or standing. Hence, the primary aim of the current study is to propose a balance control strategy to improve the balance of the human-exoskeleton system in dynamic movements. This study proposes a new safety index named Enhanced Stability Pyramid Index (ESPI), and a new balance control strategy is based on the ESPI and the Dynamic Movement Primitives (DMPs). To incorporate dynamic information of the system, the ESPI employs eXtrapolated Center of Mass (XCoM) instead of the center of mass (CoM). Meanwhile, Time-to-Contact (TTC), the urgency of safety, is used as an automatic weight assignment factor of ESPI instead of the traditional manual one. Then, the balance control strategy utilizing DMPs to generate the gait trajectory according to the scalar and vector values of the ESPI is proposed. Finally, the walking simulation in Gazebo and the experiments of the human-exoskeleton system verify the effectiveness of the index and balance control strategy.


INTRODUCTION
Spinal cord injury (SCI) is temporary or permanent damage to the spinal cord and might cause various impairments. The incidence of SCI is 40-80 new cases per 1,000,000 people per year from all causes, depending on the country (Fang et al., 2020). SCI will result in weak or paralyzed muscles, atrophy, walking disability, sensory dysfunction (Craggs et al., 2006), and autonomic disorders. Spasticity and pain are also some consequences of SCI affecting locomotor and quality of life (Barbeau et al., 1999). Also, the financial burden for rehabilitation is considerable. So, in recent years, the lower limb exoskeleton has gained considerable interest in improving the patients' life quality and reducing the financial burden since it could help the SCI patients with rehabilitation and walking assistance.
However, most patients cannot accept the exoskeleton quickly due to the security risk, like falling during walking. Moreover, once a fall occurs, it would cause secondary damage, causing the condition of the patient to worsen, even death (Brotherton et al., 2007). Therefore, it is necessary to establish a reasonable approach to accurately evaluate and perform the balance control of the safety of the human-exoskeleton system.
Stephens and Christopher presented a balance controller that allows a humanoid to recover from large disturbances and still maintain an upright posture in Stephens and Atkeson (2010). Balance is achieved by integral control, which decouples the dynamics and produces smooth torque signals. Chen et al. (2018) proposed a novel gait planning approach, which aims to provide reliable and balanced gait during walking assistance. This approach models the exoskeleton and patient together as a linear inverted pendulum (LIP) and obtains the intention of the patient through an orbital energy diagram. Guo et al. (2019) utilized a Zero Moment Point (ZMP) based method to obtain the center point position of the pressure and to get a mathematical expression on the stability of the human-machine system. By adjusting the pressure of the four support points of the two crutches and the feet of the exoskeleton robot, the system could tune the step sizes of the crutch and position dynamically to achieve the most stable motion state. Kopitzsch et al. (2017) presented an approach based on push recovery experiments while walking, multi-body system models, and least-squares optimal control to analyze the required torques to be generated by the exoskeleton, assuming that the human provides no torque. Wang et al. (2015) described the design, control, and preliminary evaluation of a novel exoskeleton, MINDWALKER. Besides powered hip flexion/extension and knee flexion/extension, it also has powered Hip Abduction/Adduction (HAA). In addition, a novel step-width adaptation algorithm was proposed to stabilize lateral balance. Current developments can only support people with paraplegia at most and require manual operation of crutches by the patient. To overcome this limitation, a theoretical model of a robotic device with actuated robotic crutches is proposed by Cohen and Or (2018), which can be used to support people with high-level disabilities, such as people with quadriplegia who cannot use the existing solutions to perform walking gaits. This study presents kinematic trajectory planning of the proposed model and dynamic analysis of main movement stages. Zhang et al. (2017) presented a high-power, self-balancing, passively and software-controlled active compliant, and wearable hip exoskeleton to provide walking and balance assistance. In addition, a new balance controller based on the "extrapolated center of mass" (XCoM) concept is presented for real-time control hip abduction/adduction to keep the center of mass (CoM) within the support polygon. The exoskeleton controller is designed to encourage participation in walking instead of overriding the intrinsic behavior users' to achieve practical assistance and training.
Most safety perception and balance control approaches cannot be applied to human-exoskeleton robots because they can only be used in a specific situation like walking or standing. Analyzing why people are not safe when wearing the exoskeleton, we summarized it for three reasons: 1. insufficient movement or perception (absence): After suffering from the SCI, they do not have enough capacity to control the exoskeleton to complete the desired action to prevent loss of balance. 2. not enough active degree of freedoms (DoFs): Though the lower limb exoskeletons could improve the motor ability of the pilot, most of them did not have enough DoFs, especially active ones, to keep the human-exoskeleton system safe. 3. insufficient cooperation between pilot and exoskeleton: The pilot has good safety perception and emergency handling ability, and the motor ability of the exoskeleton is good. Still, there is no practical way to communicate between them, especially the safety status.
According to the factors above, to keep the human-exoskeleton system safe, we must have a reliable safety indicator to tell both the pilot and the exoskeleton about the current safety status of the system. But so far, we could not find an effective index to complete this mission. Among them, the Stability Pyramid Index (SPI) (Palani et al., 2018;Zhu et al., 2018) can indicate the safety of the whole system during all the movements of the human-exoskeleton system, but it also has some defects: 1) it is a static safety index that only involves the position of the CoM at that time; 2) the weight coefficient in the index is set manually without any theoretical basis; and 3) the index can only be expressed in scalars with limited information. Therefore, to improve its adaptability, we propose a new safety index named Enhanced Stability Pyramid Index (ESPI) for the exoskeleton with some obvious advantages: 1. it will represent the state of the system more fully and accurately by fusing the position, velocity, and acceleration of the human-exoskeleton system's CoM; FIGURE 1 | The architecture of the balance control strategy. When the XCoM, Base of Support (BoS), and the gait information of the human-exoskeleton system are collected, the scalar Φ and vector υ values of ESPI can be calculated, and the spatial and temporal scaling parameters (τ sf , τ tf ) for the gait generator will be calculated.
Once the scaling parameters are entered, the gait trajectory generator could plan a new gait based on dynamic movement primitives (DMPs) taking the standard gait as a reference. Additionally, joints trajectories generated by the inverse kinematic model could be executed by the exoskeleton robot to keep the system safe.
2. it will set the weight coefficient automatically with more interpretability and convenience by introducing the Time-to-Contact (TTC) in Slobounov et al. (1997) as the urgency of safety; 3. it will indicate the system's safety status and direction that is most likely to fall simultaneously with both scalar and vector.
With the help of the ESPI, a new balance control strategy for the human-exoskeleton system based on the Dynamic Movement Primitives (DMPs) is proposed. In this new balance control strategy, the scalar and vector values of ESPI could guide the spatial and temporal scaling features of DMPs. Then, the gait trajectory of the human-exoskeleton would be generated by it to keep the system's safety. Therefore, this study makes a major contribution to research on the safety of the human-exoskeleton system by 1. proposing a new safety index named ESPI for the humanexoskeleton system; 2. promoting a balance control strategy combining ESPI and DMPs; 3. evaluating the index and control strategy with simulations and experiments.
This study is organized as follows: Firstly, the methodology of ESPI and the balance control strategy based on DMPs and ESPI will be described in detail in Section II. After introducing the human-exoskeleton system, the detailed model construction, data collection, and experimental verification of the ESPI and balance control strategy based on ESPI and DMPs are presented in Section III. In the last part, the summary of the proposed safety index, balance control strategy, and future study is demonstrated.

METHODOLOGY
This study proposes a novel balance control strategy for the human-exoskeleton system with a new safety index and DMPs. The ESPI was presented to indicate the safety status of the whole system. Simultaneously, it will consider the dynamic status of the human-exoskeleton system and provide more safety information via both scalar and vector.
With the help of this index, the exoskeleton can sense the safety status of the human-exoskeleton system. Then, a new balance control strategy combining the ESPI with DMPs is built to eliminate unsafe factors according to tuned gait trajectories. The architecture of the balance control strategy shown in Figure 1 could be divided into three parts: Safety Perception, Gait Trajectory Generator Based on DMPs, and Robot Actuation.
In the control strategy, with the feedback of safety perception, the gait trajectory generator based on DMPs would tune the gait according to the relationships between the safety status and the gait. Also, the gait would be converted to joint trajectories, which could be executed by the joint servo drives.
In this section, we will describe the balance control strategy in detail according to its flow. So it comes to ESPI.

Dynamic Status Modeling
In SPI, the vertex of the pyramid is the CoM of the system, and the contact points of the ground are taken as the corner points of the pyramid. For the human-exoskeleton system, the stability pyramid consists of the CoM and the contact points of the feet and sticks. The coordinate of CoM P CoM [x com , y com , z com ] could be expressed as follows: Among it, x i , y i , and z i means the coordinate of m i , k is the total number of system parts. The CoM only contains the static position information, ignoring many dynamic details of the system. With the limited static position, the SPI could not fully picture the safety status of the entire system, especially in the human-exoskeleton system. To incorporate the dynamic information of the system into ESPI, we replace the vertex of the stability pyramid with the XCoM (Hof et al., 2005) of the human-exoskeleton system. The coordinate of XCoM (P XCoM ) is calculated based on P CoM FIGURE 2 | The Enhanced Stability Pyramid Index (ESPI) demonstration and the index of the human-exoskeleton model. In (A), an enhanced stability pyramid is composed of the bottom points noted p i and the vertex point-eXtrapolated Center of Mass (XCoM), which could be used to evaluate the safety status of a system. The stability angles over the edges and corners are marked as γ i and ψ i (i = 1, · · · , n). While in (B), the pyramid of the human-exoskeleton to evaluate the system's safety is shown. In the pyramid, the label 1 means XCoM, and the points of contact with the ground are labeled with 2, 3, and 4. according to Equation (2).
Additionally, the P XCoM [x xcom , y xcom , z xcom ] would be: where, ω 0 = g/l, l means the length of the supporting leg or stick of the human-exoskeleton system, g is the acceleration of gravity,ẋ com ,ẏ com , andż com are the velocity of CoM along the x, y, and z axis. In ESPI, the convex is P XCoM , the ground contact points of the system's feet and sticks are set as the bottom corner of the stability pyramid. The points are marked sequentially in a clockwise direction in a plan view, as shown in Figure 2A, defined as p i (i = 1, · · ·, n). They are a reference to the world coordinate system, the instantaneous position of each corner can be recorded as p i = p x p y p z T i and the polygon enclosed by them is called Base of Support (BoS). The stability pyramid of the human-exoskeleton system is shown in Figure 2B.
The edges of the stability pyramid's bottom surface marked as a i , the tilting edges, are defined as: The straight lines l i which are perpendicular to the tilting edge while passing the XCoM, are defined as: in which,â i = a i / a i and I is a 3×3 unit matrix. The stability angles over the edges of BOS γ i can be defined as the angles between the perpendicular of the tilting edge l i and the vector of gravity f g : where, and m means the whole mass of human-exoskeleton system: Similarly, the stability angles over the corners of BOS ψ i can be defined as the angles between the vector of gravity f g and the lines passing through the corner points p i and the XCoM.
in which, When it comes to the external forces marked as f ext , along every tilting axis, the equivalent force f i can be expressed as: The pilot in the human-exoskeleton system can move autonomously, so the stability index must consider the pilot's movement, and the acceleration of CoM caused by the pilot is defined as α. Therefore, the corresponding force is calculated as f a = ma. So the equivalent force of the external forces f i would be updated to: If there is an external torque marked as τ ext apart from the external forces, the equivalent force f i would be updated as f * i with an extra force item: When considering the equivalent force, the stability angles of the tilting edges and corners need to be updated. The stability angles γ i between the resultant force f * i and the perpendicular of the tilting edge l i could be updated as: where, The stability angles ψ i between the f * i and the line passing through the corner point p i and the XCoM could be updated as: in which, To evaluate the global stability of human-exoskeleton system, the minimal stability angle α could be defined: When α < 0, the equivalent force at the CoM is out of the BoS of the stability pyramid, the human-exoskeleton system would tip over. When α = 0, the equivalent force is on the BoS side of the stability pyramid, the human-exoskeleton system is in a critical safe state. But owing to the errors of measurement and calculation, the system would be unbalanced. When α > 0, the equivalent force would keep the CoM in the BoS of the stability pyramid, which means the human-exoskeleton system would be balanced. In summary, α implies the stability of the system. The bigger it is, the safer the system is. So during the whole moving process, the most important thing is to find a maximal stability angle to keep the system balanced.
The minimum stability angle under static and dynamic conditions can be calculated by the above method. For system safety under dynamic conditions, the minimum tipping energy E t also needs to be considered, which is the minimum energy consumed by the system to roll over the edge or corner point under dynamic conditions: and the currently existing gravitational potential energy E g could be expressed as follows: h is the distance between the vertex and the bottom of the stability pyramid, the height when the ground is a plane, G is the gravity of the human-exoskeleton system. After analyzing the data, we found that when α > 0, the greater the ratio of E g to E t is, the safer the system is. So, we simplify it to a dimensionless expression further: Finally, with the stability angles over the tilting edges and the corners, the prototype of ESPI Φ could be defined as follows: in which, ζ i , η i , and σ are weighting coefficients of γ i , ψ i , and ρ, respectively. For the stability angles over the edges and corners of the stability pyramid, the smaller the angles are, the greater the possibility of tipping and the greater the weight value. In this index, the CoM is replaced by the XCoM to introduce the dynamic state of the system, providing a more accurate understanding of the current dynamic safety situation of the system. Still, we need a more intelligent weighting factor than the manual one that can adjust automatically according to the urgency of the system's safety status.

Urgency of Safety Modeling
To make the weighting factors more intelligent, we employ a new factor TTC, to automatically calculate the weights. TTC is the ability to estimate the time remaining before something reaches a person or a particular place. Additionally, it means the time it would take the XCoP to contact the BoS given its current trajectory. To evaluate the system status more accurately, the time before the XCoP crosses the BoS can be defined as: in which, b is the distance between the XCoP and the boundary of BoS, V CoM means the velocity of CoM. In addition, b τ , the time to go over BOS, could be used to express the urgency of safety.
In this study, the most important information may not be the current position of CoM or XCoM. Still, when it is unsafe in the future, which could be indicated as the urgency of safety, and b τ could represent this parameter exactly. This parameter plays an important role: During this time, the safety status of the human-exoskeleton system may change with the current dynamic status. Also, with the movements of the pilot's arm and trunk, even postural control strategies, some CoM position and velocity corrections can be planned or executed to restore the system's safety.
So, the urgency of safety parameters could be defined as b τ γ i and b τ ψi for the edges and corners of the BOS, respectively. When the V com does not intersect with the edges or corners of the BoS, the variable b τ γ i and b τ ψi would be infinity. To avoid that the weight value is 0 under any circumstances, the weights for the stability angles are defined as (1 + 1 b τ γ i ) and (1 + 1 b τ ψi ). After merging the urgency of safety, the stability index Φ could be updated to: The index Φ could represent the current safety status and the future safety trend based on the static and dynamic information of the human-exoskeleton system. So, when applying the index Φ into postural control, the current and future safety status could be considered simultaneously, which would help achieve better control.

Scalar and Vector Representation
According to Equation (28), the scalar value Φ of ESPI can be calculated. The smaller the scalar is, the safer the system would be. During movement, the human-exoskeleton system should take various actions to make the index as small as possible to ensure its safety. To feedback more safety status information, besides the scalar Φ, another vector υ is introduced to characterize the change direction of the current system's safety, defined as V CoM .
With the help of Φ and υ, the human-exoskeleton system's static and dynamic status would be represented more comprehensively, which could help the pilot and exoskeleton sense safety better. So, it comes to a balance control strategy based on it and DMPs.

Dynamic Movement Primitives
After we get the safety status according to the safety perception approach, the gait trajectory for balance control needs to be generated to guide the exoskeleton to keep the system safe.
While the pilot is patient with SCI, the trajectory of the exoskeleton must be similar to a human's. That is what the gait trajectory generator based on DMPs does. DMPs are a method of trajectory control/planning from the lab of Stefan Schaal. They were presented by Ijspeert et al. (2002), and then updated (Ijspeert et al., 2013). This study was motivated by the desire to find a way to represent complex motor actions that could be flexibly adjusted without manual parameter tuning or having to worry about instability. DMPs are used to generate discrete and rhythmic movements. The base system is a point attractor for discrete movements, and for rhythmic movements, a limited cycle is used. In this study, we focus on discrete movements of DMPs. According to Pastor et al. (2011), the original DMPs system is introduced as follows: where x and v are position and velocity of the system; τ is a temporal scaling factor; x 0 and g are the start and goal positions; K is the elasticity coefficient of the system; D is the damping coefficient of the system in a critical state; f is the nonlinear function to generate arbitrarily complex curves; s is the canonical dynamical system. The differential Equation (31) above indicates a transformation system. Among them, the nonlinear function f can be defined as: where ψ i (s) is the basic Gaussian function, it can be defined as:  in which, c i is the center of the function, h i is the height, and w i is the weight of each Gaussian function. From Equation (32), the Gaussian function f is not directly dependent on time parameters, but the phase parameter s, can be expressed as: where α can be any constant. As can be seen from Equation (34), s decreases from 1 to 0 monotonically, that is called the canonical dynamical system. For a given α and τ , the corresponding parameter value s can be calculated, so the f target in Equation (30) can be expressed as below: To find the optimal weight value w i in Equation (32), the regression algorithm was used to minimize (Equation 36; Pastor et al., 2011). With these parameters above brought into Equations (30) and (31), the position x, speed v, and accelerationv of the trajectory will be obtained.
In Figure 3, the spatial and temporal scaling features of DMPs will be utilized to tune the gait based on the safety status. Spatial scaling means that once we have set up the system to follow the desired trajectory to a specific goal, we would like to be able to move that goal farther away or closer in and get a scaled version of our trajectory. This is what the (g − y 0 ) term of the forcing function handles by scaling the activation of each of these basis functions relative to the distance to the target, causing the system to cover more or less distance. In the temporal case, we would like to be able to follow this same trajectory at different speeds, represented in Figure 4. Sometimes quick, sometimes slow, but always tracing the same path. To do that, we will add another term to our system dynamics, τ , our temporal scaling term. To give it temporal feasibility, we can add the τ term in Equation (31) and τ 2 foṙ υ in Equation (30) because it is the second derivative that is. To slow down the system, you can set τ greater than 1; to speed it up, τ could be set between 0 and 1.

Flow of Balance Control Strategy
Using the VICON motion capture devices during normal walking, the joint angle trajectories of the hip and knee can be obtained. Additionally, the normalized gait trajectory could be the initial one for DMPs to learn. With the safety perception parameters, the gait trajectory generator based on DMPs will generate different trajectories to walk safely, which is shown in Figure 1.
The ESPI would indicate the safety status of the system by the scalar and vector value in safety perception. The scalar value represents the current safety status of the system, while the vector would express the direction of the most drastic safety change in the future. The scalar and vector values should be converted to the spatial and temporal scaling parameters (τ s , τ t ) for the gait generator to pass on the safety status to the next part. The relationships could be shown as the Equation (37) in Figure 5.
FIGURE 5 | The relationships between safety status and the spatial scaling parameters. In (A), the horizontal axis is the scalar value of the ESPI, and the vertical axis shows the safety status of the human-exoskeleton system. The larger the value of the vertical axis, the safer the system. In (B), the horizontal axis is the safety status of the system, and the vertical axis shows the spatial scaling parameter τ s for the gait trajectory generator based on DMPs. In (C), the horizontal axis is the scalar value of the ESPI, and the vertical axis shows the spatial scaling parameter τ s for the gait trajectory generator based on DMPs.  The spatial and temporal scaling parameters for the safety target defined in Figure 1 are τ s0 , τ t0 , while the parameters for the inputs of DMPs are τ sf , τ tf . According to the reference human gait, the gait trajectory generator based on DMPs will produce new gaits corresponding to different spatial and temporal scaling parameters τ sf , τ tf . The spatial and temporal parameters will change the stride length and stride time, respectively. The new gait will be converted to the joint angle trajectories via forward kinematics, and the exoskeleton robot could execute the motions of joints. However, since the movements of the pilot of the humanexoskeleton system are uncontrolled, the closed-loop stability of the proposed control strategy is an open issue. It is a negative feedback control system; but, the human-exoskeleton system could fall directly when the movements of the upper body or the sticks are too large. Though the stability of the control strategy is open, there are two closed-loop stable feedback control systems in the human-exoskeleton system. One is the execution system of the gait in the gait generator. The newly generated gait could be transformed to joint trajectories by the inverse kinematic model to the joints. With the trajectories being executed, the encoders will update the joint angles of the exoskeleton. Finally, the gait executed by the exoskeleton could be the negative feedback transformed by the forward kinematic model, which could ensure the stability of this execution system. The other is the robot actuation control system in the exoskeleton. The planned joint trajectories are the inputs, and the joint servos could execute them. Contrary to open-loop systems, closedloop motor controls in joint servo are designed to automatically achieve the target output condition and maintain it by feeding back the actual state of the motor, such as torque, velocity, and position.

Simulation Environment
The feasibility of the proposed stability index ESPI has been verified efficiently and safely using a human-exoskeleton model and joint controller, based on the Robot Operating System (ROS) and Gazebo. With the balance control method of a LIP, the human-exoskeleton model could walk continually without falling.
The pilot and exoskeleton need to help each other complete the movements, making them a new human-exoskeleton system. As shown in Figure 6, this model has 10 active joints and 16 active DoFs, namely shoulder, wrist, hip, knee and ankle joints on the left and right. Among them, the left and right shoulder, hip, and ankle joints have two active DoFs, while the others only have one. The model is designed based on the dynamics of the human-exoskeleton system and shows the position of the center of gravity of each segment.
To get the position, velocity, and acceleration information of the CoM, the Statically Equivalent Serial Chain (SESC) (Cotton et al., 2009;Bonnet et al., 2015) would be used. With the LIP control method (Kajita et al., 2001) and the sensor information, FIGURE 8 | The comparison of ESPI and Stability Pyramid Index (SPI) during the walking experiments. The red and blue lines and dots represent ESPI and SPI obtained from the preliminary analysis at different times. The system is safe when SPI is less than 40, while ESPI is less than 150. The data in (A-D) shows that the ESPI is more sensitive than SPI, and they are the same when the CoM's velocity is zero labelled A and B in (A,C) respectively. this model could walk smoothly forward all the time as shown in Figure 7 with the raw sensor data of ESPI being recorded.

Simulation Experiments
During the walking simulation process of the human-exoskeleton system, all data to calculate ESPI, including the position, velocity, and acceleration of the CoM, the contact position of the feet and sticks, are collected. They are referenced to the world coordinate system in the simulation environment. Also, the human-exoskeleton system would have 1-4 contact points with the ground. Since 1-2 contact points cannot maintain a BoS and cannot maintain balance for a long time, we will exclude these data and only focus on the situation of 3-4 contact points in the analysis process of this experiment.
Also, the SPI is calculated according to Equation 26 with the weight coefficients ζ i , η i , and σ set to 1. Meanwhile, according to Equations 27 and 28, the ESPI and TTC are calculated during simulation. The comparison charts of ESPI and SPI are shown in Figure 8.
As shown from Figure 8, the human-exoskeleton system is in a safe walking state, which means the two indicators marked in the figure can accurately reflect the stability of the system. Both indicators are fluctuating during walking, but the fluctuation range of ESPI is significantly greater than that of SPI. It means that ESPI is more sensitive and effective than SPI to indicate the security status of the system, especially in Figures 8B,C. Sometimes, the value of ESPI and SPI are the same, which shows that the CoM of the system reaches the minimum kinetic energy and the maximum potential energy under the control of the LIP algorithm, as shown in Figures 8A,C labeled as A and B, respectively. But in most cases, the ESPI value is greater than the SPI, and the reason is that the CoM has a variable speed, which also proves the ESPI is more sensitive than the SPI.
In the simulation, the system takes the XCoM as the vertex and forms five types of stability pyramid expressed as T1, T2, T3, T4, and T5 with different combinations of contact points shown in the Table 1. All stability pyramid are represented in Figure 9. And the urgency of safety is represented in Figure 10.

Human-Exoskeleton Experiments
After validating the ESPI in the human-exoskeleton simulation, the balance control strategy will be verified by the humanexoskeleton system shown in Figure 11. The experiments are carried out on the exoskeleton system AssItive DEvice for paRalyzed patient (AIDER), and its basic functional diagram is shown in Figure 11A. AIDER consists of a computer-based control unit, battery, IMUs, four motor units, and smart shoes with pressure sensors. The battery will provide power for this system, the control unit could process the data of the system and generate gaits, the motor units receive and execute the control signals with the joint angles uploaded, the smart shoes provide support and feedback on the foot pressure, and the IMUs could offer the attitude, angular velocity, and angular acceleration. During the experiments, the pilot is tightly connected to the exoskeleton through ties; thus, the attitude, velocity and acceleration estimated by the IMU labeled as 1 in Figure 11B could represent this status of the pilot's upper body. Furthermore, the attitude and pressure of the sticks and joint angles could be obtained by the sensors labeled 2 and 3, respectively in Figure 11B.
To make it clear, we presented the human-exoskeleton model shown in Figure 12. The joint angles and links are all defined in it. The position of the support foot is P sp,f , and it could be the origin of the coordinate system shown in Equation (38). Additionally, the position of other joints could be obtained by the forward kinematics with the joint angles and the length. All the joint angles like θ sp,h , θ sp,k , θ sp,a , θ sw,h , θ sw,k , and θ sw,a could be measured directly by the encoders installed in the exoskeleton, the length of the links like l to , l th , l as , l sh , h f , and l com could be measured before experiments.
in which, ω is the width of the shoulder. The position of support and swing hip P sp,h , P sw,h are shown in Equations (39,40).
x sp,f + l sh * sin θ sp,a + l th * sin θ sw,h − w 2 z sp,f + h f + l sh * cos θ sp,a + l th * cos θ sw,h    T (39) Then, based on the position of the swing hip joint and the joint angles, the position of swing foot P sw,f could be calculated in Equation (41).
After getting P sp,f and P sw,f , we are going to obtain the position of the contact points between the left and right stick and the ground, which are expressed as P la and P r a . Before it, the position of left and right shoulder P l,sh , P r,sh could be obtained.
Also, the position of CoM could be expressed as below: in which, l com is the length between the hip joint and the IMU on the back, θ t is the inclination angle of the torso, which could be estimated by the IMU labeled 1 in Figure 12.
When the sticks contact the ground, the positions could be calculated according to Equations (45,46). Among them, the angles θ lax , θ lay , θ rax , and θ rax are estimated by the IMUs labeled 2 and 3, respectively. All the IMUs used in this study would get the velocity, acceleration, and attitude with the help of Digital Motion Processor developed by InvenSense. Before being installed on the human-exoskeleton system, each IMU will be calibrated. First, the IMU will be placed still and horizontally; then, the offset value FIGURE 9 | Five different types of stability pyramids with the safety change direction vector in ESPI are represented as T1, T2, T3, T4, and T5, respectively. Different combinations of contact points abbreviated as lf, rf, ls, and rs could make different types of stability pyramids with the XCoM as the vertex. Meanwhile, the vectors marked as the red arrow above mean the safety change direction.
FIGURE 10 | The urgency of safety based on the minimal Time-to-Contact (TTC) of the edges and corners of the BoS. As the velocity of CoM changes, the TTC will also vary as shown in (A-D). When the velocity becomes 0, b τ becomes infinity, and the urgency of safety will be 0 as shown in (A,C) marked as A and B respectively. This is exactly consistent with the results of the index shown in Figures 8A,C. of each coordinate axis of the gyroscope and accelerometer will be saved so that the calibration function can be called to calibrate the sensor every time it turns on. Thus, the raw data of sensors are calibrated. After all the IMUs are installed, the system will first calibrate the IMU attitude angles. When the human-exoskeleton system stands upright, the data at this time will be regarded as the initial value θ 0 , and then the value at time t could be expressed as θ t . Finally, the angle change θ we need can be expressed by the following equation.
With the calibrated sensor data and equations above, the XCoM and BoS of ESPI could be estimated. The XCoM could be estimated with the sensor data of IMU labeled 1 in Figure 12 FIGURE 11 | (A) is the basic functional diagram of the exoskeleton, and (B) is the human-exoskeleton system diagram. In the human-exoskeleton system, the pilot could stand like this with the exoskeleton. To collect the system's safety status, a lot of sensors are installed in the exoskeleton. 1: An Inertial Measurement Unit (IMU) in the backpack of the exoskeleton to sense the attitude and velocity of the pilot's upper body to estimate the position of the system's XCoM labeled as 5. 2: The IMU and pressure sensor to sense whether the crutch is in contact with the ground and the corresponding posture of the crutches, which could help to calculate part of BoS labeled as 8 and 9. 3: The angle encoder module to get the joint angles of the exoskeleton to get the position according to the forward kinematics module. 4: The pressure sensor under the foot to detect whether the foot touches the ground and estimate part of BoS labeled as 6 and 7.
according to Equations (3) and (44). Meanwhile, with the help of joint angles and links' length, the BoS consisted of P sp,f , P sw,f , P la , and P ra labeled as 5, 6, 7, and 8 in Figure 11B could be estimated with the help of Equations (38), (41), (45), and (46). So, the ESPI and the scaling parameters (τ s , τ t ) for the gait generator are obtained according to the relationships shown in Figure 5. Once the parameters enter, the gait trajectory generator based on DMPs will work with the standard gait as a reference. Additionally, the new gaits could be planned by the gait generator based on the DMPs and executed in the exoskeleton system shown in Figures 13, 14.
Finally, the joint trajectories of the new gait will be transformed by the inverse kinematics module and executed by the exoskeleton system.
When the safety status is not urgent, the τ t could be bigger than before, and the gait trajectory could stay the same with the reduction of speed. The normal and temporal scaled gaits are shown in Figure 13A, while the hip and knee joint trajectories of normal, temporal scaled, and the feedback of the exoskeleton during are represented in Figures 13B-E. If the safety status changes and the stride length needs to be smaller than before, the τ t could be bigger while the τ s would be smaller than before. The new gait and joint trajectories could be shown in Figure 14 like the temporal ones above. Additionally, all the planned gaits are executed well by the exoskeleton system, with the errors between the planned trajectories and the actual execution ones meeting the requirements of the system, which proves the practicability of the ESPI and the balance control strategy.
FIGURE 12 | Human-exoskeleton model with sticks. It consists of the torso, arms, legs, and feet, which are linked by shoulder joints, hip joints, knee joints, and ankle joints. The human arms connected to the sticks are defined as left arm+stick and right arm+stick, respectively. The joint angles of lower limbs are defined in the model: the hip angles of support leg and swing leg θ sp,h , θ sw,h , the knee joint angles of support leg and swing leg θ sp,k , θ sw,k , and the ankle joint angles of support leg and swing leg θ sp,a , θ sw,a . They are measured by the encoders installed on the joints of the exoskeleton. Additionally, the upper limbs' joint angles are defined: the torso inclination angle θ t , the shoulder angles corresponding to the movements of the arms and sticks of left and right in the x-axis direction are θ lax and θ rax . In contrast, the shoulder angles resulted from the movements in the y-axis direction are θ lay and θ ray . Also, the length of the regions are defined as follows: l to : the length of torso, l as : the length of left/right arm and stick, l th : the length of the thigh, l sh : the length of the shank, and h f : the height of the foot. The IMUs are installed at the torso, the arms and sticks of left and right labeled 1, 2, 3, and the length from label 1 to the hip joint is defined as l com .

CONCLUSIONS
To be able to evaluate the safety status of the human-exoskeleton system dynamically, this study proposed ESPI based on SPI with the following advantages: 1) it integrates dynamic information by introducing XCoM, 2) it can adjust the weight automatically by introducing the TTC as the urgency, and 3) it will reflect the safety status better through scalar and vector. By establishing a human-exoskeleton model and completing the LIP balance walking experiments in Gazebo, the effectiveness and sensitivity of ESPI have proved to be better than that of the SPI. Five different types of stability pyramid and the safety change FIGURE 13 | The temporal scaled gait and joint trajectories. The gait could be composed of the trajectories during stance and swing. For example, in (A), the dotted lines are the normal ones used as reference labeled as N-stance and N-swing, and the solid ones are the temporal scaled marked as T-stance and T-swing. (B-E) The hip and knee joint trajectories of the normal, temporal, and actual system are labeled starting with N, T, and R, respectively.

FIGURE 14 |
The temporal-spatial scaled gait and joint trajectories. In (A), the dotted and the solid are the normal and temporal-spatial gaits, including stance and swing phase, and they are labeled as N-stance, N-swing, TS-stance, and T-swing, respectively. (B-E) The data of the actual system are the solid lines labeled starting with R, while the dotted ones are the normal and temporal-spatial joint trajectories marked beginning with N and TS, respectively. The errors of the trajectories between the feedback of the actual system and the planned are acceptable. direction of ESPI have been shown. Simultaneously, with the help of the ESPI, the balance control strategy for the humanexoskeleton based on DMPs is proposed. With the help of the scalar and vector values, the gait generator could tune different gaits to keep the system safe according to the spatial and temporal features of DMPs. Finally, the balance control strategy that combines ESPI and DMPs has been validated based on the human-exoskeleton system.
In the future, it will be important to explore the potential adaptability of ESPI to people of different weights and the balance control strategy on more active joints.

DATA AVAILABILITY STATEMENT
The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author.

ETHICS STATEMENT
The studies involving human participants were reviewed and approved by the Ethics Committee of the University of Electronic Science and Technology of China. The patients/participants provided their written informed consent to participate in this study. Written informed consent was obtained from the individual(s) for the publication of any potentially identifiable images or data included in this article.

AUTHOR CONTRIBUTIONS
FX contributed to the conception and design of the study, performed the experiments, and drafted the manuscript. WY contributed to data collection. JQ and HC guided the writing of the study. All the authors contributed to manuscript revision, read, and approved the submitted version.