The Complex Dynamic Locomotive Control and Experimental Research of a Quadruped-Robot Based on the Robot Trunk

Featured Application: This paper focuses on the dynamic pacing gait planning and control of hydraulic quadruped robot. The performance of robot has been improved. As an experimental platform, the research of the robot on complex terrain can be completed in the future. Abstract: The research of quadruped robots is fundamentally motivated by their excellent performance in complex terrain. Maintaining the trunk moving smoothly is the basis of assuring the stable locomotion of the robot. In this paper we propose a planning and control strategy for the pacing gait of hydraulic quadruped robots based on the centroid. Initially, the kinematic model between the single leg and the robot trunk was established. The coupling of trunk motion and leg motion was elaborated on in detail. Then, the real-time attitude feedback information of the trunk was considered, the motion trajectory of the trunk centroid was planned, and the foot trajectory of the robot was carried out. Further, the joint torques were calculated that fulﬁllment minimization of the contact forces. The position and attitude of the robot trunk were adjusted by the presented controller. Finally, the performance of the proposed control framework was tested in simulations and on a robot platform. By comparing the attitude of the robot trunk, the experimental results show that the trunk moved smoothly with small-magnitude by the proposed controller. The stable dynamic motion of the hydraulic quadruped robot was accomplished, which veriﬁed the e ﬀ ectiveness and feasibility of the proposed control strategy.


Introduction
Quadruped robots have wide application prospects in complex environments, since they have high power density, strong load capacity, and great mobility and flexibility [1][2][3][4]. They are superior to tracked robots and wheeled robots, due to the advantage of better terrain adaptability. The Bigdog robot developed by Boston Dynamic in 2008 is the representative of the hydraulic quadruped robot [5]. Bigdog has good adaptability and stability, and can adapt to complex and dangerous environments, such as mountains, jungles, beaches, swamps, ice and snow. Since then, hydraulic quadruped robots have become a popular research topic because of their excellent obstacle-crossing and anti-interference ability in complex environments [6][7][8], and some momentous achievements have been made in recent years. For instance, Boston Dynamic's Alpha Dog [9], Cheetah [10], Spot [11] and Spotmini [12], ETH Zurich's ANYmal [13], the Italian Institute of Technology's HyQ [14], MiniHyQ [15] and HyQ2Max [16], and Shandong University's SCalf-I [17] and SCalf-II [18].
Quadrupeds in nature can choose different gaits to complete their movements according to their purposes and topographic information [2]. The motion modes of quadruped robots are inspired by Appl. Sci. 2019, 9,3911 2 of 19 quadruped animals [19]. The trotting gait is a common gait in quadruped mammals. Therefore, the trotting gait of hydraulic quadruped robots is one of the research hotspots. Moro FL et al. [20] proposed a method to directly apply the motion characteristics of horses to a quadruped robot. The foot trajectory was generated by a set of four kinematic motion primitives, and the stable, valid and effective walking and trotting gait of a quadruped robot was realized. Chung JW et al. [21] successfully tested the trotting gait of a quadruped robot by using the dynamic model of virtual biped gait. Havoutis I et al. [22] designed a gait controller for trotting gait, and the problem of force balance in the process of robotic motion was solved by using active compliance control. Cai RB et al. [23] proposed a time and attitude control method, which divides the control of quadruped robot into gait control and attitude control. Gehring et al. [24] proposed a controller that can switch between walking trot and running trot.
However, while a hydraulic quadruped robot moves with trot gait, its two swinging legs often fail to touch the ground at the same time. In that case, the robot trunk will rotate obliquely around the supporting leg, since the first landing leg has a great impact on the trunk. The turning moment around the supporting diagonal line will be generated. He et al. [25] used the starting posture to weaken the adverse effects of overturning moment. Xie et al. [26] verified that the overturning torque was caused by the forward swing joints at the hips of the standing legs, and proposed an attitude control method to balance overturning moment by using the hip side-sway joint moment. Nonetheless, these conclusions have not been validated on the robot platform, nor can they fundamentally solve the problem of robot turnover. Moreover, most of the current research efforts focus on the simple trot gait, and less on the more complex dynamic gait. In this context, the gait selection of robots in complex terrain has certain limitations.
In addition, the hydraulic quadruped robot is a strongly coupled nonlinear system. In the process of robot locomotion, the trunk is always in a bumpy state and often affected by unpredictable factors [27]. Boussema et al. [28] proposed a posture recovery strategy based on a feasible impulse group, and the effectiveness of this method was verified when the Cheetah-3 robot was disturbed by external disturbances. A control strategy based on four three-dimensional spring dampers was proposed by Tran et al. [29], and the rotational disturbance control of quadruped walking robot under unknown terrain conditions was implemented. A gait generator based on CPGs modulated by vestibular feedback was proposed by Fukui T et al. [30]. The bio-inspired robot robustly ran with an emergent gallop while stepping on and over several types of unperceived obstacles. Park et al. [31] presented a feedback controller, which allowed the robot to change its gait parameters according to terrain information. Due to the external disturbance and the real-time change of trunk position and attitude, there is an enormous gap between the theoretical and practical results of the robot driving functions. Hence, for a hydraulic quadruped robot, the position and posture of the robot trunk must be divided into the individual legs. However, the position and attitude information of the trunk in the process of robotic motion is not taken into account in the above methods.
This paper focuses on the complex dynamic gait control problem of the hydraulic quadruped robot. On the premise of guaranteeing the motion speed of the robot and in order to improve the stability of the robot, a controller for the pacing gait of the hydraulic quadruped robot is proposed. Unlike previous works, we derived our controller from the centroid of the robot trunk. Firstly, we specifically stated the relationship between the joint of the leg and the attitude information of the robot trunk. Secondly, the trajectory of the centroid of the trunk was planned. Then, we extended the method to avoid the instability of the robot when its feet touch the ground. A controller based on centroid of the trunk was designed, which can adjust the driving function in real time according to the position and attitude of the trunk. Lastly, the cyclic and stable pace gait in a simulation and on an actual robot platform were tested, which testifies to the validity and feasibility of the proposed control strategy.
For the sake of establishing this controller, our paper is organized as follows. Section 2 depicts the mechanical structure of the hydraulic quadruped robot, and establishes the kinematic model of the robot. Section 3 describes the trajectory planning for the centroid of the robot trunk. Section 4 is the design of pace-gait controller for the hydraulic quadruped robot. Section 5 verifies the control algorithm by simulation. Section 6 introduces our hydraulic quadruped robot experimental platform and reports the experimental results. Finally, Section 7 draws the conclusions of the full paper.

