A Bio-Inspired Compliance Planning and Implementation Method for Hydraulically Actuated Quadruped Robots with Consideration of Ground Stiffness

There has been a rising interest in compliant legged locomotion to improve the adaptability and energy efficiency of robots. However, few approaches can be generalized to soft ground due to the lack of consideration of the ground surface. When a robot locomotes on soft ground, the elastic robot legs and compressible ground surface are connected in series. The combined compliance of the leg and surface determines the natural dynamics of the whole system and affects the stability and efficiency of the robot. This paper proposes a bio-inspired leg compliance planning and implementation method with consideration of the ground surface. The ground stiffness is estimated based on analysis of ground reaction forces in the frequency domain, and the leg compliance is actively regulated during locomotion, adapting them to achieve harmonic oscillation. The leg compliance is planned on the condition of resonant movement which agrees with natural dynamics and facilitates rhythmicity and efficiency. The proposed method has been implemented on a hydraulic quadruped robot. The simulations and experimental results verified the effectiveness of our method.


Introduction
Legged robots have superior mobility and maneuverability in complex unstructured environments, benefitting from the ability afforded by their morphology and varied gaits [1]. Recent years have witnessed significant achievements in the research area of legged robots. Versatile high-performance robots, such as BigDog, Spot, and Atlas developed by Boston Dynamics [2], the MIT cheetah series [3][4][5][6][7], the HyQ [8,9] and the ANYmal [10,11] developed by IIT and ETH Zurich, the Aliengo [12] from the Unitree Robotics, and the Jueying robots [13,14] developed by the DeepRobotics and Zhejiang University, have brought prospective practical applications. Nevertheless, despite considerable performance improvements in the past 20 years in mechatronics and control, the locomotion efficiency of the state-of-the-art robots lags far behind that of their biological counterparts [15]. The evolutionary process of thousands of years has endowed legged animals with an exquisite dynamic mechanism and achieved excellent motion performance. Learning the dynamic mechanism from legged animals is the inevitable way to further improve the performance of legged robots.
An essential property of animal locomotion is the alternative foot-ground contact in the swing and support phases of a locomotor cycle based on their inherent dynamics, roughly defining the locomotion's rhythmicity [16,17]. Elastic structures and spring-like leg behavior have been widely found in the locomotion of animals, and the spring-loaded inverted pendulum (SLIP) model has been abstracted into a template to resolve the redundancy of multiple legs and joints [18,19]. The inherent parameters of the dynamic system, namely the body mass and the compliance of the leg, determine the rhythmicity of legged adaptability. These methods improve the robot's performance in challenging terrains due to the wider range of stiffness adjustment capability. Unfortunately, the performance of active control methods is still subject to the responsiveness of the actuator to a great extent in practical applications.
This paper proposes a systematic compliance planning and implementation method for a quadrupedal robot on various terrains. The stiffness of the ground surface is estimated during locomotion based on the analysis of ground reaction forces in the frequency domain. The compliance of the robot leg is actively controlled to offer virtual elasticity and is regulated as changes of locomotion parameters and the environment to achieve harmonic oscillation of the elastic leg-ground system in the stance phase.
In developing the bio-inspired compliance planning and implementation method, we mainly offer two contributions: (a) A novel surface stiffness estimation method is proposed for legged robots. Through analysis of ground reaction forces in the frequency domain, the estimation can be completed within one step period. (b) The principle of harmonic locomotion is exploited for the leg compliance planning to improve rhythmicity and efficiency. The leg compliance is actively regulated on the condition of resonant movement which agrees with the natural dynamics of the leg-ground system.
The paper is organized into six sections: Section 2 describes the surface stiffness estimation and the compliance profile planning method. Section 3 presents the framework for the resonant locomotion of a quadruped robot. Section 4 illustrates the implementation of the proposed method on a hydraulically actuated quadruped robot. Section 5 presents the simulation and practical experiments. Finally, conclusions are drawn in Section 6.

Compliance Planning for Harmonic Locomotion
As stated before, legged animals exploit elastic properties and adjust leg compliance to maintain longitudinal harmonic oscillation. Inspired by biological research, this paper takes harmonic locomotion as a basic principle for the motion planning and control of a quadruped robot. The leg compliance is planned on the condition of resonance to exploit the natural dynamics of elastic leg and to match the desired motion in terms of locomotion rhythmicity on various ground surfaces.

