Leg Trajectory Planning for Quadruped Robots with High-Speed Trot Gait

: In this paper, a single leg platform for quadruped robots is designed based on the motivation of high-speed locomotion. The leg is designed for lightweight and low inertia with a structure of three joints by imitating quadruped animals. Because high acceleration and extensive loadings will be involved on the legs during the high-speed locomotion, the trade-o ﬀ between the leg mass and strength is speciﬁcally designed and evaluated with the ﬁnite element analysis. Moreover, quadruped animals usually increase stride frequency and decrease contact time as the locomotion speed increases, while maintaining the swing duration during trot gait. Inspired by this phenomenon, the foot-end trajectory for quadruped robots with a high-speed trot gait is proposed. The gait trajectory is planned for swing and stance phase; thus the robot can keep its stability with adjustable trajectories while following a speciﬁc gait pattern. Especially for the swing phase, the proposed trajectory can minimize the maximum acceleration of legs and ensure the continuity of position, speed, and acceleration. Then, based on the kinematics analysis, the proposed trajectory is compared with the trajectory of B é zier curve for the power consumption. Finally, a simulation with Webots software is carried out for verifying the motion stability with two trajectory planning schemes respectively. Moreover, a motion capture device is used for evaluating the tracking accuracy of two schemes for obtaining an optimal gait trajectory suitable for high-speed trot gait.


Introduction
Legged robots are more suitable for applications with rough terrain and complex cluttered environments compared to wheeled robots [1][2][3].With respect to the leg length, quadruped robots can freely select contact points while making contact with the environment.Therefore, it is promising that they can be used for rescuing people in forests and mountains, climbing stairs, to carry payloads in construction sites, and so on [4].Recently, several quadruped robots are being developed which are equipped with hydraulic actuators or electric actuators.For example, Boston Dynamics developed a series of robots equipped with hydraulic actuators with high energy density.Hydraulic drive quadruped robots, such as Big Dog [5] and HyQ [6], make use of the characteristics of the high power density of hydraulic pressure to realize a stronger carrying capacity and motion ability.However, their large noise and size have limited their applications to outdoor applications.Moreover, they require additional hydraulic source and oil circuit, which often makes the structure more complex.Different from that, quadruped robots equipped with electric actuators can even be used to indoor environments, such as SpotMini [7], ANYmal [8], and MIT Cheetah [9][10][11].Amongst them, MIT Cheetah realized a fast, efficient design with advanced proprioceptive actuator design [9].ANYmal applies a bioinspired actuator design, making it robust against impact, while allowing accurate torque measurement at the joints.However, the complicated actuator design also increases cost and compromises the power output of the robot [4].SpotMini did not publish their detailed researches; however, public media has released its capabilities, such as climbing stairs and stabilizing several gaits [7].
On the other hand, high-speed locomotion involves high acceleration and extensive loadings on the legs, which brings a trade-off between weight and strength of legs [12].There are generally two main ways to apply the leg motors for quadruped robots: putting the motor at each joint and concentrating the motor at the shoulder.Quadruped robots, such as ANYmal, adopt the method of putting motors at each joint to achieve a fully actuated motion with high compliant series elastic actuation, suitable for highly dynamic motions.Although by using this method the quadruped robots are easier to control and can walk steadily, the swing speed of their legs is slow, which leads to low walking speed.Some quadruped robots, such as SpotMini and MIT Cheetah, adopt the method of putting motors at the shoulder.This strategy can make the leg mass and inertia of the swinging parts of the legs very low and achieve a high running locomotion.Moreover, as for the leg structure of quadruped robots, the main leg structure is a two-joint structure, which is used in most quadruped robots, such as ANYmal, Wildcat [13], SpotMini, etc.This structure is simple, intuitive, and easy to control.However, from a biological point of view, toed animals, such as tigers, leopards, lions, and wolves, have a three-joint structure in their legs, which imparts great advantages in running speed and energy efficiency.MIT Cheetah adopted the three-part structure, which achieved a 6 m/s running speed, and the ability to cross obstacles with high energy efficiency [14].Also, Cheetah-cub designed with pantograph leg configuration to simplify the control of three links with only two joints and reached a running trot with short flight phases [15].Besides, a real "cat-sized" robot called Pneupard also explored this same pantograph method [16].The method of putting motors at the shoulder has been proved to be effective on the high running locomotion.However, there is still a lack of analysis with infinitesimal kinematics for a favorable leg structure of quadruped robots with high-speed locomotion.
Except for the suitable leg design, the stable gait trajectory is the basis of movement stability for quadruped robots.Quadruped animals can achieve various gait patterns such as walk, trot, pronk, bound, half-bound, rotary gallop, transverse gallop, etc. [17].Among them, the trot gait is the most widely used gait, which is very simple and effective.The duration of leg swing is always constant for both trot and gallop gait, although quadruped animals adjust their stride frequency while trotting, and adjust stride length for gallop gait [17].Also, the leg trajectory planning is important for robots' stability with adjustable trajectories.Saputra et al. designed a Bézier curve based passive neural control method applied in bioinspired locomotion for decreasing the computational cost [18].Lee et al. designed a trajectory with a Nonuniform Basis Spline (NUBS) curve to effectively overcome obstacles [19].Hyun et al. used properties of the Bézier curve for desirable swing-leg dynamics [11].However, suitable gait trajectories considering energy efficiency are seldom researched.
Therefore, in this paper, the motivation is to design an electrically actuated leg platform for quadruped robots with high-speed locomotion.The method of putting motors at the shoulder is adopted for reducing the leg inertia during the swing.In particular, the suitable leg structure and high-efficiency gait trajectory are analyzed and verified on the leg platform.The novel designed leg trajectory combines cosine curve, quintic curve, and hexagonal curve to minimize the maximum acceleration of legs and ensure the continuity of position, speed, and acceleration during high-speed trot gait.The efficiency is evaluated by measuring the endpoint acceleration, stability, and power consumption compared with the Bézier curve [9].Furthermore, an optotrak sensor is used for measuring the actual foot-end trajectory of the two schemes.The sensor can track and analyze kinetics and dynamic motion in real-time, which is a more direct and precise method to measure the actual endpoint position, especially when the motor encoder has low precision.
The remainder of this paper is organized as follows.Section 2 introduces the detailed design of the leg and the finite element analysis of the leg for the trade-off between the leg weight and strength.Moreover, the inverse kinematic analysis of the single leg gait and two different gait trajectory planning schemes are given.Section 3 gives the simulation result of two schemes in trajectory planning with Webots and experimental results measured with the optotrak sensor.Section 4 will discuss the simulation and experimental results.At last, the conclusion and direction of future works are given.

