Contact Force Estimation Method of Legged-Robot and Its Application in Impedance Control

Legged robots have extremely strong adaptability in different terrain environment and their stable walking in the wild is still a current research hotspot. Although they have shown great motion performance in recent years, most of them rely on high-performance sensors, especially force sensors settled on foot. However, it is impractical to select special forces sensors in the field environment, and the performance degradation and noise during the usage will bring fatal control defects. In order to solve this problem, we propose a foot contact force estimation method that does not require force sensors, and applies the estimated contact force to the impedance control of the legged robot to achieve the robot’s active compliance control. The method of force estimation is based on the generalized momentum of the robot. It only needs to provide the position information of the joint and the information of the applied control torque. The designed feedforward and compensation terms effectively improve the speed and accuracy of the force estimation. We improved the response speed of the system to the contact force by improving the structure of the impedance control, and applied the estimated contact force to the impedance control to achieve the stable motion of the quadruped robot. Simulation experiments verify the effectiveness of the proposed force estimation method.


I. INTRODUCTION
With the development of automatic control and intelligent control, mobile robots have developed rapidly in recent years. The motion of the legged robot has the characteristics of discontinuous stance, and has greater adaptability in complex terrain and unstructured environments [1]. They are expected to participate in material transportation, exploration and rescue missions, etc [2]. The quadruped robot has become a hotspot in the research of legged-robots due to its superior load capacity. Some quadruped robots have already exhibited powerful movement capabilities, such as MIT's Cheetah series of robots and Boston Dynamics' Spot series. MIT has developed three generations of Cheetah series robots [3]- [5]. The newly released Cheetah Mini uses a combination of impedance control and model predictive control control mode [6], which can realize the tasks of back-flip and The associate editor coordinating the review of this manuscript and approving it for publication was Geng-Ming Jiang . blind climbing stairs. Boston Dynamics has launched a series of Spot robots. The latest model SpotMini can move flexibly in rough terrain, achieve obstacle avoidance, and maintain balance in extreme environments. Both series of robots adopt the method of motor control. Subject to the output power ratio of the motor, the quadruped robot driven by the motor has a large shortage in load capacity.
The hydraulic driving method makes the robot have a larger load-to-weight ratio and stronger durability. The quadruped robot that undertakes transportation and rescue tasks is still mainly hydraulically driven. The HyQ series of hydraulic quadruped robots developed by the Italian Institute of Technology (IIT) is the representative of hydraulically driven quadruped robots [1], [7], [8]. This robot is driven by a combination of hydraulic and electric motors, the side swing joint is controlled by a motor, and the pitch freedom is driven by hydraulic pressure, which shows powerful dynamic characteristics. The latest HyQReal [9] uses a specially designed high-performance hydraulic system with independent power VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ and high output performance. And demonstrated a strong athletic ability, carried out aircraft traction experiments. However, 10 SpotMini robots [10] are required to complete similar functions. The hydraulically drived robot control methods mainly include force control and position control. Traditional technologies of force control include current control with direct drive actuation, current control with a geared actuator, current control with frictionless cable drive transmissions, load cells with force feedback, and fluid pressure control. Due to the inherent closed characteristics of the actuator, the hydraulic system has extremely poor reverse drive capability, which seriously affects the application of hydraulic drive in force control [11]. The direct force control method is difficult to meet the high dynamic needs of the robot, and is only suitable for the movement of static steps [12]. One method of indirect force control is to use a Serial Elastic Actuator [11]. The ANYmal robot [11] is the typical representative of this method. The other is the impedance control method [13], which is used by the HyQ robot. Among them, the method of using a Serial Elastic Actuator requires a large improvement in the mechanical structure, which increases the complexity and cost of the mechanism. Therefore, a large number of robots use impedance control to perform indirect force control [13], [14]. Impedance control only realizes indirect force control through a compliant outer loop attached to the controller. The literature [15], [16] discusses the principle of series-parallel composition of the dynamic compliance of impedance control, and studies the influence of outer loop error and inner loop control error on impedance control. The inherent closed nature of the hydraulic drive makes it more suitable for position control. However, the wild environment has a high degree of uncertainty. At the same time, there are strong dynamic characteristics during the movement of the robot, and the load also changes drastically. The simple position control method will cause a greater impact force when the robot's foot touches the ground, affecting the stability of the robot's walking. Therefore, it is an important issue in the study of quadruped robots to reasonably handle the interaction between the robot legs and the environment and to realize the robot's compliance control. Impedance control indirectly adjusts the contact force between the foot and the ground, and shows excellent performance in the adjustment of impact force and the ability to adapt to the unevenness of the ground [17], which is considered to be an effective method to solve this problem. Acquiring the contact force during the movement of the quadruped robot is the primary condition for impedance control. In response to this problem, many scholars have conducted a lot of research.
Montes H [18], [19] estimates the external force by measuring the pressure difference between the two sides of the hydraulic actuator cavity, and realizes the ROBOCLIMBER quasi-static gait control. Righetti and Ijspeert [20] uses the six-dimensional force sensor installed on the foot to obtain the ground contact force (GCF) and realize the control of the quadruped robot. Chai [21] acquired the joint force by installing an one-dimensional force sensor on the joint of the hydraulic quadruped robot, and derived the GCFs on the system dynamics to achieve impedance control. HyQ [18] uses a high-performance torque sensor installed on the joint to calculate GCFs. Although the method of using the sensor to obtain GCFs is simple, it is impractical in the field environment, and performance degradation and noise during use are unavoidable. Moreover, due to frequent impacts, we have high requirements on the accuracy and reliability of the sensor, and the use of the sensor also indirectly increases the cost and complexity of the structure. At the same time, the force measured by the sensor is used to detect the ground contact of the foot, which may easily lead to multiple false detections during the ground contact process [22]. Therefore, a large number of researchers try to use sensorless methods to estimate the GCFs of the robot. MIT's Cheetah Mini [23] uses the current of the drive motor to estimate the joint torque, and calculates the foot force through the robot's Jacobian matrix. Chan et al. [24] used an extended state observer to estimate the external force of the robotic arm, and used Kalman filtering to suppress external interference in the force estimation. Hu and Xiong [25] directly uses the Disturbance Kalman Filter to estimate the external force of the manipulator through system dynamics. Magrini et al. [26], Wahrburg et al. [27] and Bledt [6] and others designed external force observers for contact force based on generalized momentum to achieve collision detection during human-machine interaction. But the observer system has a first-order filter structure, and the speed is difficult to guarantee. Research by Dong et al. [22] has shown that improving the accuracy and rapidity of GCF perception makes it easier to achieve leg flexibility, which is of great significance for the stable walking of quadruped robots in the field.
This article demonstrates the scheme of compliant control of position control robots with high rigidity without using force sensors. The proposed method is based on the realization of generalized momentum, which is simpler to implement than other force estimation methods. At the same time, it has a clearer meaning in parameter adjustment and is convenient for practical use. Part of the collision force detection for human-computer interaction tasks also uses a generalized momentum observer with a first-order filter structure. In order to realize the application of the estimated GCFs in control, not just to detect contact conditions, we designed a generalized momentum observer with a second-order filter structure. By adding feed-forward and compensation, we have achieved a fast and accurate estimation of the GCF, so that the estimated result can be applied to the control of the robot. Experiments show that the force estimation method and impedance control we designed can achieve the same effect compared with the scheme using force sensors. And it has more advantages in structure and cost, since we does not need force sensors. Actually, the method proposed in this paper is not only applicable to legged robots, but also effective in tandem manipulators. The main contributions of this paper are as follows: First, we designed a foot contact force observer system based on generalized momentum. Secondly, we added the feed-forward term and the compensation term to the contact force estimation, which makes the speed and accuracy of the foot contact force estimation significantly improved. Then we introduced the differential term of the estimated GCFs to the impedance control, so that the system can quickly respond to the estimated foot force, thereby greatly reduce the response time of the system.
The organizational structure of the rest of this paper is as follows: Section II gives the model and overall controller design of the legged robot, including the single-leg model and the quadruped model. Section III Elaborates the mathematical basis of generalized momentum for force estimation and proposes compensation scheme for force estimation. Section IV applies the obtained GCFs for impedance control design, and verifies the actual application effect on the single-leg platform and quadruped platform respectively. Section V summarizes the paper and looks forward to the next step jobs.

