Fault-Tolerant Tripod Gait Planning and Veriﬁcation of a Hexapod Robot

Featured Application: This study investigated a new method to generate a fault-tolerant gait of a hexapod robot. The adjustment measure is put forward to improve the stability margin. As a gait generation method, the research of the robot on complex terrain can be completed in the future. Abstract: In some hazardous or inaccessible applications, such as earthquake rescue, as a substitute for mankind, robots are expected to perform missions reliably. Unfortunately, the failure of components is di ﬃ cult to avoid due to the complexity of robot composition and the interference of the environment. Thus, improving the reliability of robots is a crucial problem. The hexapod robot has redundant degrees of freedom due to its multiple joints, making it possible to tolerate the failure of one leg. In this paper, the Fault-Tolerant Tripod (F-TT) gait dealing with the failure of one leg is researched. The Denavit–Hartenberg (D-H) method is exploited to establish a kinematic model for the hexapod robot, the Jacobian matrix is analyzed, and it is proved that the body can be controlled when three legs are supported. Then, an F-TT gait phase sequence planning method based on a stability margin is established, and a method to improve stability is proposed. The trajectory for the center of gravity (COG) and foot is studied. Finally, a simulation model and prototype robot experiments are developed, and the e ﬀ ectiveness of the proposed method is veriﬁed.


Introduction
With the rapid development of robot technology, autonomous mobile robots have been widely studied. Multi-legged robots have high stability and environment adaptability compared with wheeled or crawler robots since they do not require consecutive contacts between the foot and ground [1]. Although most of the inspiration for robot design and motion planning comes from insects [2], robots are not yet as flexible as insects. Legged robots are almost always applied in a structured environment while insects are faced with a more complex variable environment. Currently, significant achievements have been made in the research of robots in a normal state in terms of structure, gait, stability, and energy consumption [3]. Through phase coordination, tripod gait, tetrapod gait, wave gait, etc., have been realized. An adaptive gait that can be applied on irregular terrain also has come into reality through a central pattern generator (CPG) network [4,5]. Moreover, the Walknet Controller is a robust, decentralized controller that incorporates findings from the behavior of stick insects for gait coordination of multi-legged robots [6]. In recent years, it has been developed into different versions through expansions [7].

1.
Support phase and transfer phase: the state of legs supported on the ground is called the support phase, and the state of legs lifting in the air is called the transfer phase.

2.
Locomotion period T: the duration required for legs to complete one transfer phase and one support phase, including transfer phase period T t and support phase period T s , T = T s + T t . 3.
Duty factor κ: the ratio of the support phase period to the locomotion period; the value range is 0 ≤ κ ≤ 1, κ = T s /T = 1 − T t /T. 4.
Leg phase φ: relative position of a leg in a locomotion period at the time of lifting. 5.
Stride S: the distance that the center of gravity (COG) of the robot moves in a locomotion period. 6.
Stroke λ: the distance that the leg moves from the previous landing point to the next in the transfer phase.
Moreover, to provide an effective evaluation index for the locomotion of robot, a variety of stability evaluation indexes have been proposed, such as longitudinal stability margin (LSM) [22] and energy stability margin (ESM) [23]. However, the static stability margin (SSM) S M is versatile when the motion velocity is not high. The stability margin represents the margin from the current equilibrium state to the instability state of the robot, which is represented by the minimum vertical distance between the projection point of the COG on the foot support plane and the boundary of the support polygon [24], as shown in Figure 1.

General Definition of Robot Gait
Robot gait refers to the way that a robot moves its legs regularly in the process of motion. When a robot is walking, legs support the weight of the body and make it move in the walking direction. Different gaits can be distinguished by the order and phase of the transfer leg. Gait parameters [21] are defined as follows.
1. Support phase and transfer phase: the state of legs supported on the ground is called the support phase, and the state of legs lifting in the air is called the transfer phase. 2. Locomotion period : the duration required for legs to complete one transfer phase and one support phase, including transfer phase period and support phase period , = + . 3. Duty factor : the ratio of the support phase period to the locomotion period; the value range is 0 ≤ ≤ 1, = / = 1 − / . 4. Leg phase : relative position of a leg in a locomotion period at the time of lifting. 5. Stride : the distance that the center of gravity (COG) of the robot moves in a locomotion period. 6. Stroke : the distance that the leg moves from the previous landing point to the next in the transfer phase.
Moreover, to provide an effective evaluation index for the locomotion of robot, a variety of stability evaluation indexes have been proposed, such as longitudinal stability margin (LSM) [22] and energy stability margin (ESM) [23]. However, the static stability margin (SSM) is versatile when the motion velocity is not high. The stability margin represents the margin from the current equilibrium state to the instability state of the robot, which is represented by the minimum vertical distance between the projection point of the COG on the foot support plane and the boundary of the support polygon [24], as shown in Figure 1. When the support polygon is a triangle, the projection point of the COG on the support plane is , and the stability margin can be calculated by the following equation: = ( 1 ⃗⃗⃗⃗⃗⃗⃗⃗ × 1 2 ⃗⃗⃗⃗⃗⃗⃗⃗ | 1 2 | , 2 ⃗⃗⃗⃗⃗⃗⃗⃗ × 2 3 ⃗⃗⃗⃗⃗⃗⃗⃗ | 2 3 | , 3 ⃗⃗⃗⃗⃗⃗⃗⃗ × 3 1 ⃗⃗⃗⃗⃗⃗⃗⃗

Structure of the Hexapod Robot
The design of hexapod robot is based on the body structure and locomotion characteristics of insects. It is composed of six legs with the same structure connected to the body which is composed of two hexagonal plates. Legs are arranged symmetrically on the left side (numbered 1, 2, 3) and right side (numbered 4,5,6). Each leg has three revolving joints-coxa joint, femur joint and tibia jointconnecting three segments of the limb-coxa, femur and tibia.
In order to describe the robot quantitatively with a mathematical model, a series of coordinate systems need to be established. A world coordinate system is established to describe the locomotion When the support polygon is a triangle, the projection point of the COG on the support plane is M, and the stability margin can be calculated by the following equation:

Structure of the Hexapod Robot
The design of hexapod robot is based on the body structure and locomotion characteristics of insects. It is composed of six legs with the same structure connected to the body which is composed of two hexagonal plates. Legs are arranged symmetrically on the left side (numbered 1, 2, 3) and right side (numbered 4, 5, 6). Each leg has three revolving joints-coxa joint, femur joint and tibia joint-connecting three segments of the limb-coxa, femur and tibia. In order to describe the robot quantitatively with a mathematical model, a series of coordinate systems need to be established. A world coordinate system is established to describe the locomotion route of the robot, denoted by the symbol O w (X w Y w Z w ). Then the body coordinate and reference coordinate systems of leg links are established, denoted by the symbols ) and ∑ 0 ( 0 0 0 ) (i=1,2,3,4,5,6), respectively. Coordinate systems attached to the coxa joint ( 1 ), femur joint ( 2 ), and tibia joint ( 3 ) of leg i are established for each joint. The simplified hexapod model and coordinate systems are shown in Figure 2.