Leg Structure Comparison with Kinematics Analysis
The two-joint and three-joint articulated leg structures were considered during the initial leg structure design.By comparing the differences on the aspect of geometry and kinematics, the manipulability, obstacle avoiding ability, and occupied space for legs were analyzed.
Figure 1 shows the schematic for the three-joint leg structure on the left and two-joint leg structure on the right.It is assumed that the total link lengths for both two leg structures are identical and decided by the height of robots.The manipulability which measures at state θ with respect to manipulation vector r is defined as Equation ( 1) [20]: Appl.Sci.2019, 9, x FOR PEER REVIEW 3 of 22 trajectory planning with Webots and experimental results measured with the optotrak sensor.Section 4 will discuss the simulation and experimental results.At last, the conclusion and direction of future works are given.

Leg Structure Comparison with Kinematics Analysis
The two-joint and three-joint articulated leg structures were considered during the initial leg structure design.By comparing the differences on the aspect of geometry and kinematics, the manipulability, obstacle avoiding ability, and occupied space for legs were analyzed.
Figure 1 shows the schematic for the three-joint leg structure on the left and two-joint leg structure on the right.It is assumed that the total link lengths for both two leg structures are identical and decided by the height of robots.The manipulability which measures at state  with respect to manipulation vector r is defined as equation ( 1) [20]: Therefore, the manipulability can be calculated with   For the three-joint leg structure, the Jacobian matrix can be calculated as Equation (2): Therefore, the manipulability can be calculated with Similar, the Jacobian matrix for the two-part leg structure can be calculated as Equation (3): The manipulability can be calculated with w = |detJ(θ 4 , θ 5 )| = l 4 l 5 |sin(θ 5 )|.Here the lengths of l 1 , l 2 , and l 3 are given in the Table 1.For the two-joint leg structure, the manipulability can get a maximum value when the l 4 equates to l 5 .For comparing the manipulability of two leg structures during one gait cycle, the Bézier curve for the swing phase and the cosine function for the stance phase were used.The manipulability during one gait cycle is shown in Figure 2.
Appl.Sci.2019, 9, x FOR PEER REVIEW 4 of 22 The manipulability can be calculated with .Here the lengths of  ,  , and  are given in the Table 1.For the two-joint leg structure, the manipulability can get a maximum value when the  equates to  .For comparing the manipulability of two leg structures during one gait cycle, the Bézier curve for the swing phase and the cosine function for the stance phase were used.The manipulability during one gait cycle is shown in Figure 2. The leg structure should also protract the leg with enough ground clearance to avoid obstacles.Therefore, we compared the angles  and  , as shown in Figure 1, which can be calculated with equations (4) and (5): where h represents the height between the shoulder part of leg to the ground.The obstacle avoiding ability for the three-joint and two-joint leg structures is shown in Figure 3.The leg structure should also protract the leg with enough ground clearance to avoid obstacles.Therefore, we compared the angles α 1 and α 2 , as shown in Figure 1, which can be calculated with Equations ( 4) and ( 5): where h represents the height between the shoulder part of leg to the ground.The obstacle avoiding ability for the three-joint and two-joint leg structures is shown in Figure 3.At last, the space occupied for two leg structures was also compared.Assuming that , we can get The angle between leg and ground(deg) At last, the space occupied for two leg structures was also compared.Assuming that p 1 = (l 4 + l 5 + h)/2 and p 2 = (l 1 + l 2 + l 3 + h)/2, we can get Setting h ∈ (0.3, 0.4) and considering the height of the quadruped, the result can be obtained as shown in Figure 4.At last, the space occupied for two leg structures was also compared.Assuming that   The leg configuration between the three-joint and two-joint structures can be more clearly found in Figure 5. From these kinematics analyses, it can be found that, when h is selected as 0.343 in our leg design, the three-part leg structure has enough ground clearance to avoid obstacles.The occupied space after retracting the leg for the three-joint leg structure is much smaller than that of the two-joint leg structure when h is set as 0.343 m; the manipulability is similar between the two leg structures.By combining the biological point of view and these kinematics analyses, the three-joint leg structure was determined.The leg configuration between the three-joint and two-joint structures can be more clearly found in Figure 5. From these kinematics analyses, it can be found that, when h is selected as 0.343 in our leg design, the three-part leg structure has enough ground clearance to avoid obstacles.The occupied space after retracting the leg for the three-joint leg structure is much smaller than that of  The leg was designed for high-speed locomotion of quadrupeds and inspired by the design of MIT Cheetah [9].The physical leg parameters are shown in Table 1.The total mass of the leg is ~5.5 kg, where the swing part (1.284 kg) only occupies 23% of total mass.Moreover, the center of leg mass is only 84 mm away from the rotation center of the shoulder module, which helps reduce leg inertia during the swing.Shoulder and knee actuators with planetary gears are coaxially located at the shoulder module part for achieving a coupled motion of two joints, as shown in Figure 6, thus that the mass and leg inertia can be decreased.In detail, the knee actuator drives the knee joint through a parallel linkage, while the shoulder actuator directly drives the shoulder joint.The leg consists of the thigh, calf, and foot, where a parallel linkage connects the calf and foot.Therefore, two parallel linkages can drive the motion of the foot and thigh in parallel without an extra actuator on foot.7.There are two identical motors, including a knee motor and a shoulder motor in the shoulder module.The shoulder motor drives the knee motor part and thigh part to rotate through the hollow motor shaft and a planetary gear reducer.The shoulder module is designed as a thin-walled structure and is very compact in order to reduce its mass.The hollow motor shafts and gears are made of T4 titanium alloy to ensure their strength.On the contrary, the elements bearing less stress are made of 7075 aluminum alloy to ensure their light weight.
Actuators for quadruped robots with high-speed locomotion should provide high torque density which manages the dynamic physical interactions well.The proprioceptive actuator paradigm achieves a combination of high-bandwidth force control, high torque density, as well as impact mitigation [9].For example, NABi-V2 utilizes six-back drivable high-power density electromagnetic actuators with a low gear ratio single-phase planetary gearbox to realize proprioceptive, force-controlled dynamic locomotion [12].Similarly, a single-stage planetary gear reduction (main material is titanium alloy, and weight is 0.113kg) with low gear ratio (6:1) combined with high torque density frameless motors was applied during our leg design.
Moreover, during the high-speed locomotion, when the leg touched the ground, both linkages were pulled by two opposite forces, and neither bending moment nor torque is applied on the linkages.Therefore, these two linkages can be very thin.Hollow shafts are used in the joints of the  The detailed design of the shoulder module is shown in Figure 7.There are two identical motors, including a knee motor and a shoulder motor in the shoulder module.The shoulder motor drives the knee motor part and thigh part to rotate through the hollow motor shaft and a planetary gear reducer.The shoulder module is designed as a thin-walled structure and is very compact in order to reduce its mass.The hollow motor shafts and gears are made of T4 titanium alloy to ensure their strength.On the contrary, the elements bearing less stress are made of 7075 aluminum alloy to ensure their light weight.
Actuators for quadruped robots with high-speed locomotion should provide high torque density which manages the dynamic physical interactions well.The proprioceptive actuator paradigm achieves a combination of high-bandwidth force control, high torque density, as well as impact mitigation [9].For example, NABi-V2 utilizes six-back drivable high-power density electromagnetic actuators with a low gear ratio single-phase planetary gearbox to realize proprioceptive, force-controlled dynamic locomotion [12].Similarly, a single-stage planetary gear reduction (main material is titanium alloy, and weight is 0.113 kg) with low gear ratio (6:1) combined with high torque density frameless motors was applied during our leg design.
Moreover, during the high-speed locomotion, when the leg touched the ground, both linkages were pulled by two opposite forces, and neither bending moment nor torque is applied on the linkages.Therefore, these two linkages can be very thin.Hollow shafts are used in the joints of the leg, and ribbed plates are applied on the legs, which also decrease the total mass.In particular, the joints of linkages are so small that standard bearings cannot be used, so wear washers and dry bushing were adopted, which can effectively reduce the friction of linkages' joint by the self-lubrication characteristics of the dry bushing.