Principles of Harmonic Locomotion
The dynamics of legged locomotion can be revealed by the SLIP model, and various locomotion gaits of quadruped robots such as trotting, pacing, and bounding are expressed as elastic oscillations of the sample mass-spring bouncing system in SLIP, as illustrated in Figure 1. Ideally, harmonic motion at resonance can be realized on the mass-spring bouncing system based on natural passive dynamics without any energy consumption. and the vertical impulse scaling of ground reaction force [35,38,39] demonstrate better adaptability. These methods improve the robot's performance in challenging terrains due to the wider range of stiffness adjustment capability. Unfortunately, the performance of active control methods is still subject to the responsiveness of the actuator to a great extent in practical applications. This paper proposes a systematic compliance planning and implementation method for a quadrupedal robot on various terrains. The stiffness of the ground surface is estimated during locomotion based on the analysis of ground reaction forces in the frequency domain. The compliance of the robot leg is actively controlled to offer virtual elasticity and is regulated as changes of locomotion parameters and the environment to achieve harmonic oscillation of the elastic leg-ground system in the stance phase.
In developing the bio-inspired compliance planning and implementation method, we mainly offer two contributions: (a) A novel surface stiffness estimation method is proposed for legged robots. Through analysis of ground reaction forces in the frequency domain, the estimation can be completed within one step period. (b) The principle of harmonic locomotion is exploited for the leg compliance planning to improve rhythmicity and efficiency. The leg compliance is actively regulated on the condition of resonant movement which agrees with the natural dynamics of the leg-ground system.
The paper is organized into six sections: Section 2 describes the surface stiffness estimation and the compliance profile planning method. Section 3 presents the framework for the resonant locomotion of a quadruped robot. Section 4 illustrates the implementation of the proposed method on a hydraulically actuated quadruped robot. Section 5 presents the simulation and practical experiments. Finally, conclusions are drawn in Section 6.

Compliance Planning for Harmonic Locomotion
As stated before, legged animals exploit elastic properties and adjust leg compliance to maintain longitudinal harmonic oscillation. Inspired by biological research, this paper takes harmonic locomotion as a basic principle for the motion planning and control of a quadruped robot. The leg compliance is planned on the condition of resonance to exploit the natural dynamics of elastic leg and to match the desired motion in terms of locomotion rhythmicity on various ground surfaces.

Principles of Harmonic Locomotion
The dynamics of legged locomotion can be revealed by the SLIP model, and various locomotion gaits of quadruped robots such as trotting, pacing, and bounding are expressed as elastic oscillations of the sample mass-spring bouncing system in SLIP, as illustrated in Figure 1. Ideally, harmonic motion at resonance can be realized on the massspring bouncing system based on natural passive dynamics without any energy consumption.  However, the natural dynamics of robots are actively controlled and the motion is arbitrarily generated, respectively; thus, the harmonic motion can hardly be achieved directly. In pursuit of efficient harmonic motion, the dynamics determined by the actively controlled joints should agree with the rhythmicity of motion, and foot reaction forces should match the oscillation of the CoM during each stance phase.
For a simple spring-mass bouncing system, the natural dynamics are governed by where k is the stiffness of the spring, m is the center mass, and f is the natural bouncing frequency. The natural dynamics described by k and m determine the passive harmonic motion parameterized by f. For quadruped robots locomoting on various ground surfaces, the compressible ground surface and compliant leg are connected in series to form an elastic combination, and the combined effective stiffness regulates the legged motion on ground surfaces. To achieve harmonic locomotion for the quadruped robot, the estimation of the surface compliance under the current robot statuses and the prediction of the leg compliance for the next step based on the estimation are the main issues for the compliance planning.