Kinematics Model
Kinematics analysis is the basis of gait planning and attitude control of a hexapod robot. Kinematics studies all geometric and time parameters related to motion. To complete the kinematic analysis of the robot, the first problem is to describe the robot parametrically. Based on standard Denavit-Hartenberg (D-H) notation [25,26], the hexapod leg link can be described as in Table 1.  In Table 1, is the link length, is link twist, is the offset, is the joint angle. The homogeneous transformation matrix describes the relationship of a point in the different coordinate systems. The homogeneous transformation matrix from the foot end coordinate system to the reference coordinate system can be obtained by: where 23 = 2 + 3 .

Kinematics Model
Kinematics analysis is the basis of gait planning and attitude control of a hexapod robot. Kinematics studies all geometric and time parameters related to motion. To complete the kinematic analysis of the robot, the first problem is to describe the robot parametrically. Based on standard Denavit-Hartenberg (D-H) notation [25,26], the hexapod leg link can be described as in Table 1.
In Table 1, a is the link length, α is link twist, d is the offset, β is the joint angle. The homogeneous transformation matrix describes the relationship of a point in the different coordinate systems. The homogeneous transformation matrix from the foot end coordinate system to the reference coordinate system can be obtained by: Appl. Sci. 2020, 10, 2959 5 of 21 The reference coordinate O i 0 of leg i can be expressed in the body coordinate frame O b as given in the following equation: where ψ i is the angle between X i 0 and The position of the foot end of leg i in the body coordinate can be obtained by forward kinematics, as shown in Equation (4): where b e xi , b e yi , b e zi are the expression of the foot end in O b . The inverse kinematics maps the relationship between Cartesian coordinates and the joint angle. The joint angles of the hexapod robots are calculated using: As a parallel system, the complete configuration of hexapod robot can be determined by: where β T Li = [β Li1 , β Li2 , β Li3 ] T represents the joint angle of the leg i, and x b = [x, y, z, θ 1 , θ 2 , θ 3 ] T is the under-actuated passive degrees of freedom of the hexapod body, which represents the displacement and angle of the body in three directions of the world coordinate system. O b and O w can be regarded as connected by a virtual manipulator with six degrees of freedom, while [x, y, z, θ 1 , θ 2 , θ 3 ] can be regarded as six under-actuated passive virtual degrees of freedom variables of the manipulator. It can be seen that the motion state of the hexapod robot in O w is actually determined by the 18 leg joints and the position and attitude of the body. The velocity . e i of leg i in the world coordinate system can also be connected with the velocity . q of the joint angle of the robot through the Jacobian matrix; the relationship is: If the velocity of any foot end is given, the velocity in joint space can be obtained by: The Jacobian matrix of the foot end of leg i can be expressed by: where J β Li represents the part of Jacobian matrix related to leg i, and J x b represents the part related to body posture. The Jacobian matrix J β Li related to leg i can be obtained by the partial derivative of Equation (4). Give the result as follows: where A transformation is needed for J e to transform to the world coordinate system: The Jacobian matrix of the foot end is also affected by the passive degree of freedom of the body. In the passive degree of freedom, the influence of body displacement is linear, while the attitude is affected by the configuration of leg i, so it can be expressed as follows: Although the body has no corresponding drive to achieve the movement, by imposing certain restrictions on the foot end, the movement of body can be represented by the leg joints.
x c ∈ C k represents the k constrained degrees of freedom of the foot end, and the Jacobian matrix is J c . According to Equation (9), the Jacobian matrix of any foot end contains the parts corresponding to the joint and the part corresponding to the body. For a support foot of the robot, its displacement and velocity can be considered as 0, that is e c = . e c = 0, so: T . Equation (14) can be derived from Equation (13).
where J c . When the movement of one foot is constrained, k = 3, the motion of passive degrees of freedom is not completely eliminated. Only when k ≥ 6 and the rank of matrix Ra J x b c is 6, does Equation (14) have Appl. Sci. 2020, 10, 2959 7 of 21 a unique solution, and the state of the body can be determined by the configuration leg joints. When a hexapod robot has three legs in contact with the ground, the displacement of the three supporting legs is constrained (i.e., k = 9), and the Ra J x b c is 6. The movement of the body can be completely determined by the joints of the supporting legs. Therefore, it is necessary to have at least three legs as support legs to realize control of the robot body.

