An analytic solution for the force distribution based on Cartesian compliance models

With the advent of force control in legged robots, there is an increasing demand in research on controlling contact forces that can ensure stable interaction and balance of the system. This article aims to solve the force distribution problem by an analytic solution to regulate the contact forces particularly in a computationally efficient manner. To this end, compliance models, consisting of a virtual model of the torso and impedance models of supporting feet, are developed for a quadruped robot. The linear constraints are formulated for the analytic method based on the compliance models, and the minimization of foot slippage and the internal forces within the closed chain are also taken into account. Moreover, given the compliance models, the postural compensation of the torso can be achieved by modifying the trajectories of supporting feet in order to generate desired forces. The comparisons between the proposed analytic and numerical methods show that the analytic one is advantageous for embedded controllers due to its high computational efficiency. Finally, the effectiveness of the proposed method is first validated in simulations and then in experiments on a physical quadruped robot, and the data are presented and analyzed.


Introduction
The distinct advantages of the legged system, such as a quadruped robot, particularly has the capability of being more versatile in challenging and complex terrain compared to their wheeled counterparts. This motivates the research of designing and developing force-controlled robots that can adapt to the obstacles and pitfalls and attain stable locomotion. [1][2][3] Generally, to satisfy the force-moment balance criteria for maintaining dynamic locomotion, the active force controller will apply a net wrench (force and moment) for a legged system. Nevertheless, the wrench cannot be applied directly on the torso but only through the contact forces since they are under-actuated floating-based systems. 4 Furthermore, there exists an infinite number of possible contact forces, when constraints are more than free-floating DOFs, for achieving the constraint-consistent motion. For example, a quadruped has more than two point feet supporting the torso. So to determine the mapping between the desired net wrench on the torso and the contact forces of the supporting feet is a critical part of the force distribution for this type of floating-based systems. [5][6][7] Therefore, to analyze the contact forces that a legged robot can exert, there are a number of approaches to solve the problem of the contact force distribution in the literature, which can be categorized into two main classes. One is to obtain the solutions by means of numerical optimization, such as quadratic programming (QP) algorithms, [8][9][10][11] and the other obtains analytic calculation by imposing extra constraints. The optimization-based methods determine the optimal contact forces through cost criteria and contact constraints. More specifically, the contact force distribution of the legged system is formulated as an optimal method to prevent the feet from slippage, minimizing internal force and other physical constraints. 12 Based on this, inverse dynamics is introduced to solve required torques in the joint space subject to contact constraints. 10,11 The other approach resolves the problem of contact force distribution through the analytic solution, which is beneficial for especially for embedded applications, where low-cost controllers demand effective solutions using limited amount of computation. It is characterized that the under-determined force system can be transformed into a determined one by means of imposing equality constraints. 13 By adding some extra constraints, a fully determined equation can be formulated such that leg forces can be determined by a unique solution. For instance, Trojnacki and Zielinska 14 obtain the three components of contact forces by an analytic method, and Zhang et al. 15 transforms the virtual forces into joint torques for the diagonal supporting legs by the Jacobian-transpose mapping.
In addition, due to the uncertainty of foot-ground interactions and the unknown force disturbances, the performance of legged locomotion is barely satisfactory while walking on rough terrain. In order to improve the robustness to unpredicted disturbances, compliant properties, especially the impedance modulation, is of high interest in the robotics community for the reduction of foot-ground impacts. 16,17 Thereby, researchers have successfully achieved compliant locomotion for both position-and force-controlled legged robots such as humanoids [18][19][20] and quadruped robots. 21,22 The contribution of this article is the analytic solution for rapid computation of contact force distribution for legged robots, which was demonstrated effectively on a real quadruped robot EHbot (see Figure 1). Using compliance models consisting of a virtual model of torso and impedance models of feet in the Cartesian space, we are able to develop Cartesian mapping from the supporting feet to the torso and add the linear constraints for obtaining the analytic solution. A unique solution for force distribution is formulated by combining the constraints of dynamic motion equations, the foot slippage risk and the minimization of internal forces. Furthermore, in order to evaluate the performance of the proposed analytic solution used for quadruped locomotion control, real experimental results were obtained to demonstrate locomotion performance. The analytic method is benchmarked against a QP-based optimization method. In addition, the computational efficiency of the analytic method is more than twice higher than that of the numerical optimization and is hence more suitable for embedded solutions.
The remainder of this article is organized as follows. In the second section, the system modeling of the quadruped robots, that is, virtual model and impedance model in the Cartesian space, is presented. Based on these models, the third section formulates an analytic solution for distributing contact forces. Furthermore, the simulations and experiments conducted using the proposed method are further provided in the fourth section with data analysis. Finally, the conclusion and future work are given in the fifth section.

