Research on Gait Switching Control of Quadruped Robot Based on Dynamic and Static Combination

To improve the adaptability of quadruped robot to different terrain and ensure the posture stability of the robot body during gait switching, it is necessary to plan different gaits for quadruped robot. This paper mainly studies the switching among three different gaits, and a switching control method of quadruped robot gait based on the dynamic and static combination is proposed, which includes intermittent static gait is switched to non-intermittent gait, non-intermittent gait is switched to trot gait. Firstly, this paper takes quadruped robot as the research object, the SolidWorks is used to conduct three-dimensional modeling, and the D-H algorithm is used to deduce the kinematics equation of a single leg. Then, the stability margin theory and the walking gait model of the quadruped robot is analyzed, and the gait switching strategy is formulated and the stability of the switching process is studied. Meanwhile, the important parameters affecting the motion stability of the robot during the switching process are analyzed, and the trajectory of the switching gait is planned by Matlab. In addition, based on Matlab-Adams co-simulation analysis and physical prototype experiment analysis, the simulation and experimental resulted verify the feasibility and effectiveness of the proposed quadruped robot gait switching control strategy based on dynamic and static combination.


I. INTRODUCTION
In nature, tetrapods can flexible and efficient at coping with complex environments, one of the important reasons is that they have the ability to choose different gaits at different speeds [1], [2]. Therefore, in order to improve the ability of quadruped robot to adapt to complex environment, and the technological gap is reduced between the robot and their bionic object (tetrapods), It is necessary to study the switching control method of the quadruped robot between different gaits [3], [4].
At present, there are basically two control methods for gait switching: the biologically induced walking control method based on central pattern generator (CPG) [5], [6], [7], [8] and the design method based on gait motion trajectory [9]. Although control method based on CPG has been applied The associate editor coordinating the review of this manuscript and approving it for publication was Giulio Reina . in gait switching [10], [11], [12], [13], but it has two limitations (the creation of a CPG network and the setting of its parameters are too complex). Therefore, this paper focuses on the design method based on gait motion trajectory to realize the switch between different gaits. For example, Zhao et al. [14] took energy consumption efficiency as the gait switching index and realized the transformation of different gaits with the change of gait parameters. Liu et al. [15] realized the gait switch of the robot by using the phase change of gait. Shahbazi et al. [16] realized the transformation between static and dynamic gait of the robot by changing the elastic coefficient of the inverted pendulum (leg flexibility). Aoi et al. [17] realized free transformation of gait of quadruped robot by changing duty cycle of gait. Masakado et al. [18] proposed a switching method that enables the walking robot to stop at a certain point in time meeting the switching conditions to start the next gait. However, the above gait switching control methods do not VOLUME 11, 2023 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ consider the stability and smoothness caused by the change of step length and cycle in gait transformation. A more representative method of gaits switching between static and dynamic was proposed by Lee et al. [19], [20]. Among them, Literature [19] divided the process of gait switching into three parts with the same time, and the transformation from non-intermittent static gait to dynamic gait was realized, but the problem of speed smoothness in the transformation process was not considered. Literature [20] provided gait switching method for intermittent static gait and diagonal trot gait, but this method did not consider the time efficiency of the gait switching of robot.
The above researches mainly focus on stable gait switching on flat ground to adapt to the task requirements of the different gaits work. However, the dynamic stability of the robot body posture cannot be guaranteed during gait switching (including the swing and transient impact phase). The research of this paper is a bionic hydraulic quadruped robot, the animal has enough flexibility and stability in the process of moving. Therefore, we also need to ensure the stability of the pose when studying the gait switching of quadruped robot, so as to satisfy its choice of different gaits for different terrain and different speeds. In order for a quadruped robot to have this ability, this paper need to study the gaits switching control method between different gaits of quadruped robots [21].
Aiming at the above problems in gait switching design methods of quadruped robots, this paper proposes a gait switching control strategy of quadruped robots based on dynamic and static combination, and the stability and smoothness of the quadruped robot's gait switching process are considered. The aim of this paper is to explore an effective method for the switching between the three gaits, so that the robot can stably perform the connection between gaits during the switching process, the vibration amplitude of robot body as much as possible is reduced, the energy loss is reduced, and the overall efficiency is improved. The main innovations of this study are as follows: (1) Without stopping movement, the quadruped robot can realize a three-gait switch from intermittent static gait to non-intermittent continuous gait and then to trot gait. (2) In the process of gait switching, the speed transformation formula of gait switching is given to ensure the speed smoothness of the quadruped robot switching from low-speed static gait to high-speed dynamic gait.
(3) The stability planning of each gait is carried out to ensure the dynamic stability of the pose of robot body during gait switching.
Therefore, this paper was organized as follows: In Section II, the structure design and single-leg kinematic modeling of the quadruped robot are carried out to provide the foundation of the motion model for the subsequent analysis and research. In Section III, the walking stability and gait planning of quadruped robot are analyzed, which provides the basis for the subsequent research of gait switching control method. In Section IV and Section V, this paper studies the gait switching control of quadruped robot based on dynamic and static combination. The performance parameters of gait  switching, gait switching condition and state evaluation are analyzed, and combined with structure and kinematics modeling, the Matlab-Adams simulation analysis is carried out, which verifies the feasibility and stability of the gait method. In Section VI, the physical prototype of quadruped robot is studied, and the results further demonstrate the effectiveness of the proposed gait switching control strategy for quadruped robot based on dynamic and static combination. In Section VII, This paper summarizes the problems in this research and the direction of further research in the future. The paper was concluded in the last section.