The Mechanical Structure of the Hydraulic Quadruped Robot
The mechanical structure of a hydraulic quadruped robot consists of a trunk and four legs, as shown in Figure 1. An inertial sensor for real-time attitude detection of the trunk is fixed on the robot trunk. The hydraulic quadruped robot has eighteen degrees of freedom, which are twelve joint degrees of freedom and six trunk degrees of freedom. There are generally three active joints of each leg, which are the rolling hip joint, the pitching hip joint and the pitching knee joint. The twelve active joints are driven by the identical electro-hydraulic servo actuator.
Hydraulic quadruped robot is a mobile platform. The motion of robot is primarily realized by the movement of trunk and swing legs. In order to analyze the reasons of the change of the posture of the robot trunk, the kinematic characteristics of the robot and the force of the supporting legs to the trunk should be analyzed. The kinematic model consists of two parts: one is the relationship between the foothold position and the joint angle of a single leg; the other is the relationship between single leg and the robot trunk.
Appl. Sci. 2019, 9, x 3 of 19 the robot. Section 3 describes the trajectory planning for the centroid of the robot trunk. Section 4 is the design of pace-gait controller for the hydraulic quadruped robot. Section 5 verifies the control algorithm by simulation. Section 6 introduces our hydraulic quadruped robot experimental platform and reports the experimental results. Finally, Section 7 draws the conclusions of the full paper.

The Mechanical Structure of the Hydraulic Quadruped Robot
The mechanical structure of a hydraulic quadruped robot consists of a trunk and four legs, as shown in Figure 1. An inertial sensor for real-time attitude detection of the trunk is fixed on the robot trunk. The hydraulic quadruped robot has eighteen degrees of freedom, which are twelve joint degrees of freedom and six trunk degrees of freedom. There are generally three active joints of each leg, which are the rolling hip joint, the pitching hip joint and the pitching knee joint. The twelve active joints are driven by the identical electro-hydraulic servo actuator.
Hydraulic quadruped robot is a mobile platform. The motion of robot is primarily realized by the movement of trunk and swing legs. In order to analyze the reasons of the change of the posture of the robot trunk, the kinematic characteristics of the robot and the force of the supporting legs to the trunk should be analyzed. The kinematic model consists of two parts: one is the relationship between the foothold position and the joint angle of a single leg; the other is the relationship between single leg and the robot trunk.

Kinematic Modeling
As shown in Figure 2, the kinematic model of the robot is established based on the improved D-H (Hartenbery) parameter method. The robot requires four coordinate frames. They are the reference coordinate frame, the torso coordinate frame, the transitional coordinate frame and the joint coordinate frame. The reference coordinate frame {Ow} is a coordinate system representing all forces, displacements and velocities, also known as the inertial coordinate system. {Ow} is fixed on the ground. xw points to the forward direction of the robot; zw is perpendicular to the trunk and points in the opposite direction to the ground; and yw is determined by the right-hand rule. The origin of the torso coordinate frame {Ob} is located in the geometric center of the robot trunk. The axis direction of torso coordinate frame is the same as that of frame {Ow}. The transitional coordinate frames {Oi0} are fixed on the corners of the trunk. The subscript i is the serial number of four robotic legs (i = 1, 2, 3 and 4), representing the right foreleg (RF), left foreleg (LF), left hindleg (LH) and right hindleg (RH), respectively. The joint coordinate frames {Oij} are fixed on the joints of the robot. The subscript j is the serial number of joints (j = 1, 2, 3 and 4), representing the horizontal pendulum joint, hip joint, knee joint and foot joint, respectively. 2a is the length of the robot trunk, 2b is the width of the robot trunk and h is the height of the robot trunk. l1 is the length of the link rod between the trunk and thigh, l2 is