System modeling
Suppose that the contact surfaces between the feet and the terrain are small enough to be considered as points, then the contact forces between them can be considered as point forces. 23 The center of mass (CoM) dynamics of a generic quadruped system is shown in Figure 2. The centroid dynamics 24 can be described as where F cop is the resultant force vector acting on the robot from the center of pressure (CoP). m represents the total mass of the robot. r cop represents the position vector of CoP with respect to inertial frame. g ¼ ½0; 0; Àg T is the gravitational acceleration. r com ¼ ½C x ; C y ; C z T and q com ¼ ½q x ; q y ; q z T represent the linear and angular position vector of torso around the inertial frame, separately; while _ L com and _ H com indicate the rate of change of the linear and angular momentum around the CoM, respectively.
As shown in Figure 3, here a virtual model controller is applied at the torso to regulate the net wrench in the Cartesian space. 25 For the feet as end effectors, impedance control (IC) is formulated consisting of four individual impedance models in the Cartesian coordinate. Given all these Cartesian models and parameters, we can develop the mapping relationship to correlate the reflection of stiffness at the torso by the stiffness of the feet or leg. Therefore, given the stiffness at the end effectors, that is, feet, the additional contact forces can be computed by the change of reference positions to generate desired net wrench at the torso for correcting postural errors. This computation can be mathematically formulated by adding equality constraints to yield an analytic solution, which will be explained further.
As mentioned above, the virtual net wrench is generated by the virtual model for tracking the desired locomotion. Contact forces of supporting feet are therefore required to produce appropriate virtual wrench to satisfy the force and moment equilibrium equations. According to the constraints of geometry and force, the relationship of the stiffness parameters of the torso and legs can be calculated theoretically. As shown in Figure 3, the height, pitch, and roll angles of the six-dimensional floating base (torso) play a key role in stability, compared to the motions in the forward, lateral direction and the yaw angle. Hence, the quantities of interest are the pitch and roll of the torso, and the height of the CoM described as follows where the subscript i 2 fFL; FR; BL; BRg represents the leg index. The prime symbols indicate the measured values. P i ¼ ½P ix ; P iy ; P iz T and _ P i ¼ ½ _ P ix ; _ P iy ; _ P iz T indicate the position and velocity vector of the ith foot, respectively. And k i ¼ ½k ix ; k iy ; k iz T is the stiffness vector of the impedance model, z i ¼ ½z ix ; z iy ; z iz T is the damping ratio vector of the ith foot. k c ¼ ½k cx ; k cy ; k cz T is the CoMs position stiffness parameters in the virtual model. k q ¼ ½k qx ; k qy ; k qz T represents the torsos posture angle stiffness in the virtual model. z c ¼ ½z cx ; z cy ; z cz T and z ¼ ½z x ; z y ; z z T denote the translational and rotational damping ratios of the virtual model, respectively. l i 2 f0; 1g is the binary flag of the ith stance/swing leg, that is, when the ith leg is in the stance phase, For simplicity, the moment components around the x and y axes generated by the virtual model are equivalent to the moment components of the impedance model on the  sagittal and frontal plane, respectively. In addition, the velocity of the supporting foot is small enough such that the damping parameters have less effect on the virtual force. Thus it is reasonable for us to formulate a stiffness mapping to calculate the stiffness parameters of the virtual model. It should be noted that the stiffness mapping formulation neglects damping effects, while the virtual forces and moments produced by both the impedance model and the virtual model take damping into account. Thereby where DP iz;x and DP iz;y represents the ith foot position deviation yielded by roll and pitch angle deviation, separately. Thereby Assume small angular deviations and thus constant position vectors P i , a linear mapping of stiffness can be obtained So given the impedance parameters of four feet and the corresponding coordinates, we can project the impedance of each foot into the virtual model of the torso. Furthermore, the compensation for the torsos height, pitch, and roll angles are where f c ¼ ½f cx ; f cy ; f cz T and t q ¼ ½t qx ; t qy ; t qz T are the net wrench, that is, force and torque, acting on the CoM, respectively.