Surface Stiffness Estimation
In the practical quadruped robot, the contact force can be directly and precisely measured while the deformation value estimated from the robot state is usually not reliable. Thus, the surface stiffness estimation should mainly be based on the foot reaction forces. The robotground contact model is shown in Figure 2, where M 1 and M 2 represent the mass of the foot and body mass of the robot and, K 1 , ξ 1 , K 2 , ξ 2 denote the stiffness and damping of the surface and the compliant leg, respectively. symmetries. The stiffness of virtual leg k in SLIP model roughly equals that of the quadruped robot, and the point mass m at the CoM is about half the body mass of the robot moving at a symmetrical gait.
However, the natural dynamics of robots are actively controlled and the motion is arbitrarily generated, respectively; thus, the harmonic motion can hardly be achieved directly. In pursuit of efficient harmonic motion, the dynamics determined by the actively controlled joints should agree with the rhythmicity of motion, and foot reaction forces should match the oscillation of the CoM during each stance phase.
For a simple spring-mass bouncing system, the natural dynamics are governed by where k is the stiffness of the spring, m is the center mass, and f is the natural bouncing frequency. The natural dynamics described by k and m determine the passive harmonic motion parameterized by f. For quadruped robots locomoting on various ground surfaces, the compressible ground surface and compliant leg are connected in series to form an elastic combination, and the combined effective stiffness regulates the legged motion on ground surfaces. To achieve harmonic locomotion for the quadruped robot, the estimation of the surface compliance under the current robot statuses and the prediction of the leg compliance for the next step based on the estimation are the main issues for the compliance planning.

Surface Stiffness Estimation
In the practical quadruped robot, the contact force can be directly and precisely measured while the deformation value estimated from the robot state is usually not reliable. Thus, the surface stiffness estimation should mainly be based on the foot reaction forces. The robotground contact model is shown in Figure 2, where M1 and M2 represent the mass of the foot and body mass of the robot and, 1 1 , K ξ , 2 2 , K ξ denote the stiffness and damping of the surface and the compliant leg, respectively. The simplified robot-ground model possesses two degrees of freedom. Selecting the height of the foot x1 and the height of the robot mass x2 as the generalized coordinates, the Lagrangian Equation for the system is given by where T, V, D and Q denote the kinetic energy, potential energy, dissipated energy, and general forces of the system, respectively, and the details are given as The simplified robot-ground model possesses two degrees of freedom. Selecting the height of the foot x 1 and the height of the robot mass x 2 as the generalized coordinates, the Lagrangian Equation for the system is given by where T, V, D and Q denote the kinetic energy, potential energy, dissipated energy, and general forces of the system, respectively, and the details are given as Assuming that the damping of the spring leg and ground surface is negligible, the dynamics Equation (2) can be converted into ..
To solve the Equation (4), the variable transformation is used to obtain a relatively simple form, as follows: .. ..
Considering the analytical solutions of the ordinary differential Equation system (6) have the same frequency and different amplitudes, then the solutions can be assumed to be and Equation system (6) can be transformed into ..
The solutions for Equation (8) generally have the following form Equation (9) can be substituted into (6) to generate To ensure the existence of the solution, the determinant of Equation (10) should be zero, that is Equation (11) can be converted into an algebraic equation The analytical solutions of Equation (12) can be derived as Thus, the two modes of vibration for the robot-ground system are fully developed and can be expressed by Equations (5) and (13). On the assumption of the negligible damping of the ground surface, the foot reaction force is directly proportional to the displacement. Therefore, the vibration mode of the foot reaction force and that of the displacement, and the current spring leg stiffness and surface stiffness can be calculated by solving the vibration mode of the foot reaction force with Equation (13).

Leg Compliance Planning
According to the SLIP model of legged locomotion, the whole gait cycle period T consists of the aerial phase period T a and stance phase period T s ; that is The stance phase period can also be expressed as T s = γT, where γ denotes the duty factor.
The longitudinal oscillations of the stance leg during the stance phase approximately operate as a part of the simple harmonic vibration. The coefficient c is used to relate the stance phase period T s and harmonic vibration period T h , and we can thus obtain The relation between vibration frequency f s and gait step frequency f step can be expressed as The synthetical stiffness K of the combined robot-ground system determines the resonant frequency f s : The preferred synthetical stiffness K can be calculated from Equations (16) and (17): Through the relationship between the synthetical stiffness K and surface stiffness K 1 , leg stiffness K 2 is governed by The preferred leg stiffness can be derived from Equations (18) and (19) and can be expressed by Equation (20) can be used to estimate the preferred leg stiffness K leg based on the gait characteristics of legged locomotion.