Analysis of Support Polygon
In the practical application of a hexapod robot, leg failure could be caused by the failure of a driving device or power transmission equipment, or by impact. The relationship between the relative position of the fault leg and the fault tolerance of the hexapod robot is analyzed using the support triangle in the tripod gait, which is the design principle to determine the relative position of the support leg in the fault tolerance walking process of the hexapod robot. Figure 3 shows all six possible support triangles for a hexapod robot.
In the case of Figure 3a,b, the COG is outside the support triangle, the stability margin value is negative, and the hexapod cannot maintain stability; in Figure 3c, the support triangle is composed of three legs separated one by one, and the COG is at the center of the triangle with the best stability, which is expected for support as much as possible. In Figure 3d-f, the support triangles pass through the COG, which is a critical state. However, the stability margin can be increased by stability improvement measures, so these support triangles are reasonable.

Phase Sequence Planning of F-TT Gait
Based on the theory of the supporting triangle in Section 3.1, the gait phase sequence is planned in this section. As shown in Figure 4, because of the symmetry of the robot, the influence of a single leg fault on the leg distribution of a hexapod robot can be divided into two categories: one is that any one of the middle legs is damaged; the other is that any one of the front or rear legs is damaged. For these two kinds of faults, a unified gait description equation is established. Some new symbols are defined in Table 2.

Symbol
Definition ̄ The fault leg

Phase Sequence Planning of F-TT Gait
Based on the theory of the supporting triangle in Section 3.1, the gait phase sequence is planned in this section. As shown in Figure 4, because of the symmetry of the robot, the influence of a single leg fault on the leg distribution of a hexapod robot can be divided into two categories: one is that any one of the middle legs is damaged; the other is that any one of the front or rear legs is damaged. For these two kinds of faults, a unified gait description equation is established.

Phase Sequence Planning of F-TT Gait
Based on the theory of the supporting triangle in Section 3.1, the gait phase sequence is planned in this section. As shown in Figure 4, because of the symmetry of the robot, the influence of a single leg fault on the leg distribution of a hexapod robot can be divided into two categories: one is that any one of the middle legs is damaged; the other is that any one of the front or rear legs is damaged. For these two kinds of faults, a unified gait description equation is established. Some new symbols are defined in Table 2.

Symbol
Definition ̄ Some new symbols are defined in Table 2. Table 2. Symbolic representation.

Symbol Definition
The ipsilateral anterior leg of the fault leg L 2 The ipsilateral posterior leg of the fault leg L 1 The contralateral anterior leg of the fault leg L 2 The contralateral middle leg of the fault leg L 3 The contralateral posterior leg of the fault leg The F-TT gait equation is based on the tripod gait of the non-fault hexapod robot. Gait function g for walking machines with n legs is defined as Equation (15): The F-TT gait phase equation is given by: where φ is the phase, κ is the duty factor, and the subscript is the symbol of the corresponding leg. The process of F-TT gait motion is divided into three stages. Five legs in good conditions are divided into three groups. Each time, one group is used in the transfer phase and the rest in the support phase. However, since one leg is broken, another leg needs to swing twice in the motion. The application of the F-TT gait planning equation in two kinds of fault situations will be elucidated.

F-TT Gait in Leg 1 Fault State
During the locomotion process of a hexapod robot, the foot lifts from the ground and takes a step forward in the transfer phase, and contacts the ground to support the body in the support phase. Based on the F-TT gait phase sequence planning equation, the F-TT gait phase sequence diagram of the hexapod robot in the case of a leg 1 fault is obtained, as shown in Figure 5. The shadow parts represent the support phase, and the blank parts represent the transfer phase.
where is the phase, is the duty factor, and the subscript is the symbol of the corresponding leg. The process of F-TT gait motion is divided into three stages. Five legs in good conditions are divided into three groups. Each time, one group is used in the transfer phase and the rest in the support phase. However, since one leg is broken, another leg needs to swing twice in the motion. The application of the F-TT gait planning equation in two kinds of fault situations will be elucidated.

