Research on the Posture Control Method of Hexapod Robot for Rugged Terrain

: This paper proposes a hexapod robot posture control method for rugged terrain to solve the problem of di ﬃ culty in realizing the posture control of a foot robot in rough terrain. The walking gait and original position of a six-legged robot is planned, and the Layer Identiﬁcation of Tracking (LIT) strategy is developed to enable the robot to distinguish mild rugged terrain and severe rugged terrains automatically. The virtual suspension dynamic model is established. In mild rugged terrain, the posture maintenance strategy is adopted to keep the stability of the torso. In severe rugged terrain, the posture adjustment strategy is adopted to ensure the leg workspace and make it more widely adapt to the changing terrain, and a gravity center position adjustment method based on foot force distribution is designed to use foot force as feedback to control the position and attitude. The experiment of posture control in rough terrain and climbing experiment in the ladder terrain shows that the hexapod robot has good posture maintenance and posture adjustment e ﬀ ects when traversing complex terrain through the posture maintenance strategy and the posture adjustment strategy. Combined with the terrain identiﬁcation method based on LIT, the hexapod robot can successfully climb the ladder terrain through the identiﬁcation of the changing ladder terrain, and the movement of the posture adjustment process is stable.


Introduction
The hexapod robot has abundant motion forms, redundant limb structure, good flexibility and stability, and can widely adapt to unstructured terrain. The displacement and angular displacement of the trunk coordinate system relative to the three axes, namely, X, Y, and Z, of the ground coordinate system describe the position and posture of the robot. The torso, supporting legs, and ground constitute a spatial parallel mechanism, and the rugged terrain determines the irregularity of each landing point; thus, posture control is difficult to realize [1,2]. Posture is related to the stability, flexibility, and adaptability of a robot to complex terrain. Higher requirements are put forward for the adaptability of a robot in an unstructured environment with the progress of foot-type robot research in recent years. Therefore, posture control has become the core issue in the research of foot robots. At present, posture control methods can be divided into the following categories. In the optimal pose method [3,4], from the perspective of trunk position control, the robot's posture is controlled to make the hexapod robot have better stability and flexibility. The stability and robustness of the torso are increased, and the effect of pose stability is achieved by designing the control algorithm [5] or designing the corresponding posture controller [6,7] to realize the rapid adjustment of the pose. The suspension control method [8,9] controls the posture of the robot from the perspective of force control. The hexapod robot combines the foot force perception information with the control algorithm and realizes the coincidence of foot force vector and gravity vector by the controller [10,11] to suppress the influence of external interference on trunk posture. The force/position hybrid control method [12,13] from the perspective of force/position hybrid control realizes stable walking by adjusting the position of the center of gravity. The three methods have the disadvantages of insufficient flexibility, heavy computational burden, and difficulty in establishing control model.
In addition, scholars have tried methods such as fuzzy control [14], neural network [15], robot vision [16], data fusion [17], and virtual model creation [18] to overcome the control difficulties of the hexapod robot, such as complexity, multiple degrees of freedom, and strong coupling. The hexapod robot uses position control to realize the adjustment of the posture, which will lead to the heavy calculation burden of the controller, and ensuring the real-time performance is difficult. The force control strategy avoids the disadvantages of pure position control, but it has a poor adaptability to complex terrain and needs an accurate mathematical model to limit its application. Therefore, a pose control method which can avoid complex kinematic solution and has good operability must be designed.
The hexapod robot is a multi-chain motion structure. The force distribution methods for this structure mainly include the linear programming (LP) algorithm [19], dual linear programming algorithm [20], square programming method [21], and analytical method [22]. The solution of the foot end force needs to plan the constraint conditions according to the control objective and construct the corresponding function to make a reasonable distribution of the foot force. Chen et al. [23] constructed the objective function based on the quadratic convex function and realized the result of foot force distribution with continuous solution. Waldron [24] took the minimum internal force between feet as the optimization objective and realized the fast solution of foot force distribution in flat terrain. Galvez et al. [25] used friction cone constraint conditions to avoid foot slippage during walking on rough terrain and established the foot force optimization function of legs with the smallest margin. Vidoni [26] analyzed the leg configuration of the foot robot and found that the reasonable distribution of foot end force and joint torque can minimize the energy consumption of the standing posture. Yufei Liu et al. [27] transformed the freedom redundancy problem into an LP solution and proposed a force distribution algorithm to reduce the internal force in the tangential direction. Abhijit [28] used the quadratic programming method to determine the optimal foot force and corresponding joint torque of all legs. The problem of foot force distribution is related to the performance of multi-legged robots, which is of great significance to the improvement of walking performance.
As shown in Figure 1, it is a comparison between the stick insect and the robot HITCR-II model. The robot HITCR-II uses stick insects as a bionic prototype. Stick insects have a typical form and gait suitable for crawling. The limbs of stick insects are distributed in an elliptical shape, which not only increases the stability of movement, but also reduces the possibility of collision between legs during walking.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 2 of 22 foot force perception information with the control algorithm and realizes the coincidence of foot force vector and gravity vector by the controller [10,11] to suppress the influence of external interference on trunk posture. The force/position hybrid control method [12,13] from the perspective of force/position hybrid control realizes stable walking by adjusting the position of the center of gravity. The three methods have the disadvantages of insufficient flexibility, heavy computational burden, and difficulty in establishing control model. In addition, scholars have tried methods such as fuzzy control [14], neural network [15], robot vision [16], data fusion [17], and virtual model creation [18] to overcome the control difficulties of the hexapod robot, such as complexity, multiple degrees of freedom, and strong coupling. The hexapod robot uses position control to realize the adjustment of the posture, which will lead to the heavy calculation burden of the controller, and ensuring the real-time performance is difficult. The force control strategy avoids the disadvantages of pure position control, but it has a poor adaptability to complex terrain and needs an accurate mathematical model to limit its application. Therefore, a pose control method which can avoid complex kinematic solution and has good operability must be designed.
The hexapod robot is a multi-chain motion structure. The force distribution methods for this structure mainly include the linear programming (LP) algorithm [19], dual linear programming algorithm [20], square programming method [21], and analytical method [22]. The solution of the foot end force needs to plan the constraint conditions according to the control objective and construct the corresponding function to make a reasonable distribution of the foot force. Chen et al. [23] constructed the objective function based on the quadratic convex function and realized the result of foot force distribution with continuous solution. Waldron [24] took the minimum internal force between feet as the optimization objective and realized the fast solution of foot force distribution in flat terrain. Galvez et al. [25] used friction cone constraint conditions to avoid foot slippage during walking on rough terrain and established the foot force optimization function of legs with the smallest margin. Vidoni [26] analyzed the leg configuration of the foot robot and found that the reasonable distribution of foot end force and joint torque can minimize the energy consumption of the standing posture. Yufei Liu et al. [27] transformed the freedom redundancy problem into an LP solution and proposed a force distribution algorithm to reduce the internal force in the tangential direction. Abhijit [28] used the quadratic programming method to determine the optimal foot force and corresponding joint torque of all legs. The problem of foot force distribution is related to the performance of multi-legged robots, which is of great significance to the improvement of walking performance.
As shown in Figure 1, it is a comparison between the stick insect and the robot HITCR-II model. The robot HITCR-II uses stick insects as a bionic prototype. Stick insects have a typical form and gait suitable for crawling. The limbs of stick insects are distributed in an elliptical shape, which not only increases the stability of movement, but also reduces the possibility of collision between legs during walking.  Hexapod robot HITCR-II has 18 joints and complex movements. As shown in Figure 2, O 0 is the reference coordinate system based on the ground, and O is the trunk coordinate system, the origin of which coincides with the geometric center of the trunk. The X, Y, and Z coordinate axes meet the right-hand helix law, the X axis is consistent with the forward direction of the robot, and the Z axis is perpendicular to the torso surface and opposite to the direction of gravity. The three left legs of the robot are represented by L 1 , L 2 , and L 3 respectively, and the three right legs are represented by R 1 , R 2 , and R 3 , respectively. Starting from L 1 , the robot is arranged in a counterclockwise order. O m0 (1 ≤ m ≤ 6, m ∈ Z) is the leg coordinate system. Hexapod robot HITCR-II has 18 joints and complex movements. As shown in Figure 2, 0 O  is the reference coordinate system based on the ground, and O  is the trunk coordinate system, the origin of which coincides with the geometric center of the trunk. The X, Y, and Z coordinate axes meet the right-hand helix law, the X axis is consistent with the forward direction of the robot, and the Z axis is perpendicular to the torso surface and opposite to the direction of gravity. The three left legs of the robot are represented by L1, L2, and L3 respectively, and the three right legs are represented by R1, R2, and R3, respectively. Starting from L1, the robot is arranged in a counterclockwise order.
 is the leg coordinate system.  The main parameters of the robot HITCR-II are shown in Table 1. The weight is 3.2 kg, the length and width of the trunk are 320 and 136-196 mm respectively, and the longitudinal and transverse spans under the initial pose are 400 and 380 mm, respectively. Compared with hexapod robots with the same performance at home and abroad, the robot has obvious advantages of miniaturization and lightness. In order to reduce the volume and weight of the joint, a joint design scheme based on In Figure 3, O mn (1 ≤ n ≤ 3, n ∈ Z) is the coordinate system of the n-th joint of the m-th leg. The coordinate axis is consistent with the direction of the joint axis, and the forward direction and the opposite direction of gravity are positive. The Y m -axis is connected to the lower joint of the joint. The axis of one limb coincides and points to the next joint. The foot end coordinate system is represented by O m4 , and its coordinate axis direction is consistent with O m3 .