II. STRUCTURE DESIGN AND KINEMATIC MODELING A. STRUCTURE DESIGN OF QUADRUPED ROBOT
To study gait, the main structure of quadruped robot should be designed. Firstly, this paper uses the SolidWorks software to draw a hydraulic quadruped robot structure, as shown in Figure 1. The flexibility and stability of the robot movement are considered, the structure of front elbow and back knee is finally determined. This structure has good stability and strong movement flexibility [22]. Meanwhile, each leg of the robot is configured with three degrees of freedom, corresponding to three joints, namely, side swing joint, hip joint and knee joint [23].

B. SINGLE-LEG KINEMATIC MODELING
Kinematic model is the basis of studying gait planning and motion of quadruped robot. Without considering mechanical characteristics, the joint angle, motion speed, body posture and foot-end position are calculated from the geometric point of view. In this paper, the D-H coordinate transformation method is used to derive the forward kinematics and solve the inverse kinematics of the designed quadruped robot structure (single leg as an example).
As shown in Figure 2, L 1 is the length of lateral swing (hip). L 2 is thigh length; L 3 is calf length; θ 1 is lateral swing angle; θ 2 is thigh joint angle; θ 3 is calf joint angle. The base coordinate system is established at the side swing, and the coordinates of the foot-end coordinate system under the base coordinate system is established by using the kinematics D-H coordinates. Among them, D-H coordinate parameters are shown in Table 1.
The general formula of kinematic linkage changes is formula (1) [24]. Here, The data from the table 1 is taken into the transformation formula to obtain the transformation matrix between the connecting rods as follows.
Here, A 01 is the transformation matrix of link 1 with respect to the basis coordinates; A 12 is the transformation matrix of link 2 with respect to the coordinates of link 1; A 23 is the transformation matrix of link 3 with respect to the coordinates of link 2; A 34 is the transformation matrix of foot-end position relative to link 3.
The transformation matrix of the foot-end pose relative to the base coordinate system is formula (3).
where, A is the forward kinematic solution of one leg (footend trajectory equation). In formula (3), p x , p y , p z are the origin vector element of the position of the foot-end relative to the base coordinate system. They are expressed as formula (4).
Since each leg of the hydraulic quadruped robot has three degrees of freedom, there will be multiple solutions when solving the inverse solutions of its kinematics formula. So, the inverse transformation method of the homogeneous matrix is used to solve the inverse solution of each leg of hydraulic quadruped robot [23]. The transformation formula of the foot-end position with respect to the lateral swing joint angle θ 1 , the thigh joint angle θ 2 , and the calf joint angle θ 3 is formula (5).

III. GAIT ANALYSIS OF QUADRUPED ROBOT
The traditional gait of quadruped robot is generally divided into static gait (walk gait) and dynamic gait (trot gait). It is generally believed that when a quadruped robot has at least three legs in the supporting phase at any time, it indicates that the robot is walking with static gait, and the motion stability of the robot is better at this time. The most common static gait is the walk gait, and according to the difference of duty cycle, the walk gait can be divided into non-intermittent gait and intermittent gait [25], [26]. Non-intermittent gait, also known as continuous static gait, it is a walk gait widely used at present, and it has good motion stability and easy control. Non-intermittent gait is a critical walk gait whose duty cycle is exactly equal to 0.75. Under this gait, when one leg of the robot touches the ground and enters the support phase, another leg will inevitably lift up and enter the swing phase. That is, three legs of the robot are in the support phase at any time.
Different from non-intermittent gait, a complete gait cycle of intermittent gait is divided into six nodes. Namely, there are two more centroid position adjustment nodes. Its gait order can be expressed as: the robot first offsets the center of mass to one side, and makes the two single legs on the side complete the gait motion in turn, then the robot offsets the center of mass to the other side, accompanied by a section of center of mass forward, the robot will complete the gait motion on the other side, and prepare for the next center of mass offset, and the cycle starts again. In a complete gait cycle, the robot needs to adjust its center of mass twice in VOLUME 11, 2023 total. Meanwhile, in order to ensure the motion stability, the center of mass of the robot should always be maintained within the transverse critical range, which is determined by the critical boundary on the left and right sides of the robot where it is about to roll over. Therefore, the vertical distance between the center of mass and these two critical boundaries is the stability margin under this gait.
When the duty cycle of the robot gait is less than 0.75, the robot will enter the dynamic gait. When the robot walks with trot gait, its two sets of diagonal legs (LF, RB, RF, LB) will carry out synchronous gait movement in sequence. This highly symmetrical motion characteristic enables the robot with trot gait to have excellent stability, speed and low energy consumption. This has contributed to the trot gait becoming the most widely used moving gait for quadruped robots. In this design, trot form of dynamic gait will be adopted, and duty cycle is set as 0.5, that is, the period of support phase is equal to that of swing phase. This is a kind of trot gait in a critical state. When one group of diagonal legs is about to enter the support phase, the other group is about to enter the swing phase. This feature enables the centroid projection of the robot walking stably with trot gait to always fall on the central axis of the forward direction. Therefore, the quadruped robot with this gait has both good rapidity and stability.
In the stability analysis of trot gait, the above stability margin method is no longer applicable. Therefore, this paper adopts a method suitable for the stability analysis of trot gait, namely the zero moment point (ZMP) method, to analyze it.

