An Optimization-Based Locomotion Controller for Quadruped Robots Leveraging Cartesian Impedance Control

Quadruped robots require compliance to handle unexpected external forces, such as impulsive contact forces from rough terrain, or from physical human-robot interaction. This paper presents a locomotion controller using Cartesian impedance control to coordinate tracking performance and desired compliance, along with Quadratic Programming (QP) to satisfy friction cone constraints, unilateral constraints, and torque limits. First, we resort to projected inverse-dynamics to derive an analytical control law of Cartesian impedance control for constrained and underactuated systems (typically a quadruped robot). Second, we formulate a QP to compute the optimal torques that are as close as possible to the desired values resulting from Cartesian impedance control while satisfying all of the physical constraints. When the desired motion torques lead to violation of physical constraints, the QP will result in a trade-off solution that sacrifices motion performance to ensure physical constraints. The proposed algorithm gives us more insight into the system that benefits from an analytical derivation and more efficient computation compared to hierarchical QP (HQP) controllers that typically require a solution of three QPs or more. Experiments applied on the ANYmal robot with various challenging terrains show the efficiency and performance of our controller.


INTRODUCTION
Recent improvements in mobile robotics indicate that it is possible to achieve autonomous inspection and maintenance of critical industrial infrastructure in extreme environments (e.g., off-shore plants and nuclear sites) within the next decade. The automation of such processes will reduce their economic cost and increase the life quality of the operators that can be moved away from operational hazards. Legged robots are the most promising among ground robots for locomotion flexibility, being able to surpass a varied set of obstacles. However, this comes at the expense of reduced stability compared to wheeled robots. Quadruped robots offer a balance between efficiency and stability. Algorithms that can generate precise but compliant motions while satisfying physical feasibility are required to control quadruped robots with a large number of degrees of freedom. On the other hand, a trade-off strategy is also required to coordinate multiple tasks and constraints.
A good example for legged locomotion is the management of the contact forces that need to provide sufficient support to the body while not violating the non-slipping conditions determined by the friction cones. An intuitive control technique that can deal with these problems is the Virtual Model Controller (VMC) (Pratt et al., 2001), which has been applied to state of the art legged prototypes (Boaventura et al., 2012;Gehring et al., 2013). The VMC determines the contact forces based on the centroidal momentum model according to desired motions, and then maps these forces into joint torques. Meanwhile, the swing legs are controlled using joint PD controllers tracking a desired reference trajectory. Therefore, VMC controls swing legs and supporting legs separately and is not a whole-body controller.
Another widely used control framework is the fully optimization-based control (De Lasa et al., 2010;Saab et al., 2013). This framework relies on solving an optimization problem (usually quadratic) to minimize a cost function. The dynamic model and desired end-effector motions are introduced as equality constraints, while friction cones, torques, and joint limitations are inequality constraints. The main benefit of the optimization-based control is the integration of the operational space tasks and the joint space dynamics in a single problem. Furthermore, its formulation can be extended to solve multiple tasks, which can be implemented using either weighted optimization or strictly hierarchical optimization (Hutter et al., 2014). Two popular implementations are the Hierarchical Quadratic Programming (HQP) and the Weighted Quadratic Programming (WQP). HQP uses a strictly prioritized control framework based on null-space projectors; meanwhile, WQP relies on tunable weight matrices. Despite the fact that HQP solves two or more QPs, it is normally preferred to WQP because it does not require tuning.
The QP-schemes outlined above optimize for joint accelerations, contact forces, and joint torques, but only joint torques are eventually used for control. Since only torques are needed to control the robot, the original optimization formulation can be simplified by reducing optimization variables by considering reducing computation complexity as well. In Bellicoso et al. (2016), the QR decomposition proposed in Mistry et al. (2010) is employed to eliminate contact forces from dynamic equations so that optimization variables are reduced to two vectors. In Mansard (2012), a projector considering the consistency of the inertia matrix is proposed to separate the dynamic equations, and the optimization variables are finally reduced to two vectors. A straightforward decomposition is presented in Herzog et al. (2016) that directly splits six rows corresponding to six dimensional floating bases from the whole dynamic equation, thus removing actuation torques from optimization variables. By contrast, joint torques are the decision variables for the proposed control technique in this paper, and only one QP needs to be solved.
For optimization-based approaches, operational tasks are bounded to joint space dynamics by optimization constraints. Consequently, tuning parameters, such as impedance gains require several trials. A seminal control technique called operational space control (OSC), presented first in Khatib (1987), provides us with the analytical solution to derive joint torques from desired operational tasks. OSC has been extended to hierarchical OSC by iterative null-space projection for legged robots (Sentis and Khatib, 2006;Sentis et al., 2010;Lee et al., 2016). In Mistry and Righetti (2012), the orthogonal projector proposed by Aghili (2005) is applied to OSC with the consideration of reducing complexity. Subsequently, in Lin et al. (2018) and Xin et al. (2018), we extend that approach to involve the analytical Cartesian impedance controller proposed in Albu-Schaffer et al. (2003) and QP optimization. This paper is a further extension of our previous works under the framework of projected inverse dynamics.
The formulation proposed in this manuscript is a synergistic integration between the analytical Cartesian impedance controller and the QP. The method enables compensation of model errors while operating a trade-off strategy between multiple constraints, thus improving the locomotion capability traversing steep and slippery terrains. Specifically, the contributions of this paper come from combining the following components in a single control pipeline: • Analytical Cartesian impedance control, based on the orthogonal projected inverse-dynamics, which allows us to analyze a legged robot using a mass-spring-damper model against disturbances. • Perturbation estimation using the impedance behavior to evaluate disturbances including external forces and model errors. • QP optimization that performs a trade-off strategy to relax trajectory tracking when feasibility constraints are close to violation, which is critical when walking in extreme environments.
Finally, the proposed pipeline and controller are extensively validated on the torque controllable quadruped robot ANYmal (see Figure 1) in various scenarios.

