Human inspired fall arrest strategy for humanoid robots based on stiffness ellipsoid optimisation

Falls are a common risk and impose severe threats to both humans and humanoid robots as a product of bipedal locomotion. Inspired by human fall arrest, we present a novel humanoid robot fall prevention strategy by using arms to make contact with environmental objects. Firstly, the capture point method is used to detect falling. Once the fall is inevitable, the arm of the robot will be actuated to gain contact with an environmental object to prevent falling. We propose a hypothesis that humans naturally favour to select a pose that can generate a suitable Cartesian stiffness of the arm end-effector. Based on this principle, a configuration optimiser is designed to choose a pose of the arm that maximises the value of the stiffness ellipsoid of the endpoint along the impact force direction. During contact, the upper limb acts as an adjustable active spring–damper and absorbs impact shock to steady itself. To validate the proposed strategy, several simulations are performed in MATLAB & Simulink by having the humanoid robot confront a wall as a case study in which the strategy is proved to be effective and feasible. The results show that using the proposed strategy can reduce the joint torque during impact when the arms are used to arrest the fall.


Fall prevention strategies for bipeds
Due to the inherent instability of bipedal locomotion [1,2], falls are inevitable for humans, despite their possession of excellent balance. A common strategy to arrest the falls of humans is to use their arms to protect the head, trunk and hip [3]. However, the protective arm movements are not without risk, as they often become a site of fall-related injuries [4,5]. Therefore, identifying potential factors that lead to successful and safe fall arrest strategies has gained much attention. Chiu and Robinovitch [6] proposed a model to predict impact forces during falls on the outstretched hand. DeGoede and Ashton-Miller measured the effects of a fall arrest strategy on the peak hand impact force and explored the strength requirement necessary to arrest a fall [7]. Chou et al [8] investigated the effect of elbow flexion on the upper limb impact forces during a fall. Kim and Ashton-Miller [5] isolated critical biomechanical factors in fall arrests, such as contact pose and joint velocity during contact, by simulating a bimanual forward fall. Lattimer et al [9] investigated age-related differences in upper limb strength and fall arrest strategy differences during a simulated fall and assessed the relationships between muscle strength and biomechanical variables. In [10], Borrelli et al concluded that protective arm reaction strategies are modulated according to fall height.
Similar to humans, humanoid robots are also at risk of falling, even though various balance control methods have been proposed. These can be categorised into: stepping [11], ankle [12], ankle-hip [13], and online learning [14] strategies. However, falling remains a risk when excess external forces or obstacle constraints are imposed. To minimise damage, falling trajectory optimisation [15,16], pose reshaping [17] and adaptive compliance control [18,19] have been proposed when a fall is inevitable. To generate on-purpose impacts with rigid objects, Wang et al proposed an impact-aware [20] control method with task-space quadratic optimisation. These mentioned strategies mainly focus on how to reduce damage during contact. Recently, there has been an increase in research focussed towards fall prevention strategies. Wang and Hauser [21] presented a real-time strategy that exploited external objects to stabilise a falling robot. Hoffman et al [22] presented a novel strategy which combines passive stiffness of a compliant joint and active stiffness control by making hand contact with a wall to prevent falling. This work provides a feasible compliant control strategy for the robot to prevent falling with the upper limb, but the influence of the arm posture on the control strategy and how to choose the arm posture have not been studied. To solve this problem, we have proposed an upper limb fall impediment strategy for humanoids by imitating human behaviour [23]. However, that strategy only proposed and evaluated a posture selection method inspired by humans, the scientific principles of why people choose postures this way have not been explored. There still lacks a comprehensive strategy for humanoid robots to prevent falls, including fall detection and fully exploiting upper limb contact with environmental objects.