Control Framework for Harmonic Locomotion of a Quadruped Robot
The implementation of the active compliance control and planning for the quadruped robot is depicted in Figure 3. The entire framework consists of high-level control, compliance planning, and active compliance control with the inner torque control. The high-level control is the interaction interface between users and the robot. Users set the moving speed and gait pattern for the robot motion generator with the high-level controller and then the desired motion profile is produced. The compliance planning firstly estimates the compliance of the ground surface based on the reaction forces of robot feet and the current motion states. Then, the compliance planner calculates the preferred leg compliance, as is presented in Section 2. The active compliance control includes an inner torque control loop and an outer compliance control loop. Besides, a feed-forward loop based on rigid-body inverse dynamics is used to enhance the accuracy of motion control, and a disturbance compensation loop is introduced to deal with external forces such as loads. It should be noted that the motion generator is mainly based on the SLIP model and is not discussed in detail in this paper, and the minimum angle-of-attack is set as 62 • [56] to guarantee the assumption of non-slip contact limited by the friction cone. torque control loop and an outer compliance control loop. Besides, a feed-forward loop based on rigid-body inverse dynamics is used to enhance the accuracy of motion control, and a disturbance compensation loop is introduced to deal with external forces such as loads. It should be noted that the motion generator is mainly based on the SLIP model and is not discussed in detail in this paper, and the minimum angle-of-attack is set as 62° [56] to guarantee the assumption of non-slip contact limited by the friction cone.

Implementation for a Hydraulically Actuated Quadruped Robot
This section presents our implementation of the bio-inspired compliance planning for a hydraulically actuated quadruped robot. In contrast to electric motors, the main superiority of hydraulic actuation is its high power density, which is critical for heavy-duty legged robots. On the other hand, the control of hydraulic actuation is more challenging because of the wide variety of nonlinearities in the system. This section presents the detailed implementation of the compliance planning methods for the hydraulically actuated quadruped robot based on the framework in Section 3. Figure 4 shows the overview of the hydraulically actuated quadruped robot system. The prototype of the quadruped robot is hydraulically powered by an off-board pump. It features three active degrees of freedom (DOF) per leg: two flexion/extension DOF in the hip and knee joint, and an abduction/adduction DOF for lateral swing. Each joint is actuated by a hydraulic cylinder (Linear cylinder LB, Hoerbiger) controlled by a servo valve (G761, Moog). The geometric dimensions of the robot are 1000 × 660 × 800 mm (length/width/height) and the total mass is about 75 kg. A variety of sensors are equipped on the robot including a 16-bit high-precision digital encoder (SROA35, Reagle) at each DOF, two pressure sensors (511-943, Huba Control) for each hydraulic cylinder, a threeaxis force sensor (S302, SRI) for ground reaction force sensing at each foot, and a highperformance IMU (MTi-30, Xsens) for the state estimation of the robot torso. It is controlled by a National Instrument ® based controller.

Implementation for a Hydraulically Actuated Quadruped Robot
This section presents our implementation of the bio-inspired compliance planning for a hydraulically actuated quadruped robot. In contrast to electric motors, the main superiority of hydraulic actuation is its high power density, which is critical for heavy-duty legged robots. On the other hand, the control of hydraulic actuation is more challenging because of the wide variety of nonlinearities in the system. This section presents the detailed implementation of the compliance planning methods for the hydraulically actuated quadruped robot based on the framework in Section 3. Figure 4 shows the overview of the hydraulically actuated quadruped robot system. The prototype of the quadruped robot is hydraulically powered by an off-board pump. It features three active degrees of freedom (DOF) per leg: two flexion/extension DOF in the hip and knee joint, and an abduction/adduction DOF for lateral swing. Each joint is actuated by a hydraulic cylinder (Linear cylinder LB, Hoerbiger) controlled by a servo valve (G761, Moog). The geometric dimensions of the robot are 1000 × 660 × 800 mm (length/width/height) and the total mass is about 75 kg. A variety of sensors are equipped on the robot including a 16-bit high-precision digital encoder (SROA35, Reagle) at each DOF, two pressure sensors (511-943, Huba Control) for each hydraulic cylinder, a three-axis force sensor (S302, SRI) for ground reaction force sensing at each foot, and a high-performance IMU (MTi-30, Xsens) for the state estimation of the robot torso. It is controlled by a National Instrument ® based controller.

Force Control of the Hydraulic Actuator
The hydraulic actuator of the quadruped robot under consideration is depicted in Figure 5. As is shown, a servo valve controlled single-rod hydraulic cylinder exerts pressure force on the robot leg link. Nonlinearity in the system, such as the compressibility of the hydraulic fluid and the flexibility of the tubing, the complex flow characters of the