PROBLEM FORMULATION
In this section we consider the general problem of constrained inverse-dynamics for quadruped robots, including a discussion of the controllability of quadruped robots. Then we present the projected inverse-dynamics to deal with constrained dynamics, which we will use to derive our locomotion controller for quadruped robots.

Dynamic Model of Quadruped Robots
The rigid-body dynamics equation of a floating base system under contact constraints is where q = [x ⊤ b θ ⊤ ] ⊤ denotes the vector of actuated joint positions (θ ∈ R n ) and floating base position and orientation (x b ∈ SE(3)), M ∈ R (n+6)×(n+6) is the inertia matrix, h ∈ R n+6 is the generalized vector containing Coriolis, centrifugal and gravitational effects, τ ∈ R n+6 is the vector of torques, J c ∈ R k×(n+6) is the constraint Jacobian that describes k linearly independent constraints, λ ∈ R k is the generalized constraint force vector that enforces the condition of J cq +J cq = 0 (or J cq = 0), and is the projector into actuated joint space with n dimensional identity matrix I n .
It should be noted that J c = [J c b J c s ], whereby J c b ∈ R k×6 and J c s ∈ R k×n . J c b encodes the effect of contact constraints on the floating base, with its rank providing direct insights into the controllability properties of the robots (Mistry et al., 2008). For quadruped robots, with the assumption of point contacts, there is k = 3 × n c where n c denotes the number of legs in stance. The case of rank(J c b ) < 6 (such as during a trotting gait with only two stance legs, and static walking with three stance feet in a line) is called truly underactuated (Hutter et al., 2014) which means there are not enough contact constraints to independently control the six unactuated base coordinates x b . The case of rank(J c ) − rank(J c b ) > 0 is called overconstrained which means we can use redundancy to control the constraint/internal forces. Static walking (except with co-linear feet) is a typical overconstrained case, as rank(J c ) − rank(J c b ) = 9 − 6 = 3 with one swing leg. The proposed controller incorporating QP aims to control the internal forces to satisfy contact constraints. Moreover, one should note that we cannot independently generate the contact forces for both static walking and trotting gait because of rank(J c ) − rank(J c b ) < rank(J c ).