Force distribution algorithm
In the preview section, the compliance models for quadruped robots are formulated in the Cartesian space by utilizing the impedance models of feet and the virtual model of the torso. In this section, we develop a linear mapping relationship between the rotational deviation of torso and the translational displacement of each foot. Thereafter, the linear mapping can be used for the analytic solution to the problem of contact force distribution, and this can be applied in the modifications of supporting feet trajectories for compensating postural errors of the torso, which is critical to satisfy the stability based on the quadrupedal state estimator. 26 To track the desired locomotion and satisfy the force and moment equilibrium equations, the system therefore needs to apply appropriate net wrench defined by a virtual model controller for changing the linear and angular momentum. The virtual net wrench exerted on the robot can be written as The equations of motion in equations (1) and (2) are resulted by the desired net wrench generated by a virtual model controller as in equation (16), which are in fact realized by the distribution of contact forces where The subscript i represents the ith contact point, that is, i ¼ 1; 2; 3; 4. Substituting the equations (12)- (14) and (16) and impedance models of supporting feet into equation (17) with the assumption of quasi-static system, the positional displacement of each foot affected by the posture errors of the torso can be determined by where the direction cosine matrix (DCM) R W for the coordinate transformation is R W % 1 sDq x sDq y À sDq z sDq y þ sDq x sDq z sDq z 1 sDq y sDq z À sDq x ÀsDq y sDq x 1 where the sðÁÞ represents the sinðÁÞ. Equation (19) establishes the linear relations between the rotational increment of the torso and the translational increment of each foot in the Cartesian space. However, compared to the tangential forces generated by friction, the normal components are dominant due to large magnitudes. 27 Thereby, only the projection of vertical deviations is utilized It is clearly indicated in equation (21) that there are two contributions to the displacement of foot: one is the rotation of pitch and roll angles represented by the first two terms, and the other is the translation of the torso represented by the last term. Therefore, based on the required compensation of the torso (15), the trajectories of supporting feet can be modified accordingly.
Therefore, according to the feet's impedance models, the vertical force of the supporting foot along the z-axis direction can be calculated by three offset displacement variables The linear equations of the displacement errors of the torso and contact forces of supporting feet are established based on the equation (21). Then these equations can be applied into the contact force distribution method for obtaining a unique solution.
In order to avoid foot slippage, each force vector must be inside the friction cone during foot-ground interaction. We hereby define h as the radio of tangential component to the normal component of the ground reaction force (GRF). Thus, h 8 respects the friction constraint, and vice versa.
To prevent slippage by minimum norms of distributed forces, setting all the radios the GRFs h i equal to the global one h is optimal because it avoids the cancellation of internal forces. 28 By doing so, the relationship of each contact force vector and the centroidal force f c can be written as follows considering friction cone Generally, terrestrial mammal and quadruped robot walk mostly in sagittal direction with minimized sideway movements, so the tractive forces are mainly along the forward direction of quadruped system. 15 In order to obtain an analytic solution for the latter derivation, the ratio h can be simplified by assuming negligible lateral tractive forces as zero f iy ¼ 0 and f cy ¼ 0 Hence, we have Once f cx and f cz are generated by the high level control, the ratio h ¼ f cx f cz is then given. Therefore, to prevent slippage, the forward tractive forces of quadruped systems f ix can be controlled proportionally according to the normal forces of supporting feet f iz . Also, in order to minimize the internal forces in the closed kinematic chains during multicontact, the lateral forces of the two front legs and two hind legs are set equal, respectively.
The above formulation of analytically solving the contact forces considers the proportional relation of the force component by reinforcing h. However, to prevent foot slippage in case of centroidal forces f c that violates the friction constraint or to warrant a safety margin in extreme circumstances, we need to reinforce the friction constraint by the anti-slip formulation with an anti-slip factor x (x 2 ð0; 1) as follows Note that this constraint is a linearized Coulomb friction cone represented by an outer approximation in a pyramid shape instead of the circular one.
From the above formulations which introduce six constraints and combining the Newton-Euler dynamics (17)  Wrench component Value The equation (27) has a solution if and only if detðAÞ 6 ¼ 0. In other words, the set of seven vectors of the coefficient matrix are linearly independent. When quadruped move with static walking, in which three or four legs support the body at a time, the determinant of the coefficient matrix is non-zero, which means there always exists one analytic solution of equation (27) as More generally, the equation (27) can be solved by using pseudo inverse as With the solution from equation (28) or (29) will be used for computing the feedforward and feedback terms, respectively. The solution of sDq x , sDq y , DC z of x are substituted into equation (21) to obtain the feedforward position compensation of DP iz for each foot, for achieving zero postural errors of the torso.
The contact forces in y direction f iy are solved directly in x by equation (28) or (29), and sDq x ; sDq y , DC z of x are used in equation (22) to obtain all the normal forces f iz first, which are then substituted into equation (25) to compute the sagittal forces f ix . To this end, all the x; y; z components of each contact force are resolved.
All these four contact forces are used for the feedback control of the translational and rotational motion, which are realized via the joint torque control as