Appl. Sci. 2020, 10, x FOR PEER REVIEW 3 of 22 Hexapod robot HITCR-II has 18 joints and complex movements. As shown in Figure 2, 0 O  is the reference coordinate system based on the ground, and O  is the trunk coordinate system, the origin of which coincides with the geometric center of the trunk. The X, Y, and Z coordinate axes meet the right-hand helix law, the X axis is consistent with the forward direction of the robot, and the Z axis is perpendicular to the torso surface and opposite to the direction of gravity. The three left legs of the robot are represented by L1, L2, and L3 respectively, and the three right legs are represented by R1, R2, and R3, respectively. Starting from L1, the robot is arranged in a counterclockwise order.
 is the leg coordinate system.  The main parameters of the robot HITCR-II are shown in Table 1. The weight is 3.2 kg, the length and width of the trunk are 320 and 136-196 mm respectively, and the longitudinal and transverse spans under the initial pose are 400 and 380 mm, respectively. Compared with hexapod robots with the same performance at home and abroad, the robot has obvious advantages of miniaturization and lightness. In order to reduce the volume and weight of the joint, a joint design scheme based on The main parameters of the robot HITCR-II are shown in Table 1. The weight is 3.2 kg, the length and width of the trunk are 320 and 136-196 mm respectively, and the longitudinal and transverse spans under the initial pose are 400 and 380 mm, respectively. Compared with hexapod robots with the same performance at home and abroad, the robot has obvious advantages of miniaturization and lightness.
In order to reduce the volume and weight of the joint, a joint design scheme based on brushless DC motor drive, harmonic reduction, and synchronous belt drive was developed. The final structural parameters of the realized joint are 58.5 mm long, 42 mm wide, 28 mm thick and 118 g heavy. The base joint angle range is −45 • ≤ α ≤ 45 • , base-femoral joint angle is −90 • ≤ β ≤ 60 • , and femoral-tibial joint angle is 0 ≤ γ ≤ 120 • . Figure 4 is the structure of modularized joint.  Figure 4 is the structure of modularized joint.

Adaptive Foot Trajectory Planning for Rugged Terrain
Foot trajectory planning solves the problem of generating the foot motion trajectory when a hexapod robot is walking. This planning meets the needs of the robot's motion while constraining its motion according to its structure, motion, and dynamic characteristics to ensure that it moves in an orderly, stable manner. Aiming at the complex, rugged terrain, how to realize the adaptability of the foot trajectory to the terrain change, which can generate a continuous trajectory that can autonomously cross certain obstacles and find a stable foot point, is an important research issue.

Adaptive Strategy for Foot Trajectory Planning
The foot of the hexapod robot is composed of a base joint, a base-femoral joint, and a femoraltibial joint. A reference coordinate system,  The trajectory is divided into the ATB section of the guide layer and the adjustment layer CQ and BP.

Adaptive Foot Trajectory Planning for Rugged Terrain
Foot trajectory planning solves the problem of generating the foot motion trajectory when a hexapod robot is walking. This planning meets the needs of the robot's motion while constraining its motion according to its structure, motion, and dynamic characteristics to ensure that it moves in an orderly, stable manner. Aiming at the complex, rugged terrain, how to realize the adaptability of the foot trajectory to the terrain change, which can generate a continuous trajectory that can autonomously cross certain obstacles and find a stable foot point, is an important research issue.