II. SYSTEM MODEL AND CONTROL SYSTEM
In this section, we mainly introduce the experimental platform used in this article, including the basic structure and parameters of the robot, and provide kinematic and dynamic information by analysing the single-leg platform, and briefly introduce the overall control structure.

A. ROBOT MECHANICAL STRUCTURE
The research platform is constructed based on the existing quadruped robot in the laboratory. In order to facilitate the experiment, we have simplified the model as necessary. The simplified process is shown in Fig. 1. The simplification is mainly to redesign the body part, and to integrate the non-essential parts of the mechanical structure. The legs of the quadruped robot platform adopt a full elbow configuration. The final designed single leg has three active degrees of freedom. The three active degrees of freedom are hip side swing joint q 1 , hip anterior swing joint q 2 , knee anterior swing joint q 3 , and the semicircular foot is fixedly connected to the calf. The joints of the single-leg can be expressed as q = (q 1 , q 2 , q 3 ) T . Each platform component is integrated by a machining model based on the mechanical design software SolidWorks, and is simulated by dynamic multi-body simulation software Recurdyn. The parameters are given by measurement in the software, as seen in Table 1.

B. KINEMATICS AND DYNAMICS ANALYSIS
Single-leg kinematics and dynamics analysis is the basis of motion control, which can be extended to quadruped platforms. According to the designed single-leg model, we can establish the transition coordinate system from the center of body to the foot end, as seen in Fig. 2. {O G } is the inertial coordinate system fixed on the body. {O b } is the body base fixed coordinate system. O foot is the contact coordinate system between the foot end and the ground. and  Table 2. Using the changing relationship between the coordinate systems, we can obtain the forward kinematics solution of VOLUME 8, 2020  Table. single-leg as is recorded as C 2 , and the other expressions are the same. We can also obtain the inverse kinematics by analytical method. We use Lagrangian method to model the dynamics of the robot, and then according to the Christoffel symbol, we can calculate the dynamics of the system to have the following form, where M (q) is the inertial matrix of the robot legs, C (q,q) is the Coriolis matrix of the robot, including Coriolis force and centrifugal force terms, and G (q) is the matrix of gravity terms of the robot. For ease of writing, joint variables are omitted for each matrix in the subsequent writing of the article, which M (q) is written as M , C (q,q) as C, and G (q) as G. The dynamics of the system has the following properties [28]i: 1) The inertial matrix M (q) ∈ R 3×3 is symmetric and positive definite, ie.
Thus, the generally relationship between the inertia matrix M (q) and the matrix C (q,q)can be derived:

C. OVERALL CONTROL STRUCTURE OF THE SYSTEM
In the overall control of the system, we use the position-based impedance control structure shown in Fig. 3. The impedance performance of the outer loop directly depends on the tracking capability of the inner loop. Therefore, the most important thing to achieve impedance control is to realize high-precision inner loop position control. Since the contact area between the foot and the ground is relatively small, the contact type can be simplified as point contact. That is, only force is generated between the foot and the ground, and no moment is generated. In the motion space, we realize the position track of the foot by controlling the virtual forces in three directions. Adding gravity compensation to the control can achieve better tracking effect.

III. FOOT CONTACT FORCE ESTIMATION BASED ON GENERALIZED MOMENTUM
In this section, we designed the external moment observer based on generalized momentum, and avoided the use of leg joint acceleration. Then we can obtain the estimated contact force according to the Jacobian matrix of the legs. By designing feedforward compensation for the observer, the speed of force observation is improved obviously. At the same time, we designed a neural network to compensate the interference caused by dynamic modelling and body motion, which greatly improves the accuracy of force estimation.

A. DESIGN OF GENERALIZED MOMENTUM OBSERVER
In the absence of external force sensing, using the generalized momentum of the robot to design a disturbance observer has become a classic method of robot contact discrimination. For quadruped robots, when the foot interacts with the external environment, the robot's momentum changes significantly. It is easier and more convenient to detect the foot contacted force based on the real-time change of momentum. Moreover, the detection process avoids the use of acceleration and responds faster to external forces.
Considering the external disturbance force, the dynamic formula (2) has the following form: Each symbol represents the same definition as in the previous section, where τ d is caused by inaccurate modeling and external acting torque. The generalized momentum of the robot is defined as p = Mq. by derivating the generalized momentum, we can geṫ According to the robot dynamics property 2, (7) can be expressed asṗ The filtering form of external torque [6] is shown as (9), where s is the Laplace variable, λ is the cutoff frequency, and τ d is the estimated value of the disturbance torque. The external moment [6] of the robot and the generalized momentum have the following relationship, where L is the momentum gain matrix, andp is estimated generalized momentum. Combining (9) and (10), we can obtain the external disturbance torque aṡ Integrate (11), we can get where k 1 = λL, k 2 = 1/L. Using (8) to estimate the momentum and expanding (12),we can obtain Equation (13) is the estimation formula of foot contact torque. The use of (6) has distinguished the driving torque and disturbance torque required for the movement. Since the unmodeled factors in the motion will also bring interference torque, we assume that the external moments suffered by the robot are all generated by external forces and can be equivalent to the foot position [29]. Then we can use (14) to get the external force of the foot [6]. Disturbing forces generated by unmodelled parts will be compensated in subsequent chapters. B