Finite Element Analysis (FEA) of the Leg
As mentioned above, there is a trade-off between the total leg weight and its strength.Therefore, in order to reduce the total weight and inertia of the leg without losing too much strength, the leg structure is mainly connected by ribbed plates with only 4-mm-thin plates in the middle, and the inclination angle of ribbed plates is 45 degrees to facilitate better performance of bearing pressure and bending moment.What is more, many thin-walled structures and lightweight materials were used in both motor and leg structure, which is likely to lead to insufficient strength and stiffness.Therefore, it is necessary to confirm the strength of the leg by Finite Element Analysis (FEA).

Finite Element Analysis (FEA) of the Leg
As mentioned above, there is a trade-off between the total leg weight and its strength.Therefore, in order to reduce the total weight and inertia of the leg without losing too much strength, the leg structure is mainly connected by ribbed plates with only 4-mm-thin plates in the middle, and the inclination angle of ribbed plates is 45 degrees to facilitate better performance of bearing pressure and bending moment.What is more, many thin-walled structures and lightweight materials were used in both motor and leg structure, which is likely to lead to insufficient strength and stiffness.Therefore, it is necessary to confirm the strength of the leg by Finite Element Analysis (FEA).
During the locomotion of a quadruped robot, the leg movement mainly consists of two parts: a stance phase and a swing phase.The stance phase is a moment when the legs are stressed, and the weight of the robot body is supported by only two legs in the middle of the stance phase during trot and bound gaits.Considering that the quadruped robot needs to complete tasks like jumping over obstacles, which may generate an impact 2 to 3 times the weight of body [13], it is estimated that the total weight of the designed quadruped robot is ~40 kg, so the maximum impact distributed to each leg is !600N. At the same time, the legs need to give the body a forward motion force, which was set to 1/10 of the impact (60 N).These two forces are applied to the endpoint of the leg model imported into Adams as load forces, and the forces generated in each part of the leg can be measured as shown in Figure 8.
From the force analysis result, we know that each joint of the leg bears a large force under the ultimate load at the endpoint of the leg.In order to increase accuracy during the strength and stiffness checking, the forces obtained by the force analysis in Adams was further used as the load input for the deformation and stress analyses of each part by FEA with ANSYS software.The results are shown in Figure 9.
the leg structure is mainly connected by ribbed plates with only 4-mm-thin plates in the middle, and the inclination angle of ribbed plates is 45 degrees to facilitate better performance of bearing pressure and bending moment.What is more, many thin-walled structures and lightweight materials were used in both motor and leg structure, which is likely to lead to insufficient strength and stiffness.Therefore, it is necessary to confirm the strength of the leg by Finite Element Analysis (FEA).During the locomotion of a quadruped robot, the leg movement mainly consists of two parts: a stance phase and a swing phase.The stance phase is a moment when the legs are stressed, and the weight of the robot body is supported by only two legs in the middle of the stance phase during trot and bound gaits.Considering that the quadruped robot needs to complete tasks like jumping over obstacles, which may generate an impact 2 to 3 times the weight of body [13], it is estimated that the total weight of the designed quadruped robot is ~40 kg, so the maximum impact distributed to each leg is !600N. At the same time, the legs need to give the body a forward motion force, which was set to 1/10 of the impact (60 N).These two forces are applied to the endpoint of the leg model imported into Adams as load forces, and the forces generated in each part of the leg can be measured as shown in Figure 8.
From the force analysis result, we know that each joint of the leg bears a large force under the ultimate load at the endpoint of the leg.In order to increase accuracy during the strength and stiffness checking, the forces obtained by the force analysis in Adams was further used as the load input for the deformation and stress analyses of each part by FEA with ANSYS software.The results are shown in Figure 9.
It can be found that the maximum stress on each part of the leg is 245.6 Mpa, that is, less than 455 Mpa, which is the material strength of the 7075 aluminum alloy, and the structural strength of the leg meets the requirements with a high safety factor of 1.85.Also, there is a certain amount of deformation as a result of using a thin-walled structure and light aluminum alloy material resulting in lower stiffness brought about by the relatively lower weight of the leg.Moreover, from the view of natural animal running, the contact between their legs and the ground is a flexible contact rather than a rigid contact, which can decrease the peak force between feet and the ground and make the legs bear larger force.Therefore, the structure of the leg having a certain amount of deformation during the movement can be beneficial for buffering.(g) (h)  It can be found that the maximum stress on each part of the leg is 245.6 Mpa, that is, less than 455 Mpa, which is the material strength of the 7075 aluminum alloy, and the structural strength of the leg meets the requirements with a high safety factor of 1.85.Also, there is a certain amount of deformation as a result of using a thin-walled structure and light aluminum alloy material resulting in lower stiffness brought about by the relatively lower weight of the leg.Moreover, from the view of natural animal running, the contact between their legs and the ground is a flexible contact rather than a rigid contact, which can decrease the peak force between feet and the ground and make the legs bear larger force.Therefore, the structure of the leg having a certain amount of deformation during the movement can be beneficial for buffering.