Adaptive Strategy for Foot Trajectory Planning
The foot of the hexapod robot is composed of a base joint, a base-femoral joint, and a femoral-tibial joint. A reference coordinate system, O m0 , for trajectory planning is established with the center of the base joint axis as the coordinate origin to facilitate gait control, unified planning, and coordination of the trajectory of each leg and foot end. The direction of each axis of the coordinate system is consistent with the trunk coordinate system O , Z m0 is perpendicular to the trunk and opposite to gravity, and X m0 is the same as the forward velocity, V, of the robot. The model of the planned foot trajectory is shown in Figure 5. The swing phase and support phase in the foot trajectory are planned in the reference coordinate system O m0 . O m4 origin is the projection of the m-th leg and foot endpoint on the X m0 O m0 Z m0 plane of the corresponding reference coordinate system in the initial pose. Track_A (curve QATBP) is the projection of the swing phase trajectory on the plane X m0 O m0 Z m0 . The trajectory is divided into the ATB section of the guide layer and the adjustment layer CQ and BP. The trajectory of the guidance layer mainly realizes the swing function and has good shape and dynamic characteristics. This layer is divided into an upper guidance layer and a lower guidance layer. The distinction between the upper guidance layer and lower guidance layer is used for the robot's autonomous judgment and selection of pose control strategies. The adjustment layer trajectory is mainly used to realize the adaptation function to the ground. It is divided into upper and lower adjustment layers, and a simple trajectory is used to solve the ups and downs of the foot directly and effectively. The judgment of the foot point needs to combine the force sensing function of the leg and use the joint torque sensor of the base-femoral joint to sense the contact of the foot end with the ground. Then, the foot end is converted from the swing phase trajectory to the support phase trajectory. When the robot is walking on a flat terrain, the swing phase trajectory only contains the guidance layer, starting at point A and ending at point B. When walking on a rugged terrain, the swing phase trajectory can end at any point of the curve TBP section to switch to the support phase trajectory. If the end point is higher than the horizontal position, it ends at the guide layer, and if it is lower than the horizontal position, it ends at the adjustment layer. Track_B (curve) is the trajectory of the swing leg entering the support phase in advance, and this trajectory meets the needs of gait control.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 5 of 22 The trajectory of the guidance layer mainly realizes the swing function and has good shape and dynamic characteristics. This layer is divided into an upper guidance layer and a lower guidance layer. The distinction between the upper guidance layer and lower guidance layer is used for the robot's autonomous judgment and selection of pose control strategies. The adjustment layer trajectory is mainly used to realize the adaptation function to the ground. It is divided into upper and lower adjustment layers, and a simple trajectory is used to solve the ups and downs of the foot directly and effectively. The judgment of the foot point needs to combine the force sensing function of the leg and use the joint torque sensor of the base-femoral joint to sense the contact of the foot end with the ground. Then, the foot end is converted from the swing phase trajectory to the support phase trajectory. When the robot is walking on a flat terrain, the swing phase trajectory only contains the guidance layer, starting at point A and ending at point B. When walking on a rugged terrain, the swing phase trajectory can end at any point of the curve TBP section to switch to the support phase trajectory. If the end point is higher than the horizontal position, it ends at the guide layer, and if it is lower than the horizontal position, it ends at the adjustment layer. Track_B (curve) is the trajectory of the swing leg entering the support phase in advance, and this trajectory meets the needs of gait control. The coordination of the trajectory of each foot end of the supporting phase realizes the expected motion of the torso. The motion of the torso is planned in the ground reference coordinate system. The end of the foot in the supporting motion is stationary relative to the ground reference coordinate system without sliding. Thus, the motion of the torso can be converted. The trajectory of each foot end is separately planned for the movement of the end points of each supporting leg relative to the trunk coordinate system. Track_C (line BA) is the projection of the swing phase trajectory on plane X. When the hexapod robot simultaneously adjusts its pose during traveling, the trajectory is shown as Track_D (line B JKC   ). The JK segment is the projection of the composite trajectory supporting the forward movement of the torso and the posture change. For foot trajectory based on the above strategic planning, in the case of mildly rugged terrain, while the foot trajectory adapts to the changing terrain, it can ensure that the trunk maintains the same posture based on the initial level of walking during the entire walking process. In severely rugged terrain under the circumstances, the torso can be more widely adapted to the changing terrain through the adjustment of the pose, and the constantly changing torso plane itself is used as the reference during the entire walking process to enable the robot to adapt to the gradual terrain (such as slopes, stairs) conditions. The coordination of the trajectory of each foot end of the supporting phase realizes the expected motion of the torso. The motion of the torso is planned in the ground reference coordinate system. The end of the foot in the supporting motion is stationary relative to the ground reference coordinate system without sliding. Thus, the motion of the torso can be converted. The trajectory of each foot end is separately planned for the movement of the end points of each supporting leg relative to the trunk coordinate system. Track_C (line BA) is the projection of the swing phase trajectory on plane X. When the hexapod robot simultaneously adjusts its pose during traveling, the trajectory is shown as Track_D (line B JKC ). The JK segment is the projection of the composite trajectory supporting the forward movement of the torso and the posture change. For foot trajectory based on the above strategic planning, in the case of mildly rugged terrain, while the foot trajectory adapts to the changing terrain, it can ensure that the trunk maintains the same posture based on the initial level of walking during the entire walking process. In severely rugged terrain under the circumstances, the torso can be more widely adapted to the changing terrain through the adjustment of the pose, and the constantly changing torso plane itself is used as the reference during the entire walking process to enable the robot to adapt to the gradual terrain (such as slopes, stairs) conditions.

Autonomous Terrain Judgment Strategy Based on Layer Identification of Tracking
The purpose of distinguishing terrain is to use different pose control strategies to help the robot cross the terrain. The adaptive trajectory planning strategy for rugged terrain divides the swing phase trajectory of the foot into an upper guidance layer, a lower guidance layer, an upper adjustment layer, and a lower adjustment layer. According to the robot structure parameters and walking needs, the height of each layer of the trajectory is specified to be 40 mm. The purpose of layer identification of tracking (LIT) is to determine the coordinate range of which layer of the trajectory is located in Z-axis coordinate P tzi of the leg coordinate system, O m0 of foot end point P ti , and the interval of each layer is represented by S tg S bg S ta and S ba . In execution, the position of each foot end can be obtained by kinematic calculation based on the joint angular position sensing data in real time. The LIT autonomous judgment strategy is expressed as follows: i f P tzi ∈ S tg then LT_State = 0, HT_State = 1; else i f P tzi ∈ S bg then LT_State = 1, HT_State = 0; else i f P tzi ∈ S ta then LT_State = 1, HT_State = 0; else i f P tzi ∈ S ba then LT_State = 0, HT_State = 1; else LT_State = 0, HT_State = 0; LT_State is the flag for lightly rugged terrain, HT_State is the flag for severely rugged terrain, and the status flag is 1 to stimulate the corresponding mode. When LT_State = 0 and HT_State = 0, it is judged as no foothold. As shown in Figure 6, in case (a), when the end of the foot swings from the reference ground to the terrain with a height range of [0,40] mm, ordinate P tzi of end point P ti in the leg coordinate system O m0 is located in the lower guide layer, and the terrain is judged to be slightly rugged by leg i. In case (b), when the end of the foot swings from the reference ground to the terrain with a height range of [40,80] mm, ordinate P tzi of end point P ti in the leg coordinate system O m0 is located in the upper guide layer, and the terrain is judged to be severely rugged by leg i. When the foothold is in the adjustment layer, the judgment is the same as that in the navigation layer. If any leg determines that the terrain is severely rugged terrain, the pose adjustment mode corresponding to the severely rugged terrain is stimulated.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 6 of 22 The purpose of distinguishing terrain is to use different pose control strategies to help the robot cross the terrain. The adaptive trajectory planning strategy for rugged terrain divides the swing phase trajectory of the foot into an upper guidance layer, a lower guidance layer, an upper adjustment layer, and a lower adjustment layer. According to the robot structure parameters and walking needs, the height of each layer of the trajectory is specified to be 40 mm. The purpose of layer identification of tracking (LIT) is to determine the coordinate range of which layer of the trajectory is located in Z-axis coordinate tzi P of the leg coordinate system, LT_State is the flag for lightly rugged terrain, HT_State is the flag for severely rugged terrain, and the status flag is 1 to stimulate the corresponding mode. When LT_State = 0 and HT_State = 0, it is judged as no foothold. As shown in Figure 6, in case (a), when the end of the foot swings from the reference ground to the terrain with a height range of [0,40] mm, ordinate tzi P of end point ti P in the leg coordinate system 0 m O  is located in the lower guide layer, and the terrain is judged to be slightly rugged by leg i. In case (b), when the end of the foot swings from the reference ground to the terrain with a height range of [40,80] mm, ordinate tzi P of end point ti P in the leg coordinate system 0 m O  is located in the upper guide layer, and the terrain is judged to be severely rugged by leg i.
When the foothold is in the adjustment layer, the judgment is the same as that in the navigation layer.
If any leg determines that the terrain is severely rugged terrain, the pose adjustment mode corresponding to the severely rugged terrain is stimulated.

