{'fraction_non_alphanumeric': 0.031205864550406887, 'fraction_numerical': 0.008776649404801938, 'mean_word_length': 4.764489242101182, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Inverse Dynamics Control of Compliant Hybrid Zero Dynamic Walking

We present a trajectory planning and control architecture for bipedal locomotion at a variety of speeds on a highly underactuated and compliant bipedal robot. A library of compliant walking trajectories are planned offline, and stored as compact arrays of polynomial coefficients for tracking online. The control implementation uses a floating-base inverse dynamics controller which generates dynamically consistent feedforward torques to realize walking using information obtained from the trajectory optimization. The effectiveness of the controller is demonstrated in simulation and on hardware for walking both indoors on flat terrain and over unplanned disturbances outdoors. Additionally, both the controller and optimization source code are made available on GitHub.


I. INTRODUCTION
The inclusion of model detail in walking controllers for underactuated bipedal locomotion can be used to accurately capture the underactuated dynamics of the system in a manner which also facilitates accurate tracking of planned motions. However, implementing model-based planning and control methods on physical systems is typically non-trivial due to the inherent model inaccuracy, dynamically changing contact constraints, and possibly conflicting objectives for the robot which naturally arise in locomotion. It is due to these challenges that bipedal robots which exhibit simultaneously robust, efficient, and agile motions are rare in practice [21].
A significant subset of the bipedal robotics literature mitigates the complexity of humanoids and bipeds by viewing walking as a problem wherein the real world dynamics are assumed to be governed by the evolution of a simpler system, such as a LIP models (Linear Inverted Pendulum [8], [15]), SLIP models (Spring Loaded Inverted Pendulum [25]), and the ZMP (Zero Moment Point [27]). These methods can reduce computational complexity for fast planning and experimental success. Despite its viability in practical implementation, this local representation of the system can limit the agility of behaviors and compromise energy efficiency. One area of model-based planning and control which is particularly difficult to directly address is passive compliance in locomotion. Some of the earliest inclusions of compliant hardware on bipedal robots was with spring flamingo and spring turkey [13], with more recent examples being MABEL [18] and ATRIAS [25]. One of the latest robots to exhibit compliant leg structures is the Cassie biped (shown in Fig. 1), which is the experimental platform that we consider in this work. From a mathematical standpoint, compliance increases  the degree of underactuation which makes finding walking behaviors that satisfy stability constraints more difficult. With regard to implementation compliance also increases numerical stiffness and model uncertainty. We attempt to address these challenges through two contributions.
The first contribution of this paper is a motion library of walking behaviors for Cassie that leverage its full-body dynamics including its compliance. To generate this library, we utilize the framework of Hybrid Zero Dynamics (HZD) [28] which has demonstrated success in developing controllers for highly underactuated walking behaviors. The HZD framework [28] has demonstrated success in developing controllers for highly underactuated walking behaviors. In the context of robotic implementations, HZD has enabled a wide variety of dynamic behaviors such as underactuated humanoid walking [22], compliant running [26], and 3D bipedal walking with point-feet [20]. Directly related to this work, motion libraries on sagittal motions under the assumption of sufficient rigidity has been successfully realized on Cassie [9], but this work ignored the robot's inherent compliance. Tangentially, singular walking behaviors which consider passive compliance were realized in [24]. This work, therefore, is the first to combine motion libraries that consider the full-body dynamics of Cassie together with compliance.
The second contribution of this paper is the synthesis of controllers able to realize motion libraries in a manner that exploits the compliance for which they were generated. One of the limiting assumptions which can affect HZD behaviors is that their formal stability guarantees are often tied to exponential tracking of motion objectives, or outputs. This can lead to the use of high-gain PD feedback controllers when applied to hardware to obtain periodic stability. Instead, it would be more desirable to achieve tracking with some inherent control compliance to perturbations and unknown terrain. In this direction, model-based control in the form of inverse dynamics [3], [16], control Lyapunov functions [4], or some combination of the two [23] may offer more desirable control properties. In this work, we consider an analytical solution to the floating-base inverse dynamics problem, extending the work in [17]. The end result is a model-based controller that is demonstrated experimentally on Cassie, with the result being stable and robust walking.
The paper is structured as follows: Section II gives an overview of the Cassie robotic model and the hybrid domain structure which is prescribed for walking. Section III details the optimization problem which is used to produce a library of compliant walking trajectories. Section IV introduces a orthogonal decomposition based inverse dynamics controller, which uses the optimized accelerations and robot model to obtain a dynamically consistent feedforward term for the planned walking gaits. Walking on hardware and in simulation is then demonstrated, validating that the planned trajectories capture the passive dynamics of the robot.

II. ROBOTIC MODEL
The Cassie biped is an approximately one meter tall walking robot designed and manufactured by Agility Robotics 1 . The sensing on the robot is entirely proprioceptive and includes a 9-DOF IMU, torque sensing, and high-resolution absolute encoders to measure both compliance and actuated joints. The physical model of Cassie is complex, with 22 degrees of freedom, 4 of which are fiberglass leaf springs. There are 10 BLDC motors which control the joints through 8 low-friction cycloidal gearboxes and 2 harmonic gearboxes at the feet. The compliance in the model is contained to a 4bar linkage, through which the knee motors effectively drive the leg length. While the feet of the robot are actuated, and offer some small control authority in the sagittal direction, contact is a reduced to a point in the coronal plane.

A. Floating Base Model
The robot itself is modeled as a tree structure composed of rigid links. As legged locomotion inherently involves intermittent sequences of rigid contacts with the environment, it is common practice to construct a floating-base Lagrangian model of the system and then add constraint forces via D'Alembert's principle [10]. We define the configuration space of the bipedal robot Cassie as Q ⊂ R n , where n is the DOF (degrees of freedom) without considering any holonomic constraints that result in DOF reduction. A visualization of the prescribed coordinates is shown in Fig.  2, and an URDF of the robotic model detailed in this work is provided online as a part of a software package [1]. Let orientation, and q l ∈ Q l ⊂ R n l are the local coordinates representing the joint angles between links. Further, the state space X = T Q ⊂ R 2n has coordinates x = (q T ,q T ) T . The local coordinates are denoted as q T l = q L , q R , where the superscript L/R denotes the left/right leg, and represents the joint of hip roll, hip pitch, hip yaw, knee, shin, tarsus, heel spring and ankle accordingly. Among these joints, θ hr , θ hp , θ hy , θ k , θ a are actuated by BLDC motors with associated control inputs u ∈ U ⊂ R m with m = 10 as previously described. The joints θ hs , θ s are directly driven by leaf springs, which are treated as rigid links with rotational springs of stiffness 2300 and 2000 Nm/rad respectively at the pivot. There is one completely passive joint θ t per leg, and an unconstrained model of the robot with 22 DOF. The floating-base dynamic model can be expressed in the form of Lagrange: where D(q) is the inertia matrix, h(q,q) contains the Coriolis and gravity terms, B is the actuation matrix with gear reduction as its entries, and the Jacobian matrix of the holonomic constraints is J(q) = ∂ η ∂q (q) with its corresponding constraint wrenches λ ∈ R mη . Note that we introduced the spring forces as external forces τ s = k s q + k bq with k s , k b the stiffness and damping coefficients, which are distributed according to the associated spring selection matrix B s .

B. Holonomic Constraints
Two types of holonomic constraints are commonly considered for legged robotic systems, external contact constraints depending on the current configuration of the robot and it's interactions with the world, and internal kinematic constraints resulting from the robot geometry. Both types of constraints are enforced in the same manner, by prescribing a closure equation, η(q) = constant, which represents a positional constraint on the robot. This expression then yields a constraint on the accelerations when differentiated twice: The enforcement of this constraint gives rise to the corresponding force terms, λ, in the equations of motion (1).
Contact Constraints. In this work, ground contact is assumed to be enforced through a holonomic constraint on a stance foot's position and orientation, η st (q), which is rendered constant while the foot remains on the ground. Because the width of the feet on Cassie is negligible we enforce contact as a line, or as two collinear points of contact at the toe and heel. This gives rise to a ground contact constraint for each foot with five components: where the first three components are the Cartesian position of the center of the foot and the last two correspond to the the foot pitch and yaw, shown in Fig. 3. Because λ z st is a normal force, it is unilateral. Additionally, the tangential forces λ x st , λ y st are required to satisfy friction models to remain feasible. Ideally, a classical Amontons-Coulomb model of (dry) friction is used to avoid slippage and is represented as a friction cone. For a friction coefficient µ and a surface normal, the space of valid reaction forces is then: Additionally, the moment associated with the foot pitch λ my st can produce rotation of the foot over the forward edge if it is too large. It has been shown that due to the unilateral nature of contact this moment is limited by: where l is the length of the foot from heel to toe.
Loop Constraints. It is common practice to model robotic manipulators in branched tree structures. However, on Cassie, a compliant multi-link mechanism is used to transfer power from higher to lower limbs without allocating the actuators' major weight onto the lower limbs, and effectively acts as a pair of springy legs [24]. When the mechanism has a kinematic loop, this is often managed by cutting the loop at one of the joints and enforcing a holonomic constraint at the connection to form the closed-chain manipulator. In the Cassie leg the heel spring is attached to the rear of the tarsus linkage, with its end constrained via a pushrod affixed to the hip pitch linkage. For this work, we assume that pushrod attachment is a virtual holonomic distance constraint applied between the hip and heel spring connectors as: where the attachment distance d(q l ) ∈ R is obtained via the forward kinematics between connectors at the hip and heel spring (see Fig. 2). We also assume that when a leg is in swing that the springs on that leg are a rigidly fixed: This simplifies both the optimization and control implementations [26], and makes the dynamics less numerically stiff. Fig. 3. Shown on the left is the contact geometry of the robot's foot, along with the constrained coordinates and associated contact frame. The directed graph of walking used in this paper is shown on the right, where we view walking on Cassie as consisting of two single-support domains with a compliant stance leg, and rigidly stiff swing leg.

C. Hybrid Locomotion Model
A bipedal walking gait consists of one or more different continuous phases followed by discrete events that transition from one phase to another, motivating the use of a hybrid system formulation with a specific ordering of phases. This is traditionally described as a walking cycle, which is a directed cycle with a sequence of continuous domains (continuous dynamics) and edges (changes in contact conditions).
In this work, we structure the dynamics of walking on Cassie in a hybrid fashion. The walking consists of two single support domains, D

{L,R} SS
, associated with stance on the respective left (L) or right (R) foot, with an instantaneous double-support (the swing leg lifts immediately on impact). An associated directed graph can be specified for the system which is depicted in Fig. 3. There is an additional assumption that the walking is symmetric for both left and right stance when the robot's average lateral speed over a step is zero, while the walking is allowed to be asymmetric otherwise. A transition from one single support domain to another occurs when the normal reaction force on the non-stance foot crosses zero. Therefore, the domain and guard are given by: is the vertical ground reaction force of the swing foot and p z swf (q) is the vertical position of the center of the swing foot from the ground. Impact occurs when the swing foot touches the ground, modeled here as an inelastic contact between two rigid bodies. In this contact model, the configurations of the robot are invariant through the impact and velocities will instantaneously change due to the introduction of new holonomic constraints [10], [14]. The associated reset map, ∆, is given as: where R is a relabeling matrix, q − and q + denote the pre and post-impact configuration, and ∆q(q) is obtained from the plastic impact equation:

III. TRAJECTORY PLANNING FOR WALKING
This section details the trajectory optimization approach used to design a collection of trajectories which can be implemented to obtain compliant walking behaviors on the physical system in both the sagittal and coronal directions.

A. Virtual Constraints
Analogous to holonomic constraints, virtual constraints are defined as a set of functions that regulate the motion of the robot with a desired behavior [28]. The term "virtual" comes from the fact that these constraints are enforced through feedback controllers instead of through physical constraints. The primary idea is to design a controller u(x, α) to regulate: for which a behavior can be encoded through the desired outputs, y d (α, t). A 6th-order Bézier polynomial chosen for the desired outputs, for which α is a matrix of real coefficients that parameterize the curve. In this work, we consider nine outputs of vector relative degree 2: pelvis roll/pitch stance/swing hip yaw swing hip roll swing leg length stance leg length swing leg pitch swing foot pitch where φ y (θ tp ) is the swing foot Cartesian pitch and, is the expression for the distance between the hip pitch and ankle pitch joints from the forward kinematics. Because the foot geometry is quite small, we leave the stance foot passive. It should be noted that we are controlling the undeflected leg length and angle of the legs by zeroing the spring deflections. By formulating the outputs in this way, the passive dynamics of the system will contain the additional dynamics associated with the compliant elements [26]. As a practical matter, this is also important as directly controlling the compliance in the leg is a significantly more difficult problem to achieve.

B. Hybrid Zero Dynamics
The combined mechanical model (1) and (2) can be expressed in state variable form as, Additionally, because all outputs specified for the system have vector relative degree two, we assume the existence of a feedback control law u * (u, t) that drives y → 0 exponentially, resulting in a closed loop system: Additionally, by driving the outputs to zero the controller u * renders the zero dynamics manifold: Z = {(q,q) ∈ D | y(q, t) = 0, L f cl y(q,q, t) = 0}. (13) forward invariant and attractive. Thus, the continuous dynamics (12) will then evolve on Z. However, because (13) has been designed without taking into account the hybrid transition maps (7), it will not be impact invariant. In order to enforce impact invariance, the Bézier polynomials for the desired outputs can be shaped through the parameters α. This can be interpreted as the condition: and will be imposed as a constraint on the states through the impact (7). When (14) is satisfied, we say that the system lies on the hybrid zero dynamics (HZD) manifold.

C. Gait Library Optimization
The desired evolution of the outputs (9) must now be designed such that we can achieve locomotion, while also satisfying both the physical limitations of the hardware and other conditions such as (14). A nonlinear trajectory optimization problem is formed to solve this problem. Similar to [9], [29], we would like to design a variety of walking speeds for which the robot can operate. To accomplish this, a library of walking gaits at sagittal speeds of v x ∈ [−0.6, 1.2] m/s and coronal speeds of v y ∈ [−0.4, 0.4] m/s are generated in a grid of 0.1 m/s intervals. The impact-to-impact duration of each step is fixed at 0.4 seconds for ease of implementation.
Each hybrid optimization was performed over the two domains, D

{L,R} SS
, with a constraint imposed such that when the discrete impact (7) is applied to the terminal state that it satisfies the hybrid invariance condition (14). It is critical that the motions respect the limitations of the physical system. In order to address this constraints for the friction cone, actuator limits, and joint limits are imposed. While these constraints alone ensure invariance and satisfaction of the physical constraints, additional constraints on the behavior were tuned for implementation on hardware, such as the swing foot velocity, impact foot configuration, step symmetry when v y = 0, and others outlined in Table I.
In order to minimize torque and to center the floating base coordinate movement around the origin, the following cost function was minimized: where w ∈ R Nw with N w being the total number of optimization variables and c are weights applied to the respective terms. For the library presented in this work the weights used were c u = 0.0001 and c φ = (20, 1, 30). An optimization package, FROST [12], was used to transcribe the constraints and cost of each of the 171 gaits into a nonlinear programming (NLP) problem that can be solved by a standard optimization solver such as IPOPT [5]: Physical feasibility: Table I Each optimization was then solved through the C-FROST interface [11] on a laptop with an Intel Core i7-6820 HQ CPU @ 2.7 GHz with 16 GB RAM, and consisted of 8418 variables with 4502 equality and 5880 inequality constraints. Using each gait as an initial guess for the next speed in the library, the average number of iterations per run was 199 with an average total evaluation time of 263.8 seconds, and an average objective value of J (w * ) = 4.12.  Extracting parameters for real-time control. The controller implemented on hardware needs both the feedback control objectives, defined by y d (α, t), and acceleration informationq * from the optimal path to complete the planned motions. The feedback parameters, α, already concisely parameterize the feedback control, and are placed in a large matrix which can be used in a bilinear interpolation routine.
A subset of the resulting library of output parameters are shown in Fig. 4, where the leg length, leg pitch, and hip roll outputs are visualized over various walking speeds alongside a corresponding motion in simulation. An interesting characteristic which can be immediately seen is that the stance leg length output has a 'double-hump' shape, which is a result of the planned motions taking advantage of the spring deflection in the leg to minimize torque (15). Generalized accelerationsq * are extracted directly from the optimization variables, w, as time-series data from each step. To allow for easier implementation, regression is performed on each curve to obtain the parameters for a 6th order Bézier polynomial. They can then be stacked with the α parameters in the same bilinear interpolation routine for code efficiency. Plots of the accelerations for the floating base x and y coordinates are visualized in Fig. 5. Finally, the floating-base position p * x,y and velocity v * x,y relative to the stance foot is also extracted in the same manner asq * . This is shown on the velocity plots in Fig. 6 as the dashed lines and serves as a reference velocity for regulation.

IV. REAL-TIME TRACKING OF OPTIMIZED MOTIONS
The optimization framework described in Sec. III creates a continuum of walking trajectories [7], which can be interpolated to obtain walking motions at a range of speeds. In previous work we presented on Cassie [24], PD control achieved reasonable tracking of the desired outputs with the passive compliance in the system matching the planned response. However, implementation relied on high-gain PD control with heuristic feedforward terms and trajectory modifications that needed to be hand-tuned to account for the model mismatch. A similar approach was used also by others [9], which demonstrated walking without planning for compliance or velocity terms in the dynamics. A benefit to inverse dynamics approaches on robotic systems is that lower gain PD feedback control can be used, while feedforward terms which respect the constrained rigid body dynamics of the system are used to produce most of the control input.

A. Inverse Dynamics Controller
The use of inverse dynamics control for underactuated and floating-base robots is significantly more complex than for fixed-base manipulators. In developing controllers for these systems, there are many considerations to address such as numerical problems due to repeated matrix inversions of the inertia matrix, contact force distribution, and computational efficiency [23]. Here, we follow the approach of Mistry [17], which uses an orthogonal decomposition to compute the inverse dynamics torques in the null-space of the constraints.
The underlying idea of the method is to use a QR decomposition of the constraint Jacobian matrix: where Q is an orthogonal matrix and R is an upper triangle matrix of rank m η . The Q in the QR decomposition provides a coordinate transform which separates the system dynamics (1) into the constrained and unconstrained components: Remark 1. In (18) the spring force term, B s τ s , is not present. We originally developed the controller with the spring dynamics and were able to achieve walking. However, the robot would often overreact to perturbations in the spring deflections. Instead, we apply a constraint on the springs similar to (6), but at their current deflected state. This produces a torque consistent with the deflected leg configuration, but does not react aggressively to spring oscillations.
Through the use of a selection matrix S u = 0 (n−k)×k I (n−k)×(n−k) , we can obtain the unconstrained system dynamics which are not dependent on the constraints: Solving for u leads us to the inverse dynamics: where † represents the appropriate Moore-Penrose inverse andq d is a target acceleration for the system to follow. For a more detailed analysis of the orthogonal decomposition and controller derivation, we again direct readers to [17]. In addition to the feedforward term provided by (20), a feedback correction is computed as a standard PD controller: u = u f f − ∂y(t, q) ∂q m † (K p y(t, q) + K dẏ (t, q,q)) , (21) where K p = [900, 500,300,250,200,200,200,200,25] and K d = [12,6,4,6,5,6,4,4,2] are the proportional and derivative gains applied to the output feedback on hardware.
In order to select the parameters which are used for output tracking and for the feedforward term, we use average velocity of the previous step,v a k−1 . Thus, our Bèzier polynomial array provides us at each time instant with the nominal accelerationq * (t,v a k−1 ), outputs y d (t,v a k−1 ), floating-base positions p * x,y (t,v a k−1 ) and velocities v * x,y (t,v a k−1 ).

B. Velocity Tracking and Regulation Heuristics
The presented controller required no heuristic tuning on the feedforward terms to achieve tracking of the outputs such as offsets or hand-tuned torque profiles. However, directly implementing this controller with the trajectory obtained from the NLP (16) can at best result in a marginally stable locomotion for experiments as it has no way to trend walking towards an overall target walking speed. Motivated by this, a PD controller is used to find an offset to the footstrike location, and translated to the desired outputs: whereṽ a x,y =v a k−1 + v a x,y − v * x,y is the current step velocity, v d x,y is the target step velocity from the user joystick, v a x,y is the instantaneous velocity of the robot relative to the stance foot, and p * nsf (y d ) = (p * nsf,x , p * nsf,y , p * nsf,z ) are the nominal Cartesian swing foot positions computed from the desired outputs. This style of regulator is inspired by early work of [19], and has been used widely in the literature.
An additional regulator is applied to modify the nominal accelerations of the floating base accelerations, which were pictured in Fig. 5. Through the application of a heuristic feedback controller, we can make the robot choose feedforward torques which trend the robot toward the target velocity while satisfying the contact constraints on the system:  (20) uses the full actuator matrix B, it does apply some control effort on the stance foot actuator. It is for that reason that the integral term is applied to the x direction, and not in the y. On the right is a comparison of the torque from the feedforward controller with the total torque applied for the knee pitch and hip roll joints.

C. Experimental Implementation and Results
The controller is implemented on the Intel NUC computer which comes installed in the Cassie torso, on which we added a PREEMPT RT kernel. The software runs on two ROS nodes: one which communicates to the Simulink Real-Time xPC over UDP to send torques and receive sensor data and to perform estimation, and a second which runs the controllers. Each node is given a separate core on the CPU, and is elevated to real-time priority. The first node runs at 2 kHz and executes contact classification, inverse kinematics to obtain the heel spring deflection, and an EKF for velocity estimation [6], [24]. The second node runs at 1 kHz and receives the estimation and proprioceptive data over ROS. It then runs either the standing controller presented in [23], or executes the controllers presented in Sec. IV-A and IV-B before communicating the commanded torque over ROS.
These controllers were first tuned in a Gazebo simulation, shown in Fig. 4, before implementation on hardware. Cassie was then tested indoors for stepping in place and forward, backward, lateral, and diagonal walking. The velocity tracking data, output tracking, and feed-forward torques are shown in Fig. 6 for forward walking and stepping in place. Additionally, limit cycles of the knee and hip pitch joints are shown in Fig. 7, demonstrating the stability of the walking. Cassie was then taken outside to walk over several hills, raised roots, and a brick path. A video of both the simulation and experiments is provided at [2], with walking tiles of the robot on flat ground and traversing rough terrain is shown in Fig. 8. The controller, simulation, and trajectory optimization also made available in an open-source repository [1].

V. CONCLUSIONS AND FUTURE WORK
The Cassie biped poses a unique challenge due to its compliant leg mechanism and the highly underactuated nature of the dynamics. In order to leverage these components in experiments, we constructed a hybrid model for walking dynamics based on a compliant model. A trajectory optimization was then developed to efficiently generate walking trajectories using the method of HZD and was then tracked through an inverse dynamics controller. The resulting experiments show that the optimization can effectively capture the passive dynamics on a highly complex robot, while providing accurate model-based feedforward information. On the physical system, a trivial double-support domain is virtually impossible to attain due to the compliance present in both legs. While this assumption simplified the development of controllers and trajectory planning, the consideration of a continuous double-support domain can enhance the stability of the behaviors. Future work will focus on reintroducing a nontrivial double-support domain to our walking model. Additionally, the use of an analytical solution to the inverse dynamics cannot account for optimal distributions of contact forces, friction, torque limits, or provide convergence guarantees. Thus, our future controller development is focused on further developing real-time model based controllers for implementation on hardware, such as extending the control Lyapunov function based methods in [23] to walking. Fig. 8. Gait tiles of the robotic walking exhibited experimentally on the Caltech Cassie robot. The top half is two steps of flat-ground forward walking outside, while the bottom half shows several steps of the robot walking over a height variation caused by both a shallow grassy slope and exposed roots.