Objectives and outline
The aim of this study is to design an optimal fall prevention strategy for humanoid robots. Inspired by the natural reaction of humans, to actively make hand contact with nearby walls to arrest falls, we propose a hypothesis that humans favour to select the pose of the arm that maximises the value of the stiffness ellipsoid of the endpoint along the impact force direction.
Based on this principle, we present a novel strategy for humanoid fall prevention by using environmental contacts. The proposed strategy consists of three segments: • A capture point (CP) [11] method is adopted to detect whether the robot will fall after being pushed. • Once a fall is inevitable, an optimisation problem is formulated to find the optimal arm contact pose for the humanoid robot to actively seek contacts with the environmental object. The objective function is designed to choose an arm pose that gives the maximum value of the stiffness ellipsoid of the endpoint along the impact force direction. • When impact occurs, the upper limb acts as an adjustable active spring-damper and absorbs impact shock to stabilise the robot. The validity of the proposed strategy is demonstrated in a simulated environment as shown in figure 1, where the robot is able to prevent falling from a strong push by using their arms to gain contact with a vertical wall, and compliantly interact with it afterwards. The presentation of this work is arranged as follows. Section 2 presents the related work about the problems that our strategy addresses and proposes a hypothesis inspired by human fall arrests. Section 3 details the concept principle about the proposed hypothesis. Section 4 details the proposed strategy. Section 5 demonstrates simulation results and, finally, section 6 concludes the paper.

Fall arrest
A fall arrest can be divided into the following three phases: (1) fall detection, (2) pre-impact and (3) postimpact [9]. Fall detection is to detect the occurrence of a fall event [24]. The earlier that falls are detected, the better it is for the robot to react [17,25]. In recent years, the 'prior-to-impact fall detector' has attracted research attention for its potential application in humans by creating a fall alarm system and wearable fall injury prevention system [25]. The rationale is to reveal unexpected and potentially dangerous postural transitions which can result in a fall, by using wearable sensors like inertial measurement units [26]. The detection algorithms ranged from threshold-based [27,28], baseline [29] to neural network [25] and machine learning [26].
To minimise damage and avoid falling, fall detection techniques have been proposed for robots. In [17,22], fall detection utilises the angle between the body and vertical axis. This method is simple and fast to calculate but has poor predictability. To predict falls early and maximise the lead time to fall, abnormality detection method, experiential learning [30] and multi-way principal component analysis (MPCA) method [31] are developed for the detection of falls. Compared with the fall detection using anomaly detection method which has a problem of deciding the threshold, the fall detection based on experience learning has an algorithm that can be easily implemented with good detection performance. The MPCA method has a successful detection probability of up to 90% while assuming that the full state information of the robot is known. Additionally, machine learning is applied to fall prediction in [32] but requires prior training. However, it is still a difficult problem to quantitatively judge how large a disturbance can be so that humanoid robots may recover using feedback control. A CP is a point on the ground where the robot must step to in order to bring itself to a complete stop [11], which is suitable for judging whether the robot needs to take steps to recover from a disturbance. If the CP is situated within the support polygon of the foot, the robot can recover from the push without stepping or getting any other external support. If the CP exceeds the foot support area, it will fall unless a step or other action is taken to prevent it. Therefore, we consider the CP method to predict falling due to its advantages of good predictability, fast calculation and no training required.
The pre-impact step is defined by the time period from when the fall is detected until impact [33]. The focus in this research is the pre-impact step because during this period, the activities of the upper limb have a major influence in post-impact response during fall arrests [5]. How does a human decide their arm posture when making contact with the environment? And how can this strategy be transferred to a humanoid robot? To understand human behaviour, we provide an analysis of human fall prevention behaviour to illustrate the role of arm posture in the interaction between humans and the environment.
In order to prevent falls by using the arms, the endpoint of the arm interacting with the environment needs to have proper stiffness. There is some evidence that higher stiffness may increase the risk of injury, while lower stiffness may result in collapse [34]. The stiffness of the arm interacting with the environment depends on both the posture of the arm and the stiffness of the joints [35,36]. The muscle mechanism is essentially a force dampening system which adjusts the amount of shock accordingly through eccentric contractions about the joints [9]. The joint resistance produced by the corresponding deformation of muscle can be defined as joint stiffness [37]. For example, if the elbow joint maintains a high stiffness when contact occurs, it may result in a high damage risk due to under attenuation [8,10,38]. On the other hand, low joint stiffness may result in excessive joint gyration, thus not being able to support the body [33]. But for humans, the stiffness of joints is limited by muscle strength. If the joint has insufficient stiffness due to muscle weakness, the individual can stretch the arm to compensate for this due to there being higher joint stiffness demands to control a forward fall with increased bending of the arm [6,8]. However, there are higher joint stiffness demands to break falling, which increases with elbow flexion [8], and it is also possible that older adults can generate extended elbows at impact as a compensatory mechanism for weaker muscles [5].
Although it is possible to realise the same endpoint stiffness through joint control in different arm configurations [39], arm configurations play a major role in achieving a certain physical interaction behaviour [40][41][42]. One reason is that to achieve an arbitrary stiffness, the desired endpoint force/displacement relationship must be mathematically mapped to the joint torque/displacement, which requires that the joint torque control depends on the joint configuration and the joint displacement in a coupled way. A stiffness ellipsoid is the classic method to describe specifications of the desired force/displacement behaviour in such problems [43], which transforms the joint stiffness to end-effector stiffness. However, the stiffness ellipsoid is widely used for Cartesian stiffness control in robotics, such as impedance control, and rarely used for posture selection. On the contrary, to control the stiffness of arms, humans predominantly use arm configurations. Experiments show that the neural, mechanical, and geometric features make the human arms behave like a spring and the desired response in different directions can be represented by the stiffness ellipsoid [44]. Therefore, it is worth exploring how humans choose postures when preventing falls, and the stiffness ellipsoid is a necessary concept. The greater the value of the stiffness ellipsoid, the greater the adjustable range of stiffness.

