Design and Control of a Novel Single Leg Structure of Electrically Driven Quadruped Robot

In order to solve the defects of the large inertia and control difficulty of the electrically driven quadruped legs of robots, a novel leg structure and a control method are proposed in this paper. In terms of structure, the motor of the knee is arranged in the body of the robot to reduce the weight of the legs. In addition, this paper improves the PVTdifference control algorithm embedded in the PMAC controller. Using the nonlinear control principle of the U-model, the optimized segmented Hermite difference method is used to implement the planning of the foot trajectory of the quadruped robot. Simulation and experiment show that the leg structure design is reasonable and the improved interpolation algorithm has good control effect.


Introduction
Quadruped robots, which combine the flexibility of biped robots and the stability of hexapod robots, are widely used in flood fighting, explosive disposal, military transportation, interplanetary detective, etc. Due to their superior performance, they have attracted more and more scholars for study. In recent years, experts all over the world have continuously overcome difficulties in quadruped robots and achieved a series of experimental results [1][2][3]. Among them, one of the most representative robots is Big Dog, which is developed by Boston Dynamics for more than a decade [4,5]. With a top speed of 10 km/h, the robot can transport weapons, ammunition, food, and other items to hard-toreach areas and can cooperate with soldiers. With the support of the national high and new technology research and development plan (863 Plan), Shandong University, Harbin Technical University, Shanghai Jiao Tong University, and other institutes have made a lot of achievements in the field of quadruped robots, successfully realizing robot steady walking on the slope and gravel road surface [6][7][8][9].
When a quadruped robot walks according to the planned trajectory, it is difficult to obtain an ideal foot trajectory due to the constraints of robot structure and control mode. erefore, trajectory generation and control of quadruped robot has always been an important subject in this research field. In literature [10] He and Ma raised a method to generate cycloid trajectory of the foot. In literature [11], Lei et al. studied the kinematics and dynamics of several common trajectories and analyzed the advantages and disadvantages of cycloidal trajectory. Wang et al. proposed an improved algorithm for zero-impact cycloid trajectory to generate a foot trajectory with section of continuous function in literature [12]. However, none of the above literatures has proposed a specific method to realize the cycloid trajectory of the quadruped robot through the controller. In this paper, we designed an electrically driven leg structure and proposed a method of generating the foot trajectory of quadruped robot for the purpose of the trajectory planning. Furthermore, the planned foot trajectory is also written into the PMAC controller to realize the foot movement.

Structural Design.
When a quadruped robot walks, it mainly depends on the reaction force (friction and support force) of the ground to the touching foot to drive the fuselage forward. As a result, the design of leg mechanism will directly affect the stability of the quadruped robot during walking. ere are two main factors to be considered in leg design: driving method and leg structure. e common leg structures of quadruped robots can be divided into four types: full elbow joints, full knee joints, front knee joints and back elbow joints, and front elbow joints and back knee joints ( Figure 1). rough the simulation of virtual prototypes and the testing of physical prototypes, Zhang et al. believed that the quadruped robots in the form of front elbow joints and back knee joints have the characteristics of high speed, small lateral offset, low energy consumption, and small fluctuation. In addition, the four symmetrical leg structures can effectively eliminate the sway of the fuselage while walking and maintain the stability of the fuselage. Most domestic and foreign quadruped robots use this method to arrange the leg structure [13].
ere are two driving modes of quadruped robot: hydraulic and servo. e hydraulic actuator changes the force mainly by changing the hydraulic pressure and has the advantages of simple structure, stable acceleration and deceleration, and good reliability. However, the liquid medium is easy to be polluted, and the cost of hydraulic components is high. e servo driver has the advantages of high standardization, simple structure, low cost, and high transmission efficiency. In this paper, from the perspective of structure and application, the servo motor with high transmission efficiency is selected as the main driving mode. In order to satisfy the three conditions of low inertia and quality of the legs and ensure good motion performance and quick recovery of the stability of the whole machine after the imbalance, the leg structure is designed according to the skeletal anatomy and bionics of German shepherd dog as is shown in Figure 2. e motors of the hip and knee joint are integrated into the side swing joint of the body. e driving moment of the knee joint is transmitted to the knee joint of the leg through parallelogram and contra-parallelogram mechanism. Four identical side swing motors are arranged symmetrically on the left and right sides. e electrically driven MQ (MCVN quadruped robot) as shown in Figure 3 is designed on the basis of the idea of front elbow joints and back knee joints.