. OPTIMIZATION OF FORCE ESTIMATION OBSERVER
In impedance control, the accuracy and speed of GCFs acquisition directly affect the effect of impedance control. When the robot foot contacts obstacles or enters stance state, the external force received instantaneously changes, and the estimated value should be able to track the real value of the force accurately and quickly. We can analyse the performance of the observer by examining its frequency domain characteristics. Demotivating (13) and substituting (8), we can obtain The designed generalized momentum observer is equivalent to the introduction of a second-order system (referred to as the observation system). We can obtain the transfer function by performing the Laplace transform.
For the characteristics of the second-order system represented by (16), simply adjusting the values of k 1 and k 2 cannot achieve better results. Because for a general second-order system, the better its rapidity, the greater the oscillation of the system. While when the oscillation is smaller, the rapidity will be correspondingly worse. There is an upper bound on the performance of the observation system. When we adapt critical damping, the overshoot is 4.33% and the settling time is 0.066s. In order to balance speed and accuracy, adding a zero point in the forward channel can increase the damping of the system and reduce overshoot. It can also effectively improve the transient response of the system [30] without affecting the stability of the system.
The transfer function of the observation system after adding zero is asτ Among them k 3 is the zero adjustment parameter of the observer. When the values of k 1 , k 2 , and k 3 are 100, 0.99, and 1, respectively, the overshoot of the system is 1.8%, and the settling time is 0.029s. The added zero point of the system is close to the pole near the imaginary axis. At this time, the pole far from the imaginary axis plays a leading role, and we can adjust the pole to meet the system requirements.
In order to obtain the feedforward term of the generalized momentum observer, we should rewrite the (17), and substitute (8) into it. Then we can geẗ Integrating Equation (18) again, we can geṫ and Equation (20) is the formula of GCF estimation based on generalized momentum observer with feedforward term. By comparing (13) and (20), The feedforward term can be expressed as We can use (21) to compensate the estimated GCF value and evaluate the effect by appling to the experimental platform. The result is shown in Fig. 4. The results of the GCF VOLUME 8, 2020 The upper graph is the estimation result without feedforward, and the lower graph is the estimation result after adding feedforward. Plotted three cycles of data, the red curve represents the vertical foot force measured by the sensor, and the blue curve represents the force estimation result obtained by the observation system. obtained by the observation system with feedforward term are far superior to the uncorrected system, and the performance is improved by about 60 %. Fig. 5 shows the comparison of the error in the GCF estimation. We observed that both systems can effectively estimate the force, where the maximum error is the moment when the foot touches the ground. The observing system with added feedforward terms is superior to the observing system without feedforward in tracking speed and accuracy.