Projected Inverse Dynamics
The dynamics Equation (1) can be divided into two subspaces: the motion space where the acceleration can be chosen freely, and the constraint space where the acceleration is fixed and constraint forces can be chosen. Working with the two subspaces allows us to satisfy contact constraints independently of joint motion. Paper (Aghili, 2005) proposes an orthogonal projector derived only from kinematic parameters without consideration of constraint dynamic consistency, leading to a much simplified solution compared to Sentis et al. (2010). The employment of this orthogonal projector is the key for analytical Cartesian impedance control and optimization variable reduction.
The constraint equation J cq = 0 implies that any admissible generalized velocity must lie in the null space of matrix J c , i.e., q ∈ N(J c ). We can use the pseudoinverse of J c to compute the orthogonal null space projector P as P = I − J + c J c , such that R(P) = N(J c ), Pq =q, PJ ⊤ c = 0, and P 2 = P ⊤ = P. Since the vectors lying in N(J c ) denote the motions of torso and any end-effector in the air, we call N(J c ) the motion space. It should noted that any vector could be projected into motion space by pre-multiplying with the projection matrix P. Then the complimentary projection I − P projects vectors into the constraint space N(J c ) ⊥ = R(J ⊤ c ). Subsequently, we can split Equation (1) into two equations of two orthogonal spaces (motion space and constraint space) using the above two projectors: and then torque command τ = τ m + τ c . Constraint torques τ c in Equation (4) do not contribute to the motion of the system, but system motion will affect contact forces due toq in Equation (4). We wish to invert PM in Equation (3) to solvë q, and then substitute that result into (4) to determine contact forces. However, PM is not invertible due to the rank deficiency of P. The contact constraint dictates that (I − P)q = 0, and its derivative Substituting Equation (5) into Equation (3) yields where M c = PM + I − P is invertible and named as constraint inertia matrix. Then we geẗ Substituting Equation (7) into Equation (4) yields the equation that can determine the contact forces By replacing τ m and τ c with their original definitions in terms of τ , Equation (8) becomes It should be noted that the utility of Equation (7) is key for the derivation of the analytical impedance control law in section 3 and the reduction of optimization parameters in section 4 to τ instead of [q ⊤ τ ⊤ ] ⊤ .

Applying Cartesian Impedance Control to Underactuated Systems
Since contact forces have been removed from the projected inverse dynamics of Equation (3), we can design a Cartesian impedance controller to achieve a desired motion performance in motion space without considering contact constraints. First, for the four stance legs case, only the torso requires desired motion, the torso is therefore considered an end-effector. The objective of Cartesian impedance control is to dictate the disturbance response of the robot. If a given Cartesian location x of the endeffector is subject to an external disturbance F x we would like to prescribe the motion at x as where e = x − x d is the motion error between the current pose and the desired pose, d , D d and K d are the desired Cartesian inertia, damping, and stiffness matrices that define the Cartesian impedance behavior. On the other hand, adding the external disturbance into the general dynamic equation Results in where J x is the Jacobian matrix mapping external forces/torques to joint space. Project Equation (11) into the motion space Next, we employ M c to transform Equation (12) to operational space. Equation (12) can be rewritten as We replace J xq withẍ−J xq and multiply by where c is named as the constraint-consistent operational space inertia matrix. For the moment, we will assume full actuation B = I. In the latter, we will deal with the underactuation constraint separately. Then, if we replace all non-linear terms with h c and τ with J ⊤ x F, we can compactly write the above equation as where F is the operational forces due to actuation. In order to achieve the impedance response of Equation (10), we can define the control law as We notice that if we sacrifice the ability to shape the inertia matrix by specifying d = c our control law simplifies to The advantage of the above control law is that we do not need to measure the external disturbances F x (e.g., with a force/torque sensor) to realize the impedance response.
On the other hand, by assigning d = c , the impedance gains of Equation (10) can still be tuned by analytical techniques based on different configurations (see in Angelini et al., 2019), whereas HQP controllers rely on manual trial and error tuning.
This may happen, for example, for the case when the robot is trotting (only two point feet on the ground) or for a swing leg when the leg is in singularity configuration. In these cases we can approximate c by computing a singularity robust inverse of J x M −1 c PJ ⊤ x , for example, by Singular Value Decomposition (SVD) with zero or near-zero eigenvalues removed.