F-TT Gait in Leg 1 Fault State
During the locomotion process of a hexapod robot, the foot lifts from the ground and takes a step forward in the transfer phase, and contacts the ground to support the body in the support phase. Based on the F-TT gait phase sequence planning equation, the F-TT gait phase sequence diagram of the hexapod robot in the case of a leg 1 fault is obtained, as shown in Figure 5. The shadow parts represent the support phase, and the blank parts represent the transfer phase. leg1 leg2 leg3 leg4 leg5 leg6 T 2T 0 The movement process is divided into three steps, as shown in Figure 6. The dotted line in the figure indicates that the leg is in the transfer phase, the dot-dash line indicates a broken leg, the solid line indicates a normal leg in the support phase, the red point is the COG position of the robot, and the blue triangle indicates the stable area formed by the support legs. When the COG is in the support area, the hexapod can be regarded as stabile, otherwise it will tend to topple.
In the first process, legs 4 and 6 are lifted up to swing forward, legs 2, 3, and 5 are in the support state to push the body forward, and the robot posture is transformed from Figure 6a to Figure 6b.
In the second step, legs 4 and 6 touch down, leg 2 is lifted up to swing forward, leg 5 is raised to swing forward at a slower speed, and legs 3, 4, and 6 support the body. Meanwhile, the robot is moved forward passively, and the attitude of hexapod changes from Figure 6b to Figure 6c. The movement process is divided into three steps, as shown in Figure 6. The dotted line in the figure indicates that the leg is in the transfer phase, the dot-dash line indicates a broken leg, the solid line indicates a normal leg in the support phase, the red point is the COG position of the robot, and the blue triangle indicates the stable area formed by the support legs. When the COG is in the support area, the hexapod can be regarded as stabile, otherwise it will tend to topple.
In the first process, legs 4 and 6 are lifted up to swing forward, legs 2, 3, and 5 are in the support state to push the body forward, and the robot posture is transformed from Figure 6a,b.
In the second step, legs 4 and 6 touch down, leg 2 is lifted up to swing forward, leg 5 is raised to swing forward at a slower speed, and legs 3, 4, and 6 support the body. Meanwhile, the robot is moved forward passively, and the attitude of hexapod changes from Figure 6b,c.
In the third process, leg 2 touches down, leg 5 continues to transfer forward while leg 3 is lifted to swing forward, legs 2, 4, and 6 are supporting legs, pushing the robot body to move forward, and the attitude of robot changes from Figure 6c,d.
After the above three processes, the robot completes a period of the F-TT gait movement under the fault condition of leg 1. In fact, the postures in Figure 6a,d are the same, because after a period of motion, the robot returns to the initial motion posture. The movement process is divided into three steps, as shown in Figure 6. The dotted line in the figure indicates that the leg is in the transfer phase, the dot-dash line indicates a broken leg, the solid line indicates a normal leg in the support phase, the red point is the COG position of the robot, and the blue triangle indicates the stable area formed by the support legs. When the COG is in the support area, the hexapod can be regarded as stabile, otherwise it will tend to topple.
In the first process, legs 4 and 6 are lifted up to swing forward, legs 2, 3, and 5 are in the support state to push the body forward, and the robot posture is transformed from Figure 6a to Figure 6b.
In the second step, legs 4 and 6 touch down, leg 2 is lifted up to swing forward, leg 5 is raised to swing forward at a slower speed, and legs 3, 4, and 6 support the body. Meanwhile, the robot is moved forward passively, and the attitude of hexapod changes from Figure 6b to Figure 6c.
In the third process, leg 2 touches down, leg 5 continues to transfer forward while leg 3 is lifted to swing forward, legs 2, 4, and 6 are supporting legs, pushing the robot body to move forward, and the attitude of robot changes from Figure 6c to Figure 6d.
After the above three processes, the robot completes a period of the F-TT gait movement under the fault condition of leg 1. In fact, the postures in Figure 6a,d are the same, because after a period of motion, the robot returns to the initial motion posture.   In the first process, legs 4 and 6 are lifted up to swing forward, legs 1, 3, and 5 are in the support state to push the body forward, and the robot posture is transformed from Figure 8a to Figure 8b.
In the second step, legs 4 and 6 touch down, leg 1 is lifted up to step forward, leg 5 is raised to step forward at a slower velocity, legs 3, 4, and 6 provide support on the ground. Meanwhile, the body is moved passively, and the attitude changes from Figure 8b to Figure 8c.
In the third process, leg 1 touches down, leg 5 continues to transfer forward while leg 3 is lifted to swing forward, legs 1, 4, and 6 support the body, which pushed the body to move forward, and the attitude changes from Figure 8c to Figure 8d.
After the three processes, a whole walking cycle of the F-TT gait movement under the fault condition of leg 2 is completed, reverting to the initial attitude in Figure 8a and looping the cycle. In the first process, legs 4 and 6 are lifted up to swing forward, legs 1, 3, and 5 are in the support state to push the body forward, and the robot posture is transformed from Figure 8a,b.
In the second step, legs 4 and 6 touch down, leg 1 is lifted up to step forward, leg 5 is raised to step forward at a slower velocity, legs 3, 4, and 6 provide support on the ground. Meanwhile, the body is moved passively, and the attitude changes from Figure 8b,c.
In the third process, leg 1 touches down, leg 5 continues to transfer forward while leg 3 is lifted to swing forward, legs 1, 4, and 6 support the body, which pushed the body to move forward, and the attitude changes from Figure 8c,d.
After the three processes, a whole walking cycle of the F-TT gait movement under the fault condition of leg 2 is completed, reverting to the initial attitude in Figure 8a and looping the cycle. body is moved passively, and the attitude changes from Figure 8b to Figure 8c.
In the third process, leg 1 touches down, leg 5 continues to transfer forward while leg 3 is lifted to swing forward, legs 1, 4, and 6 support the body, which pushed the body to move forward, and the attitude changes from Figure 8c to Figure 8d.
After the three processes, a whole walking cycle of the F-TT gait movement under the fault condition of leg 2 is completed, reverting to the initial attitude in Figure 8a and looping the cycle.