Kinematic Modeling
As shown in Figure 2, the kinematic model of the robot is established based on the improved D-H (Hartenbery) parameter method. The robot requires four coordinate frames. They are the reference coordinate frame, the torso coordinate frame, the transitional coordinate frame and the joint coordinate frame. The reference coordinate frame {O w } is a coordinate system representing all forces, displacements and velocities, also known as the inertial coordinate system. {O w } is fixed on the ground. x w points to the forward direction of the robot; z w is perpendicular to the trunk and points in the opposite direction to the ground; and y w is determined by the right-hand rule. The origin of the torso coordinate frame {O b } is located in the geometric center of the robot trunk. The axis direction of torso coordinate frame is the same as that of frame {O w }. The transitional coordinate frames {O i0 } are fixed on the corners of the trunk. The subscript i is the serial number of four robotic legs (i = 1, 2, 3 and 4), representing the right foreleg (RF), left foreleg (LF), left hindleg (LH) and right hindleg (RH), respectively. The joint coordinate frames {O ij } are fixed on the joints of the robot. The subscript j is the serial number of joints (j = 1, 2, 3 and 4), representing the horizontal pendulum joint, hip joint, knee joint and foot joint, respectively. 2a is the length of the robot trunk, 2b is the width of the robot trunk and h is the height of the robot trunk. l 1 is the length of the link rod between the trunk and thigh, l 2 is the length of the thigh and l 3 is the length of the shank. θ i1 , θ i2 and θ i3 are the rolling hip joint angle, pitching hip joint angle and pitching knee joint angle, respectively.
Since the mechanical structure of the four legs is identical, the coordinate frame established according to the D-H rule of the four legs is exactly the same. Hence the transformation matrix from the foot coordinate frame {O i4 } to the transitional coordinate frame {O i0 } of each leg is identical. The transformation matrix 0 T i4 can be expressed as: where s 23 = sin(θ 2 + θ 3 ), c 23 = cos(θ 2 + θ 3 ), s 1 = sinθ 1 and c 1 = cosθ 1 . 0 p ix , 0 p iy and 0 p iz represent the x-coordinate, y-coordinate and z-coordinate of the foot in the corresponding transitional coordinate frame, respectively. the length of the thigh and l3 is the length of the shank. θi1, θi2 and θi3 are the rolling hip joint angle, pitching hip joint angle and pitching knee joint angle, respectively. Since the mechanical structure of the four legs is identical, the coordinate frame established according to the D-H rule of the four legs is exactly the same. Hence the transformation matrix from the foot coordinate frame {Oi4} to the transitional coordinate frame {Oi0} of each leg is identical. The transformation matrix 0 Ti4 can be expressed as: where s23 = sin(θ2+θ3), c23 = cos(θ2+θ3), s1 = sinθ1 and c1 = cosθ1. 0 pix, 0 piy and 0 piz represent the Based on forward kinematic analysis, the transformation matrix from {Oi0} to {Ob} of four legs is then found: The position of the foot of the hydraulic quadruped robot in the transitional coordinate frame 0 p ie = { 0 p ix 0 p iy 0 p iz 1} T is given by: Based on forward kinematic analysis, the transformation matrix from {O i0 } to {O b } of four legs is then found: where α and β are symbolic signs, which are defined as follows: The inverse kinematic analysis is significant for gait planning and motion control of quadruped robots. Since the forelegs of the hydraulic quadruped robot are elbow joints and the hind legs are knee joints [32,33], the joint variables θ i2 and θ i3 obtained based on inverse kinematic are different. The joint angles of the hydraulic quadruped robots are as Equation (5).
where m is defined as: Obviously, for RF and LF (i = 1, 2) of a hydraulic quadruped robot, θ i2 and θ i3 are positive. On the contrary, for LH and RH (i = 3, 4) of a hydraulic quadruped robot, θ i2 and θ i3 are negative.
If given the coordinate of a foot in the torso coordinate frame {O b }, the joint angles of quadruped robot legs could be solved by Equations (3) and (6).
Jacobian matrix is a mapping of foot velocity and joint velocity, which can be derived from Equations (1) and (3).
If the joint angles in the joint space θ i = [θ i1 θ i2 θ i3 ] T are known, the motion velocities of the foot in three directions along the torso coordinate frame {O b } can be obtained according to Jacobian matrix using: where b V i and b p i represent the velocity vector and position vector of the foot in the torso coordinate frame, respectively. Conversely, the joint angular velocity in joint space can be solved from the velocity of the foot and the inverse of Jacobian matrix. where Appl. Sci. 2019, 9, 3911 6 of 19