Imposing Underactuation Constraints
The previous derivation of the control law (Equation 18) for Cartesian impedance control is based on an assumption of B = I. In fact, a quadruped robot is a typical underactuated system, i.e., the definition of B in Equation (2) is not an identity matrix. We need to satisfy the additional underactuation constraint Our control law of Equation (18) is defined in operational space. Although in general J ⊤ x F = BJ ⊤ x F, we may still be able to satisfy (19) by adding constraint forces in constraint space and we can solve for τ 0 Subsequently, the Cartesian impedance control law in motion space with consideration of underactuation becomes Frontiers in Robotics and AI | www.frontiersin.org Furthermore, as described in Mistry and Righetti (2012), it could be simplified to where F is defined in Equation (18). The above Cartesian impedance controller could also be applied to swing legs by replacing J x with corresponding Jacobian matrix of a swing foot. If we define the Jacobian matrix of torso and one swing leg as J b and J s , respectively, the only difference is J s ∈ R 3×(n+6) due to the point foot while J b ∈ R 6×(n+6) . Furthermore, let F b ∈ R 6 and F s ∈ R 3 represent the control law of Equation (18) for torso and swing feet, resulting in the torque command of motion space as follows where weight ω is 1 when leg i is in swing, and 0 otherwise. Figure 2 depicts the case of two Cartesian impedance controllers applied to base and one foot, respectively.

Model Error Estimation and Compensation
One of the benefits of Cartesian impedance control is that the impedance response of Equation (10) provides us with a way to estimate the disturbances using motion errorŝ It should be noted thatF x contains external disturbances as well as model errors. Considering the existing model error, the control law of Equation (18) becomes whereĥ c andˆ c denote the approximate items in computation. Substituting Equation (27) into operational space dynamics of Equation (16) yieldŝ Further, the above equation impliesF where not only external disturbances are involved, but also model errors. In the case where small external disturbances exist, Equation (28) can be used to estimate model errors.
This feature is useful for legged robots to carry unknown objects. If we feed the model error (e.g., caused by adding an object of unknown mass onto the robot) back into the control law of Equation (18), the position errors due to model errors will be removed. Therefore, the robot may carry unknown objects by compensating for estimated model errors. The control law in motion space with model-error compensation becomes whereF x is constant by computing Equation (28) once at the beginning of switching on model error compensation. By contrast, HQP controllers cannot use motion errors to estimate disturbances because the gains of HQP controllers have different scaling. We will verify this point in the experimental section.

QUADRATIC PROGRAMMING
The control scheme outlined above does not yet impose physical feasibility on the contact forces and joint torques. In this section, these constraints are introduced, and we present our quadratic programming approach to handle them.

Physical Constraints
The contact forces at the feet should be sufficient to prevent the separation or sliding of the contact. Additionally, motor torques typically have saturation values. To formalize the contact force constraint, the force at each foot is divided into tangential components λ x and λ y , and normal component λ z . This leads to the following constraints: • Unilateral constraint to avoid loss of contact • Friction cone constraint to avoid slipping where µ is the friction coefficient at the contact point. The saturation of torque command gives.

Optimization Formulation
Our previous work (Xin et al., 2018) minimized a quadratic cost function of the torque commands, thereby minimizing the torques.
where τ = τ m +τ c . To track trajectories and to deal with external disturbances, the Cartesian impedance controller (25) defines the motion space torque command τ m . This partial command is included in the optimization using the linear equality constraint: The friction forces are computed from the optimization variable τ based on (9) and simplified to be Then we can transform the unilateral constraint and friction cone constraint to be written in terms of decision variable τ . The quadratic programming problem is now formulated as: where the index i signifies the ith stance leg.