Hypothesis
Based on the above analysis, we propose a hypothesis that: when a fall is inevitable and requires environmental support via hand contact, in order to ensure the proper interactions and contact stability for a diverse range of tasks, humans favour an arm posture that maximises the value of the stiffness ellipsoid of the endpoint along the impact force direction. This is because the greater the value of the stiffness ellipsoid along the impact force direction, the larger the range of the recovery force can be generated at the endpoint. This hypothesis contains two implicit sub-hypotheses: (a) The chosen pre-impact arm configuration should minimise the deviation between the longaxis of the stiffness ellipsoid of the endpoint and the impact force direction. Since the value of the stiffness ellipsoid along the long-axis direction is the more favourable in a set configuration, the displacement in this direction can generate the maximum range of forces under stiffness control.
(b) The long-axis length of the stiffness ellipsoid of the arm end-point should be as long as possible. Under the condition that (a) is satisfied, as the length of the long-axis increases, so does the value of the stiffness ellipsoid of the endpoint along the impact force direction. Thus, this results in a sufficient stiffness range.
To the best of our knowledge, this work is the first analytical study of the fall arrest strategy of humans using the concept of a stiffness ellipsoid. This hypothesis is also applicable to the posture selection within the design of the fall arrest strategy, as impedance control is a well-known technique that generates task-adapted restoring forces in response to environmental displacements. The desired response in different directions, often represented by the stiffness ellipsoid, can be achieved by changing the joint control parameters and the geometry of the robot [43].
The post-impact step describes the movement occurring immediately after impact until stabilisation. In this phase, the accumulated momentum during the fall should be absorbed using contact forces [19]. One efficient way to achieve a fall arrest is the soft-arm landing of humans [45], which would create smaller impact force peaks and more time for falling energy absorption [5]. Compliance control has been widely used in humanoid robotics as an effective method to ensure appropriate interactions and contact stability. Hoffman et al [22] presented an impedance control algorithm combining both active stiffness and passive stiffness for a compliant joint robot to handle interactions between the arms and environments. Faraji et al [46] implemented Cartesian stiffness control and balance control based on inverse kinematics in a torque controlled robot. Samy and Kheddar [17] suggested using active compliance through instant proportionalderivative (PD) gain reduction to realise compliant spring-damper behaviour. Furthermore, QP-based adaptive-gain compliance control and active adaptive compliance based on predictive control are proposed to improve the momentum absorption's performance [18,19]. In this work, we consider a PD gain reduction compliance control strategy for post-impact, where the PD gains are selected by the desired Cartesian stiffness.