Posture Maintenance Strategy for Mildly Rugged Terrain
The configuration and motion mode characteristics of the hexapod robot determine that it has a high stability margin. The stability of the walking robot is evaluated by the size of the stability margin (SM) (Zero Moment Point). The widely used criterion of the stability margin is the ZMP (Zero Moment Point) principle, which is defined as the minimum distance between the projection point of the center of gravity vector on the supporting polygon and each side of the polygon. The motion characteristics of the hexapod robot determine that it can be analyzed in a quasi-static way. Therefore, the minimum distance of the center of gravity from the supporting polygon to each side of the polygon is taken as the evaluation standard of the stability margin, ignoring the effect of inertia. As shown in Figure 8, the stability margin for n-side shape is shown as follows.

Posture Maintenance Strategy for Mildly Rugged Terrain
The configuration and motion mode characteristics of the hexapod robot determine that it has a high stability margin. The stability of the walking robot is evaluated by the size of the stability margin (SM) (Zero Moment Point). The widely used criterion of the stability margin is the ZMP (Zero Moment Point) principle, which is defined as the minimum distance between the projection point of the center of gravity vector on the supporting polygon and each side of the polygon. The motion characteristics of the hexapod robot determine that it can be analyzed in a quasi-static way. Therefore, the minimum distance of the center of gravity from the supporting polygon to each side of the polygon is taken as the evaluation standard of the stability margin, ignoring the effect of inertia. As shown in Figure 8, the stability margin for n-side shape is shown as follows.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 7 of 22 Figure 7 shows the control scheme used by the hexapod robot to walk on rough terrain.

Posture Maintenance Strategy for Mildly Rugged Terrain
The configuration and motion mode characteristics of the hexapod robot determine that it has a high stability margin. The stability of the walking robot is evaluated by the size of the stability margin (SM) (Zero Moment Point). The widely used criterion of the stability margin is the ZMP (Zero Moment Point) principle, which is defined as the minimum distance between the projection point of the center of gravity vector on the supporting polygon and each side of the polygon. The motion characteristics of the hexapod robot determine that it can be analyzed in a quasi-static way. Therefore, the minimum distance of the center of gravity from the supporting polygon to each side of the polygon is taken as the evaluation standard of the stability margin, ignoring the effect of inertia. As shown in Figure 8, the stability margin for n-side shape is shown as follows.  The interference of mildly rugged terrain is not enough to cause its motion instability, but it will still affect the posture. Therefore, a posture maintenance strategy, which keeps the level and height of the torso unchanged based on the initial posture during walking, is proposed for mild ruggedness terrain. In order to obtain higher leg space, the hexapod robot was required to walk with TG (tripod gait) as the starting gait [29]. Adjust the position of the center of mass of the torso on the projection of the supporting polygon within the range of motion and take the minimum distance between the projection point and each side of the supporting polygon as the initial attitude of the hexapod robot. So, the initial level and height of the torso depends on the terrain.

Hexapod Robot Foot Force Distribution Model
The motion form of the hexapod robot is crawling. It can be analyzed as a quasi-static motion due to its low speed and stable motion. Analyzing the mechanical model of the robot aims to determine the relationship of the force between the supporting feet when the robot has a larger stability margin and use this foot force as feedback to control the position and attitude.
The mechanical model is shown in Figure 9. Global coordinate system is O , and center of gravity is G = G x , G y , G z . The projection of the center of gravity on the torso coordinate system is located in the torso coordinate on the X axis, and it is close to origin O of the torso coordinate system because the robot configuration is symmetrically distributed with the geometric center in an elliptical shape in the initial pose. Taking the contact point between foot end P i = [x i , y i , z i ] of the i-th leg and the ground, Appl. Sci. 2020, 10, x FOR PEER REVIEW 8 of 22 The interference of mildly rugged terrain is not enough to cause its motion instability, but it will still affect the posture. Therefore, a posture maintenance strategy, which keeps the level and height of the torso unchanged based on the initial posture during walking, is proposed for mild ruggedness terrain. In order to obtain higher leg space, the hexapod robot was required to walk with TG (tripod gait) as the starting gait [29]. Adjust the position of the center of mass of the torso on the projection of the supporting polygon within the range of motion and take the minimum distance between the projection point and each side of the supporting polygon as the initial attitude of the hexapod robot. So, the initial level and height of the torso depends on the terrain.

Hexapod Robot Foot Force Distribution Model
The motion form of the hexapod robot is crawling. It can be analyzed as a quasi-static motion due to its low speed and stable motion. Analyzing the mechanical model of the robot aims to determine the relationship of the force between the supporting feet when the robot has a larger stability margin and use this foot force as feedback to control the position and attitude.
The mechanical model is shown in Figure 9. Global coordinate system is O  , and center of gravity is , . The projection of the center of gravity on the torso coordinate system is located in the torso coordinate on the X axis, and it is close to origin O of the torso coordinate system because the robot configuration is symmetrically distributed with the geometric center in an elliptical shape in the initial pose. Taking the contact point between foot end of the i-th leg and the ground, external force received is , external moment is , and ground reaction force at the foot end of leg i is i Vertical direction Pitching angle Roll angle Appl. Sci. 2020, 10, 6725 9 of 21 Formula (1) is expressed in matrix form as follows: The available full end force formula is as follows: A − is pseudoinverse. When the robot is supported on three legs, no matter where the end of the foot is in any position corresponding to a certain state of the robot, the only solution for the size of the full force can be obtained by Formula (6). Under rugged terrain, the robot walks in a wave gait with more than three-leg support. At this time, if the foot force is solved according to this model, the system is indeterminate. Therefore, constraints must be added to make the system have a unique solution. When the supporting legs even bear the gravity of the robot, the robot has a large stability margin, a large carrying capacity, and a low energy consumption. Therefore, the minimum mean square error of the foot force is set as the objective function: Among them, µ = (1/n) n i f iz = (F z + mg)/n, where n is the number of robot supporting legs.
This can determine the foot end force f 0i = [ f 0ix , f 0iy , f 0iz ] in the initial posture.