Inverse Kinematic Analysis
In order to accomplish the foot-point trajectory control of the leg, it is necessary to derive the inverse kinematics formula for the leg.The leg model is shown in Figure 10, where q 1 represents the rotation angle of the shoulder part.Because the knee motor rotates by the shoulder motor, the actual rotation angle of the knee part will be (q 1 + q 2 ).

Inverse Kinematic Analysis
In order to accomplish the foot-point trajectory control of the leg, it is necessary to derive the inverse kinematics formula for the leg.The leg model is shown in Figure 10, where q1 represents the rotation angle of the shoulder part.Because the knee motor rotates by the shoulder motor, the actual rotation angle of the knee part will be (q1+q2).
where, qh is the angle between the calf and the thigh; θ is the angle of leg's endpoint with the opposite direction of Y; l1, l2, l3, l12, l13, and l14 are the length of the linkages in the four-bar structure;α The final expression formulas are shown as Equations ( 8)-( 10): q 2 = π − q 1 − arccos l 1 + l 12 cos(α − qh) l  (10) where, q h is the angle between the calf and the thigh; θ is the angle of leg's endpoint with the opposite direction of Y; l 1 , l 2 , l 3 , l 12 , l 13 , and l 14 are the length of the linkages in the four-bar structure; α is the angle between the calf and the linkage l 12 ; and (x,y) is the coordinate of the endpoint of the leg.

Stance Phase Trajectory Design
The leg movement of a quadruped robot can be divided into two phases: the stance phase and the swing phase.Consider that high acceleration and extensive loadings will be exerted on the legs during the stance phase.If only the position control is used, it will easily bring a greater rigid impact to the quadruped robot's body, which does not benefit stable walking or running and will also cause damage to the structure.Therefore, the stance and swing phases are separately designed with position control and impedance control.When the leg contacts the ground, an impedance control method will be applied to ensure the flexible contact between the leg and ground, which can reduce the impact effectively [21,22].
In order to reduce the impact between the leg and ground when the leg leaves or touch the ground, the X-direction motion of the stance phase is designed as a uniform velocity.The formulas of the X-direction of the stance phase are shown as Equations ( 11) and ( 12): where L is the leg stride in a gait cycle, T st is the time of the stance phase, and V desire is the desired speed of the robot.Consider that the cosine function has a good performance in smoothness, so the cosine function, which was also used in other robots [19,23], was used in the trajectory of the stance phase.Considering that the leg will bear an impact and generate deformation when it touches the ground and the impedance control is used to resist impact in the stance phase, it needs a virtual displacement to ensure the body stability of quadruped robot.The Y-direction formula of support phase is shown as Equation ( 13):

Swing Phase Trajectory Design
The objective of the swing phase trajectory design is to protract the leg with enough ground clearance for avoiding obstacles and to have desirable swing leg retraction rate for reducing energy losses of running during touch down motion [24].Consider that the leg is not affected by environmental forces so it can achieve higher speed and acceleration.Therefore, the period of the swing phase T sw is defined as 0.25 s, calculated according to the maximum rotation speed of motors.Two schemes of the trajectory in the swing phase are proposed based on the spline curve and Bézier curve respectively.