Conceptual principle
The Cartesian stiffness ellipsoid is defined by the following parameters. Consider the upper limb as an n degrees of freedom manipulator, whose hand acts as the end-effector, fixed to a wrist in an mdimensional task space. Let τ be the joint torque matrix, q be the joint configuration and K q = diag(k q 1 , k q 2 , . . . , k q i , . . . , k q n ) be the joint stiffness matrix, where k q i represents the stiffness of the ith joint. Assuming there are rigid connections between joints, the relationship between the joint deformations, δq, and the joint torques, τ , can be described as Mapping of the joint deformations into Cartesian end-effector displacement, δx, is described by the linear relationship, where J (q) is the forward kinematic Jacobian matrix. Considering the relationship between the joint torques and the generalised force F of the end-effector means we can obtain the extrapolated form , is the Cartesian stiffness matrix. In order to investigate the joint torques that produces one unit deformation at the end-effector, let: (δx) T (δx) = 1.
Substituting (4) into (5), obtains In a given configuration, (6) can represent an mdimensional force ellipsoid, also known as the Cartesian stiffness ellipsoid. A point on the ellipsoid indicates the magnitude of the generalised force applied to the end-effector, which is required to produce one unit displacement along the direction of that point.
Imitating human behaviour to arrest falling is a feasible solution. There are many experimental studies to investigate critical biomechanical factors in fall arrests using the upper extremity [5-10, 45, 47, 48]. Among them, Kim and Ashton-Miller [5] investigated the posture of humans when arresting falls. In the simulated fall experiment, subjects were asked to fall forward in front of a 10 • inclined wall, where the distance between the standing position and the wall is 0.4 m, 0.6 m, 0.8 m and 1.0 m, corresponding to 64%, 95%, 126% and 157% of the arm length respectively. The subjects were divided into two groups according to age, but had similar height and weight. The mean height and weight were 173.6 cm and 74.6 kg of the older groups, while the younger groups were 177.8 cm 75.5 kg respectively. Initially, the subjects stood on an elevated platform, and leaned forward with hands in contact with the lean control cable at a 10 • vertical angle. The cable was then released at a random time and the fall arrest action was recorded. The subjects were asked to move the hands, upper arms and forearms freely but the torso, head and lower limbs as one. Table 1. The joint position at impact of the fall arrest experiment in [5], the unit of the angle is (deg) and the unit of s imp and s max is (N m −1 ).  In order to understand the hypothesis presented in section 2, and the strategy of human fall arrest, we plotted the landing pose of the subjects as they landed and the end-effector stiffness ellipsoid of the upper limbs in the experiments of [5]. Table 1 shows the joint angle parameters at the time of impact, where θ ankle is the angle between the trunk and direction of gravity, θ shoulder is the angle between the upper arm and trunk, and θ elbow is the angle between the forearm and upper arm. The size of each body part is calculated by the 50th percentile male, whose size and weight represent average values for adult males [49] of which the height is 178 cm and the weight is 78 kg. The size of each part can represent the average value following the normal distribution.
The contact pose and stiffness ellipsoid of the arm is shown in figure 2, in which the joint stiffness matrix is K q = diag(1 N rad −1 , 1 N rad −1 ). This is a unit value to show the shape of the stiffness ellipsoid. The human body is simplified into a three-link mechanism with a trunk length of 1.41 m, an upper arm length of 0.338 m, and a forearm length of 0.297 m. The role of the arm is to act as a spring system between environmental objects and the body, in order to break falling and decelerate the trunk. From contact to stabilisation, the trunk emulates an inverted pendulum model (IPM). The impact force direction is consistent with the shoulder joint motion, which is perpendicular to the trunk. To stabilise the inverse pendulum, an effective force is applied-the force component along the impact force direction.
We calculate the angle θ imp , between the long axis of the stiffness ellipsoid and the impact force direction: s imp represents the value of the stiffness ellipsoid along the impact force direction, while s max is the value of the long axis of the stiffness ellipsoid as shown in table 1. It can be seen that the stiffness ellipsoid long axis direction is close to the impact force direction when there is sufficient space for the arm to move as shown in figures 2(c), (d), (g) and (h). When the object is closer to the standing point, there is a large angular deviation between the long axis and the impact force direction, due to the arms being constrained by launch time and work space as shown in figures 2(a), (b), (e) and (f). Thus, if humans want to decrease θ imp , they should increase the shoulder angle and elbow angle. However, the length of the long axis may decrease as the elbow joint angle increases.
The position of the elbow joint affects the axis length and orientation of the stiffness ellipsoid, while the position of the shoulder joint only affects the orientation of the stiffness ellipsoid. The relationship between the elbow angle and the long axis length is shown in figure 3. Within a certain range, the stiffness ellipsoid long axis length increases as the joint angle decreases, while the opposite occurs if beyond the range. Figure 3 shows this trend as in the range of 10 • -170 • , the length of long axis will tend to infinity when the elbow angle is from 0 • to 180 • , this is due to singularity within the configuration. For example, the configuration [11 • , 117.5 • ] for the condition in figure 2(a) can make the long axis of the stiffness ellipsoid consistent with the impact force direction, but the stiffness ellipsoid value along the impact force direction is 17.9 N m −1 , which is lower than the stiffness ellipsoid value 18.1 N m −1 for the configuration chosen by humans as shown in table 1. Accordingly, for figure 2(b), the configuration [29 • , 100 • ] makes the long axis consistent with the impact force direction, but the maximum value of the stiffness ellipsoid of the endpoint is 21.4 N m −1 , which is lower than that of 25.7 N m −1 . In the above examples, humans tend to choose a configuration with a greater stiffness ellipsoid value along the impact force direction. Alternatively, when comparing figures 2(c) and (d), humans favour using a stretched arm (smaller elbow angle) to acquire a greater value of the stiffness ellipsoid along the impact force direction. The same conclusion can also be drawn from the comparison of figures 2(g) and (h). Additionally, the value of the stiffness ellipsoid of the older group along the impact force direction is larger compared to the younger group, which also explains the phenomenon summarised in [5], why the older adults tend to choose a more stretched arm. This is because the muscles of the elderly are weaker, and the more stretched posture makes the value of stiffness ellipsoid greater, thereby preventing support failure at impact. The results support the hypothesis we present in section 2, where protective arm arrest strategies that humans favour are arm poses with the maximum value of stiffness along the impact force direction of the arm end-effector during contact. The findings also confirm that arm arrest reactions are in accordance with the two implicit hypotheses described in section 2.