Simulation and experimental results
In order to validate the proposed method of contact force distribution, we demonstrate a series of tests in simulations  and then on a quadruped prototype, EHbot. First, a set of random virtual net wrench in Table 1 are used to calculate and analyze the results of contact forces using the proposed analytic solution in simulation. Based on Table 1, 10,000 random net wrenches are generated to simulate the centroidal forces and torques computed by the virtual model. Under the normal standing situation, the information of EHbot, such as position and impedance parameters, is used for obtaining the coefficient matrix A in equation (27). Thereby, the contact forces can be solved by the proposed method. The data of analytic solution of resolving contact forces given inputs of random net wrench are shown in Figure 4. Note that as a comparison, the solutions with and without the friction constraints are both presented. When a large tangential force and a smaller normal force are required, the analytic solution without the friction constraint is subject to the risk of foot slippage.
As illustrated in Figure 4(b), the implementation of friction constraints can effectively avoid foot slippage with the possibility of slipping risk reduced from 6.47% to 0.04% (with x ¼ 0.95) despite the existence of poorly defined virtual wrenches. More importantly, using the friction constraints, the infeasible wrench input in certain circumstances (e.g. high acceleration) can be effectively   resolved for satisfying the physical viability. In turn, the introduction of the anti-slip factor x as a safety margin also limits the viability range of the quadruped locomotion, which can be a disadvantage. Nevertheless, for static walking gait of quadruped robots at low speed, that is, the system is over-actuated with three or four feet on the ground, the anti-slip factor x can meet the requirements of the flexibility of the quadruped locomotion.
We implemented the proposed algorithm of contact force distribution on the EHbot quadruped. EHbot, an electro-hydraulic quadruped prototype, is the latest version in the lab. It has a variety of sensors developed to explore and analyze the balance control of legged system. More information about the experimental system can be found in Shi et al. 29 The trajectories of supporting feet were modified using equation (21) for the compensation of torsos posture. To validate the effectiveness, we first carried out a series of experiments of static motion, with the front legs standing on a box using three different controller: (a) IC, only the impedance models of supporting feet were applied without the proposed force distribution to adjust the torsos posture; (b) the proposed force distribution (Force_Dist.) & IC, in which the analytic solution of the contact force distribution was applied with the virtual model control and leg impedance models; (c) feedforward compensation of modify foot trajectories (ModifyTraj.) & Force_Dist. & IC, in which the steady error of torsos posture was reduced by modifying the trajectories of supporting feet. Figure 5 shows the results of the average normal forces of the front and hind legs in each experiment. The results demonstrate that the larger force errors of the front and hind legs exist while using only the IC. Despite using the contact force distribution will generate net moment to reduce the postural error of the torso, this feedback control term a priori requires the non-zero postural error in order to compute a control effort. Hence, feedforward compensation is needed such as modifying the supporting feet trajectories in accordance with the Cartesian compliance models. Note that the difference of normal forces of the front and hind legs is mainly caused by asymmetric distribution of the mass. As shown in Figure 5, large angular errors can be minimized by the feedback control using distributed contact forces, and the trajectory modification of the supporting feet can further reduce the postural errors to zero, which also suggests that the assumption of our formulation of small angular errors, that is, equations (9) and (10), is reasonable.
The second validation is the simulation of quadruped walking on rough terrain (see Figure 6) with 0.2 m/s. The test was carried out in the Gazebo 7 simulator. As shown in Figure 7, the yellow shaded area represents the duration of terrain disturbance. Figure 7(a) shows that the maximum amplitudes of pitch and roll angles are less than 3.0 and 6.0 . Figure 7(b) shows that the postural angles can restore to the desired ones in presence of large terrain variations during 24 s and 28 s. Besides, it was found that when the FL foot steps on a high plank (at 24.2 s), the large errors between the desired and actual normal forces cause the system to be unstable. Once the controller reduces the residuals close to zero, the corresponding posture is then stable again during 27 s and 28 s.
In the third validation, in order to compare the performance of the proposed analytic solution with an optimal solution in equation (12), we applied both methods to the robot walking in place, in both the simulation and the experiments, under the same circumstances (terrain, computer, etc.). Note that all the above algorithms are implemented on a personal computer with 2.3 GHz quadcore Intel Core i5-6300HQ processor. The qpOASES-3.2.0 library 30 is used for optimal method. And ROS Indigo and Gazebo-7 on Ubuntu Linux are used to build the simulation platform. Figure 8 shows the experimental results of comparing the torso's roll angles from both methods. We see that the maximum roll angle amplitude with the analytic method is no more than 5.5 , which is slightly bigger than the maximum angle amplitude (approximately 4.0 ) with optimal method. The phenomena of angle amplitude's asymmetry may be caused by the uneven distribution of mass.
It should be emphasized that the analytic solution is more computationally efficient and can provide more computing resources for other algorithms. Compared to the average computation of the optimal solution of 0.16 ms, our analytic approach has an average of 0.07 ms only, which is less half the time. Similar results have been discovered in different computers. As can be seen in Figure 9, the snapshots of conducted experiments show that the proposed method was successfully implemented on a quadruped platform EHbot. These tests demonstrated the effectiveness of the proposed method for contact force distribution.