Linear Model of Virtual Suspension Dynamic Model
According to the characteristics of the FBM mechanism of the hexapod robot, a virtual suspension dynamic model (VSDM) is established to suppress the change of posture during walking, in the vertical, pitch, and roll directions of the torso, as shown in Figure 3. A one-dimensional virtual spring damper is set up, and the vertical direction fluctuation and the pitch angle and roll angle disturbance are suppressed by controlling the spring damper. Here, the ground and the body are assumed rigid, and the mathematical expression obtained according to the model is as follows: where K z , K p , and K r are the virtual spring stiffness coefficients in the vertical, pitch, and roll directions respectively, C z , C p , and C r are the virtual damping coefficient for vertical, pitch, and roll directions respectively, I p and I r are the moment of inertia in the pitch and roll directions respectively, z, θ p , and θ r are trunk height, pitch angle, and roll angle respectively, and M g is the robot weight.
After Equation (8), taking the Laplace transform, the characteristic equation of the virtual model in three directions is expressed as follows: where M = m, I p , I r T , C = C z , C p , C r T , and K = K z , K p , K r T . The frequency characteristic equation is as follows: The characteristic frequency and damping ratio of the system are expressed as follows: The damping ratio is selected between 0.7 and 1.0 to improve the system response speed and reduce the overshoot. In addition, the interference caused by the pose control amount has a very low-frequency characteristic during the execution of the controller due to the collision and sliding of the foot with the ground and the change of the robot's own motion state. The system's characteristic frequency, ω n , has a large value to avoid resonance. When the robot is in a static state, no disturbance is caused by the external and its own state changes. In this state, the corner frequency and damping ratio are ω n = ω nz , ω np , ω nr = [240, 240, 60] and ξ n = ξ nz , ξ np , ξ nr = [0.85, 0.85, 0.85], respectively. The mass of the robot is 3.2 kg, and the moments of inertia in the pitch and roll directions in the initial pose are respectively Substituting I p = 8.98 × 10 −2 kg.m 2 and I r = 1.2 × 10 −1 kg.m 2 a into Formula (10), we can obtain K z = 1.8 × 10 4 N/m, K p = 5.1 × 10 3 Nm/rad, K r = 6.7 × 10 3 Nm/rad, C z = 5.0 × 10 2 Ns/m, C p = 3.7 × 10 1 Nms/rad, and C r = 4.7 × 10 1 Nms/rad.

No Linear Model of Virtual Suspension Dynamic Model
When the robot is in a slow-motion state on a flat terrain, pose control can be realized by a linear time-invariant system determined by the Formula (8) model. However, when the robot is walking on rugged terrain, interference is caused by the change of its own state and the effect of the external environment on the body. The model in this case is expressed as follows: where µ z , u p , and u r are the control amounts of vertical, pitch, and roll directions respectively, d z , d p , and d r are the amounts of interference in the vertical, pitch, and roll directions respectively, and ∆I p is the change of inertia in vertical, pitch, and roll directions.
The model includes changes in dynamic parameters caused by changes in the position of the center of gravity as well as the amount of interference introduced by the interaction between the foot and the ground. This model describes a nonlinear time-varying system, and the position tracking effect must be improved by controlling the position and velocity errors simultaneously to track the target pose better.

Two-Loop Sliding Mode Controller Based on VSDM Model
The unique synovial motion of the synovial membrane controller can make the system make small-amplitude, high-frequency reciprocating motion along the specified trajectory under certain characteristics. This motion can shield the influence of model parameters and external disturbances, so that the control system has good robustness. In order to realize the position and speed tracking control of the VSDM model, a sliding membrane controller with a double-loop structure is designed.
As shown in Figure 10, the outer loop of the structure is a position loop, the inner loop is a speed loop, and the speed command output by the outer loop is used as the outer command of the inner loop.
The unique synovial motion of the synovial membrane controller can make the system make small-amplitude, high-frequency reciprocating motion along the specified trajectory under certain characteristics. This motion can shield the influence of model parameters and external disturbances, so that the control system has good robustness. In order to realize the position and speed tracking control of the VSDM model, a sliding membrane controller with a double-loop structure is designed. As shown in Figure 10, the outer loop of the structure is a position loop, the inner loop is a speed loop, and the speed command output by the outer loop is used as the outer command of the inner loop.

Outer loop controller
Inside loop controller Position feedback x F Figure 10. Structure of a two-loop sliding mode control system. The trunk height, pitch angle, and roll angle have the same mathematical model, so the same synovial controller can be used for control respectively, and the VSDM model can be further planned to obtain: Force compensation amount is , d  includes not only the amount of external interference, but also the amount of interference caused by the change of its own state.

Analysis of Pose Adjustment Strategy for Heavy Rugged Terrain
Compared with keeping the torso moving steadily in the initial posture under lightly rugged terrain, when walking on heavy rugged terrain, the robot needs to adjust the posture actively according to the changes in the terrain to adapt to the changing rugged terrain more widely and ensure the leg working space has good movement flexibility. For heavily rugged terrain, the robot adopts a posture adjustment strategy to adjust the height and inclination of the torso. As shown in Figure 11a, the pose of the robot represented red lines is analyzed in coordinate system The trunk height, pitch angle, and roll angle have the same mathematical model, so the same synovial controller can be used for control respectively, and the VSDM model can be further planned to obtain: ..
Force compensation amount is u = [u z , u P , u r ] T , and disturbance variable is d = [d z , d p , d r ] T , d includes not only the amount of external interference, but also the amount of interference caused by the change of its own state.

Analysis of Pose Adjustment Strategy for Heavy Rugged Terrain
Compared with keeping the torso moving steadily in the initial posture under lightly rugged terrain, when walking on heavy rugged terrain, the robot needs to adjust the posture actively according to the changes in the terrain to adapt to the changing rugged terrain more widely and ensure the leg working space has good movement flexibility. For heavily rugged terrain, the robot adopts a posture adjustment strategy to adjust the height and inclination of the torso. As shown in Figure 11a, the pose of the robot represented red lines is analyzed in coordinate system O 0 based on the earth. The coordinates of the origin of the torso coordinate system O in O 0 represent the position of the torso. When walking in complex terrain, the combined effect of posture adjustment and traveling motion makes the origin of the torso coordinate system move from O to O . In pose adjustment, facing convex terrain, a trunk height change amount is ∆H pz1 , and pitch angle change amount is ∆θ px1 ; facing recessed terrain, b trunk height adjustment amount is ∆H pz2 , and pitch angle adjustment amount is ∆H pz2 . Walking continuously changes the position of the torso coordinate system as the benchmark of motion planning through the adjustment of trunk height H pz and inclination θ px , then: where ∆H pzi and ∆θ pxi are the changes in the height and inclination of the torso during posture adjustment, and ∆H is the change in the height of the torso caused by the traveling motion during the non-posture adjustment. The movement of the robot is determined by the trajectory of the end of the foot. Traveling movement does not produce the change of the torso inclination because the trajectory of the end of the foot is planned in the torso coordinate system. H pz and θ px can approximately represent the change in altitude and slope of the current terrain from the initial horizontal plane, respectively. Pose adjustment achieves wide adaptability to gradual and rugged terrain through continuous adjustment of trunk height and inclination changes. Pose control has a clear distinction between light and severely rugged terrain. However, in practical applications, a type of terrain is slightly rugged in a certain walking cycle, while the overall observation during a period of travel is severely rugged. The analysis of this type of terrain is shown in Figure 11b.The blue lines represent the foot track of the robot.
the non-posture adjustment. The movement of the robot is determined by the trajectory of the end of the foot. Traveling movement does not produce the change of the torso inclination because the trajectory of the end of the foot is planned in the torso coordinate system.

pz H and px
 can approximately represent the change in altitude and slope of the current terrain from the initial horizontal plane, respectively. Pose adjustment achieves wide adaptability to gradual and rugged terrain through continuous adjustment of trunk height and inclination changes. Pose control has a clear distinction between light and severely rugged terrain. However, in practical applications, a type of terrain is slightly rugged in a certain walking cycle, while the overall observation during a period of travel is severely rugged. The analysis of this type of terrain is shown in Figure 11b.The blue lines represent the foot track of the robot is at point A, the end of the foot swings from position a to position b, and the end point of the foot end is located in the lower guide layer of the trajectory. Thus, the terrain is judged to be slightly rugged, and the posture maintenance strategy is stimulated. From the rugged terrain adaptive foot trajectory planning this article, the end position of the foot end on the trajectory of this cycle is the starting position of the next cycle. When the foot end swings again from position b to position c, the termination point is at the upper adjustment layer, and the terrain is determined to be heavily rugged. The behavior can be expressed as follows: In general, the accumulation of changes in the trajectory height in multiple cycles can be expressed as follows: where i H  is the height amount of the end point of the foot end of the i-th cycle relative to the start point.