Fall prevention strategy
In order to avoid falling, this section will focus on how to realise human-like behaviour in humanoids. The fall avoidance strategy includes three purposes: predict falls quickly and effectively, find the optimal posture while considering the hypothesis proposed in section 3 as well as the robot's physical constraints and make contact with environmental objects compliantly to reduce damage. Consider the scenario demonstrated in figure 1, an external force is applied to the robot in the sagittal direction. The robot may not be able to maintain balance, but can prevent falling by exploiting an external physical object in front of it. The object is defined as a vertical wall in this paper. In practical applications, the shape of the wall and the distance between the robot and the wall would be detected by visual sensors. The robot must react quickly and efficiently to support itself using only the upper limbs, therefore to solve this problem, the process is divided into three stages as follows.

Fall detection
It is known that for a push of a large magnitude, a human or a humanoid robot must react, such as stepping to avoid falling [11]. The CP can be used to determine when and where to take a step to recover from a push. In this work, we consider the situation where the robot cannot take a step due to obstacle constraints but can avoid falling by using an arm to gain contact with other objects, where the CP can be used to detect falling as a predictive method.
The CP is calculated as follows. Assume that the robot is simplified as a linear IPM [50,51], when an external force is applied on it, the forward acceleration of the centre of mass (CoM) can be calculated bÿ where g is the gravitational acceleration constant, x CoM and z CoM are the CoM coordinates. The linear inverted pendulum orbital energy E LIP can be calculated by which can represent a mass-spring system with a unit mass [50]. When E LIP > 0, the CoM will have enough energy to go over the foot, and when E LIP < 0, the CoM will stop and reverse directions. When E LIP = 0, the CoM will come to rest over the foot. The equilibrium state E LIP = 0 defines two eigenvectors of the system [11],ẋ From (9) we obtain the CP When the CP is situated within the foot support region, the robot can recover from a push without establishing other contacts with the environment. Otherwise, it must take a fall prevention action. Therefore, the fall is detected when where x foot represents the limiting value of foot support in sagittal direction of the fall.