Adding Trade-Off Between Multiple Constraints
In practice, there may not be a physically feasible solution that achieves both the desired motion and impedance behavior. For example, tangential contact forces may increase due to the desired acceleration for walking forward, causing contact forces to violate the friction cone. To avoid a need for replanning the desired motion, we propose a trade-off between the constraints. The inequality constraints cannot be traded-off because they enforce physical limitations and stability of the system. On the other hand, the equality constraint enforces the operational space tasks. We will sacrifice motion performance to ensure feasibility of the physical (inequality) constraints when there is no possibility of finding a solution that satisfies both types of constraints. Here, we employ a trade-off of the trajectory tracking control to seek a compromise in low level control. The trade-off is implemented by moving the equality constraint into the cost function to compose a least squares optimization.
The above formulation means that the QP optimization will try to find the admissible torques that are as close as possible to the torque command of motion space required for the desired motion performance. It should be noted that if the QP needs to trade-off the motion performance it will change the swing trajectory more than the torso trajectory, as the torso contributes more to contact forces than the swing leg. Alternatively, we could add a weighting matrix to balance the modification of different parts if it is necessary. However, we would then need to tune the weighting matrix in practice. Therefore, we recommend using a null space projection of the swing legs to project the cost function, in order to enforce accurate swing leg performance. After the QP provides the optimized torque command based on the torso motion, we will add the dynamic consistent torques for the swing legs. The QP in the null space of the swing legs becomes where N s = I − J + s J s , J s = J s,1 for static walking gait, J s = J s,1 J s,2 for the gaits with only two supporting legs, such as trotting gait, and J s = 0 for four stance legs case. The final torque command will be The controller proposed above is represented as a block diagram in Figure 3.

Remark.
One notices that the friction cone constraints are quadratic constraints. Therefore, the quadratic programming of Equation (38) is quadratically constrained quadratic programming. In order to use standard active set methods, we approximate the friction cone with a linearized 4-edge pyramid. This results in a linearly constrained quadratic programming problem, which is readily solved (Goldfarb and Idnani, 1983).

EXPERIMENTS AND DISCUSSION
To validate our proposed controller, three sets of experiments were performed: a comparison the HQP controller, model error compensation, and walking on challenging terrains. This section treats each of the experiments in turn, and provides a setup description, results, and discussion for all of them. The experiments have been performed using ANYmal, a torque-controlled quadruped robot made by ANYbotics. The robot weights ∼35 kg and has 12 joints actuated by the Series Elastic Actuator (SEA). The control cycle runs at 400Hz. The on-board computer running controllers has an Intel 4th generation (Haswell ULT) i7-4600U (1.4-2.1GHz) processor and two HX316LS9IBK2/16 DDR3L memory cards. Experiment videos can be found in the Supplementary Video 1.

Comparison With HQP Controller
To show the efficacy of our proposed controller, we compare it with an HQP-computer. This comparison considers both the computational efficiency and the capacity to estimate external disturbances. Our implementation of the HQP controller follows the original framework from De Lasa et al. (2010), adding a dimension-reduction to that framework in order to enhance computational efficiency. This dimensionreduction, proposed in Herzog et al. (2016) removes the motor-torque from the decision variables by using the equations of motion of the robot. The remaining decision variables are the torso and joint accelerations and the contact forces. An active-set QP solver was employed to solve QPs in both controllers.