For the sag terrain, the same conclusion can be obtained by analyzing the problem in the adjustment layer. The above analysis shows that for pseudo-lightly rugged terrain, the LIT strategy When the origin of the leg coordinate system Σ O m0 is at point A, the end of the foot swings from position a to position b, and the end point of the foot end is located in the lower guide layer of the trajectory. Thus, the terrain is judged to be slightly rugged, and the posture maintenance strategy is stimulated. From the rugged terrain adaptive foot trajectory planning this article, the end position of the foot end on the trajectory of this cycle is the starting position of the next cycle. When the foot end swings again from position b to position c, the termination point is at the upper adjustment layer, and the terrain is determined to be heavily rugged. The behavior can be expressed as follows: where ∆H 1 is the height of the end point of the foot end of the first cycle relative to the start point, ∆H 2 is the height of the end point of the foot end of the second cycle relative to the start point, H LB is the height of the guide layer under the trajectory, and H L is the height of the track guide layer. In general, the accumulation of changes in the trajectory height in multiple cycles can be expressed as follows: where ∆H i is the height amount of the end point of the foot end of the i-th cycle relative to the start point. For the sag terrain, the same conclusion can be obtained by analyzing the problem in the adjustment layer. The above analysis shows that for pseudo-lightly rugged terrain, the LIT strategy has a cumulative effect, and a reasonable pose control strategy can be invoked by accurately identifying the terrain.

Master Polygon
The polygon formed by the end points of each supporting foot of the hexapod robot in the torso coordinate system is called the configuration polygon (CP). Affected by the rugged terrain, the CP is generally a spatial polygon. Figure 12 shows the CPs formed by the end points of the feet when supported by three, four, and five legs. In the case of four and five legs, not all the end points of the feet are on the same plane. From the gait rules, at least three non-adjacent legs are in the supporting phase at any time, and the triangle that is stipulated to be formed by connecting the end points of the three non-adjacent legs is the master polygon (MP). A unique MP always exists in any CP during walking, or it is the LMP formed by the end of the foot of leg L 2 , R 1 , and R 3 , or the RMP formed by the end of the foot of leg R 2 , L 1 , and L 3 . The CP of the hexapod robot and the terrain jointly determine its pose, and it cannot be used as a reference plane to measure the pose of the torso because it is a spatial polygon, while MP approximates the orientation characteristics of the CP, so MP is used as the position. The reference plane for pose adjustment and the selection rules are as follows: where L i _Stance and R i _Stance are the status flags of the leg support, LMP_State and RMP_State are the status flags of LMP and RMP respectively, and the priority of LMP is higher than that of RMP.

Master Polygon
The polygon formed by the end points of each supporting foot of the hexapod robot in the torso coordinate system is called the configuration polygon (CP). Affected by the rugged terrain, the CP is generally a spatial polygon. Figure 12 shows the CPs formed by the end points of the feet when supported by three, four, and five legs. In the case of four and five legs, not all the end points of the feet are on the same plane. From the gait rules, at least three non-adjacent legs are in the supporting phase at any time, and the triangle that is stipulated to be formed by connecting the end points of the three non-adjacent legs is the master polygon (MP). A unique MP always exists in any CP during walking, or it is the LMP formed by the end of the foot of leg 2 L , 1 R , and 3 R , or the RMP formed by the end of the foot of leg 2 R , 1 L , and 3 L . The CP of the hexapod robot and the terrain jointly determine its pose, and it cannot be used as a reference plane to measure the pose of the torso because it is a spatial polygon, while MP approximates the orientation characteristics of the CP, so MP is used as the position. The reference plane for pose adjustment and the selection rules are as follows: where _ After the MP is determined, the posture of the torso is adjusted by taking the line of the coordinate origin of the hind leg and the middle leg of the main support leg as the reference axis, and the torso plane parallel to the MP as the control target. As shown in Figure 13a, taking the six-leg

Posture Adjustment Method Based on the CP
After the MP is determined, the posture of the torso is adjusted by taking the line of the coordinate origin of the hind leg and the middle leg of the main support leg as the reference axis, and the torso plane parallel to the MP as the control target. As shown in Figure 13a, taking the six-leg simultaneous support state as an example, leg R 1 triggers severely rugged flag HT_State = 1, and it is judged as LMP. The reference axis is O 20 O 40 , and the posture control target is plane ∆O 20 O 40 O 60 parallel to the LMP. The control quantity composed of the height of the trunk, the pitch angle, and the roll angle can then be obtained. In pose adjustment, except for the two legs that determine the reference axis  Figure 13b, where the foot end trajectory is planned in the leg coordinate system. The trajectory is an arc with the same shape and opposite direction as the origin of the leg coordinate due to the relative motion because the supporting foot end is stationary relative to the ground. In pose adjustment under this planning method, the pitch angle and the yaw angle have a strict correspondence because of the height of the trunk. Therefore, only one of the factors, instead of three, is required as the control quantity to realize the pose adjustment. The amount is controlled separately, reducing the control burden.

Posture Adjustment Method Based on the CP
After the MP is determined, the posture of the torso is adjusted by taking the line of the coordinate origin of the hind leg and the middle leg of the main support leg as the reference axis, and the torso plane parallel to the MP as the control target. As shown in Figure 13a, taking the six-leg simultaneous support state as an example, leg 1 R triggers severely rugged flag _ 1 HT State  , and it is judged as LMP. The reference axis is 20 40 O O , and the posture control target is plane parallel to the LMP. The control quantity composed of the height of the trunk, the pitch angle, and the roll angle can then be obtained. In pose adjustment, except for the two legs that determine the reference axis, the trajectories generated by the pose adjustment movement at the origin of the other leg coordinate systems are shown as 10 10 O O , 60 60 O O , 50 50 O O , and 30 30 O O , as shown in Figure 13b, where the foot end trajectory is planned in the leg coordinate system. The trajectory is an arc with the same shape and opposite direction as the origin of the leg coordinate due to the relative motion because the supporting foot end is stationary relative to the ground. In pose adjustment under this planning method, the pitch angle and the yaw angle have a strict correspondence because of the height of the trunk. Therefore, only one of the factors, instead of three, is required as the control quantity to realize the pose adjustment. The amount is controlled separately, reducing the control burden.

Torso plane
Reference axis The hexapod robot divided the terrain into mild rugged terrain and severe rugged terrain through the LIT strategy and adopted the corresponding pose control strategy, respectively. After foot trajectory compensation, the foot state and trajectory were adjusted, and the foot trajectory was re-planned. Figure 14 shows the control process of the hexapod robot when it crosses rugged terrain The hexapod robot divided the terrain into mild rugged terrain and severe rugged terrain through the LIT strategy and adopted the corresponding pose control strategy, respectively. After foot trajectory compensation, the foot state and trajectory were adjusted, and the foot trajectory was re-planned. Figure 14 shows the control process of the hexapod robot when it crosses rugged terrain.