Trajectory Generation of Trunk Centroid
The motion of robot trunk has an important influence on the stability of a hydraulic quadruped robot. The position of the trunk is p b = (x b , y b , z b ). The centroid trajectories of the trunk with bipedal support and quadruped support are designed separately. When the robot is supported by two feet, the centroid coordinate of the robot trunk is (x bw (t), z bw (t)). When the robot is supported by four feet, the centroid coordinate of the robot trunk is (x bp (t), z bp (t)).

Horizontal Position Planning of Robot Trunk
The horizontal displacements of the robot trunk centroid x bw (t) and x bp (t) are expressed by cubic polynomials as follows: where T m is the period time of the swing phase, T is the motion cycle of the hydraulic quadruped robot and t is the time. According to (12), the range of t during quadruped support phase is from T m to T. The trajectory of the centroid of the trunk should be continuous during the motion of the robot. It is mainly manifested in two aspects. The horizontal displacement and velocity of the trunk centroid at the beginning of the quadruped support phase coincide with their values at the end of the bipedal support phase. The attitude angle and angular velocity of the trunk centroid at the beginning of the bipedal support phase are consistent with those of the trunk centroid at the end of the quadruped support phase. The constraints are as follows: x bw (0) = .
x bp (T) (13) where S w0 is the position of the robot trunk centroid at the beginning of the bipedal support phase, and S is the stride length.

Vertical Position Planning of Robot Trunk
In the process of a robot's motion, the vertical displacements of robot trunk centroid z bw (t) and z bp (t) are fixed values, which are as follows: where H bz is the height of the robot trunk.
If H bz is too small, the force arm of the robot trunk centroid relative to the knee joint will be increased, hence the torque of the knee joint will be increased. Taking the two right landing legs (RF and RH) of the hydraulic quadruped robot as an example, the structure diagram of the robot is illustrated in Figure 3. In order to avoid the singularity bit-type of the robot, the maximum height of H bz is: where q 2 is the pitch angle of the robot trunk. Due to the error between the actual robot structure and the theoretical model, the height of the center of mass of the trunk is generally 0.8 times of H max .
Similarly, due to the symmetry of the structure of the hydraulic quadruped robot, while the robot is supported by four legs, the height of the trunk centroid is half of the total height of the two diagonally supported legs.
Appl. Sci. 2019, 9, x 7 of 19 where q2 is the pitch angle of the robot trunk. Due to the error between the actual robot structure and the theoretical model, the height of the center of mass of the trunk is generally 0.8 times of Hmax.
Similarly, due to the symmetry of the structure of the hydraulic quadruped robot, while the robot is supported by four legs, the height of the trunk centroid is half of the total height of the two diagonally supported legs.

Foot Trajectory Planning of Quadruped Robot
Each leg of the hydraulic quadruped robot has three degrees of freedom, according to the above kinematic analysis, the joint trajectories can be calculated from the foot trajectories. The position of the robot foot is affected by the attitude of the trunk and the angle of the joint. The foot trajectory should not only meet the requirement of minimizing the contact force between the ground and the foot, but also ensure that the contact velocity of the foot is zero. Up to now, a variety of foot trajectory planning methods have been proposed, such as compound cycloid trajectory [34], modified compound cycloid trajectory [35,36], quintic polynomial curve trajectory [37], sine function trajectory [38], a combination trajectory of cubic polynomial and straight line trajectories [17] and elliptical trajectory [39]. However, the disturbance of the robot trunk is not considered in the above methods.
After comparing the various foot trajectory planning methods mentioned above, for this paper, the cycloid trajectory planning method proposed in reference [40] was decided on. The trajectory equations can be written as: where H is the maximum height of the foot, px, py and pz represent the horizontal displacement, lateral displacement and vertical displacement of the robot foot, respectively. px, py and pz are the positions of the foot in the reference coordinate frame {Ow}. Hence, the homogeneous coordinate of pie = {pix piy piz 1} T can be determined by: (18) in which, 0 pie is the homogeneous coordinate of the foot in the transitional coordinate frame {Oi0}. R is the rotation matrix of the torso coordinate frame with respect to the reference coordinate frame, which can be expressed as:

Foot Trajectory Planning of Quadruped Robot
Each leg of the hydraulic quadruped robot has three degrees of freedom, according to the above kinematic analysis, the joint trajectories can be calculated from the foot trajectories. The position of the robot foot is affected by the attitude of the trunk and the angle of the joint. The foot trajectory should not only meet the requirement of minimizing the contact force between the ground and the foot, but also ensure that the contact velocity of the foot is zero. Up to now, a variety of foot trajectory planning methods have been proposed, such as compound cycloid trajectory [34], modified compound cycloid trajectory [35,36], quintic polynomial curve trajectory [37], sine function trajectory [38], a combination trajectory of cubic polynomial and straight line trajectories [17] and elliptical trajectory [39]. However, the disturbance of the robot trunk is not considered in the above methods.
After comparing the various foot trajectory planning methods mentioned above, for this paper, the cycloid trajectory planning method proposed in reference [40] was decided on. The trajectory equations can be written as: where H is the maximum height of the foot, p x , p y and p z represent the horizontal displacement, lateral displacement and vertical displacement of the robot foot, respectively. p x , p y and p z are the positions of the foot in the reference coordinate frame {O w }. Hence, the homogeneous coordinate of p ie = {p ix p iy p iz 1} T can be determined by: in which, 0 p ie is the homogeneous coordinate of the foot in the transitional coordinate frame {O i0 }. R is the rotation matrix of the torso coordinate frame with respect to the reference coordinate frame, which can be expressed as: where cq 1 = cos q 1 , sq 1 = sin q 1 , and q 1 and q 3 are the attitude angles of the robot trunk, which are, roll angle and yaw angle. These attitude angles can be detected in real time by an inertial measurement unit (IMU) attached to the robot trunk.
Once the trajectory of the foot is determined, the position of the foot in the transitional coordinate frame can be written in the form: The joint angles of the hydraulic quadruped robot could be solved by substituting Equation (19) back into Equation (6). The driving functions of hydraulic cylinder can be calculated by the geometric relationship of the legs of the hydraulic quadruped robot. Thus, the servo drive control of the hydraulic quadruped robot is carried out. The control device switches to the touch stage once one leg touches the ground.

Centroid Control in Touchdown Stage
Under the ideal conditions, while the robot moves in a pacing gait, the pitch angle and yaw angle of the trunk are zero, and the attitude angles can be measured by the IMU in real time.
The control of hydraulic quadruped robots is easier when they are equipped with a set of virtual elements: a spring and damping. Those virtual actuators allow us to ignore the non-linearity due to the legs [41,42]. Three sets of virtual elements can control the rolling angle, pitching angle and height of the trunk, respectively.
For the sake of simplicity, we ignore the inertial force of the legs, hence the relationship between joint torque and generalized force acting on the trunk can be expressed as: where τ = [τ 1 τ 2 τ 3 ] T is the vector of joint output torque. τ 1 , τ 2 and τ 3 represent rolling hip joint torque, pitching hip joint torque and pitching knee joint torque, respectively. F = [F x F y F z ] T is the vector of generalized force. F x , F y and F z represent the virtual force of the landing leg acting on the robot trunk along x, y and z axes. According to the force analysis, the mapping of the moment of the landing leg acting on the robot trunk T = [T x T y T z ] T to the joint torque is as follows: Combining Equations (11), (20) and (21), we get a set of simplified equations: Appl. Sci. 2019, 9, 3911 9 of 19 Let The virtual force and moment of two landing legs acting on the robot trunk can be expressed as: where FT FH = [F Fx F Fy F Fz T Fx T Fy T Fz F Hx F Hy F Hz T Hx T Hy T Hz ] T , in which, the subscript F denotes the foreleg, and the subscript H denotes the hind leg. The vector of virtual force and moment acting on the centroid of the trunk can be obtained by the vector of generalized force and torque, hence FT b = [F bx F by F bz T bx T by T bz ] T can be written as: We can substitute Q back into Equation (25) to get a set of simplified equations: So that we can rearrange Equation (24) into the following intuitive form: As shown in Figure 4, the resultant forces and moments at the centroid of the trunk are as follows: where k ph , k px and k py are the elastic coefficients of the virtual components; k dh , k dx and k dy are the damping coefficients of the virtual components; h d is the desired height of the trunk; h is the actual height of the trunk; and q 1d and q 2d are the desired roll angle and pitch angle of the robot trunk. T bx , T by and T bz represent the torque of the landing leg acting on the robot trunk along x, y and z axes.   The actual attitude angles and the height of the robot trunk are close to their theoretical values when choosing reasonable elastic coefficients and damping coefficients. By substituting Equation (29) into Equation (28), the following results can be obtained: Let be However, it is impossible to solve all six joint torques of two landing legs according to Equation (29). Our solution allows for the output requirements of actuators so as to derive the joint torques. Therefore, the following equations are added: From Equations (25), and (29) to (32), the joint torques of the two landing legs can be concluded: As shown in Equation (33), the roll angle, pitch angle and height of the trunk can be controlled with reference to the joint torques of the landing leg of the hydraulic quadruped robot.