Scheme I: Trajectory design with spline curve
The basic principle of this scheme is to minimize the maximum acceleration of legs as much as possible during the swing phase and ensure the continuity of position, speed, and acceleration.The planning trajectory is shown in Figure 11 with four increased velocities.
losses of running during touch down motion [24].Consider that the leg is not affected by environmental forces so it can achieve higher speed and acceleration.Therefore, the period of the swing phase Tsw is defined as 0.25s, calculated according to the maximum rotation speed of motors.Two schemes of the trajectory in the swing phase are proposed based on the spline curve and Bézier curve respectively.Scheme I：Trajectory design with spline curve  In order to avoid the high order polynomial trajectory planning, the trajectory in the swing phase is divided into 0 to 0.5T SW and 0.5T SW to T SW in the X direction.During 0 to 0.5T SW , for guaranteeing the touch-down and leave-off points between the swing phase and stance phase have better smoothness, it is necessary to ensure the position, speed, and acceleration continuously, which are given by Equations ( 14), (15), and ( 16): Similarly, for ensuring the acceleration changes slightly and smoothly in the X direction and limiting the trajectory length of the swing phase to be appropriate, the time reaching zero velocity, T SW,V SW,x=0 , which is a variable parameter with V desire , should be limited by Equation (17): In the X direction, the trajectory is in the acceleration stage before 0.5T SW , and then in the deceleration stage.At the time of 0.5T SW , in order to ensure that the acceleration is small and continuous between the two stages, the acceleration and position should be zero, which are given by Equations ( 18) and ( 19): From Equations ( 14) to (19) above, the five-order spline curves in the direction of X can be fitted from 0 to 0.5T SW , and the curves between 0.5T SW and T SW are obtained symmetrically.
The trajectory in the Y direction is also divided into two parts: 0 to 0.5T SW and 0.5T SW to T SW .It is also necessary to ensure that the position, velocity, and acceleration are continuous at the moment connecting the stance phase and swing phase in the part of 0 to 0.5T SW , which are given by Equations ( 20)-( 22): The highest position of the swing phase is limited at P 1 , in which the velocity and acceleration are zero, which are given by Equations ( 23)-( 25): Therefore, the five-order spline curve in the Y direction during the period from 0 to 0.5T SW can be fitted by Equations ( 20) to (25).For a smooth change between 0 to 0.5T SW and 0.5T SW to T SW , one extra condition is added for ensuring the jerk continuously.Thus, a six-order spline curve can be fitted.

Scheme II: Bézier curve
In this scheme, the trajectory of the swing phase can be obtained by Bézier curve, which is a smooth curve controlled by several points.MIT Cheetahs also used this curve to obtain a smooth swing phase trajectory [9], and a similar method was used in a quadruped robot, called AiDIN-IV [19].The formula is written as Equation ( 26): where P i is the fitting point.The Bézier curve has several properties: (1) double coincidence fitting points determine a zero-velocity point; (2) triple coincidence fitting points determine a zero acceleration point; (3) and V SW,i | t SW =0 = (n + 1)(P 1 − P 0 )/T sw , V SW,i | t SW =T SW = (n + 1)(P n − P n−1 )/T sw .According to these properties, a smooth curve can be obtained by twelve control points as shown in Table 2.
The shape of the trajectory is shown in Figure 12.
According to these properties, a smooth curve can be obtained by twelve control points as shown in Table 2.The shape of the trajectory is shown in Figure 12.

The Features of Two Schemes
Comparing the swing phase trajectory acceleration of spline curve with that of the Bézier curve as shown in Figure 13, a curve with continuous acceleration cannot be obtained.Moreover, the acceleration of the Bézier curve at a contact point with the stance phase cannot reach 0, which means that there will be an impact force on the ground, and the maximum value of its acceleration curve is also larger than that in the spline curve.As to the spline curve trajectory, it will be more difficult to obtain the trajectory.Although there are many fitting conditions, it can obtain continuous curves with the stance phase, velocity, and acceleration, because the impact on the ground will be relatively small.However, from the analysis of Figure 14, in both schemes, the rotation angle for the shoulder and knee motors are changed continuously.

The Features of Two Schemes
Comparing the swing phase trajectory acceleration of spline curve with that of the Bézier curve as shown in Figure 13, a curve with continuous acceleration cannot be obtained.Moreover, the acceleration of the Bézier curve at a contact point with the stance phase cannot reach 0, which means that there will be an impact force on the ground, and the maximum value of its acceleration curve is also larger than that in the spline curve.As to the spline curve trajectory, it will be more difficult to obtain the trajectory.Although there are many fitting conditions, it can obtain continuous curves with the stance phase, velocity, and acceleration, because the impact on the ground will be relatively small.However, from the analysis of Figure 14, in both schemes, the rotation angle for the shoulder and knee motors are changed continuously.

Simulation
From the above results, it can be seen that the two leg trajectories have different properties, but their movement stability performance on a quadruped robot is still unknown.Therefore, in this section, the Webots software (Cyberbotics Ltd.) is introduced to simulate the motion stability of a quadruped robot under two high-speed gait trajectories.A model, which has the same physical parameters of the designed leg, was built, and two different gait trajectories were applied.The simulation results are shown in Figure 15.The desired speed was set as 2 m/s, which is a relatively high speed for quadruped robots.During the stance phase, an impedance controller was added for both of two schemes with appropriately set parameters of K = 80 Nm/rad and C = 5 Nms/rad.A distance sensor was placed in the center of the robot to measure the height change of the center of gravity of the quadruped robot from the ground for testing the new proposed gait trajectory and comparing the stability between two gait trajectories as shown in Figure 16.