Posture Control Simulation for Uneven Terrain
As shown in Figure 15a, the terrain is randomly generated in a three-dimensional (3D) Figure 14. The control process diagram when the hexapod robot crosses rugged terrain.

Posture Control Simulation for Uneven Terrain
As shown in Figure 15a, the terrain is randomly generated in a three-dimensional (3D) coordinate system by using MATLAB software, and the maximum height difference of the entire terrain is 210 mm. In addition, the hexapod robot model is established to verify whether the posture control strategy can realize the robot's traversing of rugged terrain. The target path of the robot traversing the terrain is a diagonal line through the coordinate origin, and different colors of the terrain represent different heights. The projection of the main support foot in the XY plane in each stage of walking is calculated, as shown in Figure 15b, where the dotted line is LMP projection and the solid line is RMP projection. Finally, the robot successfully traverses the terrain.
Foot force distribution adjustment method Leg state judgment controller Figure 14. The control process diagram when the hexapod robot crosses rugged terrain.

Posture Control Simulation for Uneven Terrain
As shown in Figure 15a, the terrain is randomly generated in a three-dimensional (3D) coordinate system by using MATLAB software, and the maximum height difference of the entire terrain is 210 mm. In addition, the hexapod robot model is established to verify whether the posture control strategy can realize the robot's traversing of rugged terrain. The target path of the robot traversing the terrain is a diagonal line through the coordinate origin, and different colors of the terrain represent different heights. The projection of the main support foot in the XY plane in each stage of walking is calculated, as shown in Figure 15b, where the dotted line is LMP projection and the solid line is RMP projection. Finally, the robot successfully traverses the terrain.  Figure 16 shows the curves of the trunk yaw angle, pitch angle, and roll angle. Each curve either maintains a zero value or changes smoothly and slowly at different stages. This control method can make the robot switch between mild and severe rough posture control mode in a timely manner with the change of terrain. In addition, it can adapt to the changing rugged terrain and complete the walking of the complex terrain through the posture adjustment of severe rough terrain.  Figure 16 shows the curves of the trunk yaw angle, pitch angle, and roll angle. Each curve either maintains a zero value or changes smoothly and slowly at different stages. This control method can make the robot switch between mild and severe rough posture control mode in a timely manner with the change of terrain. In addition, it can adapt to the changing rugged terrain and complete the walking of the complex terrain through the posture adjustment of severe rough terrain.  Figure 17 is the foot trajectory curve that the hexapod robot adjusts automatically when encountering obstacles. The trajectory at the beginning is planned according to the established boundary conditions and functions. Starting from the starting point A, the foot touches the obstacle during the swing process and ends. For the initial swing trajectory, update the boundary conditions and call the support phase trajectory function. Starting from the transition point B, the foot end moves along the support phase trajectory to the end point C. It can be seen that this strategy can generate a foot trajectory that satisfies the functions of swinging and supporting motion and enables the  Figure 17 is the foot trajectory curve that the hexapod robot adjusts automatically when encountering obstacles. The trajectory at the beginning is planned according to the established boundary conditions and functions. Starting from the starting point A, the foot touches the obstacle during the swing process and ends. For the initial swing trajectory, update the boundary conditions and call the support phase trajectory function. Starting from the transition point B, the foot end moves along the support phase trajectory to the end point C. It can be seen that this strategy can generate a foot trajectory that satisfies the functions of swinging and supporting motion and enables the trajectory to be adjusted autonomously in real time according to changes in terrain [30].  Figure 17 is the foot trajectory curve that the hexapod robot adjusts automatically when encountering obstacles. The trajectory at the beginning is planned according to the established boundary conditions and functions. Starting from the starting point A, the foot touches the obstacle during the swing process and ends. For the initial swing trajectory, update the boundary conditions and call the support phase trajectory function. Starting from the transition point B, the foot end moves along the support phase trajectory to the end point C. It can be seen that this strategy can generate a foot trajectory that satisfies the functions of swinging and supporting motion and enables the trajectory to be adjusted autonomously in real time according to changes in terrain [30].

Posture Control Experiment on Unstructured Terrain
The purpose of the posture control experiment is to verify the ability of the hexapod robot HITCR to traverse complex terrain under the control of the posture controller and the effect of the

Posture Control Experiment on Unstructured Terrain
The purpose of the posture control experiment is to verify the ability of the hexapod robot HITCR to traverse complex terrain under the control of the posture controller and the effect of the gravity center position control method based on foot end force distribution on improving walking stability. The terrain is planned to analyze the effects of the slightly rugged terrain posture maintenance and the severely rugged terrain posture adjustment, as shown in Figure 18. The terrain is divided into three parts: flat, lightly rugged, and heavily rugged. The rugged terrain is paved with angular gravel and stones of different sizes and roughness, and the protruding terrain is piled up in the severely rugged part. The maximum height of the protruding relatively flat terrain is about 210 mm.
Appl. Sci. 2020, 10, x FOR PEER REVIEW 17 of 22 gravity center position control method based on foot end force distribution on improving walking stability. The terrain is planned to analyze the effects of the slightly rugged terrain posture maintenance and the severely rugged terrain posture adjustment, as shown in Figure 18. The terrain is divided into three parts: flat, lightly rugged, and heavily rugged. The rugged terrain is paved with angular gravel and stones of different sizes and roughness, and the protruding terrain is piled up in the severely rugged part. The maximum height of the protruding relatively flat terrain is about 210 mm.

Flat terrain
Lightly rugged terrain Heavily rugged terrain Figure 18. Staged unstructured terrain. Figure 19 shows the process screenshot of the robot crossing the terrain. As shown in (a), the robot enters the slightly rugged terrain after two walking cycles, and the maximum obstacle height of the terrain is less than 40 mm, so the posture maintenance strategy is selected. As shown in (c), the robot enters the heavily rugged terrain after another 12 walking cycles, and in (d) the foot falls on a  Figure 19 shows the process screenshot of the robot crossing the terrain. As shown in (a), the robot enters the slightly rugged terrain after two walking cycles, and the maximum obstacle height of the terrain is less than 40 mm, so the posture maintenance strategy is selected. As shown in (c), the robot enters the heavily rugged terrain after another 12 walking cycles, and in (d) the foot falls on a stone with a height of about 50 mm. This behavior can stimulate the posture adjustment strategy of the severely rugged terrain. The robot climbs the convex terrain in (e) and finally crosses the complex terrain in (f). Therefore, the experimental results verify the effectiveness of the posture controller and the walking ability of the HITCR in rough terrain.

Lightly rugged terrain
Heavily rugged terrain Figure 18. Staged unstructured terrain. Figure 19 shows the process screenshot of the robot crossing the terrain. As shown in (a), the robot enters the slightly rugged terrain after two walking cycles, and the maximum obstacle height of the terrain is less than 40 mm, so the posture maintenance strategy is selected. As shown in (c), the robot enters the heavily rugged terrain after another 12 walking cycles, and in (d) the foot falls on a stone with a height of about 50 mm. This behavior can stimulate the posture adjustment strategy of the severely rugged terrain. The robot climbs the convex terrain in (e) and finally crosses the complex terrain in (f). Therefore, the experimental results verify the effectiveness of the posture controller and the walking ability of the HITCR in rough terrain.