Force Control of the Hydraulic Actuator
The hydraulic actuator of the quadruped robot under consideration is depicted in Figure 5. As is shown, a servo valve controlled single-rod hydraulic cylinder exerts pressure force on the robot leg link. Nonlinearity in the system, such as the compressibility of the hydraulic fluid and the flexibility of the tubing, the complex flow characters of the servo valve, and the nonlinear dynamic friction of the hydraulic cylinders, significantly affects the performance of the system. The nonlinear dynamics of the hydraulic system are modeled in this paper to improve the control performance.

Force Control of the Hydraulic Actuator
The hydraulic actuator of the quadruped robot under consideration is depicted in Figure 5. As is shown, a servo valve controlled single-rod hydraulic cylinder exerts pressure force on the robot leg link. Nonlinearity in the system, such as the compressibility of the hydraulic fluid and the flexibility of the tubing, the complex flow characters of the servo valve, and the nonlinear dynamic friction of the hydraulic cylinders, significantly affects the performance of the system. The nonlinear dynamics of the hydraulic system are modeled in this paper to improve the control performance. The pressure dynamics of the cylinder considering the compressibility of the oil can be modeled as The pressure dynamics of the cylinder considering the compressibility of the oil can be modeled as where V 1 = V 01 + A 1 x and V 2 = V 02 − A 2 x denote the total control volumes of the cylinder chambers, V 01 and V 02 are the original volumes when x = 0,x is the piston displacement, β is the oil bulk modulus,Q 1 is the supplied flow rate,Q 2 is the return flow rate and c i is the internal leakage flow coefficient. The considered servo valve is developed for high dynamic response applications. The dynamics of the servo valve are neglected; thus the control input u is assumed to be proportional to the valve spool displacement x. Q 1 and Q 2 are related to the control input u by where c 1 , c 2 , c 3 , c 4 are the valve orifice coefficients, p s is the pressure of fluid supply and p r is the reservoir or reference pressure. The function s(u) is defined as The net fluid force can be described by where p 1 and p 2 are the pressures inside the two chambers of the cylinder and A 1 and A 2 represent the piston area and piston rod area, respectively. The effective force applied on the loads is given by where f (t) is the estimation of the friction force. The time derivative of Equation (24) is given by Substituting Equations (21) and (22) into (26) yields Equation (27) maps the control voltage to the fluid force. Through the inverse of Equation (27), the hydraulic force controller can be obtained as where F d denotes the desired force of the hydraulic cylinder,k L is a positive gain coefficient of force error, and the non-zero item z is presented in Equation (28). We see that .
F in Equation (27) becomes The exponential force stabilization is guaranteed by Equation (31) indicates that (F(t) − F d (t)) → 0 with time constant τ = 1/k L . The value of the time constant mainly depends on the response bandwidth of the hydraulic system. The model-based force controller governed by Equation (29) captures the nonlinear dynamics of the hydraulic actuation system and achieves compensation through feedback linearization.

Active Compliance Controller Design
Active compliance control plays an important role in the period of contact of the actuator and the load. It indicates the synchronous control of force and position during the contact by tuning the stiffness, damping and inertia, and can be described as where f c is the contact force and K p , K d and K m indicate the stiffness, damping, and inertia parameters, respectively; x re f denotes the desired position reference and x is the measured position.
Referring to Equation (32), position and velocity tracking errors are used to compute the desired force. The measured acceleration is usually unreliable since it is calculated through the second-order difference of the position signals. The desired acceleration is used to replace the acceleration feedback. Thus, the ideal desired force is derived as where m, k v , k p are the equivalent mass of the load, the velocity feedback gain and the position feedback gain, respectively; x d (t) and x(t) represent the desired and measured positions of the piston. In practice, the friction force of the hydraulic cylinder also affects the character of the contact. In hydraulic systems, notable friction force exists in hydraulic cylinders for leak tightness requirements. A dynamic friction force identification method is used based on our previous work [49]. For further research on dynamic friction identification methods, one can refer to some state-of-the-art works [57,58]. Therefore, in this paper the desired fluid force is (34) whereF f is the estimated friction force, andF ext is the estimated external disturbance. The disturbance item is set as a constant of the robot gravity in the stance phase and is reduced to zero during the swing phase. The equation of motion is given by where F f ( . x) and F ext are the friction force and external disturbances, respectively. Subtracting (34) from (35) and letting e = x − x d , we get x) − F ext denotes the disturbance due to inaccurate estimation of friction and external disturbances. The Equation (36) can be considered a second-order linear system in e driven by (F − F d ) and δ( . x). The disturbance δ( . x) is bounded and (F(t) − F d (t)) → 0 , so the system represented by the Equation (36) is stable.
Equations (29) and (34) reveal the main framework of the active compliance controller for the hydraulic quadruped robot. The velocity gain k v is equivalent to damping, and the position gain k p serves as the spring stiffness. The damping k v is set as a constant, and the active stiffness is regulated online to achieve the desired compliance of the robot.
It should be noted that the active compliance parameters in the Equation (34) are expressed in the actuation space. Based on the virtual work principle, the relation between the stiffness in each actuation and joint space can be derived as where k θ is the rotational stiffness in joint space,k l is the linear stiffness in cylinder actuation space and l c denotes the force arm of cylinder. As is known, the Jacobian relates the joint torques and the forces applied on the foot by From the definition of stiffness, we differentiate Equation (38) and we have ∂τ ∂θ where J is the Jacobin of the leg and θ is the joint angle; K θ and K X represent the stiffness matrixes in the joint space and the Cartesian space. We approximate the vertical stiffness in K X by taking the value of the leg stiffness obtained from Equation (20), and the forward and lateral stiffnesses are set as a reasonable constant based on experience. Equation (37) and (39) map the vertical leg stiffness obtained from Equation (20) into that in the cylinder actuation space.