Computational Efficiency
To evaluate the computational efficiency of the proposed whole-body controller against the HQP-controller, we compare their execution time on the robot hardware. A comparison of average computation times while executing a fixed static walking gait is provided in Table 1.
The computation time analysis shows that our controller is faster than the HQP controller. This is expected since our controller only requires one QP although it computes a few pseudo-inverses of matrices. By contrast, HQP needs to compute more QPs and also needs to compute null-space projectors which include pseudo-inverses as well. In fact, HQP needs to solve at least two QPs for dynamic feasibility and trajectory tracking tasks. In order to save energy, a third QP has to be added to minimize torque commands. Usually, those are the three fundamental QPs required by HQP controllers (Bellicoso et al., 2019). For walking gaits, if we separate swing legs and torso into different prioritized tasks, one more QP has to be solved. In this experiment, the HQP controller solved three QPs for the four-legged stance phase and four QPs during a one leg swing. In Herzog et al. (2016), the first QP is solved by pseudo-inverse when moving friction cone constraints into a lower priority, which aims to save computation time. But, based on Table 1, the computation time of HQP is still greater than the proposed controller, even omitting the computation time of QP 1 . Furthermore, Herzog et al. (2016) also suggests parallelizing the computations of nullspace projectors and QPs. In that case, the total computation time of HQP will be the sum of solving QPs, which is close to our controller's according to Table 1. What's more, as pointed out in Escande et al. (2014) and Herzog et al. (2016), the size of decision variables can be reduced over the levels of hierarchies by additional SVD, which could potentially improve the computation efficiency of HQP even further. Readers should keep in mind that we did not employ that technique in the comparison of Table 1. The results are the means of 2,000 samples, respectively. HQP controller needs to compute two null-space projectors N i and solve three QPs during Stance phase, whereas one more QP is added for swing leg control during Swing phase. The proposed controller only needs to compute analytical Cartesian impedance control τ m and solve one QP. The computation time of HQP is almost doubled compared to the proposed controller either in Stance phase or in Swing phase. The similarity in the response of both controllers shows that the effective torso stiffness is roughly equal, despite the large difference in gains used. HQP cannot estimate disturbance forces whereas the estimated force of our controller is roughly close to the measured force.

External Disturbance Estimation
The ability of the two controllers to estimate external disturbances is assessed on the robot by comparing their response to similar force perturbations while standing still. The operator pushed the torso along the vertical axis using about 30N force, and the recorded position displacements are used to estimate the external perturbation received by the robot. As would happen in practice, we only use the multiplication of K d and displacement errors as the estimated disturbance instead of the entire Equation (28) since accelerations and velocities are noisy. Figure 4 shows the measured pushing forces and torso heights, which have been obtained using the gains reported in Table 2. The position errors caused by pushing forces are similar between the two controllers, which means they produce approximately the same effective stiffness. The force estimated by the proposed controller is K d,z e z ≈ 35N. This estimation is close to the measured pushing force 30N. However, the relationship between the effective stiffness and the controller gains is not straightforward for the HQP-controller. For this controller, the gains map from an error to a desired acceleration, not to a desired force, as is the case for our proposed controller. As a result, the K d gains of the HQP controller are much smaller than the ones of the proposed controller, meaning the HQP estimated force is 1.6N which is much lower than the received external perturbation. A conversion factor could be found, either based on the equations of motion or using experiments, such as this one. However, the conversion factor would depend on the robot configuration, which means the HQP-controller would require extensive tuning to be able to perform disturbance estimation. Therefore, the proposed controller is more suitable for performing the forces estimation for the compensation of constant external perturbations, such as the additional load carried by the robot.

Model Error Compensation
Legged robots may be deployed to move small loads which may not always be known; thus, it is important to adapt the robot behavior to maintain stable and efficient locomotion. Equation (29) describes how the proposed controller may be modified to use the external perturbation estimation to perform a model error compensation. For the experiment, the robot was loaded with a 10 kg mass and walked with and without activating the model compensation, which has been enabled after about 23 s. Table 3 contains the gains of the proposed controller in the experiment. The recorded video for this experiment can be found in the Supplementary Material. Figure 5 shows the snapshots from the experiments of adding weight to walking with it. Figure 6 is the recorded position error along the z axis during the experiment. After enabling the compensation, the torso immediately rose as shown in Figure 6 and continued its locomotion with a reduced position error. It should be noted that the estimated model error is about 65N. A bias of 35N has been added in this experiment to account for friction and other uncertainties of a real robot. The results demonstrate that the position error  (9,9,9,7,7,7) diag (250,250,90,10,10,10) Although the gains are so different in the two controllers especially for torso control, the torso showed similar stiffness performance.
can be reduced by model error compensation when carrying unknown objects, which is useful for deployment of legged robots in th real world. However, an important upgrade required to deploy this feature in a real scenario is continuous real-time model adaptation, which has currently been left as future work to develop.