C. ERROR COMPENSATION STRATEGY OF GCF ESTIMATION
The observation system is designed based on generalized momentum. In the design process, we used the characteristics of the dynamic Coriolis force term to avoid the use of acceleration. However, the actual leg structure is not ideal homogeneous links. The actual center of mass of each link is not located at the geometric center. There is a deviation between the actual point and the theoretical point for gravity. At the same time, the rotational inertia cannot be calculated as the homogeneous link model. Therefore, there is an inherent deviation in the system's dynamics parameter matrix. In the process of robot modelling, we also ignored the influence of the actuators of each joint and other non-linear effects, such as friction, joint clearance, and deformation of links. All of these factors affect the estimation accuracy of external moments and is difficult to accurately model.
The external torque obtained through the observation system actually contains the following information, whereC,G, andδ represents the deviation between the nominal system parameters and the actual system parameters. Due to the highly dynamic characteristics of the motion, the torque caused by this deviation cannot be ignored. We can obtain more accurate estimates of foot force by compensating the friction and gravity terms, as well as the disturbing force terms generated by motion. It has been proved that neural networks have powerful nonlinear mapping, adaptation and learning capabilities [31], which can fit nonlinear functions with high precision. In fact, there have been studies using neural networks to compensate robot dynamics [25], [32]. Using fully connected neural networks can well compensate errors caused by inaccurate dynamic modelling. However, due to the peculiarity of the legged robot's movement, the error not only comes from modelling errors, but also has dynamic errors. It is still an effective method to directly compensate force estimation by using neural networks. Generally, a typical three-layer fully connected network can be expressed as where x = x 1 , x 2 , . . . , x N n T ∈ R N n represents the input vector, N n represents the input dimension, W = ω 1 , ω 2 , . . . , ω N 0 ∈ R N n ×N o represents the weight matrix, w ∈ R N s , k = 1, 2, . . . , N o represents the number of neuron cells, N o represents the number of output cells, and φ (x) = φ 1 (x) , φ 2 (x) , . . . , φ N s (x) T ∈ R N s represents the activation function, usually using the Sigmoid function. The input part of the neural network contains the position status of the body, the angle and the angular velocity of joints. The neural network train framework and on-line application framework are shown in Fig. 6 and Fig. 7.
Therefore, the neural network data acquisition is mainly divided into two parts: one is the data acquisition in the swing period, and the other is the data acquisition in the stance period. The swing period data can be obtained by traversing the entire motion space of the foot while the body remains fixed. It is mainly used to compensate for the errors caused by inaccurate dynamic modelling. Considering the actual situation of the robot, traversing the space is unrealistic.  We divided the entire motion space into several trajectories according to the motion step length and leg lift, and obtain data by tracking these trajectories. Fig. 8 shows 100 foot trajectories generated according to the division method, with a motion period of 1s. The data during stance period is obtained through the robot's stepping motion, which is mainly used to compensate the force estimation error caused by the motion and other leg swings. The real value of GCF during the swing period is zero. While the real value during the support period can be obtained through the built-in sensor on the platform or the force plate installed on the ground. We use a typical fully connected neural network during our study. The BP network contains an input layer (with 9 input neurons), a hidden layer (with 19 hidden neurons, determined by Kolmogorov's theorem), and an output layer (3 output neurons). The activation functions of the hidden layer and the output layer adopt Sigmoid function and linear transfer function respectively. The optimization goal of training is the minimum sum of squared errors.
After the neural network is trained, we store its parameters and implement real-time compensation of GCF estimation by calling the network parameters during application. The final GCFs estimation framework is shown in Fig. 9, and the vertical GCF estimation results are shown in Fig. 10. From the figure we can observe that the force estimation error is much smaller than the uncompensated observer. The estimated value is much closer to the true value, especially during the swing period. Generally, we realize the detection of the ground contact state of the leg by judging the contact force of the foot. When the foot force is not zero, we believe that the foot is in contact with the ground. However, due to the error of the foot contact force during the swing period, we have to set a certain detection threshold. When the foot force exceeds the threshold, it is considered to be contact, which inevitably leads to a lag in the true ground contact. Because when the foot actually touches the ground, the initial contact force is less than the threshold, and it is still judged as the swing state at this time. So, the closer the foot force estimated during the swing period is to zero, the more favourable it is to lower the detection threshold, thereby reducing the detection lag of the true ground contact state.