A. STABILITY MARGIN THEORY 1) STABILITY MARGIN ANALYSIS OF WALK GAIT
The stability margin of walk gait is an effective method to illustrate the stability of the robot's static gait. The stability criterion of this theory is: when the robot is moving, whether the projection of the robot's center of mass on the plantar plane can remain in the supporting polygon formed by the three legs in the supporting phase. As shown in Figure 3, CM represents the projection of the robot's centroid, d 1 , d 2 , d 3 respectively represent the vertical distance of the projection of the centroid to each side of the stable triangle. According to the theory of stability margin, the stability margin when the robot adopts the walk gait can be expressed as: According to Formula 6 and Figure 3, when d m < 0, the centroid projection falls on the outside region of the stable triangle, and the robot is in an unstable state, prone to toppling or roll over. When d m > 0, the centroid projection falls in the stable triangle, and the robot is in a stable state. The larger the value of d m , the closer the centroid projection is to the center of the triangle, and the robot has better stability. When d m = 0, the centroid projection just falls on the edge of the stable triangle. At this time, the robot is in a critical stable state and prone to instability when subjected to external interference.  Using the theory of stability margin, we can plan the static gait sequence of the robot. The schematic diagram of the quadruped robot is shown in Figure 4(a), where LF, RF, RB and LF represent the left front leg, right front leg, right rear leg and left rear leg of the robot respectively.
When the lateral movement of the quadruped robot is not considered, the center of mass of the robot body can be regarded as always falling on the central axis of the forward direction. Meanwhile, when the robot moves, its four single legs will enter the swing phase in turn, and the change of single legs in each swing phase will bring about the change of stable triangle. Therefore, in order to ensure the stable walking of the robot, it is necessary to constantly adjust the position of the center of mass in the forward direction of the robot body, so that it can accurately fall within each stable triangle. The motion diagram of the robot's walk gait is shown in Figure 4(b). In the figure, the solid circle represents the foot-end of the one-legged in the support phase, the hollow circle represents the end-foot of the one-legged in the swing phase, the blue triangle represents the stable triangle formed before the gait movement, and the red triangle represents the stable triangle formed after the gait movement. CM and CM' respectively represent the position of the robot's center of mass before and after gait movement, while the two line segments separated by the horizontal short line represent the range of the robot's center of mass that can move stably.