Simulation
From the above results, it can be seen that the two leg trajectories have different properties, but their movement stability performance on a quadruped robot is still unknown.Therefore, in this section, the Webots software (Cyberbotics Ltd.) is introduced to simulate the motion stability of a quadruped robot under two high-speed gait trajectories.A model, which has the same physical parameters of the designed leg, was built, and two different gait trajectories were applied.The simulation results are shown in Figure 15.The desired speed was set as 2 m/s, which is a relatively high speed for quadruped robots.During the stance phase, an impedance controller was added for both of two schemes with appropriately set parameters of K=80Nm/rad and C=5Nms/rad.A distance sensor was placed in the center of the robot to measure the height change of the center of gravity of the quadruped robot from the ground for testing the new proposed gait trajectory and comparing the stability between two gait trajectories as shown in Figure 16.

Experiment
The hardware configuration of the single leg platform main consists of a PC, a controller (C6015, Beckhoff), two motor drives (G-SOLTWI10/200EE1, Elmo), two frameless motors (127P1, 380W, Allied Motion), and rotary magnetic encoders (RMB20SC13BC10, Renishaw), as shown in Figure 17.The controller has a dual-core CPU of 1.92 GHz with a rapid data computing capability.Moreover, the size of the controller is only 96 mm x 91 mm x 41 mm, which can greatly save space.The custom driven unit with a frameless motor with high torque density was specific designed, which significantly reduces the weight of the leg structure.Additionally, this motor can provide a sufficient torque of 21 Nm for high-speed running and jumping.Considering that the legs will bear periodic impact load during movement, magnetic encoders were used in the leg that can separate the encoder from the rotating shaft and avoid damage caused by the impact between the encoder and the shaft.

Experiment
The hardware configuration of the single leg platform main consists of a PC, a controller (C6015, Beckhoff), two motor drives (G-SOLTWI10/200EE1, Elmo), two frameless motors (127P1, 380W, Allied Motion), and rotary magnetic encoders (RMB20SC13BC10, Renishaw), as shown in Figure 17.The controller has a dual-core CPU of 1.92 GHz with a rapid data computing capability.Moreover, the size of the controller is only 96 mm x 91 mm x 41 mm, which can greatly save space.The custom driven unit with a frameless motor with high torque density was specific designed, which significantly reduces the weight of the leg structure.Additionally, this motor can provide a sufficient torque of 21Nm for high-speed running and jumping.Considering that the legs will bear periodic impact load during movement, magnetic encoders were used in the leg that can separate the encoder from the rotating shaft and avoid damage caused by the impact between the encoder and the shaft.During the high-speed locomotion of the quadruped robot, its legs need to swing periodically and quickly, so the legs need to complete a swing trajectory in a very short time, which requires that the control cycle time be short enough to follow the trajectory [24].Therefore, both the controller and drives need to have high real-time computing ability and high signal transmission speed.Therefore, an EtherCAT bus was chosen from PC to driver.The EtherCAT bus has a high transmission rate, and the control cycle time can reach the level of a microsecond, which can meet the high real-time requirement of the movement of the leg.
The control program was designed by TwinCAT 3 which can provide abundant modules to realize different kinds of motion control in Visual Studio.The Beckhoff C6015 controller has a dual-core structure, which can process different data in parallel, and the communication between the two cores is simple and efficient.Therefore, one of the cores can be used for trajectory selection and trajectory planning, and the other core can be used to send command signals to the motor to ensure real-time movement of the legs.
The experimental platform was constructed as shown in Figure 18.The NDI Optotrak Certus was used to trace the endpoint of the leg to measure the actual trajectories of the two schemes During the high-speed locomotion of the quadruped robot, its legs need to swing periodically and quickly, so the legs need to complete a swing trajectory in a very short time, which requires that the control cycle time be short enough to follow the trajectory [24].Therefore, both the controller and drives need to have high real-time computing ability and high signal transmission speed.Therefore, an EtherCAT bus was chosen from PC to driver.The EtherCAT bus has a high transmission rate, and the control cycle time can reach the level of a microsecond, which can meet the high real-time requirement of the movement of the leg.
The control program was designed by TwinCAT 3 which can provide abundant modules to realize different kinds of motion control in Visual Studio.The Beckhoff C6015 controller has a dual-core structure, which can process different data in parallel, and the communication between the two cores is simple and efficient.Therefore, one of the cores can be used for trajectory selection and trajectory planning, and the other core can be used to send command signals to the motor to ensure real-time movement of the legs.
The experimental platform was constructed as shown in Figure 18.The NDI Optotrak Certus was used to trace the endpoint of the leg to measure the actual trajectories of the two schemes (V desire = 2 m/s).The marker was fixed on the endpoint of the foot.The experimental results are shown in Figure 19, from which we can see that the leg can trace the desired trajectory.Whether the movement is stable and the power consumption is low are directly related to the efficiency of the trajectory design.For evaluating the efficacy of two trajectory planning methods, during the test, the voltage and current of the battery, the angular velocity of the motors, and the torque output of the motors in two schemes were sampled simultaneously.Also, the following formulas ( 27) and ( 28) were used to calculate the consumption power.Finally, the power consumption can be obtained as shown in Figure 20, and the energy consumption is compared in Table 3.In particular, the time traces of the energetics of legs swing with Vdesired=2m/s for two schemes can be found in Figure 21.Whether the movement is stable and the power consumption is low are directly related to the efficiency of the trajectory design.For evaluating the efficacy of two trajectory planning methods, during the test, the voltage and current of the battery, the angular velocity of the motors, and the torque output of the motors in two schemes were sampled simultaneously.Also, the following formulas ( 27) and ( 28) were used to calculate the consumption power.Finally, the power consumption can be obtained as shown in Figure 20, and the energy consumption is compared in Table 3.In particular, the time traces of the energetics of legs swing with Vdesired=2m/s for two schemes can be found in Figure 21.Whether the movement is stable and the power consumption is low are directly related to the efficiency of the trajectory design.For evaluating the efficacy of two trajectory planning methods, during the test, the voltage and current of the battery, the angular velocity of the motors, and the torque output of the motors in two schemes were sampled simultaneously.Also, the following Formulas ( 27) and ( 28) were used to calculate the consumption power.Finally, the power consumption can be obtained as shown in Figure 20, and the energy consumption is compared in Table 3.In particular, the time traces of the energetics of legs swing with V desired = 2 m/s for two schemes can be found in Figure 21.