IV. APPLICATION OF GCF ESTIMATION METHOD IN IMPEDANCE CONTROL
Impedance control incorporates force and position into a unified framework, and achieves compliant control of the robot by adjusting the relationship between position and contact force dynamically. Through impedance control, the leg movement of the quadruped robot can be smoothly transition from free space to constrained space, which makes the control has continuity [33]. This section mainly introduces the impedance control of the quadruped robot, and introduces the method of GCF estimation to verify the effectiveness of the method. In impedance control, we adopt the overall control block diagram planned in Section II and the external VOLUME 8, 2020 foot force obtained by the method in Section III. We verified the effectiveness and practicability of the force estimation method through experiments,.

A. IMPROVED IMPEDANCE CONTROLLER STRUCTURE
As mentioned in the first part, impedance control is one of the main methods to realize the robot's active compliance control. The position-based impedance control used in this paper is also called admittance control. According to the definition [13], the position-based impedance can be expressed as the ratio between the force source and the motion output measured at the point of action. When considering the task of expected force tracking, impedance control has the following form [34] (24) where M d is the expected inertia matrix, B d is the expected damping matrix, k d is the expected stiffness matrix, E (t) is the deviation between the expected position and the actual position, F c (t) is the estimated GCFs, F d (t) is the expected GCFs. In particular, F d (t) = 0 while the leg is in the stance period. And F d (t) = 0 while the leg is in the swing period. The traditional impedance controller is a typical second-order system, and its transfer function has the following form, as Since the traditional impedance control is a typical second-order filter system, the transition performance between the system position correction and the GCF is insufficient to meet the dynamic interactive performance [35]. Due to the lag in the response of the contact force, the foot will continue to move along the previously planned trajectory, which is likely to cause a relatively large impact or cause the robot's motion to become unstable. According to the research of Claudio et al. [36], the smaller the delay of the impedance controller is, the better the system compliance is.
PID controller is a linear controller widely used in industry, and is known for its good control effect and simple structure. Each parameter plays a different role. From the perspective of the impedance control of the legged-robot, the proportional parameter can coordinate the steady relationship between force and position, the differential parameter can increase the response speed of the system, and the integral parameter helps to eliminate the final error of position tracking. However, in the impedance control of legged robots, the zero final position error is not necessary, and can be ignored in the control [37]. While introducing the change trend of the GCFs can improve the force tracking ability of the robot system. When we adopt the method of Chapter III to estimate the GCF, the differential of GCF is always present due to the integral form. We used the differential of the estimated GCF to modify the traditional impedance control into a proportional differential impedance controller, and (24) is rewritten as The transfer function model can be written as We can analyse the transfer function in a specific direction. Equation (27) can be written into the form shown in (28), where σ is defined as the force position conversion factor(FPCT) and G (s) is the impedance filtering subsystem. Because the change of FPCT does not affect the zero pole position of the system, that is, it does not affect the dynamic characteristics of the impedance filter. The adjustment of FPCT is based on the task needs to comprehensively the force deviation and position deviation. And the filtering subsystem is mainly to adjust the dynamic characteristics of the subsystem. The overall impedance control effect is achieved by adjusting the two parts separately. When k fp = 1, the FPCT is equivalent to the reciprocal of the impedance stiffness.
According to the research of Boaventura et al. [38], the admittance-type impedance control Y (s) is a passive system when the following two conditions are met.
1) The system has no pole in the right half plane.
Based on these two conditions, we can complete the selection and tuning of the impedance controller parameters by using the zero-pole matching method. For the FPCT, we can calculate it based on the expected leg stiffness. Considering the quality of our robot platform and the length of the legs, our FPCT can be between 10 −2 and 10 −1 orders of magnitude. Corresponding to the stiffness of different phases, the FPCT of the swing period is larger than that of the support period. For the adjustment of the filtering subsystem, we can transform it into the form of a standard zero-pole transfer function.
Firstly, We determined the value of z,made the zero point of the system is placed on the negative real axis and away from the coordinate origin. Secondly, we selected an appropriate pole position p 1 according to the principle of the system's dominant pole placement, and place another pole p 2 near the zero position. Since the positions of the pole and zero are very close, a dipole is formed, which has a relatively small impact on the dynamics of the system [39]. The dynamic characteristics of the system are mainly determined by the dominant pole. We can adjust the position of the dominant pole p 1 according to the system requirements, and adjust the gain factor k to ensure |G (s)| = 1.