2) STABILITY MARGIN ANALYSIS OF TROT GAIT
The stability margin analysis of trot gait generally adopts the Zero-Moment Point (ZMP) theory. The premise of the ZMP stability criterion is to ensure that the ZMP of the robot in motion is always in the support polygon formed by the feet-end points of the robot [27], [28], [29]. The specific calculation of ZMP criterion method is shown in Figure 5. Here, the Z-axis direction is the forward direction of the robot. The X-axis is going straight up, The Y direction is determined Taking the left front leg as an example, the coordinate P i of the robot's foot-end point in the single-leg coordinate system X i Y i Z i can be obtained according to the forward kinematics solution results. After corresponding coordinate translation transformation, the coordinate B P i of the foot-end point in the base coordinate system X B Y B Z B and the coordinate W P i in the global coordinate system X W Y W Z W can be obtained respectively. Therefore, the supporting polygon under the trot gait can be constructed through the coordinate W P i of each foot-end point, as shown in polygon P 1 P 2 P 3 P 4 in Figure 5.
Suppose the total mass of the robot is M, gravity is g, and the net force of action on the foot-end facing the ground is f, then under the global coordinate system X W Y W Z W , gravity can be expressed as g =[-g,0,0] T , The center of gravity coordinates can be expressed as According to theoretical mechanics, we can obtain the torque of the reaction force f on the foot-end to the global coordinate as follows: τ = W Pf +τ ZMP . Here: τ ZMP represents the torque passing through ZMP. According to the momentum theorem, the momentum expression of the robot can be written. After sorting out and differentiating with respect to t, we can get: Similarly, according to the angular momentum theorem, the expression of angular momentum derivative can be written: Associated with equation (7) and formula (8), τ ZMP can be calculated as: According to the properties of ZMP, the total moment of the horizontal component acting on it is zero.
Therefore, if τ ZMP | z = τ ZMP | y =0 in formula (9), then: In the formula (10), X ZMP represents the height of the foot from the ground. When the quadruped robot is just in the critical condition of quadruped touching the ground, X ZMP = 0. In order to facilitate analysis, the robot can be regarded as a point of mass, then the momentum of the robot can be expressed as: Angular momentum can be expressed as: Equations (10) and (11) are substituted into formula (12), as follows: In the formula (13), X zmp can be measured according to the actual situation, and Z B and Y B can be obtained by transforming the results of the forward kinematics solution. Therefore, the values of Z ZMP and Y ZMP can be easily solved, and the coordinates of ZMP can be calculated as: Combined with ZMP coordinates, we can plan the dynamic gait stability margin of the robot by ZMP theory. Different from the stability triangle criterion of static gait, the stability criterion of trot gait can be divided into two conditions. One is the instantaneous condition when all four legs of the robot are in the supporting phase, as shown in Figure 6(a). Set the distance between ZMP and each side of the supporting polygon as d i , then the stability margin d ZMP of the robot meets:  The stability criterion can be expressed as follows: when d ZMP < 0, the robot is in an unstable state. When d ZMP > 0, the robot is in a stable state. When d ZMP = 0, the robot is in a critical stable state. In the other case, the robot will have a set of diagonal legs in the swinging phase, as shown in Figure 6 (b). At this time, the robot only touches the ground with two feet, so it cannot form the traditional support polygon. We used the magnification method to describe the stability margin d ZMP as the vertical distance between ZMP and the support boundary, while the critical stability margin is the vertical distance between the diagonal of the support and the support boundary d max . The range of the supporting boundary is determined by the touching area of the robot's supporting feet. The robot stability condition d ZMP in this case can be expressed as: In the initial stage, we will adjust the body posture, which is the switch point 6 in the screenshot, to adjust the body's center of gravity in the forward direction and the side swing direction, and then the motion planning of the robot's four legs is carried out. In a gait cycle, we need to adjust the center of gravity of the robot twice, which is also the biggest characteristic of intermittent gait.

C. ANALYSYS OF NON-INTERMITTENT STATIC GAIT
After planning the intermittent static gait, we need to analyze the non-intermittent static gait in order to find the connection point between the two states, so as to make the transition of each gait stable and shorten the time. Non-intermittent gait can also be called continuous static gait, this gait is more stable, but also slower. Meanwhile, the center of gravity does not move laterally during the advance of the gait. By adjusting the displacement of the center of the forward direction, the projection of its center of mass is located in the triangle of the stability criterion.
Therefore, after we plan the intermittent gait, we need to adjust the center of gravity of the robot to the center line, and then we can plan the continuous static gait. According to the analysis, the sequence of gait is divided into left front legright back leg -right front leg -left back leg. In the late stage of non-intermittent gait, the speed is uniformly accelerated from 0 to V in order to accelerate the trot gait later, so as not to cause unstable state due to excessive acceleration during the switch.
Here, V = 2 * S/T , part of its walking strategy and gait timing diagram are shown in Figure 8. Among them, COG is center of gravity.

D. ANALYSIS OF DIAGONAL GAIT
After planning the non-intermittent gait, we will move on to the final diagonal gait analysis. From static gait to dynamic gait, we should not only calculate the connection of the two states well, but also set the speed well, so that it can switch stably under the condition of changing gait and speed, and finally achieve the diagonal effect.
Diagonal gait is a relatively stable gait, and the duty cycle of each leg in diagonal gait is 0.5 [30]. The center of mass of the robot moves in the straight direction, and the two groups of diagonal legs swing alternately. Part of its gait sequence is shown in Figure 9. COG is center of gravity.