Kinematic Modeling.
e leg structure of quadruped robot has two degrees of freedom: hip joint and knee joint. Its structure includes parallelogram mechanism (ABCD), the contra-parallelogram mechanism (AEFG), thigh connecting rod l AG , and crus connecting rod l GH . e parallelogram mechanism is composed of two cranks (l BC and l AD ) and two connecting rods (l AB and l DC ), while the contraparallelogram mechanism is composed of two cranks (l AE and l FG ) and one connecting rod l AG (Figure 4). By driving the crank l BC of parallelogram and the l AG of connecting rod of thigh, the foot can perform specific movements in XY plane [14,15].
In light of the geometric characteristics of parallelogram and contra-parallelogram mechanisms, the corresponding angle relationship can be calculated, where lin l FGH is the same linkage with an angle of 170 degrees. Constructing auxiliary dotted lines as shown in Figure 4, the corresponding sides in triangle AEF and triangle AFG, triangle AEG, and triangle FGE are all equal, so they are congruent triangles. If θ 1 and θ 2 are known, θ 3 can be calculated through the cosine theorem (the length of each rod is known): Equations (1)-(5) can be sorted out as follows: where the parameters of each connecting rod of leg joint of quadruped robot are shown in Table 1: Similarly, if the θ 3 and θ 1 are known, knee angle θ 2 can be calculated as follows: 2.3. Forward and Inverse Kinematics. D-H (Denavit Hartenberg) coordinate method is used to analyze the kinematics of quadruped robot [16][17][18][19]. Due to the complexity of D-H coordinate and the characteristics of parallelogram and contraparallelogram linkage mechanism, the leg model of the quadruped robot is simplified in kinematics analysis. According to the conversion relationship between equations (6) and (7), the actual rotation angle of the servo motor is mapped into the D-H coordinate system. In addition, on the basis of rules of D-H coordinate system, the fixed reference coordinates (X 0 , Y 0 , Z 0 ) at hip joint A are first determined, then the common vertical lines of joint axes 1 and 2 are obtained. eir intersection points are the origin of the link coordinate system {1}. In line with the difficulty of calculation, the direction of axis Z 1 is confirmed; meanwhile the positive direction of axis X 1 as the direction of the common vertical line mentioned above is specified. Finally, the direction of Y 1 is determined by the right hand rule. Similarly, the linkage coordinate systems {2} and {3} can be established. e D-H coordinates of the swinging phase of the quadruped robot are shown in Figure 5.
D-H related parameters are shown in Table 2. For the D-H coordinate system with n joints, the coordinate transformation of link i relative to link i−1 is i−1 i T: where cθ i � cos (θ i ); sθ i � sin (θ i ); cα i � cos (α i ); sα i � sin (α i ); l i is the length of connecting rod; θ i is the joint angle; α i is the connecting rod angle; and d i is the offset of connecting rod. According to the above D-H coordinate transformation, the attitude and position change of reference coordinate system {3} relative to base coordinate system {0} can be obtained as shown in the following equation: where c 12 � cos (θ 1 + θ 2 ) and s 12 � sin (θ 1 + θ 2 ). rough geometric analysis, the inverse kinematic solution of the leg linkage can be received as shown in the following equation: where (x y) is the position of the robot foot in the space coordinate {0}.

Foot Workspace Analysis.
e foot workspace of a quadruped robot, which is one of the important indexes to measure the motion performance, is a collection of points of spatial position that can be reached. However, the workspace of each robot is only related to its own characteristic parameters. At present, analytic, numerical, and graphical methods are usually used to solve the workspace. e analytic method usually solves the workspace boundary by linear or nonlinear function relationship between the joints. In addition, its expression is relatively complex and is not suitable for applications in practical engineering [20]. e graphical method is intuitive, but it is limited by the degree of freedom. When the degree of freedom exceeds three, graphical methods usually require grouping [21]. What is more, it only needs to select as many different joint variables as possible in the numerical method. It can use the forward kinematics of the robot to solve the foot coordinates. e boundary surface formed by the coordinate points is the working interval of the robot.
Typical numerical methods include search method, iteration method, and Monte Carlo method. In this paper, Monte Carlo method is adopted to calculate the working space of the robot foot. e specific steps are as follows: (1) e forward kinematics of the leg mechanism is calculated (2) e random variables of each joint of the robot are calculated, including the constraint relationship between the angles of each joint (3) e boundary surface of foot workspace is drawn by MATLAB