Measure to Improve the Stability of F-TT Gait
In Section 3.2, when a malfunctioning robot performs the F-TT gait, it has the two states of stability and instability. As the hexapod robot moves, the COG of the hexapod robot will move out of the stable region composed of the supporting legs, resulting in the hexapod robot toppling. Locomotion moment, as shown in Figure 6b,c and Figure 8c, due to the forward movement of the body, causes the COG to gradually move out of stability. Aiming at the instability state of the robot, a measure is proposed to solve the problem of the ineligible stability margin of the hexapod robot with one leg fault: coxa initialization angle adjustment. An initial value of coxa joint angle is preset to increase the support area. For the legs involved in the unstable support state, the support area can be increased by selecting the appropriate coxa initialization angle within the allowed space. Figure 9 and Figure 10 demonstrate the initial attitude with or without coxa initialization angle adjustment.
The figure on the left shows the initial attitude without coxa initialization angle adjustment while the initial attitude with coxa initialization angle adjustment is shown on the right.

Measure to Improve the Stability of F-TT Gait
In Section 3.2, when a malfunctioning robot performs the F-TT gait, it has the two states of stability and instability. As the hexapod robot moves, the COG of the hexapod robot will move out of the stable region composed of the supporting legs, resulting in the hexapod robot toppling. Locomotion moment, as shown in Figure 6b,c and Figure 8c, due to the forward movement of the body, causes the COG to gradually move out of stability. Aiming at the instability state of the robot, a measure is proposed to solve the problem of the ineligible stability margin of the hexapod robot with one leg fault: coxa initialization angle adjustment. An initial value of coxa joint angle is preset to increase the support area. For the legs involved in the unstable support state, the support area can be increased by selecting the appropriate coxa initialization angle within the allowed space. Figures 9 and 10 demonstrate the initial attitude with or without coxa initialization angle adjustment. The figure on the left shows the initial attitude without coxa initialization angle adjustment while the initial attitude with coxa initialization angle adjustment is shown on the right.
The calculation of coxa initialization angle uses the Monte Carlo method to generate the random matrix of coxa initialization angle, restricting the adjustment range to [−20 • , 30 • ]. Based on the planned gait parameters, the position of the foot ends of the next supporting phase is a known quantity. The stability margin is calculated using Equation (1). The solution with the stability margin greater than 0 is regarded as the feasible solution, and the evaluation index is defined as: where ψ i is the coxa initialization angle of the leg i. The minimum value of the evaluation is regarded as the adjustment angle. Figure 11 shows the method to obtain the adjusted angle.
When a fault is detected, the robot resets to its original attitude and uses the coxa initialization angle adjustment method to calculate the angle of the initialization angle of the coxa joint. In a very short time, each leg is raised and swung to the initialization angle of the coxa joint to obtain a higher stability margin, and then begins to enter the fault-tolerant trip gait stage. By the measure of coxa initialization angle adjustment, the motion of Figures 6 and 8 translates to that shown in Figures 12  and 13, respectively. It can be seen that the stability margin is increased, and the COG is in the interior of the supporting triangle, which meets the static stability requirements.
angle adjustment method to calculate the angle of the initialization angle of the coxa joint. In a very short time, each leg is raised and swung to the initialization angle of the coxa joint to obtain a higher stability margin, and then begins to enter the fault-tolerant trip gait stage. By the measure of coxa initialization angle adjustment, the motion of Figure 6 and Figure 8 translates to that shown in Figure  12 and Figure 13, respectively. It can be seen that the stability margin is increased, and the COG is in the interior of the supporting triangle, which meets the static stability requirements.
(b) With coxa initialization angle adjustment.   When a fault is detected, the robot resets to its original attitude and uses the coxa initialization angle adjustment method to calculate the angle of the initialization angle of the coxa joint. In a very short time, each leg is raised and swung to the initialization angle of the coxa joint to obtain a higher stability margin, and then begins to enter the fault-tolerant trip gait stage. By the measure of coxa initialization angle adjustment, the motion of Figure 6 and Figure 8 translates to that shown in Figure  12 and Figure 13, respectively. It can be seen that the stability margin is increased, and the COG is in the interior of the supporting triangle, which meets the static stability requirements.

Trajectory Planning of the F-TT Gait
The trajectory planning includes two parts: the motion trajectory of the COG, and the swing trajectory of the foot end. By controlling the joint of the legs supported on the ground, the control of the COG can be realized. The leg swinging in the air needs to meet certain constraints. The control of the attitude of the body is not involved, only the displacement and velocity in the X-and Y-axis is considered. In order to verify the feasibility of the F-TT gait, the linear uniform motion of the robot on an even road is planned.

Trajectory Planning of the F-TT Gait
The trajectory planning includes two parts: the motion trajectory of the COG, and the swing trajectory of the foot end. By controlling the joint of the legs supported on the ground, the control of the COG can be realized. The leg swinging in the air needs to meet certain constraints. The control of the attitude of the body is not involved, only the displacement and velocity in the X-and Y-axis is considered. In order to verify the feasibility of the F-TT gait, the linear uniform motion of the robot on an even road is planned.