IV. DESIGN OF GAIT SWITCHING STRATEGY FOR QUADRUPED ROBOT
In Section III, the intermittent walk gait, non-intermittent walk gait and trot gait of quadruped robot have been classified and explained in detail. Compared with dynamic gait, the robot with static gait has better stability. Therefore, the gait switching strategy adopted in this paper is to start with the intermittent walk gait. On the basis of the basic pose adjustment and stable start of the robot, the robot is switched to the non-intermittent walk gait through the static gait switching process and then to the trot gait through the static-dynamic gait switching process. Meanwhile, the speed is constantly increased in the switching process to ensure the stability margin of the robot and achieve a stable and smooth transition of the robot at the switching point [31], [32].
The parameters involved in the gait switching strategy are as follows: Basic period T : the time parameter used to facilitate calculation and classification discussion.
Gait cycle T i (i = 1, 2, 3): it is composed of several basic cycles, and different gait movements correspond to different gait cycles. In this paper, the intermittent walk gait cycle T 1 = 3T , the non-intermittent walk gait cycle T 2 = 2T , and the trot gait cycle T 3 = 0.5T .
Speed of static gait v 1 : static gait movement speed of robot. Speed of moving gait v 2 : speed of moving gait of the robot. In addition, this strategy involves two coordinate systems: the one-legged coordinate system and the global coordinate system. The single-leg coordinate system is established at the hip rotation center of the single leg, and the horizontal direction pointing to the center of gravity is the positive direction of the Z -axis, which is used to represent the vertical distance from the foot-end to the corresponding hip rotation center, namely, the relative position of the foot. The global  coordinate system is established at the center of gravity of the robot, with the forward direction of the robot as the positive direction of the Z -axis and the left direction perpendicular to the forward direction as the positive direction of the Y -axis, which is used to represent the transverse and longitudinal displacement and velocity of the robot. The establishment diagram of the coordinate system is shown in Figure 10. O W Z W Y W (COG) is coordinate of the (center of gravity);

A. STATIC GAIT SWITCHING STRATEGY
The static gait switching process of the robot in this design is divided into four stages.

1) PHASE ONE
As shown in Figure 11. The quadruped robot makes the pose adjustment and prepares to enter the intermittent walk gait, duration T /2.
The gait movement characteristics of this stage are as follows: a) The distance from the end points of the front and rear feet-end to the center of rotation of the corresponding hip was adjusted to S/2.
b) The center of gravity of the quadruped robot is shifted laterally by the single leg that performs gait movement for the first time, and the offset is W (in this design, RB will perform gait movement for the first time, so the center of gravity is biased to the left).

2) PHASE TWO
As shown in Figure 12. The robot performs intermittent walk gait movement with a duration of 3nT/2 (n = 1,2,3. . . ).   The gait movement characteristics of this stage are as follows: a) The gait movement of the quadruped robot will follow the following sequence: RB movement → RF movement → adjust the center of gravity of the robot → LB movement → LF movement → Adjusting center of gravity of the robot. b) Each time the center of gravity of the robot body is adjusted, the lateral offset of the center of gravity is 2W and the forward offset is S/2. c) In each gait movement with one leg, the step length is S, and the center of gravity does not move forward. In a complete gait cycle (3T ), each single leg of the robot moves once, and the center of gravity moves forward by S in total.

3) PHASE THREE
As shown in Figure 13. The robot posture was adjusted to switch from intermittent walk gait to non-intermittent walk gait with a duration of 3T /2.
The gait movement characteristics of this stage are as follows: a) The gait movement of the quadruped robot will follow the following sequence: Adjust the center of gravity of the robot → LB movement → LF movement.
b) The center of gravity does not shift laterally. c) In each gait movement with one leg, the step length is S, and the center of gravity moves forward by S/4. In a complete gait cycle (2T ), each single leg of the robot makes a gait movement, and the center of gravity moves forward by S in total.

B. STATIC -DYNAMIC GAIT SWITCHING STRATEGY
The static dynamic gait switching process of quadruped robot is also divided into four stages. Figure 14. The robot performs a uniformly accelerated non-intermittent walk gait to prepare the speed for the switch to trot gait, and the duration is T .

As shown in
The gait movement characteristics of this stage are as follows: a) The gait movement of the quadruped robot will follow the following sequence: RB movement → RF movement.
b) The center of gravity does not shift laterally. c) In each gait movement with one leg, the step length is S, and the center of gravity moves forward by S/4. d) The movement speed gradually increases.

2) PHASE TWO
As shown in Figure 15. The leg posture of the robot was adjusted to switch from non-intermittent walk gait to trot gait with a duration of 3T /4.  The gait movement characteristics of this stage are as follows: a) Adjust gait position to achieve stable and smooth switching between static and dynamic gait.
b) The center of gravity does not shift laterally. c) The movement speed gradually increases.

3) PHASE THREE
As shown in Figure 16. The robot performs an accelerated trot gait movement with a duration of T /2. The gait movement characteristics of this stage are as follows: a) The gait movement of the quadruped robot will follow the following sequence: The movement of diagonal leg RF, LB → The movement of diagonal leg LF, RB.
b) The center of gravity does not shift laterally. c) In each gait movement of the diagonal leg, the step length is 7S/4, and the center of gravity moves forward by S. In a complete gait cycle (0.5T ), each group of diagonal legs of the robot performed one gait movement, and the center of gravity moved forward for 2S in total, that is, the center of gravity displacement of the robot had a forward length of S/4 relative to the foot displacement.
d) The movement speed is gradually increased to the maximum speed v 2 .
The gait movement characteristics of this stage are as follows: a) The gait movement of the quadruped robot will follow the following sequence: The movement of diagonal leg RF, LB → The movement of diagonal leg LF, RB.
b) The center of gravity does not shift laterally.   c) In each gait movement of the diagonal leg, the step length is 3S/2, and the center of gravity moves forward 3S/4; In one gait cycle (0.5T ), each group of diagonal legs of the robot performed one gait movement, and the center of gravity moved forward 3S/2 in total. The center of gravity of the robot and the foot position remained relatively static.