Climbing Experiment on Stepped Terrain
The ladder is a typical discontinuous gradual terrain, which belongs to the same gradient terrain as the slope terrain. The climbing ability of this kind of terrain enables the robot to adapt to the terrain more widely. The ladder climbing movement requires the robot to have strong movement ability, and it needs to adapt to the discontinuous changes of the terrain through continuous posture adjustment compared with the slope terrain.
As shown in Figure 21, the heights of the three steps are 51, 34, and 51 mm from the bottom to the top. The step size of the robot is 50 mm, and the maximum height of the foot track is 80 mm. During climbing, the robot's motion is stable. Every time a leg moves from swing phase to support phase, the posture of the trunk is adjusted to adapt to the changing step terrain. Finally, the robot successfully climbs to the top of the ladder terrain.

Climbing Experiment on Stepped Terrain
The ladder is a typical discontinuous gradual terrain, which belongs to the same gradient terrain as the slope terrain. The climbing ability of this kind of terrain enables the robot to adapt to the terrain more widely. The ladder climbing movement requires the robot to have strong movement ability, and it needs to adapt to the discontinuous changes of the terrain through continuous posture adjustment compared with the slope terrain.
As shown in Figure 21, the heights of the three steps are 51, 34, and 51 mm from the bottom to the top. The step size of the robot is 50 mm, and the maximum height of the foot track is 80 mm. During climbing, the robot's motion is stable. Every time a leg moves from swing phase to support phase, the posture of the trunk is adjusted to adapt to the changing step terrain. Finally, the robot successfully climbs to the top of the ladder terrain. The curves of pitch angle and roll angle observed in climbing the ladder are shown in Figure  22a,b, respectively. The pitch angle starts from point zero and adjusts according to the change of step height. The maximum value is 11°, and the pitch angle returns to zero after the robot climbs to the top completely. The roll angle starts from point zero and changes with the change of terrain and the replacement of leg motion state, and the maximum offset is 3.2°. After the robot fully climbs to the top, the pitch angle returns to zero. The autonomous terrain identification method based on the LIT, mild rugged posture maintenance strategy, and severe rugged posture adjustment strategy can autonomously identify the changed step terrain and adopt the corresponding posture control strategy to make the robot successfully climb the ladder terrain. In addition, the curves of pitch angle and roll angle are smooth, and the motion of posture adjustment is stable.  The curves of pitch angle and roll angle observed in climbing the ladder are shown in Figure 22a,b, respectively. The pitch angle starts from point zero and adjusts according to the change of step height. The maximum value is 11 • , and the pitch angle returns to zero after the robot climbs to the top completely. The roll angle starts from point zero and changes with the change of terrain and the replacement of leg motion state, and the maximum offset is 3.2 • . After the robot fully climbs to the top, the pitch angle returns to zero. The autonomous terrain identification method based on the LIT, mild rugged posture maintenance strategy, and severe rugged posture adjustment strategy can autonomously identify the changed step terrain and adopt the corresponding posture control strategy to make the robot successfully climb the ladder terrain. In addition, the curves of pitch angle and roll angle are smooth, and the motion of posture adjustment is stable.

Climbing Experiment on Stepped Terrain
The ladder is a typical discontinuous gradual terrain, which belongs to the same gradient terrain as the slope terrain. The climbing ability of this kind of terrain enables the robot to adapt to the terrain more widely. The ladder climbing movement requires the robot to have strong movement ability, and it needs to adapt to the discontinuous changes of the terrain through continuous posture adjustment compared with the slope terrain.
As shown in Figure 21, the heights of the three steps are 51, 34, and 51 mm from the bottom to the top. The step size of the robot is 50 mm, and the maximum height of the foot track is 80 mm. During climbing, the robot's motion is stable. Every time a leg moves from swing phase to support phase, the posture of the trunk is adjusted to adapt to the changing step terrain. Finally, the robot successfully climbs to the top of the ladder terrain. The curves of pitch angle and roll angle observed in climbing the ladder are shown in Figure  22a,b, respectively. The pitch angle starts from point zero and adjusts according to the change of step height. The maximum value is 11°, and the pitch angle returns to zero after the robot climbs to the top completely. The roll angle starts from point zero and changes with the change of terrain and the replacement of leg motion state, and the maximum offset is 3.2°. After the robot fully climbs to the top, the pitch angle returns to zero. The autonomous terrain identification method based on the LIT, mild rugged posture maintenance strategy, and severe rugged posture adjustment strategy can autonomously identify the changed step terrain and adopt the corresponding posture control strategy to make the robot successfully climb the ladder terrain. In addition, the curves of pitch angle and roll angle are smooth, and the motion of posture adjustment is stable.

Conclusions
This paper proposed a rugged terrain adaptive strategy based on foot trajectory to solve the problem of hexapod robot posture control in the unstructured terrain climbing. The unstructured terrain was judged as mild unstructured and severe unstructured, and the corresponding posture adjustment mode was activated by combining the change of foot trajectory and the autonomous terrain judgment strategy based on LIT. A VSDM was established to keep the trunk moving smoothly based on the initial posture and reduce the influence of mild unstructured terrain on posture changes. In severe unstructured terrain, the hexapod robot actively adjusts the height and inclination of the trunk and uses the main support triangle MP formed by the support foot as the reference plane for posture adjustment. According to the MP projection in the MATLAB simulation experiment, when the robot passes through rugged ground, the variation curve of trunk yaw angle, pitch angle, and roll angle will either maintain a zero value or change smoothly and slowly at different stages, and the robot can switch between mild and severe unstructured posture control mode in a timely manner. The experiments show that the posture controller based on the VSDM model can filter out the disturbance of external environment and unstable factors of the robot's own motion. In addition, the robot can autonomously identify the changing stair terrain and adopt the corresponding posture control strategy to make it successfully complete the stair climbing.
The innovation of the posture adjustment strategy for uneven terrain in this paper is as follows: First, the hexapod robot can automatically divide the climbing terrain into mild uneven terrain and severe uneven terrain according to the foot motion trajectory, and accurately activate the corresponding posture adjustment strategy according to the terrain. Second, the hexapod robot adjusts its posture according to the VSDM model for flat and mild uneven terrain. In severe uneven terrain, the robot needs to adjust one of the trunk's height, pitch angle, and deflection angle based on the main support triangle MP. Under the premise of ensuring the robot's climbing ability, the hybrid use of the two posture adjustment strategies improves the passing efficiency. Third, the simulation and experimental results show that the control method can switch the posture control mode in a timely manner. The posture controller based on the VSDM model can filter out the external environment disturbance and unstable factors of the robot's own motion and improve the stability of the motion on the basis of realizing the target motion. This control method has good adaptability and passing performance to unstructured terrain.
The experimental results showed that the VSDM controller can filter out small vibrations during the adjustment of the pose, but the smoothness of the adjustment needs to be further enhanced. When the robot travels heavy rugged terrain, the degree of torso vibration was more than when traversing lightly rugged terrain. The posture adjustment control algorithm and controller used in the heavy rugged walking need to be optimized. In view of the above problems, the hexapod robot needs to be studied in depth from the following aspects: First, the hexapod robot needs to redesign and optimize the controller to improve the control accuracy, response speed, and stability of the torso during the adjustment process. Second, improve the accuracy and speed of robot attitude adjustment for heavy rugged terrain. Third, more external interference should be added in subsequent experiments to verify the adaptability of the robot in a complex environment.