Experiments and Simulations
The systematic method of compliance planning and implementation proposed in this paper consists of two major steps: the compliance planning and the compliance implementation. For the compliance implementation, the position and force tracking experiments were conducted to verify the inner force controller and the outer position controller of the active compliance controller, as illustrated in Section 5.1; to verify the superiority over the traditional PID-based position controller, a comparative impact disturbance experiment was conducted in Section 5.2. For the compliance planning, the ground surface compliance estimation experiment was conducted in Section 5.3 to demonstrate the reliability of the estimated ground stiffness. Based on the estimated ground stiffness, the compliance planning of the robot leg was realized using the Equation (20). The effectiveness of the whole method was verified through simulation and comparison of energy efficiency in Section 5.4.

Experiments on Position/Force Tracking
In the control framework of this paper, the inner-loop torque control is the basis of the compliance control algorithm, while, ideally, the compliance control will not reduce the position tracking performance. To verify the force and position tracking performance of the compliance controller, the experiment was conducted on the left front leg of the quadruped robot hanging in the air. The robot was controlled to perform a 50 mm range of squatting motion when a 25 kg load was mounted on the foot. The pressure sensors on the hydraulic cylinder allow for the calculation of the measured force of the hydraulic cylinder. The encoder on the joint allows for the indirect measurement of the joint position, which is represented by the cylinder length. Figure 6 displays the main results. The force tracking performance of the hip and knee joints is depicted in Figure 6a. As can be seen from the figure, the maximum amplitude of the force tracking errors in the two joints is approximately 100 N. The peak error occurs primarily during the movement of the legs, which may be caused mainly by the disturbance due to the inertial force of the load at the foot. The position tracking performance is provided in Figure 6b, and the maximum amplitude of the errors is about 0.5 mm. The results suggest the promising performance of the active compliance controller and accurate force and position control is achieved at the same time.

Experiments on Impact Disturbance
We expect the robot leg to behave as an actual spring under the active compliance controller to cope with the impact disturbances exerted on the robot feet. We designed the corresponding experiment on our quadruped robot. The impact disturbance force was exerted to the foot when the robot was lifted in the air and the position response was

Experiments on Impact Disturbance
We expect the robot leg to behave as an actual spring under the active compliance controller to cope with the impact disturbances exerted on the robot feet. We designed the corresponding experiment on our quadruped robot. The impact disturbance force was exerted to the foot when the robot was lifted in the air and the position response was measured. Without loss of generality, the actuation stiffness of 500 N/mm was set for the hydraulic cylinder. The impact disturbance force was also sensed by the three-axis force sensor. We took the compression of an ideal virtual spring with the same stiffness as the desired position response and measured the actual position response of the hydraulic cylinder. The comparison is shown in Figure 7. As can be seen from the figure, both the PID-based position controller and the proposed active compliance controller allow the robot to exhibit significant compliance characteristics, similar to the actual spring, given the appropriate gain and proper stiffness. However, there is a significant overshoot in the PID-based position controller, which can seriously affect the stability of the robot. In comparison, the active compliance controller exhibits superior stability.