C. SWITCHING CONDITION AND STATE EVALUATION
To adapt to the needs of different environmental terrain, the robot is required to automatically switch gait. The switching state of the gait switching control method of the quadruped robot designed in this paper can be evaluated as follows: Within 5 movement cycles, the pose angle of the robot during movement (including pitch angle, roll angle and yaw angle) should meet the requirements of (−5 • − +5 • ), and the error range of the force on the foot-end of each leg is [0-300N]. Meanwhile, the switching conditions are shown in Table 2, where '' √ '' indicates that the conditions are met and ''×'' indicates that the conditions are not met.

V. ANALYSIS OF GAIT SWITCHING PERFORMANCE PARAMETERS A. FOOT-END POSITION ANALYSIS OF SWITCHING POINT
When a quadruped robot switches its gait, the position of its foot landing point is related to the switching efficiency and the motion performance after switching [33]. To solve this problem, it is divided into two cases: static gait switching and static-dynamic gait switching.   According to the walking strategy planned above, the oneleg movement step of the robot under the intermittent walk gait is S, and the center of gravity moves forward by S/2 during each pose adjustment, accompanied by a certain lateral deviation. However, the center of gravity of the robot with non-intermittent walk gait always stays on the center line. Therefore, the reset mode of the center of gravity can be divided into two situations: left deviation and right deviation, as shown in Figure 18.
When the center of gravity is reset to the center line, LB and LF of the robot will adjust the gait position successively, and the adjustment step length is determined by the non-intermittent walk gait step length after the switch. According to the non-intermittent walk gait strategy, the step length of each single leg step is S, and the center of gravity moves forward by S/4. Therefore, from the perspective of stability, the relative position x i of each foot should be guaranteed to have a displacement difference of S/4. Therefore, the position of the hind foot can be adjusted as follows: To reach the foot position described in formula (17), LB will first conduct gait movement with a step length of 3S/2, and then LF will conduct gait movement with a step length of 5S/4, as shown in Figure 19.
However, when the center of gravity is reset to the center line through the left deviation, RB and RF need to reset the foot-end before the above foot position adjustment operation.
Compared with static gait switching, the foot position adjustment method during static and dynamic gait switching is relatively simple, which only needs to ensure that the relative foot position x i of each group of diagonal legs is the same. Combined with the trot gait movement strategy in the next stage, the expected foot position can be obtained as follows: To reach the foot position mentioned in formula (18), LB will first conduct walk gait movement with step length S/2 and center of gravity moving forward S/4, then LF and RB will conduct diagonal gait movement, where LF step length is 3S/2 and RB step length is 3S/4, and center of gravity moving forward S/2, as shown in Figure 20.

B. ANALYSIS OF STATIC-DYNAMIC GAIT SWITCHING SPEED
According to the static-dynamic gait switching strategy, when entering the later stage of walk gait, the quadruped robot's movement speed will continue to increase until the connection with trot gait is completed. During this process, whether the transition of the robot's center of gravity speed is reasonable will determine whether the switching process is smooth [12].
To solve the velocity change function of the switching process, the static gait velocity v 1 and the dynamic gait velocity v 2 need to be solved first, and they are taken as the initial and final velocities before and after the static and dynamic gait switching. Combined with the definition and switching strategy given above, it can be seen that the gait cycle of non-intermittent walk is 2T , and the total displacement of the center of gravity in one gait cycle is S. The trot gait cycle is T /2, and the total displacement of the center of gravity in a gait cycle is 2S, then the static and dynamic gait velocities can be expressed as: Assuming that the displacement of the robot's center of gravity at any time during the switching process is S t and its velocity is v t . Meanwhile, in order to ensure the smooth transition of the switching process, the acceleration a is set as a constant value, then the robot will accelerate uniformly during the whole switching process, and the change function of its displacement and velocity can be expressed as: In the process of gait switching, the total displacement S max of the center of mass, the total time T max and the final velocity v 2 are all known quantities. Therefore, by substituting the above parameters into formulas (21) and (22) and sorting them out, the expressions of acceleration a and the total time T max can be obtained: Finally, by substituting formula (23) into formula (22) and sorting it out, the velocity change function of the stationdynamic gait switching process can be obtained:

C. GAIT SWITCHING TRAJECTORY CURVE OF ROBOT
According to the above derived formulas and combined with the compilation of a large number of Matlab trajectory programs, this paper reasonably planned the switching trajectories of four legs and three gaits, as shown in Figure 21, the switching curves of four legs.