Discussion
Our leg design concentrates all the motors on the shoulder joint.Hence the center of mass is near to the center of rotation, which makes the inertia of the swing leg change smaller so that the leg

Discussion
Our leg design concentrates all the motors on the shoulder joint.Hence the center of mass is near to the center of rotation, which makes the inertia of the swing leg change smaller so that the leg

Discussion
Our leg design concentrates all the motors on the shoulder joint.Hence the center of mass is near to the center of rotation, which makes the inertia of the swing leg change smaller so that the leg can achieve higher acceleration and a faster response.This leg configuration is also adopted by several quadrupeds, such as the MIT cheetah [25], Laikago robot [26], and SpotMini [7].For the manufactured leg, it can be found that the swing inertia of the knee joint, which mainly provides the movement in the vertical direction, is very low and its movement is very flexible.Also, the force the quadruped robots bear most is also in the vertical direction.Hence such a leg structure is suitable to the high-speed movement and jumping for quadruped robots.Differing from the leg of MIT cheetahs, which was made with a bioinspired fabrication method [14], our leg structure is mainly connected by ribbed plates with only 4-mm-thin plates in the middle.The structure has a better performance of bearing pressure and bending moment and is simpler for manufacturing.In particular, wear washers and dry bushings were adopted in our joints design to reduce the friction of linkages' joint by the self-lubrication characteristics of the dry bushing.
Moreover, two high torque density motors are used in the single leg, which can provide a strong power regardless of a low gear ratio.The coaxial motor configuration can achieve a coupled motion of two shoulder and knee joints, which has also been adopted by several quadrupeds, such as MIT cheetah [25] and Laikago robot [26].The used single-stage gear can greatly decrease the size and mass of the reducer as well as reducing the energy loss in the process of mechanical transmission, making a significant contribution to energy efficiency.
From the acceleration curves of the two schemes, it is obvious that the gait trajectory of spline curve in scheme 1 can ensure the continuity of acceleration, and the acceleration of the contact point between swing phase and stance phase is almost zero in scheme 1, which means no additional impact is generated from the ground.Because of the characteristics of the Bézier curve, the gait trajectory planned finds it difficult to achieve continuity of acceleration, and the acceleration of the legs once in contact with the ground is not zero.Therefore, there will be an impact on the legs, which will affect the walking stability of the quadruped robot.Besides, the shape of the curve in Figure 13c resembles human gait ground reaction forces [27].According to Marc Raibert's virtual leg principle [28], a quadruped gait that uses four legs in two pairs, such as trot and pace, could be viewed as an equivalent biped, which means that human gait somewhat resembles quadruped gait.That may be the reason why the curves are similar, and it also proves that the gait trajectory is close to a biological gait.The characteristics of these two schemes were also evaluated with the simulation in Webots.During the simulation, the robot used the gait of scheme 1 and can walk more steadily with less body shaking; however, the quadruped robot, while using the gait of scheme 2, suffers from minor shaking, although it can walk normally.According to the change of the height of gravity center, the maximum difference of gravity center height in the scheme I is 22.62 mm, while that of scheme II is 23.79 mm.Overall, it can be seen that the gait stability of scheme I is better than that of scheme II especially for the change of pitch angle.
Furthermore, the power consumption for the two schemes indicates that scheme 1 consumes less battery energy and has higher efficiency than that of scheme 2, as shown in Figure 20 and Table 3 in the results section, although scheme 1 consumes more mechanical energy.Besides, the RMS knee current, which corresponds to heating in scheme 1, is similar to that of scheme 2. While the RMS shoulder current in scheme 1 is much smaller than that in scheme 2. Hence, scheme 1 is superior to scheme 2 in energy consumption.In particular, from Figure 21, which shows the time traces of the energetics of legs swing with two schemes, it can be found that, due to the acceleration discontinuity of scheme 2, there is greater power consumption for the leave-off motion than the touch-down motion between the swing leg and ground.
Jacobian matrix for the two-part leg structure can be calculated as equation (3):

Figure 1 .
Figure 1.Schematic for the three-joint and two-joint leg structures.

Figure 2 .
Figure 2. Manipulability for the three-joint and two-joint leg structure.

Figure 2 .
Figure 2. Manipulability for the three-joint and two-joint leg structure.

22 Figure 3 .
Figure 3. Obstacle avoiding ability of the three-joint and two-joint leg structures.

Figure 3 .
Figure 3. Obstacle avoiding ability of the three-joint and two-joint leg structures.

Figure 3 .
Figure 3. Obstacle avoiding ability of the three-joint and two-joint leg structures.
height of the quadruped, the result can be obtained as shown in Figure4.

Figure 4 .
Figure 4. Occupied space after retracting the leg for the three-joint and two-joint leg structures.

Figure 4 .
Figure 4. Occupied space after retracting the leg for the three-joint and two-joint leg structures.

22 Figure 5 .
Figure 5. Leg configuration comparisons between the three-joint and two-joint leg structures.