Experiments on Ground Surface Compliance Estimation
The experimental setup of a single robot leg is built for the study of robot-ground contact behaviors. The internal components, including the spring of the robot leg, substrate surface, sliding rail and sensors are illustrated in Figure 8. The stiffness of the spring was 50 N/mm. The three-axis force sensor was used to measure the contact force. The LVDT (Linear Variable Differential Transformer, GA09, Utsensor) 2/3 were used for the measurement of the displacement of the leg base along the sliding rail; meanwhile, the LVDT 1 was used to measure the deformation of the spring, and the difference between them represented the compression of the ground surface. The proposed surface compliance estimation method was verified on the experi-

Experiments on Ground Surface Compliance Estimation
The experimental setup of a single robot leg is built for the study of robot-ground contact behaviors. The internal components, including the spring of the robot leg, substrate surface, sliding rail and sensors are illustrated in Figure 8. The stiffness of the spring was 50 N/mm. The three-axis force sensor was used to measure the contact force. The LVDT (Linear Variable Differential Transformer, GA09, Utsensor) 2/3 were used for the measurement of the displacement of the leg base along the sliding rail; meanwhile, the LVDT 1 was used to measure the deformation of the spring, and the difference between them represented the compression of the ground surface.
The proposed surface compliance estimation method was verified on the experimental setup of a single robot leg. The leg was released after being lifted to a certain height to excite the contact of the robot foot and ground surface. The contact force and surface deformation were measured as shown in Figure 9. Benefitting from various sensing systems in the experimental setup, the stiffness of the ground surface can be calculated by Hooke's Law. It can be seen in Figure 9 that the maximum contact force is about 440 N, and the maximum deformation is 1.2 mm. The calculation result is 366.7 N/mm, which can be considered as the measured value of surface stiffness. contact behaviors. The internal components, including the spring of the robot leg, substrate surface, sliding rail and sensors are illustrated in Figure 8. The stiffness of the spring was 50 N/mm. The three-axis force sensor was used to measure the contact force. The LVDT (Linear Variable Differential Transformer, GA09, Utsensor) 2/3 were used for the measurement of the displacement of the leg base along the sliding rail; meanwhile, the LVDT 1 was used to measure the deformation of the spring, and the difference between them represented the compression of the ground surface. The proposed surface compliance estimation method was verified on the experimental setup of a single robot leg. The leg was released after being lifted to a certain height to excite the contact of the robot foot and ground surface. The contact force and surface deformation were measured as shown in Figure 9. Benefitting from various sensing systems in the experimental setup, the stiffness of the ground surface can be calculated by Hooke's Law. It can be seen in Figure 9 that the maximum contact force is about 440 N, and the maximum deformation is 1.2 mm. The calculation result is 366.7 N/mm, which can be considered as the measured value of surface stiffness. As can be seen from Figure 9a, a high-frequency oscillation signal appears at the beginning of the period and a low-frequency oscillation signal is present throughout the period. This observation is consistent with the Equation (13). To quantify the frequencies of oscillation signals, the single-sided amplitude spectrum of contact force is obtained by Fast Fourier Transform (FFT) as shown in Figure 10. The result indicates that the contact force mainly contains both a 6 Hz and a 240 Hz component. Substituting the frequencies into the Equation (13), the robot leg stiffness can be obtained as 52.1 N/mm and the ground surface stiffness as 357.2 N/mm. The estimated value of surface stiffness is in general agreement with the measurement. The experiment result verifies the effectiveness of the proposed surface stiffness estimation method in Section 2.2; thus, the ground stiffness can be taken into consideration in the process of compliance planning, as given in Section 2.3. Figure 10. Single-sided amplitude spectrum of contact force.