D. SIMULATION ANALYSIS OF MATLAB AND ADAMS
To effectively and accurately verify the three-gait trajectory switching, a co-simulation platform was built here to adjust and analyze the stability of the motion in real time. The cosimulation of Matlab-Simulink and Adams ca realize this process. Adams virtual prototype was our control object, the corresponding driver data output by Matlab, and then according to the realization state of Adams to adjust the control program. Therefore, the Adams state output was the input of the Matlab.

1) SETTING SIMULATION PARAMETERS AND PROCESS ANALYSIS
The Matlab-Adams simulation time set in this paper was 15s. Meanwhile, we need to capture and record the simulation data curve of robot gait switching. Among them, the simulation parameter table and simulation animation in each stage of gait switching simulation were shown in Table 3 and Figure 22- Figure 25, respectively. After the completion of the simulation, the oscilloscopes were opened in the co-simulation platform to observe the motion changes of each joint Angle, as shown in Figure 26- Figure 28.
In the first 3.5s of the simulation, the intermittent walking gait was performed, and between 3.5s and 5s, the first switching sequence was performed. At the end of the switching, the non-intermittent gait needs to be adjusted in two steps, and between 6s and 9.5s, the non-intermittent walking gait was performed. Finally, 0.5T was used to switch from walk to trot, and then trot acceleration was carried out.

2) ANALYSIS OF SIMULATION RESULTS
The displacement change curve in the process of gait switching was shown in Figure 29. In the figure, the solid red, blue and green lines respectively represent the displacement changes of the center of mass in the transverse, vertical and forward directions. The observation showed that the displacement of the robot before 6s was in the intermittent walk gait, and the displacement change of the center of mass in the forward direction showed a periodic rise, while the displacement change of the center of mass in the lateral direction showed a periodic fluctuation, and the fluctuation range was ±100mm. When the robot switched to non-intermittent walk gait, the displacement change of the center of mass in the lateral direction tends to be stable, while the displacement change in the forward direction began to enter a stable rising stage, and the rising slope was 50mm/s. When the robot moved to 10.25s, the forward speed gradually increased and reached the peak at 12s, and the rising slope of the displacement of the center of mass gradually increased to 540mm/s. In addition, the position of the center of mass in the vertical direction was stable until the 10.25s fast trot movement begins to show small fluctuations. Figure 30 showed the lateral and longitudinal velocity change curves of the center of mass. It could be seen that several key switching points in the figure correspond to the displacement curve of the center of mass, which mainly showed the stage of large periodic fluctuation from 0 to 6s, the stage of small periodic fluctuation from 6s to 10.25s, and the stage of velocity rise after 10.25s.
In addition, the lateral velocity curve fluctuates at the position of 0 velocity line, and the average value is slightly greater than 0, indicating that the robot has a small deviation VOLUME 11, 2023     in the lateral direction. The longitudinal velocity changes with the change of centroid displacement, and finally reaches 540mm/s, which is in line with the expected value. Figure 31- Figure 32 showed the changing curve of the robot's pose angle. In general, the pitch angle fluctuation range of the quadruped robot was -1 • ∼0.6 • , and the yaw angle fluctuation range was -1.8 • ∼1.8 • . By contrast, the dynamic gait posture angle range was better than static gait, this was because as robot to switch from the gait unceasingly, also the corresponding gait cycle from 3T reduced to 2T, finally only 0.5T, this lead to one leg of the robot alternating frequency was accelerated, and the volatility of pose angle also decreased accordingly.
Through the above simulation and analysis, it could be clearly seen that the center of mass of the quadruped robot body tended to be stable in the process of gait switching, which verified the feasibility of the stable gait switching strategy proposed in this paper.

VI. ANALYSIS OF EXPERIMENT
To verify the effectiveness of the proposed gait switching strategy, it is necessary to establish a physical prototype for experimental analysis. This quadruped robot is a hydraulic quadruped robot test platform jointly developed and built by Harbin Institute of Technology, University of Shanghai for Science and Technology and Yanshan University. It has a built-in fuel source, so it can walk on its own.

A. CONTROL SYSTEM HARDWARE
The hardware structure of the control system of the hydraulic quadruped robot is shown in Figure 33. For the quadruped robot studied in this paper, according to the requirements of the control system structure, working environment and information collection, the control system adopts a two-layer structure of the upper and the lower computer.
As shown in Figure 33(a), advantech PC104 is used as the master computer in the upper computer, which is mainly used for data storage, data processing, real-time control program download, start-stop logic control, and transmits the excitation signal to the controller of the lower computer. In addition, it is also responsible for gait planning, foot trajectory planning and gait switching tasks of quadruped robot during walking. Meanwhile, it can also calculate the foot-end position contact force and robot body pose control.     Advantech PC104 is used as the core controller of the lower computer, as shown in Figure 33(b). It is used to execute the output displacement signal of the hydraulic cylinder, the acquisition position and the signal collected by the force sensor. Its peripheral components include: (1) HIT-PC104-HXL-515 acquisition card is used to collect the force/position sensor information of each joint and perform A/D conversion.
(2) HIT-PC104-HXL-P520 is used for D/A conversion to generate hydraulic valve control signals.
Hydraulic quadruped robot control program framework based on Matlab Simulink framework for simulation, testing. The whole development process can be co-simulation and experiment, controller algorithm changes are in the unified    Matlab Simulink framework, and its development efficiency is high. When the controller determines the program, it can be generated, solidified, shaped, and then integrated with the motion master module.