Foot Trajectory Planning and Interpolation Control.
In this paper, PMAC programmable multiaxis motion controller from Delta-Tau-Data-System company is selected as the main controller to control the leg servo motor. e method of calculating other points between known points based on a particular algorithm is called interpolation control. Common interpolation algorithms include line, arc, and PVT (Position Velocity and Time). e curve velocity calculated by the linear algorithm is not smooth and has acceleration and deceleration errors and is not suitable for accurate control [22]. Arc algorithm is suitable for rough interpolation and is usually mixed with other algorithms [23]. e essence of PVT algorithm is Hermite interpolation, which can generate more intuitive control curves [24,25].
According to the position and velocity of the initial point and the position and velocity of the end point, the position and velocity of any curve at any time in the curve section can be approximately solved under the PVT mode. Furthermore, the velocity variation received is relatively smooth.   e movement process of quadruped robot is divided into swing and support phase. In swing phase, the length and height step have an important impact on the performance of the whole machine. In supporting the phase, the foot of the robot is always in contact with the ground, and the trajectory formed is usually a simple straight line. erefore, the movement of the swinging phase is only to be considered in the trajectory planning. In order to reduce the impact of the foot on the ground and prevent the foot from sliding with the ground, the lifting and landing speed of the swing stage are both zero. As the trajectory of the quadruped robot is relatively free, a variety of curves, which met the above requirements, can be designed.
In this paper, a piecewise interpolation method based on known points in the workspace is proposed. At the same time, in order to facilitate the writing of trajectory function into PMAC controller, a more intuitive PVT interpolation algorithm is selected. Because the PVT interpolation function of the controller itself does not make a specific study on the selection method of segment points, the segmented point selection and the foot track characteristics of the quadruped robot based on the original PVT interpolation function are studied in this paper. e Hermite interpolation (PVT) cubic polynomial of a curve segment can be expressed as follows: where p k and p k+1 are the track points at time t k and t k+1 , respectively; v k and v k+1 are the velocities at time v k and v k+1 respectively; h k � t k+1 − t k represents the time interval within the current subsection. At the same time, in order to get a relatively smooth curve of velocity change, the proportional coefficient C was introduced in literature [26]. As shown in equation (12), the relationship between velocity and position increment is adjusted by area method. Typical velocity variation curves that used Hermite interpolation are shown in Figure 6: Here, Δp is the increment of position change. e smoothness of the speed change of quadruped is related not only to the speed change within a certain section, but also to the selection of segment points. A selection method of segment points is proposed in this paper. Referring to the characteristic of velocity smoothing of cycloid trajectory (equation (13)) proposed in reference [27], the swing phases in a cycle are evenly divided into four equal parts for Hermite interpolation. e velocity curve of cycloid trajectory can be approximately equivalent by choosing the appropriate proportional coefficient C.
Referring to the law of velocity variation shown in Figure 7, where the velocity at the beginning and end points of the X-axis direction is zero, a concave curve with a ratio coefficient C of 1/3 as shown in Figure 6(a) is selected (the velocity variation at V k is relatively gentle). Meanwhile, in order to satisfy the smooth change of velocity at the transition points at T/2 time, the convex curve with a proportionality coefficient C of 2/3 as shown in Figure 6(b) is chosen for the symmetric piecewise curves of the transition point (the velocity variation at V k+1 is relatively gentle). In the Y-axis direction, in order to meet the requirement that the velocity change at the transition point at T/2 and T/4 time is relatively smooth and the time velocity at 2/T is zero, a convex curve with a proportionality coefficient C of 2/3 as shown in Figure 6(b) is selected. To sum up, the velocity change rate coefficient of X-axis is [1/3, 2/3, 2/3, 1/3], and the velocity change rate coefficient of Y-axis is 2/3. Finally, the change curve of foot track speed is obtained as shown in Figure 8: where S is the step length, H is the step height, and T is the period of oscillation phase.
Assuming that the period of the oscillating phase is two seconds, the maximum velocity in the X-axis direction is 80 mm/s, and the maximum velocity in the Y-axis direction is 16 mm/s. In the X-axis direction, at T/2 time, the foot speed reaches the maximum value −V max ; at T/4 and 3 T/4 time, the speed is one half of the maximum value. According to equation (13), the position increment of the four points is [−6.67, −33.33, −33.33, −6.77] mm. In the direction of Y axis, at T/4 time, the foot velocity reaches the maximum value −V max ; at 3 T/4 time, the foot velocity is V max ; at T/2 time, the foot velocity is zero. e position increments of the four points calculated by equation (13) are [−5.33, −5.33, 5.33, 5.33] mm. e foot trajectory function generated by interpolation is shown in the following equation: Mathematical Problems in Engineering 5 x (mm)      Mathematical Problems in Engineering

t (s)
e step length and lift height of the quadruped robot are shown in the following equation: where i and j are the numbers of sections and △P i and △P j are the displacement increments of each section.
According to equation (15), the step length S is 80 mm and the leg lift height H is 10.66 mm. As can be seen from Figure 9, the foot trajectory formed by the step length and step height is within the working space of the leg of the quadruped robot. Considering the mechanical characteristics of parallelogram and contra-parallelogram, the foot trajectory is symmetrically distributed along the Y-axis with an initial position of (40 mm, 330 mm), when the robot's leg joint moves. Since the positive direction of D-H coordinate is located in the third quadrant of the rectangular coordinate system, when the robot's leg moves to the highest point, the Y-axis coordinate is 319.34 mm. e generated foot track is shown in Figure 10.