The Design of a Centroid-Based Controller
As shown in Equation (33), the roll angle, pitch angle and height of the trunk can be controlled with reference to the joint torques of the landing leg of the hydraulic quadruped robot. Figure 5 presents the block of the centroid-based controller for the hydraulic quadruped robot. The superscript d in ensuing figures represents the expected value of each variable. Light green blocks indicate user-defined parameters. Light blue blocks indicate control parameters, while light pink blocks indicate feedback parameters. The trajectory of the robot, generated by the gait parameters given and the motion of the swing leg, is controlled. After the robot leg touches the ground, the position and attitude of the trunk are controlled by virtual model. Moreover, the input parameters are adjusted in real time by using the feedback information of sensors which are fixed on the robot.  The block diagram of a centroid-based controller for the hydraulic quadruped robot depicted in Figure 6. We assume that the hydraulic quadruped robot starts with all four legs touching the ground. On the basis of kinematic derivations, the centroid trajectory of the trunk is planned, while the state machine controls a pair of legs as swinging legs according to the specified gait sequence. Once the change of contact state is detected, the control state will be switched. The change of contact state is determined by control algorithm or sensor feedback. Then the current legs are controlled in the touchdown phase and the other pair legs are controlled in the swing phase.  The block diagram of a centroid-based controller for the hydraulic quadruped robot depicted in Figure 6. We assume that the hydraulic quadruped robot starts with all four legs touching the ground. On the basis of kinematic derivations, the centroid trajectory of the trunk is planned, while the state machine controls a pair of legs as swinging legs according to the specified gait sequence. Once the change of contact state is detected, the control state will be switched. The change of contact state is determined by control algorithm or sensor feedback. Then the current legs are controlled in the touchdown phase and the other pair legs are controlled in the swing phase.

Simulation Environment
1 0 0 -1 0 0 = 0 1 0 0 -1 0 0 0 1 0 0 -1 (35) As shown in Equation (33), the roll angle, pitch angle and height of the trunk can be controlled with reference to the joint torques of the landing leg of the hydraulic quadruped robot. Figure 5 presents the block of the centroid-based controller for the hydraulic quadruped robot. The superscript d in ensuing figures represents the expected value of each variable. Light green blocks indicate user-defined parameters. Light blue blocks indicate control parameters, while light pink blocks indicate feedback parameters. The trajectory of the robot, generated by the gait parameters given and the motion of the swing leg, is controlled. After the robot leg touches the ground, the position and attitude of the trunk are controlled by virtual model. Moreover, the input parameters are adjusted in real time by using the feedback information of sensors which are fixed on the robot.  The block diagram of a centroid-based controller for the hydraulic quadruped robot depicted in Figure 6. We assume that the hydraulic quadruped robot starts with all four legs touching the ground. On the basis of kinematic derivations, the centroid trajectory of the trunk is planned, while the state machine controls a pair of legs as swinging legs according to the specified gait sequence. Once the change of contact state is detected, the control state will be switched. The change of contact state is determined by control algorithm or sensor feedback. Then the current legs are controlled in the touchdown phase and the other pair legs are controlled in the swing phase.

Simulation Environment
In order to verify the effectiveness of the proposed method, the dynamic simulations were carried out in dynamic simulation software ADAMS. The virtual prototype model in the simulation had the same size and mass distribution as the HD platform developed by the Hydraulic Quadruped Robot Joint Lab of Harbin University of Science and Technology. The parameters of the simulation model are shown in Table 1.

Simulation Results and Analysis
In a cycle, two pairs of legs alternately swing and support. In the initial stage, the robot is supported by four legs. Next, RF and RH legs are in the swing stage. Then, RF and RH legs are in the supporting stage. The motion process of the quadruped robot is shown in Figure 7.
In order to verify the effectiveness of the proposed method, the dynamic simulations were carried out in dynamic simulation software ADAMS. The virtual prototype model in the simulation had the same size and mass distribution as the HD platform developed by the Hydraulic Quadruped Robot Joint Lab of Harbin University of Science and Technology. The parameters of the simulation model are shown in Table 1.