B. GAIT SWITCHING EXPERIMENT ON FLAT GROUND
The key point in stable gait switching experiment on flat ground was to control the step frequency and the position of the center of gravity during the gait switching. That was, on the one hand, to control the speed change before and after  the gait switching, on the other hand, to ensure that the shifted center of gravity of the robot could be accurately reset to the center line. Since the quadruped robot gait in this experiment only involved intermittent walk gait and trot gait, the gait switching strategy formulated above need to be adjusted, which was mainly reflected in replacing the non-intermittent walk walking stage with the intermediate transition stage. In this phase, the robot reset its center of gravity and adjust its posture, and prepare for the accelerated trot walk after the switch.
In the experiment, we set the intermittent walk gait step length was 100mm, step height was 60mm, gait cycle was 3s, and duty cycle was 0.83. The step length was 50mm, the step height was 40mm, the gait cycle as 0.5s, and the duty cycle was 0.5. The experimental process of stable gait switching of the quadruped robot prototype was shown in Figure 34. Meanwhile, the experiment adopted the manual control method to carry out the gait switching experiment.
We also derived the comparison curves of hydraulic cylinder displacement between RF side swing, thigh and calf, as shown in Figure 35-Figure 37. Where, the solid red, green and blue line represent the theoretical, actual and adjusted displacement curve respectively. It could be seen that in the stable gait switching experiment, the motion state of the robot was mainly divided into three stages: intermittent walk walking stage, intermediate transition stage and trot walking stage. In the first 6s of the experiment, the robot completed two gait cycles of intermittent walk gait movement. Then the robot entered an intermediate transition stage of 4s. In this stage, the robot adopted a slow step gait with a gait cycle of 2s to complete the adjustment of pose and center of gravity. Then the robot entered the third stage, in which the robot first performed accelerated trot movement, and the gait cycle gradually decreased from 1s to 0.5s. When the speed reached the maximum, the robot then performs uniform trot movement at the same speed.
To be able to more clearly visualize the gait switching process in detail, we will compare the curve of the transition point between the various stages of amplification processing, could be seen in every transition point, the stability of the robot was affected by a certain, although walk in stabilizing controller to adjust the situation improved, but part of the transition points still existed larger overshoot amount.

C. GAIT SWITCHING EXPERIMENT ON DIFFERENT TERRAIN
To verify the effectiveness of the proposed gait switching control method for quadruped robot based on the combination of dynamic and static to adapt to different terrain, the robot was placed on horizontal road surface→sand road surface→stone road surface (pothole road surface) for gait switching experiment. Meanwhile, the parameters of three gaits are consistent with the previous experiment, and the automatic control method is used for gait switching. In addition, the conventional trot gait→walk gait was compared with the gait switching method proposed in this paper (before adjustment and after adjustment). Figure 38 showed the comparison curves before and after the adjustment of the robot pose angle in the process of gait switching. The two transition points were located at 8s and 12s respectively. It could be seen that the optimization effect in the intermediate transition stage was obvious after adjustment, and the fluctuation frequency and range of each pose angle had been improved to a certain extent.

VII. DISCUSSION
The main content of this paper is gait switching control strategy of quadruped robot based on dynamic and static combination. Through simulation and experimental analysis, this study has achieved certain phased results, but there are also some problems, which need to be improved and optimized in the subsequent work: In the simulation and experiment of the dynamic and static gait switching in this paper, although the situation is improved under the regulation of the stable walking controller, there is still a large overshoot at some transition points, so it is necessary to further optimize the dynamic and static gait switching method.
The fluctuation frequency and fluctuation range of each pose angle of the four groups of robots adjusted by the dynamic and static gait switching strategy are improved to some extent during the process of gait switching, but further optimization design can be made to make the pose angle change range smaller and more stable.

VIII. CONCLUSION
This paper takes quadruped robot as the research object, formulates the gait switching strategy and studies the stability of the switching process. In this paper, a set of switching strategies are formulated according to the static and static gait switching of the robot, and the important parameters affecting the stability of the robot motion are analyzed in the switching process. After that, the simulation of the quadruped robot's gait switching is completed by building the matlabadams model. The simulation results show that the proposed quadruped robot gait switching strategy based on dynamic and static combination can achieve stable and smooth switching of quadruped robot, which verifies the feasibility and stability of the strategy. Meanwhile, the physical prototype experiment of quadruped robot further verifies the effectiveness of the proposed gait switching control strategy for quadruped robot based on dynamic and static combination.
The research of this paper provides a design reference for the research of quadruped robot walking stably.