Walking on Challenging Terrains
We tested the proposed controller for its ability to tackle challenging terrains. We tested walking on a low friction surface (PTFE Sheets, fiction coefficient of 0.22 as shown in Figure 7), and the feasibly of climbing a significant incline (30 • slope in Figure 8). As perception is not the focus of this work, the friction coefficient and slope angle parameters, to be used by the controller in the optimization stage, are set manually. Locomotion performance for these tasks may be seen in the accompanying video. We did not alter the step planning in our experiment, but rather used the default ANYbotics static gait planner. This means the planned locomotion trajectory was not optimized for  our particular tasks or evaluated for feasibility. Thus, during execution, if the controller does not trade-off trajectory tracking and constraint satisfaction, the robot may slip due to the inability of the QP finding a feasible solution. We further evaluate this trade-off by analyzing trajectory tracking errors when statically walking on flat terrain, while varying the friction coefficient parameter used by the controller. As shown in Figure 9, the trajectory tracking error along the z direction has an occasional sharp rise particularly when the friction coefficient µ is equal to 0.1 and 0.08. This indicates that trajectory tracking performance is sacrificed in order to maintain the friction cone constraint. We also see that the cost function value of QP increases, due to the increase of trajectory tracking error. In theory, the value of cost function should be zero if the trade-off is not triggered. The model error explains why the deviation between PBτ and τ m is not equal to zero even when FIGURE 6 | Measured torso height during carrying 10 kg weight. At 10 s, the weight is slowly lowered onto the robot, resulting in an increasing position error. At 23 s the force compensation is enabled, after which the robot takes two steps. The small difference between the initial and final position error shows the efficacy of the disturbance compensation. µ = 0.5. The controller in our previous work (Xin et al., 2018) does not have this trade-off feature, and this is an improvement over our previous work.

CONCLUSIONS
A semi-analytical locomotion controller incorporating an analytical Cartesian impedance controller and a QP optimization for quadruped robots is presented in the paper. Cartesian impedance controllers can track desired end-effector trajectories and can also be used to estimate external disturbances. The disturbance estimation is applied to model error compensation in the case of making a robot carry unknown objects. The QP optimization guarantees physical feasibility by sacrificing trajectory tracking if the torque command required to track the desired trajectory does not satisfy physical constraints. The benefit of this trade-off strategy enables the robot to walk on synthetic ice and a 30 • FIGURE 7 | ANYmal walking on slippery synthetic ice. The estimated friction coefficient between ANYmal's feet and the synthetic ice is 0.22. The friction coefficient in our controller needs to be ≤0.2 in order to avoid slipping on the synthetic ice. increasing errors for small friction coefficients show the trade-off in tracking performance made to guarantee feasibility of the friction cone constraint. In particular, a behavior emerges in which the controller deviates from the target motion in z direction, in order to increase normal contact forces when walking with a small friction coefficient. The trade-off between tracking error and constraint satisfaction is also visible in the increasing deviation between PBτ and τ m . ramp. Besides, the computation time is verified to be less than other fully optimization-based whole-body controllers since we only need to solve one QP with less decision variables compared to other controllers. Future work will focus on applying this control framework to dynamic gaits, such as trotting.

DATA AVAILABILITY STATEMENT
All datasets generated for this study are included in the article/Supplementary Material.

AUTHOR CONTRIBUTIONS
GX, H-CL, and MM significantly contributed to the development of the presented approach. GX, WW, and CT added the least-square optimization to the framework. All authors have contributed to the writing and they have reviewed the submitted version.