Trajectory Planning of the F-TT Gait
The trajectory planning includes two parts: the motion trajectory of the COG, and the swing trajectory of the foot end. By controlling the joint of the legs supported on the ground, the control of the COG can be realized. The leg swinging in the air needs to meet certain constraints. The control of the attitude of the body is not involved, only the displacement and velocity in the X-and Y-axis is considered. In order to verify the feasibility of the F-TT gait, the linear uniform motion of the robot on an even road is planned.
For the transfer legs, to reduce the impact, two aspects should also be taken into consideration: one is that the velocity at the posterior extreme position (PEP) and anterior extreme position (AEP) is 0; the other is that there is no jump in the acceleration curve [27]. The motion of the transfer phase can be divided into two directions, namely, longitudinal and vertical motion. The longitudinal motion needs to meet the following conditions: y t=T t = 0 (18) where w p 0y is the current location of the legs in Y-axis.
The locomotion of the transfer leg in the vertical direction is lifted at the AEP, reaches the highest point at the middle position (MP) and is then put down at the PEP, so the vertical locomotion trajectory should satisfy the following conditions: where h is the stride height. z e are assumed to be: where c 1 and c 2 are constant. Through the initial conditions, the displacement of the foot end is obtained: The COG moves forward at a uniform speed, so the velocity during walking is: The displacement equation is as follows: According to the foot trajectory planned in Equation (21) and Equation (23), the foot trajectory curve during a period is shown in Figure 14. After obtaining the trajectory of the COG and the foot, the angular velocity of the leg joint can be solved.
From Equation (16), the F-TT gait we proposed applies a different duty factor to different legs. The duty factor 2 of 2 is 1/3, and that of the other legs is 2/3, which results in the period of the transfer phase of 2 ( 2 ) being twice that of the other non-fault legs ( ′ ). The relationship between 2 , ′ , and is: Because of the identity of the leg motion cycle, the period of the support phase of 2 ( 2 ) is half that of the other non-fault legs ( ′ ). The relationship between 2 , ′ , and is:

Simulations and Experiments
The simulation analysis and walking experiments of the F-TT gait were carried out for the leg 1 fault and leg 2 fault states. Parameters of the physical prototype model used are shown in Table 3. The locomotion period is assumed to be 3 s. Each process is executed in 1 s. After obtaining the trajectory of the COG and the foot, the angular velocity of the leg joint can be solved.
From Equation (16), the F-TT gait we proposed applies a different duty factor to different legs. The duty factor κ 2 of L 2 is 1/3, and that of the other legs is 2/3, which results in the period of the transfer phase of L 2 (T tL2 ) being twice that of the other non-fault legs (T t ). The relationship between T tL2 , T t , and T is: Because of the identity of the leg motion cycle, the period of the support phase of L 2 (T sL2 ) is half that of the other non-fault legs (T s ). The relationship between T sL2 , T s , and T is:

Simulations and Experiments
The simulation analysis and walking experiments of the F-TT gait were carried out for the leg 1 fault and leg 2 fault states. Parameters of the physical prototype model used are shown in Table 3. The locomotion period is assumed to be 3 s. Each process is executed in 1 s.

Simulation Results
The fault-tolerant tripod gait simulation of the hexapod robot was undertaken using the virtual prototype software ADAMS and MATLAB. The hexapod and ground were established in SolidWorks and imported to ADAMS. The constraints and driving and other parameters were established in ADAMS, and the control system was designed in Simulink.

Simulation Results with Leg 1 Fault
In a period, three processes are executed in sequence. Legs alternately transfer and support. Figures 15 and 16 show some simulation sequences under the leg 1 fault state at different times from the lateral and the vertical view, respectively. The swing sequence of the legs can be observed in Figure 15, and accords with the planned sequence. Figure 16 displays the posture after each process in the F-TT gait; the gesture after coxa initialization angle adjustment has been demonstrated in Figure 16 when t = 0.0s. To measure the locomotion of the hexapod robot, the displacement curves of the COG are shown in Figure 17. It can be concluded that the robot has a uniform speed along the Y-axis, and the fluctuation in the X and Z directions is slight. The main reason is that, due to the failure of leg 1, the symmetrical structure of the hexapod is damaged and the left side is only supported by one leg, resulting in about 10 mm displacement in the X-axis direction in three periods. In order to observe the stability margin intuitively, the support position is measured, and the stability margin is calculated using Equation (1). Figure 18 presents the detail at any time the stability margin is nonnegative.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 14 of 21 of the COG are shown in Figure 17. It can be concluded that the robot has a uniform speed along the Y-axis, and the fluctuation in the X and Z directions is slight. The main reason is that, due to the failure of leg 1, the symmetrical structure of the hexapod is damaged and the left side is only supported by one leg, resulting in about 10 mm displacement in the X-axis direction in three periods. In order to observe the stability margin intuitively, the support position is measured, and the stability margin is calculated using Equation (1). Figure 18 presents the detail at any time the stability margin is nonnegative.
t=0.0s t=0.5s t=1.0s t=1.5s t=2.0s t=2.5s t=3.0s Figure 15. Lateral view of one period simulation sequence with leg 1 fault. Figure 15. Lateral view of one period simulation sequence with leg 1 fault.
t=2.0s t=2.5s t=3.0s Figure 15. Lateral view of one period simulation sequence with leg 1 fault.