Simulation Results and Analysis
In a cycle, two pairs of legs alternately swing and support. In the initial stage, the robot is supported by four legs. Next, RF and RH legs are in the swing stage. Then, RF and RH legs are in the supporting stage. The motion process of the quadruped robot is shown in Figure 7. To measure the motion of the hydraulic quadruped robot, the displacement curves of the centroid of the robot trunk are shown in Figure 8. Figure 8a,b,c shows displacement curves along x, y and z-axes, respectively. It can be concluded that the motion of the robot tends to be stable after two cycles of acceleration. When the RF leg and the RH leg are raised, it marks the beginning of the motion cycle. At the beginning of the cycle, the centroid of the trunk has a small displacement in the opposite direction of the forward direction. Figure 8a shows the forward displacement of the hydraulic quadruped robot is two meters in ten motion cycles. Figure 8b shows that the robot has generated laterality motion during pacing gait. The main reason is that the center of gravity of the trunk moved to the same side when the one pair legs of the robot first touched the ground. When the other side legs touched the ground, the center of gravity of the trunk moved to the other side. As shown in Figure 8c, the centroid of the robot trunk varies from −16 mm to −10 mm in the vertical direction. In order to reduce the impact force of the ground, a shock absorber spring is added to the shank of the robot in the design of the mechanical structure. The fluctuation of the hydraulic quadruped robot trunk is small in the vertical direction by the proposed control method, which verifies the effectiveness of the proposed height control strategy. To measure the motion of the hydraulic quadruped robot, the displacement curves of the centroid of the robot trunk are shown in Figure 8. Figure 8a-c shows displacement curves along x, y and z-axes, respectively. It can be concluded that the motion of the robot tends to be stable after two cycles of acceleration. When the RF leg and the RH leg are raised, it marks the beginning of the motion cycle. At the beginning of the cycle, the centroid of the trunk has a small displacement in the opposite direction of the forward direction. Figure 8a shows the forward displacement of the hydraulic quadruped robot is two meters in ten motion cycles. Figure 8b shows that the robot has generated laterality motion during pacing gait. The main reason is that the center of gravity of the trunk moved to the same side when the one pair legs of the robot first touched the ground. When the other side legs touched the ground, the center of gravity of the trunk moved to the other side. As shown in Figure 8c, the centroid of the robot trunk varies from −16 mm to −10 mm in the vertical direction. In order to reduce the impact force of the ground, a shock absorber spring is added to the shank of the robot in the design of the mechanical structure. The fluctuation of the hydraulic quadruped robot trunk is small in the vertical direction by the proposed control method, which verifies the effectiveness of the proposed height control strategy.  The velocity curves of the centroid of the robot trunk are shown in Figure 9. As seen from Figure  9, the speed of the robot in the forward direction is stable at about 0.25 m/s. The lateral velocity range of the robot trunk varies from −0.1 m/s to 0.1 m/s, and changes symmetrically along the y-axis. The sudden change of velocity in the vertical direction is caused by the impact of the ground on the robot when the foot touches the ground.  The velocity curves of the centroid of the robot trunk are shown in Figure 9. As seen from Figure 9, the speed of the robot in the forward direction is stable at about 0.25 m/s. The lateral velocity range of the robot trunk varies from −0.1 m/s to 0.1 m/s, and changes symmetrically along the y-axis. The sudden change of velocity in the vertical direction is caused by the impact of the ground on the robot when the foot touches the ground.  The velocity curves of the centroid of the robot trunk are shown in Figure 9. As seen from Figure  9, the speed of the robot in the forward direction is stable at about 0.25 m/s. The lateral velocity range of the robot trunk varies from −0.1 m/s to 0.1 m/s, and changes symmetrically along the y-axis. The sudden change of velocity in the vertical direction is caused by the impact of the ground on the robot when the foot touches the ground.