Conclusion
This article proposed an analytic solution for solving the problem of contact force distribution considering friction constraints for stable quadruped locomotion. Using impedance models in the Cartesian space for the control of legs and virtual model control of the torso, we are able to develop linear relationship between the postural errors and the corresponding increment of foot trajectories for the feedforward compensation. Hence, posture errors of torso can be compensated by modifying the trajectories of supporting feet. Then by combining with the Newton-Euler dynamics, the internal forces can be minimized by using the tangential-normal ratio h, which is used for the friction constraints to prevent foot slippage. All this can be formulated analytically, and thus the solution of force distribution can be computed with high computational efficiency for the implementation on low cost controllers. This allows a wider range of applications in which real-time computation is critical.
However, there are some limitations in this analytic method. One of the assumption is that the lateral tractive force is close to zero, so this control method is vulnerable to large lateral disturbances. In addition, as a trade-off, the performance of this algorithm is less desirable than that of the optimal method, therefore it is suitable for lowcost controller for reducing the computation. In the future, we would like to reformulate the problem to achieve better performance in terms of accuracy of the solutions at high computational efficiency.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by National Nature Science Foundation of China under Grant No. 61473015, 61773139, and U1713222, the Shenzhen special fund for future industrial development JCYJ20160425150757025 and Shenzhen Peacock Plan KQTD2016112515134654.

Supplemental material
Supplemental material for this article is available online.