Simulation Results with Leg 2 Fault
The same items are measured when leg 2 is subject to a fault. According to the measure to improve the stability of the F-TT gait, the coxa initialization angle adjustment is made. Figure 19 shows a sequence of motion from the lateral view direction. The gesture and motion of each process are shown in Figure 20. It is obvious that the five non-faulty legs of the hexapod produce coordinated movement consistent with the planned sequence, and realize the smooth locomotion of the hexapod. The displacement of the COG is measured and shown in Figure 21. It can be seen that there is little or no deviation from the Y-axis, and the velocity along the Y-axis is steady. The stability margin value is shown in Figure 22. However, there are some critical values, since the transition between transfer phase and support phase occurs at specific moments.
Combined with the above analysis, the F-TT gait of the hexapod allows one leg to fail, and the hexapod robot can walk smoothly due to the planned F-TT gait and the coxa initialization angle adjustment.

Simulation Results with Leg 2 Fault
The same items are measured when leg 2 is subject to a fault. According to the measure to improve the stability of the F-TT gait, the coxa initialization angle adjustment is made. Figure 19 shows a sequence of motion from the lateral view direction. The gesture and motion of each process are shown in Figure 20. It is obvious that the five non-faulty legs of the hexapod produce coordinated movement consistent with the planned sequence, and realize the smooth locomotion of the hexapod. The displacement of the COG is measured and shown in Figure 21. It can be seen that there is little or no deviation from the Y-axis, and the velocity along the Y-axis is steady. The stability margin value is shown in Figure 22. However, there are some critical values, since the transition between transfer phase and support phase occurs at specific moments.
Combined with the above analysis, the F-TT gait of the hexapod allows one leg to fail, and the hexapod robot can walk smoothly due to the planned F-TT gait and the coxa initialization angle adjustment.
shows a sequence of motion from the lateral view direction. The gesture and motion of each process are shown in Figure 20. It is obvious that the five non-faulty legs of the hexapod produce coordinated movement consistent with the planned sequence, and realize the smooth locomotion of the hexapod. The displacement of the COG is measured and shown in Figure 21. It can be seen that there is little or no deviation from the Y-axis, and the velocity along the Y-axis is steady. The stability margin value is shown in Figure 22. However, there are some critical values, since the transition between transfer phase and support phase occurs at specific moments.
Combined with the above analysis, the F-TT gait of the hexapod allows one leg to fail, and the hexapod robot can walk smoothly due to the planned F-TT gait and the coxa initialization angle adjustment.
t=0.0s t=0.5s t=1.0s t=1.5s t=2.0s t=2.5s t=3.0s Figure 19. Lateral view of one period simulation sequence with leg 2 fault. Figure 19. Lateral view of one period simulation sequence with leg 2 fault.

Experiment Results
To verify the effectiveness of the proposed fault-tolerant gait in practical robots, the experiments were implemented in an authentic hexapod robot. The experimental platform of the hexapod robot is illustrated in Figure 23. For the experiments, six force sensors were installed at the bottom of the foot end to collect the normal contact force between the foot and the ground, and a gyroscope, mounted on the body center, collected the attitude data of the hexapod body.

Experiment Results
To verify the effectiveness of the proposed fault-tolerant gait in practical robots, the experiments were implemented in an authentic hexapod robot. The experimental platform of the hexapod robot is illustrated in Figure 23. For the experiments, six force sensors were installed at the bottom of the foot end to collect the normal contact force between the foot and the ground, and a gyroscope, mounted on the body center, collected the attitude data of the hexapod body.  Figure 24 shows a set of snapshots of the walking experiment with leg 1 fault; clearly, the legs lift, transfer and support as planned. Figure 25 shows the curve of the normal contact force data collected at the foot end. The force can reflect the phase of each leg, because it exists only in the support phase. Leg 1 has no contact force with the ground, and the remaining five normal legs alternate to form a support triangle. At least three legs are in the support phase at each time. Figure  26 shows the attitude data of the COG. The pitch and roll angle change slightly, ranging from −1.0° to 1.0°, and the yaw angle ranged from −2.0° to 2.0°.  Figure 24 shows a set of snapshots of the walking experiment with leg 1 fault; clearly, the legs lift, transfer and support as planned. Figure 25 shows the curve of the normal contact force data collected at the foot end. The force can reflect the phase of each leg, because it exists only in the support phase. Leg 1 has no contact force with the ground, and the remaining five normal legs alternate to form a support triangle. At least three legs are in the support phase at each time. Figure 26 shows the attitude data of the COG. The pitch and roll angle change slightly, ranging from −1.0 • to 1.0 • , and the yaw angle ranged from −2.0 • to 2.0 • .

Experiment Results with Leg 1 Fault
lift, transfer and support as planned. Figure 25 shows the curve of the normal contact force data collected at the foot end. The force can reflect the phase of each leg, because it exists only in the support phase. Leg 1 has no contact force with the ground, and the remaining five normal legs alternate to form a support triangle. At least three legs are in the support phase at each time. Figure  26 shows the attitude data of the COG. The pitch and roll angle change slightly, ranging from −1.0° to 1.0°, and the yaw angle ranged from −2.0° to 2.0°.   Figure 24 shows a set of snapshots of the walking experiment with leg 1 fault; clearly, the legs lift, transfer and support as planned. Figure 25 shows the curve of the normal contact force data collected at the foot end. The force can reflect the phase of each leg, because it exists only in the support phase. Leg 1 has no contact force with the ground, and the remaining five normal legs alternate to form a support triangle. At least three legs are in the support phase at each time. Figure  26 shows the attitude data of the COG. The pitch and roll angle change slightly, ranging from −1.0° to 1.0°, and the yaw angle ranged from −2.0° to 2.0°.