Experimental Analysis
To certify the effectiveness of the proposed control strategy in practical robots, the designed controller was applied to a hydraulic quadruped robot developed by the Hydraulic Quadruped Robot Joint Lab of Harbin University of Science and Technology.
The experimental platform of the hydraulic quadruped robot is illustrated in Figure 10. The electro-hydraulic servo valve was the SFL212F-12/8-21-40 two-stage force feedback asymmetric servo valve, produced by the 18th Research Institute of the First Academy of China Aerospace Science and Technology Corporation (Beijing, China). The displacement sensor was the LVDT-PA1HL60X sensor produced by Fuxin Lisheng Automatic Control Co., Ltd. (Fuxin, China). The force sensor was the WMC-3000 Sensor produced by the Interface Company of America (Phenix City, AL, USA). The IMU was the XW-G15615 produced by Starneto (Beijing, China).
Appl. Sci. 2019, 9, x 14 of 19 To certify the effectiveness of the proposed control strategy in practical robots, the designed controller was applied to a hydraulic quadruped robot developed by the Hydraulic Quadruped Robot Joint Lab of Harbin University of Science and Technology.
The experimental platform of the hydraulic quadruped robot is illustrated in Figure 10. In the experiment, the duty cycle of the robot pace gait was 0.5; that is, the swing phase and the support phase were equal in time. The period time was 0.8s, the stride length was 200 mm, and the maximum height of the foot was 50 mm. The experimental process of pace gait motion of the hydraulic quadruped robot is shown in Figure 11. In the picture, the red solid point represents the supporting leg, and the blue one represents the swinging leg. During a motion cycle, a pair of legs of the hydraulic quadruped robot went through lifting, falling and supporting stages.  In the experiment, the duty cycle of the robot pace gait was 0.5; that is, the swing phase and the support phase were equal in time. The period time was 0.8s, the stride length was 200 mm, and the maximum height of the foot was 50 mm. The experimental process of pace gait motion of the hydraulic quadruped robot is shown in Figure 11. In the picture, the red solid point represents the supporting leg, and the blue one represents the swinging leg. During a motion cycle, a pair of legs of the hydraulic quadruped robot went through lifting, falling and supporting stages. To certify the effectiveness of the proposed control strategy in practical robots, the designed controller was applied to a hydraulic quadruped robot developed by the Hydraulic Quadruped Robot Joint Lab of Harbin University of Science and Technology.
The experimental platform of the hydraulic quadruped robot is illustrated in Figure 10. In the experiment, the duty cycle of the robot pace gait was 0.5; that is, the swing phase and the support phase were equal in time. The period time was 0.8s, the stride length was 200 mm, and the maximum height of the foot was 50 mm. The experimental process of pace gait motion of the hydraulic quadruped robot is shown in Figure 11. In the picture, the red solid point represents the supporting leg, and the blue one represents the swinging leg. During a motion cycle, a pair of legs of the hydraulic quadruped robot went through lifting, falling and supporting stages.  The variations of attitude angle and attitude angular velocity of the robot trunk detected by IMU are shown in Figures 12 and 13, respectively. The curves of original controller represent the experimental data obtained without the proposed controller. It only planned the foot trajectory based on the kinematic analysis of the single leg of the quadruped robot, but did not plan and control the centroid of the robot trunk. The curve of centroid-based controller represents the experimental data obtained with the proposed controller. The proposed controller includes foot trajectory planning, and the trajectory planning of the trunk centroid and centroid control of the trunk. During the motion of the hydraulic quadruped robot in pacing gait, since the right leg and the left leg alternately lie in the supporting phase and swing phase, the robot trunk alternately leans to either side. The attitude angles of the robot trunk change slightly in Figure 12. In ten period cycles, when the proposed controller was not used, the roll angle of the hydraulic quadruped robot ranged from 0.6 to 4.5 degrees, and the pitch angle ranged from −4.2 to 1.13 degrees. When using the presented control method, the roll angle ranged from 1.58 to 3.94 degrees, and the pitch angle ranged from −3 to 0.35 degrees.
From Figure 13, it can be seen that the attitude angular velocity of the trunk of the hydraulic quadruped robot changed smoothly, by the proposed controller. The results show that the fluctuation of the robot trunk is small during the movement of the robot. As seen from the experimental process, the motion of each leg of the robot is coordinated, and the robot can move smoothly and straight. The availability and rationality of the proposed control method are further proved. The variations of attitude angle and attitude angular velocity of the robot trunk detected by IMU are shown in Figures 12 and 13, respectively. The curves of original controller represent the experimental data obtained without the proposed controller. It only planned the foot trajectory based on the kinematic analysis of the single leg of the quadruped robot, but did not plan and control the centroid of the robot trunk. The curve of centroid-based controller represents the experimental data obtained with the proposed controller. The proposed controller includes foot trajectory planning, and the trajectory planning of the trunk centroid and centroid control of the trunk. During the motion of the hydraulic quadruped robot in pacing gait, since the right leg and the left leg alternately lie in the supporting phase and swing phase, the robot trunk alternately leans to either side. The attitude angles of the robot trunk change slightly in Figure 12. In ten period cycles, when the proposed controller was not used, the roll angle of the hydraulic quadruped robot ranged from 0.6 to 4.5 degrees, and the pitch angle ranged from −4.2 to 1.13 degrees. When using the presented control method, the roll angle ranged from 1.58 to 3.94 degrees, and the pitch angle ranged from −3 to 0.35 degrees.
From Figure 13, it can be seen that the attitude angular velocity of the trunk of the hydraulic quadruped robot changed smoothly, by the proposed controller. The results show that the fluctuation of the robot trunk is small during the movement of the robot. As seen from the experimental process, the motion of each leg of the robot is coordinated, and the robot can move smoothly and straight. The availability and rationality of the proposed control method are further proved.   The position tracking curves of the electro-hydraulic servo actuator of the robot in pacing gait are illustrated in Figures 14 and 15. The reference signals were obtained by cycloid trajectory planning. The measured signals are the positional variations of the piston rods of the robot's actuators detected by the displacement sensors attached to the actuators. As can be seen from the figures, the whole tracking process is compact. The effectiveness of the proposed control method based on centroid trajectory is further verified.  The position tracking curves of the electro-hydraulic servo actuator of the robot in pacing gait are illustrated in Figures 14 and 15. The reference signals were obtained by cycloid trajectory planning. The measured signals are the positional variations of the piston rods of the robot's actuators detected by the displacement sensors attached to the actuators. As can be seen from the figures, the whole tracking process is compact. The effectiveness of the proposed control method based on centroid trajectory is further verified.

Conclusions
In order to enhance the stability of hydraulic quadruped robots in motion, this paper presents a centroid-based controller for quadrupedal pacing. The centroid control of the hydraulic quadruped robot trunk was added to the control of the whole robot. The kinematic model of the whole hydraulic quadruped robot was established, and the relationship between each leg and the robot trunk was described. The coupling of trunk motion and leg motion was explained in detail. The real-time attitude feedback information of the trunk centroid was introduced into the trajectory planning of the trunk centroid. Joint torques that fulfilled the minimization of the contact forces were calculated. The positions and attitudes of the robot trunk were adjusted by the spring damper virtual elements. The performance of the proposed framework was tested in simulation and on a robot platform. The motion attitude data of hydraulic quadruped robot with or without the proposed controller were compared. The experimental results showed that the robot trunk moved more smoothly with the proposed controller than that without the proposed controller. The stable and accurate dynamic motion was accomplished, which verified the effectiveness and feasibility of the proposed control strategy. The centroid-based controller can be extended to the other dynamic gaits of quadruped robots, as long as the corresponding parameters and models are changed. In the near future, our work is to study the stability of robots in complex working environments.
Funding: This research received no external funding.

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