Interpolation Control.
e speed of the segment points and the segment points of the planned trajectory are written into the controller by script language (Figure 11). e leg servo motor is controlled to move according to the planned trajectory. e trajectory interpolation procedure within 0.5 seconds is shown in the following equation: PVT 500, where 500 milliseconds is the interval between segments; X 33.33 mm and Y 324.67 mm are the existing positions of P 0 (the initial points) after △P increment change; −40 mm/s and −16 mm/s are the velocities of the end points of the first segment.

ADAMS Simulation.
In order to verify correctness of the quadruped robot foot trajectory and the smoothness of the speed change in the direction of XY axis, the simulation is carried out by MATLAB and ADAMS in this paper [28,29]. Firstly, SolidWorks is used to build the 3D model of the virtual prototype, and then the 3D model is imported into ADAMS to add constraints and drivers. e coordinate set on the foot track is mapped to the corresponding motor angle by MATLAB. Finally, the motor angle is imported into ADAMS to complete the simulation verification of the virtual model. e specific simulation process is shown in Figure 12.
In one cycle, the foot movement process is shown in Figure 13.

Simulation Results
Analysis. When a quadruped robot travels along the foot trajectory formed by Hermite interpolation, the synthetic velocity curve along the XY axis is shown in Figure 14. According to the graph, the change of the foot speed of the robot in a single cycle is relatively smooth and can meet the requirements of the stable motion of the robot.

Analysis of Experimental Results.
e quadruped robot designed in this paper uses steel processing leg structure. In order to verify the trajectory of one leg when the robot swings, and to avoid the friction caused by the contact between the other three legs and the ground affecting the trajectory of the foot, aluminum profiles are used to construct a support frame to support the entire body in the air. e standard laser tracker R-20 Radian of the automatic precision engineering company (API) is adopted in the measurement system. e spatial position of the measuring point relative to the measuring coordinate system is calculated by the laser interference principle [30]. e experimental platform is shown in Figure 15.
Due to the limited space of the body of the quadruped robot, in order to increase the reliability of the robot in the process of moving and the bearing capacity of the body of the robot, PMAC 16-axis ck3e controller with small size and good openness is selected as the main controller. e controller is equipped with the corresponding EtherCAT slave station module to realize the information interaction between switch and analog. e DB59M024035-KYAN brushless DC servo motor of Nanotec German is used as the servo motor. e specific models are shown in Table 3. e control principle of the whole machine is shown in Figure 16.
e initial joint angle of the robot is set as 40°for the hip joint and 80°for the knee joint. According to the kinematics model, the initial angle of the calf motor is calculated as 52.8°. e trajectory drawing software embedded in PMAC is used to draw the movement trajectory of the robot foot in the oscillating phase in a single cycle (Figure 17). Under the initial conditions, the program of fast return to zero is executed, then the foot moves to (40 mm, 330 mm), and the foot of the robot walks according to the preset trajectory. In one period, the displacement in the X-axis direction is Motor program  Mathematical Problems in Engineering 9 80 mm, and the displacement in the y-direction is about 10.66 mm. e sampling time is set by the laser tracker, and the foot motion track is measured as shown in Figure 18.
Due to the gap in the leg structure during processing and assembly, the mechanical mechanism of the foot has a slight vibration in the actual movement process, which leads to the deviation between the fitted track and the actual track. e displacement in the X-axis direction is 81.3 mm with an error of 1.65%. e maximum displacement in the Y-axis direction is 10.3 mm with an error of 3.4%. e error is small and can fully meet the walking requirements.

Conclusion
(1) In order to reduce the inertia of quadruped robot's legs, a leg structure is designed in this paper. e motor of hip joint and knee joint is reasonably arranged on the body, and the parallel quadrilateral and contra-parallel quadrilateral bar structures are used for power transmission. (2) For the quadruped robot with the goal of trajectory planning, MATLAB software is adopted, Hermit interpolation algorithm is applied, and the characteristic of smooth velocity change of cycloid trajectory is used for reference. Proportional coefficient C is reasonably selected to approximate the velocity change curve of the foot trajectory, so as to generate the movement trajectory of the foot of the quadruped robot. ADAMS software is used to simulate. According to the simulation results, the quadruped robot can move using the designed trajectory, and the speed changes in the process of movement are relatively smooth. (3) e PMAC bus controller with small volume and high integration is adopted as the main controller. e forward and inverse solution algorithm is written and the PVT interpolation library function is called to control the leg servo motor by writing the motion program through scripting language, so as to test the real prototype. e experimental results show that the trajectory generated by piecewise interpolation based on the cycloid velocity curve can be realized under the leg structure of the quadruped robot in this paper. At the same time, the velocity variation is relatively stable during the movement. is experiment offers a theoretical basis for the trajectory design, optimization, and overall debugging of the electrically driven quadruped robot.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.