Experiment Results with Leg 2 Fault
The experiment of the F-TT gait with leg 2 fault was also carried out. Figure 27 shows a set of snapshots of the walking experiment in the leg 2 failure, which show the motion state of the robot at different times. Figure 28 shows the normal contact force data collected at the foot, with the data smoothed by Gauss filter. The force changes periodically. The weight of the body is not evenly distributed to each supporting foot end; for example, the contact force of leg 6 and the ground is relatively small, which may be because the model is rigid. However, there should be an elastic buffer device between the foot and the ground, such as a spring. Figure 29 shows the attitude data of the COG. The pitch and roll angle ranged from −1.0° to 1.0°, and the yaw angle ranged from −1.0° to 2.0°.
The experiment results show that the locomotion of the hexapod robot is stable. It can be

Experiment Results with Leg 2 Fault
The experiment of the F-TT gait with leg 2 fault was also carried out. Figure 27 shows a set of snapshots of the walking experiment in the leg 2 failure, which show the motion state of the robot at different times. Figure 28 shows the normal contact force data collected at the foot, with the data smoothed by Gauss filter. The force changes periodically. The weight of the body is not evenly distributed to each supporting foot end; for example, the contact force of leg 6 and the ground is relatively small, which may be because the model is rigid. However, there should be an elastic buffer device between the foot and the ground, such as a spring. Figure 29 shows the attitude data of the COG. The pitch and roll angle ranged from −1.0 • to 1.0 • , and the yaw angle ranged from −1.0 • to 2.0 • . snapshots of the walking experiment in the leg 2 failure, which show the motion state of the robot at different times. Figure 28 shows the normal contact force data collected at the foot, with the data smoothed by Gauss filter. The force changes periodically. The weight of the body is not evenly distributed to each supporting foot end; for example, the contact force of leg 6 and the ground is relatively small, which may be because the model is rigid. However, there should be an elastic buffer device between the foot and the ground, such as a spring. Figure 29 shows the attitude data of the COG. The pitch and roll angle ranged from −1.0° to 1.0°, and the yaw angle ranged from −1.0° to 2.0°.
The experiment results show that the locomotion of the hexapod robot is stable. It can be concluded through the experimental process that the movement of the robot is coordinated, and the hexapod robot can move smoothly and straight. The availability and rationality of the F-TT gait and the measures to improve stability are further proved.

Conclusions
In this paper, we focus on the fault-tolerant tripod gait of a hexapod robot with failure of one leg. A gait with different duty factors in different legs and a stability improvement method are proposed, which greatly improves the walking stability and the adaptability of the robot in complex environments. The specific research results are as follows.
Based on the prototype structure of the hexapod robot, the geometric relationship between the links on the legs of the robot is obtained. The D-H method is used to establish a kinematic model of

Conclusions
In this paper, we focus on the fault-tolerant tripod gait of a hexapod robot with failure of one leg. A gait with different duty factors in different legs and a stability improvement method are proposed, which greatly improves the walking stability and the adaptability of the robot in complex environments. The specific research results are as follows.
Based on the prototype structure of the hexapod robot, the geometric relationship between the links on the legs of the robot is obtained. The D-H method is used to establish a kinematic model of The experiment results show that the locomotion of the hexapod robot is stable. It can be concluded through the experimental process that the movement of the robot is coordinated, and the hexapod robot can move smoothly and straight. The availability and rationality of the F-TT gait and the measures to improve stability are further proved.

Conclusions
In this paper, we focus on the fault-tolerant tripod gait of a hexapod robot with failure of one leg. A gait with different duty factors in different legs and a stability improvement method are proposed, which greatly improves the walking stability and the adaptability of the robot in complex environments. The specific research results are as follows.
Based on the prototype structure of the hexapod robot, the geometric relationship between the links on the legs of the robot is obtained. The D-H method is used to establish a kinematic model of the hexapod robot, which provides a theoretical basis for the subsequent F-TT gait research.
This research proposes a new gait generation mechanism of the tripod gait for a hexapod with a faulty leg, which results in a continuous gait. The advantage of the continuous tripod gait is that it has higher locomotion velocity, which helps to maintain the fast movement ability of the hexapod robot. An adjustment method based on pre-adjustment of the coxa joint is proposed to improve stability. This proposed method also provides an evaluation scheme to obtain the optimal adjustment. Through the coxa initialization angle adjustment method and the planned gait, the robot can move straight continuously without adding the adjustment phase during the movement.
The trajectories of the COG and swing legs are planned, and the joint angles of the straight walking gait are calculated with the combination of kinematic models and the planned trajectories. The simulations and experiments of the F-TT gait of the hexapod under the failure of leg 1 and leg 2 conditions are investigated separately. If the failure occurs in other legs, it can be resolved according to symmetry.
The F-TT gait effectively solves the forward motion problem of the hexapod under the condition of a single leg failure. However, this research was conducted only on even terrain. In the future, we will focus on the research of uneven terrain, and force control based on a dynamic model will also be considered. Furthermore, situations with locked legs that disturb the robot's motion should be analyzed.

Conflicts of Interest:
The authors declare no conflict of interest.