B. IMPEDANCE CONTROL EFFECT OF SINGLE-LEG PLATFORM
We applied the GCF estimation method and improved impedance control structure designed in this paper to the single-leg platform and quadruped platform, and tested the application effect of the estimated force in impedance control.

1) EFFECT OF IMPEDANCE CONTROL DURING SWING PERIOD
The foot robot mainly faces forward and normal obstacles in the complex field environment. When there are obstacles in the swing trajectory, the purpose of control is to minimize the impact force caused by touching the obstacles, to prevent the destruction of the leg mechanical structure and the instability of the body. Fig. 11 shows the effect of impedance control using the estimated GCFs. After the foot comes in contact with the ground obstacle, the GCF passes through the impedance filter to generate the position correction amount. This amount is superimposed on the desired trajectory, so that the actual position deviation is much smaller than the deviation in pure position control, and accordingly the actual GCFs are also much smaller than position control. The peak value of the impact force during position control is 600N, and the peak value of the impact force during two types of impedance control is about 160N. Using impedance control can effectively FIGURE 11. The effect of impedance control during the swing period. In this experiment, we fixed the position of the robot's body and controlled the foot to track the specified trajectory. During the swinging process, we set up immovable obstacles on the trajectory in order to simulate the situation in which the swinging legs of the robot touch the obstacles in the direction of movement. When the leg touches the obstacle, it will produce impact force in the opposite direction of the movement and trajectory tracking error. The figure above shows the estimated GCFs, and the figure below shows the errs of the foot tracking position. The right side is the red line box Partial enlarged view. The green curve represents the effect without impedance control, the blue curve represents the effect using traditional impedance control, and the red curve represents the improved impedance control effect. prevent the foot from generating a large impact force during movement and prevent damage to mechanical devices and instability of motion. Both forms of impedance control have a certain time lag, and there is an approximate impact force at the initial moment when the robot foot contacts the obstacle. Because the traditional impedance structure lags behind the improved impedance structure in tracking speed. Correspondingly, the position correction lags behind the foot contact state, resulting in a certain fluctuation in position deviation and foot contact force. The improved impedance form has a smoother control effect, which helps reduce leg tremor.

2) EFFECT OF IMPEDANCE CONTROL DURING STANCE PERIOD
Consider the situation that the foot does not slip, the position between the foot end and the ground remains fixed in the stance period. At this moment, the foot needs to provide normal support force to bear the weight of the body, and the ground friction force to provide the forward movement of the body. We can use impedance control only in the vertical direction to effectively reduce the dynamic impact caused by high-speed motion.
We constrained the movement of single-leg in the vertical direction. It fell freely from a height of 50 mm from the foot end to the ground. The expected body height is 700 mm. Fig. 12 shows the curve of body height and foot force with time. From the picture on the left, we can discover when pure position control is adopted, a second collision occurred due to the high rigidity of the foot contacting the ground, and both collisions produced a large impact force. When the two impedance controls are adopted, a good compliance effect is produced, and a secondary collision with the ground is avoided. Using impedance control can significantly suppress the impact force of the foot and showed better spring characteristics, but this characteristic is obtained by sacrificing position accuracy. From the picture on the right, we can compare the effect of the traditional form of impedance control with the improved impedance control. The improved impedance control has a better effect of suppressing the impact force. The maximum impact force is reduced from 258N to 185N, and the GCF fluctuation is smaller, which is closer to the physical spring characteristics.
The recovery capability of the robot when it is impacted by the external force is shown in Fig. 13. At the initial moment, the height of the body dropped to 674mm under the effect of impedance control. We applied a vertical downward impact force of 30N at 1.5s for a duration of 0.1s. After 0.4s, the system can restore stable support. Impedance control enables the system not only to respond to sudden external disturbances, but also to respond to load changes during movement. We also verified the different performance of the body under the control of two impedances after being impacted. We found an interesting phenomenon, because the traditional impedance has a lag in response speed, and its equivalent damping is greater than the improved form of impedance control, which is more conducive to the suppression of shock. Although the improved form of impedance control improves the response speed of the system, it comes at the expense of the ability to partially suppress interference shocks.