Figure 5 .
Figure 5. Leg configuration comparisons between the three-joint and two-joint leg structures.

2 .
Detailed Leg Design with Three-joint Leg Structure

22 Figure 6 .
Figure 6.Structural design of one leg of the quadruped.

Figure 6 .
Figure 6.Structural design of one leg of the quadruped.

22 Figure 7 .
Figure 7. Detailed design of the shoulder module.

Figure 8 .
Figure 8. Force calculation by Adams.(a) Leg model imported in Adams.(b) Forces measured in each part of the leg.

Figure 7 .
Figure 7. Detailed design of the shoulder module.

Figure 8 .
Figure 8. Force calculation by Adams.(a) Leg model imported in Adams.(b) Forces measured in each part of the leg.

Figure 8 .
Figure 8. Force calculation by Adams.(a) Leg model imported in Adams.(b) Forces measured in each part of the leg.

Figure 9 .
Figure 9. Finite Element Analysis (FEA): (a) The total deformation of the thigh; (b) the equivalent stress of the thigh; (c) the total deformation of the calf; (d) the equivalent stress of the calf; (e) the total deformation of the foot; (f) the equivalent stress of the foot; (g) the total deformation of the linkage connecting the knee motor and knee joint; (h) the equivalent stress of the linkage connecting the knee motor and knee joint; (i) the total deformation of the linkage connecting the thigh and foot; (j) the

Figure 9 .
Figure 9. Finite Element Analysis (FEA): (a) The total deformation of the thigh; (b) the equivalent stress of the thigh; (c) the total deformation of the calf; (d) the equivalent stress of the calf; (e) the total deformation of the foot; (f) the equivalent stress of the foot; (g) the total deformation of the linkage Appl.Sci.2019, 9, x FOR PEER REVIEW 11 of 22 equivalent stress of the linkage connecting the thigh and foot; (k) the total deformation of the shoulder motor shaft; (l) the equivalent stress of the shoulder motor shaft; (m) the total deformation of the knee motor shaft; (n) the equivalent stress of the knee motor shaft; (o) the total deformation of the component connecting the thigh and the shoulder motor; and (p) the equivalent stress of the component connecting the thigh and the shoulder motor.

Figure 10 .
Figure 10.Inverse kinematics model of the leg.

Figure 10 .
Figure 10.Inverse kinematics model of the leg.

Figure 13 .
Figure 13.The endpoint acceleration of the leg calculated by MATLAB during the swing phase: (a) The acceleration in the X direction for the spline curve trajectory; (b) the acceleration in the Y direction for the spline curve trajectory; (c) the acceleration in the X direction for the Bézier curve trajectory; and (d) the acceleration in the Y direction for the Bézier curve trajectory.

Figure 13 .
Figure 13.The endpoint acceleration of the leg calculated by MATLAB during the swing phase: (a) The acceleration in the X direction for the spline curve trajectory; (b) the acceleration in the Y direction for the spline curve trajectory; (c) the acceleration in the X direction for the Bézier curve trajectory; and (d) the acceleration in the Y direction for the Bézier curve trajectory.

Figure 13 .Figure 14 .
Figure 13.The endpoint acceleration of the leg calculated by MATLAB during the swing phase: (a) The acceleration in the X direction for the spline curve trajectory; (b) the acceleration in the Y direction for the spline curve trajectory; (c) the acceleration in the X direction for the Bézier curve trajectory; and (d) the acceleration in the Y direction for the Bézier curve trajectory.

Figure 14 .
Figure 14.The motor rotation angle calculated by MATLAB during the swing phase: (a) The shoulder motor rotation angle in the spline curve trajectory, (b) the knee motor rotation angle in the spline curve trajectory, (c) the shoulder motor rotation angle in the Bézier curve trajectory, and (d) the knee motor rotation angle in the Bézier curve trajectory.

Figure 15 .
Figure 15.The simulation of the movement running at Vdesire=2m/s with trot gait: (a) The quadruped robot runs by the spline curve trajectories and (b) the quadruped robot runs by the Bézier curve trajectories.

Figure 15 .Figure 15 .
Figure 15.The simulation of the movement running at V desire = 2 m/s with trot gait: (a) The quadruped robot runs by the spline curve trajectories and (b) the quadruped robot runs by the Bézier curve trajectories.

Figure 16 .
Figure 16.Simulation results with Webots for the height of the center of mass (CoM).

Figure 16 .
Figure 16.Simulation results with Webots for the height of the center of mass (CoM).

Figure 19 .
Figure 19.The desired and actual trajectory with V desired = 2 m/s.(a) The trajectory of the scheme I. (b) The trajectory of the scheme II.

Figure 21 .
Figure 21.Time traces of the energetics of legs swing with two schemes.(a) The battery power consumption of the scheme I with spline curve in swing phase.(b) The battery power consumption of the scheme 2 with Bézier curve in swing phase.

Figure 20 .
Figure 20.Power consumption of two schemes in V desired = 2 m/s.

Figure 21 .
Figure 21.Time traces of the energetics of legs swing with two schemes.(a) The battery power consumption of the scheme I with spline curve in swing phase.(b) The battery power consumption of the scheme 2 with Bézier curve in swing phase.

Table 1 .
Physical leg parameters.The detailed design of the shoulder module is shown in Figure
where Pi is the fitting point.The Bézier curve has several properties: (1) double coincidence fitting points determine a zero-velocity point; (2) triple coincidence fitting points determine a zero acceleration point; (3) and = −

Table 3 .
Energy consumption of two schemes in Vdesired=2m/s within 17s.

Table 3 .
Energy consumption of two schemes in Vdesired=2m/s within 17s.

Table 3 .
Energy consumption of two schemes in V desired = 2 m/s within 17 s.