Simulation and Comparison of Energy Efficiency
To observe the influence of leg stiffness on legged locomotion performance, a quadrupedal robot simulation model was constructed based on Matlab ® and Simscape ® . The As can be seen from Figure 9a, a high-frequency oscillation signal appears at the beginning of the period and a low-frequency oscillation signal is present throughout the period. This observation is consistent with the Equation (13). To quantify the frequencies of oscillation signals, the single-sided amplitude spectrum of contact force is obtained by Fast Fourier Transform (FFT) as shown in Figure 10. The result indicates that the contact force mainly contains both a 6 Hz and a 240 Hz component. Substituting the frequencies into the Equation (13), the robot leg stiffness can be obtained as 52.1 N/mm and the ground surface stiffness as 357.2 N/mm. The estimated value of surface stiffness is in general agreement with the measurement. The experiment result verifies the effectiveness of the proposed surface stiffness estimation method in Section 2.2; thus, the ground stiffness can be taken into consideration in the process of compliance planning, as given in Section 2.3. As can be seen from Figure 9a, a high-frequency oscillation signal appears at the beginning of the period and a low-frequency oscillation signal is present throughout the period. This observation is consistent with the Equation (13). To quantify the frequencies of oscillation signals, the single-sided amplitude spectrum of contact force is obtained by Fast Fourier Transform (FFT) as shown in Figure 10. The result indicates that the contact force mainly contains both a 6 Hz and a 240 Hz component. Substituting the frequencies into the Equation (13), the robot leg stiffness can be obtained as 52.1 N/mm and the ground surface stiffness as 357.2 N/mm. The estimated value of surface stiffness is in general agreement with the measurement. The experiment result verifies the effectiveness of the proposed surface stiffness estimation method in Section 2.2; thus, the ground stiffness can be taken into consideration in the process of compliance planning, as given in Section 2.3. Figure 10. Single-sided amplitude spectrum of contact force.

Simulation and Comparison of Energy Efficiency
To observe the influence of leg stiffness on legged locomotion performance, a quadrupedal robot simulation model was constructed based on Matlab ® and Simscape ® . The mass and geometric dimensions were set according to the robot experimental setup. The

Simulation and Comparison of Energy Efficiency
To observe the influence of leg stiffness on legged locomotion performance, a quadrupedal robot simulation model was constructed based on Matlab ® and Simscape ® . The mass and geometric dimensions were set according to the robot experimental setup. The robot walked with different step frequencies and leg stiffness using a trotting gait at a speed of 2 m/s. The energy consumption of the robot locomotion was normalized by the displacement on the ground surface. The preferred leg stiffness to obtain minimum energy consumption at a given gait frequency was investigated and compared with the calculated leg stiffness using the Equation (20). The simulation result in Figure 11 shows that the simulated optimal leg stiffness is consistent with the calculated results. ergy consumption at a given gait frequency was investigated and compared with the calculated leg stiffness using the Equation (20). The simulation result in Figure 11 shows that the simulated optimal leg stiffness is consistent with the calculated results.

Conclusions
Compliant legged locomotion has recently become an emerging area of interest in the field of robotics. Few studies, however, have been carried out on the planning and implementation of leg compliance with the consideration of ground stiffness. As mentioned in the introduction section, the main challenge is the lack of rapid and affordable ground compliance estimation methods and of reasonable principles for leg compliance planning. In this paper, a systematic compliance planning and implementation method for the quadrupedal robot is proposed to plan and control the leg compliance continuously with the consideration of the ground through surface stiffness estimation. In this way, the compliant robot leg behaves naturally following bio-inspired principles, and the performance is improved in terms of locomotion efficiency and rhythmicity. The effectiveness of the proposed control method has been shown through simulations and experimental results on a hydraulic quadruped robot. The proposed method can also be extended to other legged robots actuated by hydraulic systems or motors where both the torque and compliance are controllable.
Future work will include the development of the proposed control architecture for a practical hydraulic quadruped robot, walking and running in a more challenging ground environment.

Conclusions
Compliant legged locomotion has recently become an emerging area of interest in the field of robotics. Few studies, however, have been carried out on the planning and implementation of leg compliance with the consideration of ground stiffness. As mentioned in the introduction section, the main challenge is the lack of rapid and affordable ground compliance estimation methods and of reasonable principles for leg compliance planning. In this paper, a systematic compliance planning and implementation method for the quadrupedal robot is proposed to plan and control the leg compliance continuously with the consideration of the ground through surface stiffness estimation. In this way, the compliant robot leg behaves naturally following bio-inspired principles, and the performance is improved in terms of locomotion efficiency and rhythmicity. The effectiveness of the proposed control method has been shown through simulations and experimental results on a hydraulic quadruped robot. The proposed method can also be extended to other legged robots actuated by hydraulic systems or motors where both the torque and compliance are controllable.
Future work will include the development of the proposed control architecture for a practical hydraulic quadruped robot, walking and running in a more challenging ground environment.