C. IMPEDANCE CONTROL EFFECT OF QUADRUPED ROBOT PLATFORM
In order to verify the practical application of the proposed force estimation method, we further extended the contact force estimation method to the quadruped robot platform. In the control of the quadruped robot platform, each leg adopted an independent controller. The controller used the control structure shown in Fig. 3 and the estimated GCFs. The movement gait adopted the typical diagonal trot gait. The motion period of the robot was set to 1 s, the legs on the diagonal side used the same phase motion, and the motions of the two groups of legs differ by half a period. The foot trajectory was planned by bezier curve, the height of the leg lift was set to 15 cm, and the step length was set to 0. At the initial moment, the quadruped robot did not touch the ground. It fell freely under the influence of gravity. After the robot stood steadily, it stepped in a trot gait. Fig. 14 is the snapshot of the quadruped robot's stepping motion, and Fig. 15 shows the GCFs estimation results and sensor measurement results during the motion. From the experimental results, we can observe that the force estimation method proposed in this paper shows a relatively good effect during the movement of the quadruped robot. We also tested the load changes during the robot movement and the robot movement in rough terrain. The experimental process of load change is shown in Fig. 16. At the beginning of the experiment, a 40 kg mass was suspended above the robot, and after 5 s, the mass was applied to the robot body in free fall motion. The estimation results of GCF and the sensor measurement results are shown in Fig. 17 (limited to space, we only give the force curve of the left front leg). From the experimental results, it can be seen that the force estimation method we designed can accurately    track the true GCF before and after the load is applied. The motion experiment on rugged terrain is shown in Fig. 18. Obstacles of varying distances are randomly placed on the route of movement, and setted the foot trajectory step length to 10 cm. The results of GCF and sensor measurement results are shown in Fig. 19. Because the robot adopted impedance control strategy, the end of the foot cannot leave the ground directly at the beginning of the swing period. Therefore, there are small fluctuations in foot force during the transition from the support period to the swing period.  Applying the estimated contact forces in impedance control can avoid the use of force sensors and make the robot exhibit better compliance characteristics. The trot gait experiment of a quadruped robot shows that the estimated GCFs can track the real foot force and can be used for robot control to achieve stable motion.

V. CONCLUSION AND PROSPECT
This paper proposes a method for estimating foot force based on generalized momentum. We improve the speed and accuracy of force estimation through the design of feed-forward and compensation terms. For the estimation of the continuous characteristics of force, we introduced the differential term of force and changed the structure of impedance control to improve the response speed of the body to foot force. First, we analysed the basis of force observation based on generalized momentum, and designed a feed-forward term by analysing the performance of the observer system. Secondly, aiming at the system deviation in dynamic modelling and other disturbances during motion, we proposed a compensate scheme using neural network, so that the force estimation scheme can be deployed in real robot systems. Finally, based on the estimated GCFs, we conducted impedance control experiments on the single-leg platform and the quadruped platform. The estimated foot contact force and the actual foot contact force in the experiment are highly consistent, and the foot contact force can be obtained without using a force sensor, which verifying the effectiveness of the method proposed in this paper.
The application of the designed method in the actual system does face greater challenges. We believe that the challenge mainly comes from the acquisition of training data for compensation neural networks. In the acquisition of training data during the swing period, we can fix the robot body, and the feet can swing freely in the motion space. Since the foot is VOLUME 8, 2020 in free space, its true value should be zero. For the acquisition of training data during the support period, a more feasible way is to set a force plate on the end of the robot to obtain real force data. However, the obtained force value may still have a large noise problem, which needs to be dealt with. Simultaneously, We adopted the motion time in the design of the phase conversion and state machine of the quadruped robot. The fixed-cycle phase switch is not an ideal solution for the quadruped robot to walk in the field. When the stance leg can provide stable supporting force, the contralateral leg should enter the swing period as soon as possible, thereby improving the robot's movement efficiency. The movement experiment on rugged terrain verifies the drawbacks of time stamp switching. In future work, we will re-plan the walking gait according to the condition of the foot contact force and the phase time to improve the robot's movement efficiency.