Contact pose optimisation
After triggering the fall prevention manoeuvre, the reaction controller must choose a configuration of the arm coming into contact. Based on the hypothesis proposed in section 2, a contact pose optimiser is designed to choose an ideal pose of the arm that maximises the value of the stiffness ellipsoid of the endpoint along the impact force direction. Due to limited actuation and safety constraints, the undesired momentum cannot be absorbed immediately. However, the momentum must be absorbed before reaching the positional limit (joint limits and environmental collision). Therefore, the arm should have the necessary compliance to sustain all external forces without the body collapsing. The proposed configuration optimiser improves the performance of the arm by using a limited supply of time and actuation power to absorb the momentum accumulated during falling. Let us consider the scenario shown in figure 1, the pose optimisation function can be defined as where q = θ, α x , α y , α z , β T represents the joint position of the arm. To generalise the method, the objective function is applied to the two arms separately. θ is the ankle angle, α x , α y and α z are the shoulder angles around x-axis, y-axis and z-axis respectively, and β is the elbow angle. Due to the wrist and fingers being weaker than the shoulder and elbow joints, the contact force should be applied on the forearm limit, not only on the hand or the fingers, thus the wrist joint can be simplified as having negligible effect on the Cartesian displacement stiffness of the endeffector. S (q) is the Cartesian stiffness matrix of the arm end-effector. v is the unit direction vector of displacement of the shoulder joint when contact occurs. In order to avoid calculation of the inverse Jacobian matrix, (12) is changed to minimise the compliance, so that min where C (q) is the Cartesian compliance matrix of the arm end-effector.
There is a positional constraint that the endeffector should place on the physical object, defined by f r x e−e , r y e−e , r z e−e = 0, where the function, f x, y, z = 0, represents the profile of the physical object in the workspace, and r e−e = r x e−e , r y e−e , r z e−e T is the Cartesian kinematic coordinate of the end-effector (e-e).
To avoid singularity and decrease the displacement of the shoulder joint and elbow joint, additional inequality constraints should be inserted to bound the joint position within certain limits. Therefore, a few constraints are defined: In this study, we are interested in only the arm behaviour, therefore, the ankle joint θ is considered as non-controlled and moving solely due to gravity. After the fall prevention strategy is triggered, only the shoulder and elbow joints are controlled to reach the optimised pose. These joints are expected to reach the optimised target position as fast as possible firstly, and then keep the optimised arm pose until it is in contact with the wall. To ensure that the arm will have sufficient time to reach that target position, the lower limit for ankle position θ can be calculated by where the x 0,CoM andẋ 0,CoM are the position and velocity of the CoM at the time when the fall prevention is triggered, l CoM is the length from the ankle joint to the CoM, t f is the maximum time needed for the arm to reach the optimised target position driven by the maximum joint velocity, which is defined by where ω αx, max , ω αy, max , ω αz, max and ω β, max are the corresponding maximum joint velocities.
To avoid slip when impact occurs, the ratio between normal contact force and tangential contact force should be limited to less than the friction coefficient. The underactuated robot system with Lagrangian dynamics is given by (18) where M (q) is the generalised inertia matrix of the robot. H (q,q) and G (q) are vectors containing centrifugal and Coriolis forces, and the gravitational vector, respectively. τ = 0, τ αx , τ αy , τ αz , τ β is the actuated joint torque, and F ext is the contact force. δx represents the displacement between end-effector and shoulder joint. Given the control torque: (19) where K c and D c are the Cartesian stiffness matrix and Cartesian damping matrix of the end-effector. Substituting (19) into (18), assuming the mass of the arm is negligible relative to the body, we can get To avoid slipping, the angle between the contact force and the normal vector n of the surface should be within the range of the friction cone: where μ f is the contact coefficient of friction. Therefore, the final optimisation problem is subject to f r x e−e , r y e−e , r z e−e = 0, q min q q max , This formula is used to calculate the desired configuration of one of the two arms. However, the value of their constraint conditions should be based on the positional relationship between the standing position and the external object.

Compliance control
The fall arrest control is divided into two phases. The first is the pre-impact phase, where a joint stiffness controller is used to ensure the arm maintains a high stiffness movement to reach the optimised configuration as soon as possible just before the impact. The second is the post-impact phase, where the controller switches to Cartesian stiffness control. When the endeffector gains contact with the physical object, the end-effector is set to low Cartesian stiffness for compliant behaviour until the CoM of the robot stops moving. The arm is equivalent to a spring-damper system with a specific stiffness and damping, and provides a force to absorb the momentum of the robot.
Once the accumulated momentum of the robot during the fall is absorbed, the Cartesian stiffness of the arm is increased to maintain stability. In pre-impact phase, consider the low-level actuator controller as where δq = q − q d is the joint position errors and δq =q −q d is the joint velocity errors. q d andq d are set to the desired joint position and desired joint velocity just before the impact, respectively. K q and D q represent the diagonal matrices of PD gains. K q and D q are set to very high to make the actuators track the reference trajectory as soon as possible, accounting for perturbations, inertia and dynamics from initialisation. A collision detector is used to determine whether the end-effector is in contact with the supporting surface. The advantage of this detection method is that no additional sensors or mechanical devices are required [52]. Considering (18), when a collision occurs, the actual accelerationq is expressed as (24) where τ ext = J T F ext are the joint torques caused by the external force, F ext .
If we set the observer output r as the observed value of τ ext , then the observer dynamics can be defined aŝ where is the gain matrix of the observer. The observer output is whereq(t 0 ) is the initial joint velocity. When there is no impact force, the output value of the observer should be close to 0. When the output exceeds the set threshold r thr , it can be considered that the endeffector is in contact with the environment. Once the contact is detected, the controller switches to the Cartesian stiffness controller as in (19), the Cartesian position errors δx and velocity errors δẋ is calculated by Substitute (28) into (19), thus the Cartesian stiffness control during contact is In order to be compliant during contact to lessen damage, the Cartesian stiffness should be decreased. After the CoM velocity decreased to 0, and the robot successfully stabilises itself, the Cartesian stiffness should be then increased.

Case study and discussions
In order to validate the proposed fall prevention strategy, simulations were conducted in MATLAB & Simulink by taking the scenario depicted in figure 1 as case study. In this case, the robot was pushed by an external force and fell forward, the linear momentum of this impact was 8.8 Ns. The parameters of the robot are listed in table 2. The environmental object model used can be referred to [53], which represents the environment as a spring and damper. The stiffness K e is 10 6 N m −1 and the damping D e is 250 N (m −1 s −2 ), and the profile is defined by f x, y, z = ax + by + cz + d located at distances x object from the standing point in front of the robot, these parameters represent a hard vertical wall [54]. The upper body of the robot is controlled using the controller proposed in section 4, the waist and the lower body motions used position control, while the ankle joint is not controlled. The movement of the arm only considers the shoulder pitch joint and the elbow joint. In the following discussion, the shoulder joint represents the shoulder pitch joint. ) in x-z space, was realised using τ in (29). This profile represents a round stiffness value of the end-effector in order to achieve compliant behaviour to cushion the impact in all directions, as the preferred direction of impact cannot be guaranteed.
To illustrate the effectiveness of the fall prevention strategy for a range of operations, two conditions are considered: x object,1 = 0.23 m and x object,2 = 0.28 m, which are 126% and 157% of the arm length respectively. The optimal contact pose is solved by the fmincon function:  Figure 4 shows the Cartesian stiffness ellipsoids of different configurations for x object,1 . The robot stands in the same position and the position of the ankle joint is also the same. The joint stiffness is set to unit values because the goal is to compare the effect of the configuration on the stiffness ellipsoid. It can be seen from figure 4(c) that the value of the stiffness ellipsoid of configuration q d1 along the direction of impact force, which is the direction of endeffector displacement relative to the shoulder joint during contact, is significantly greater than that of the intuitive configuration in figure 4(a) without optimisation. Figure 4(b) shows the Cartesian stiffness ellipsoids of the arm with the optimised configuration to make the long axis of the stiffness ellipsoid consistent with the impact force direction. The configuration obtained by this optimisation method makes the long axis of the stiffness ellipsoid consistent with the impact force direction, but the value in the stiffness direction is smaller than that of the proposed optimiser (22).
To illustrate the implementation, figure 5 shows the snapshots of the fall prevention simulation. It can be seen from figure 5(b), the robot starting from an From ankle joint to the front of the foot (α y, min ,α y, max ) (rad) (−pi/2, pi) Constraint condition of the shoulder pitch joint (β min ,β max ) (rad) (0, pi) Constraint condition of the elbow joint  upright position with the arms naturally resting. An external impulsive force is applied to the rear shoulder of the robot and the fall prevention strategy is triggered at 0.21 s as the x capture exceeds the threshold. At 0.28 s the arms have achieved the desired pose, and finally at 0.4 s, it shows the arm's interaction with the wall to prevent falling. Figure 5(a) replicates this with the intuitive configuration corresponding to figure 4(a). Figure 6 shows the variation of the robot's CoM positions and CP positions with time in x-z plane. Initially the robot stands upright, but due to the external force the robot falls forward about the axis of the ankle angle which is noticeably seen as an inverted  pendulum, therefore the CoM of the robot decreases along the z-axis and moves forward along the x-axis under the effects of gravity. The CP x capture is zero at the beginning, and the position of the CP changes when the robot starts to fall. The dotted line indicates when the CP exceeds the threshold x foot , and when the fall prevention strategy is activated. When the arm comes into contact with the wall, the movement of the CoM terminates.
To illustrate the detailed implementation, figure 7 shows the joint trajectories. The variation of the shoulder pitch joint and the elbow joint represents the reaction of the arm. When the fall is detected, the shoulder pitch joint and elbow joint rotate to emulate the target position. Once contact between the arm and the wall occurs, the arm works as a spring-damper system. The arm generates a resistive force, corresponding to the displacement, to absorb the impact and stabilise the robot. When the momentum is absorbed, the arm returns to high stiffness, the joint displacement occurs during this process.
To investigate the influence on the joint torque reduction when exploiting the proposed approach, figure 8 shows the joint torques of the arms within simulation. Comparing figures 8(c) and (a), it can be seen that when contact occurs, the maximum joint torque without compliance control increased to 58 Nm, which is significantly greater than that with compliance control due to the arms having high PD gains. Then comparing figures 8(b) and (c), both the two cases switch to compliance control once contact occurs, but there is not a configuration with optimisation in the former. To achieve the same Cartesian stiffness during contact (e.g. 0.29 s when contact occurs and 0.5 s when arms return to high stiffness), the optimised configuration will reduce the joint torque. This is because the stiffness ellipsoid value of optimised configuration q d1 is greater than that of a configuration without optimisation along the direction of impact force. As a result, the same Cartesian stiffness characteristics along the impact force direction of the end-effector is achieved and the required maximum joint torque of the optimised configuration q d1 is small. On the other hand, the optimised configuration during contact enables the arm to confront larger external forces. This result proves the hypothesis we made in section 2. When the stiffness of the arm is increased, the maximum joint torque in figure 8(b) is smaller than that in figure 8(c), because only the Cartesian stiffness in the x-direction is increased while z-direction remains constant. As a result, in figure 4, the stiffness ellipsoid value along the x-axis direction of optimised configuration q d1 is smaller than that of the configuration without optimisation. In addition, the maximum joint torque in figure 8(d) remains less than that in figure 8(b) although the accumulated momentum is greater.

Conclusion
Inspired by the fall arrest of humans, we proposed a hypothesis that humans prefer using the direction of their respective arm stiffness ellipsoids against the direction of the fall. Experiments on human fall arrest can also support this hypothesis. Based on this principle, a novel fall prevention strategy for humanoid robots using their arms is presented. The CP method is exploited for fall detection, and once falling has begun, the upper limb's kinematics are generated and executed by an optimisation algorithm. The optimised algorithm is used to generate arm posing that maximises the value of the stiffness ellipsoid of the endpoint along the impact force direction. Finally, validation of the proposed strategy is completed by having the humanoid robot confront a wall as a case study, the results successfully show the strategy to be efficient and effective.
The proposed method provides a scientific principle for humanoid robots to choose the posture when they prevent falling by using upper limbs, the method is model-based and computationally efficient. The main advantage of this method is that the stiffness of the end-effector of the arm can provide a wider range of changes for compliant robots, which can then provide more choices for the design of the end-effector stiffness controller in the future.
Future work will focus on the applications in 3D scenarios and implementation of this strategy on real humanoid robots. As well as combining different balancing strategies such as ankle and hip strategies for bipeds to further improve the overall stability against impact forces.