Impedance Matching: Enabling an RL-Based Running Jump in a Quadruped Robot
Neil Guan Shangqun Yu Shifan Zhu Donghyun Kim






Impedance Matching: Enabling an RL-Based Running Jump in a Quadruped Robot
    Neil Guan^1, Shangqun Yu^1, Shifan Zhu^1, and Donghyun Kim^1
^1 University of Massachusetts Amherst, 140 Governors Dr, U.S. donghyunkim@cs.umass.edu

    Received / accepted 
=========================================================================================================================================================

empty
empty





























Replicating the remarkable athleticism seen in animals has long been a challenge in robotics control. Although Reinforcement Learning (RL) has demonstrated significant progress in dynamic legged locomotion control, the substantial sim-to-real gap often hinders the real-world demonstration of truly dynamic movements. We propose a new framework to mitigate this gap through frequency-domain analysis-based impedance matching between simulated and real robots. Our framework offers a structured guideline for parameter selection and the range for dynamics randomization in simulation, thus facilitating a safe sim-to-real transfer. The learned policy using our framework enabled jumps across distances of 55 and heights of 38. The results are, to the best of our knowledge, one of the highest and longest running jumps demonstrated by an RL-based control policy in a real quadruped robot. Note that the achieved jumping height is approximately 85% of that obtained from a state-of-the-art trajectory optimization method, which can be seen as the physical limit for the given robot hardware. In addition, our control policy accomplished stable walking at speeds up to 2 in the forward and backward directions, and 1 in the sideway direction.







§ INTRODUCTION

Unlike wheeled systems, legged robots can navigate irregular terrains by leveraging their multiple limbs. This ability allows them to overcome substantial obstacles and wide gaps by running and leaping across diverse terrains. Numerous studies have sought to enhance the dynamic locomotion of legged robots, with notable demonstrations including high-speed running and hurdling <cit.>, and performing backflips <cit.>. Unofficially, Boston Dynamics' Atlas robot has shown impressive acrobatic movements across various terrains <cit.>. Despite these advancements, a common limitation is that the controllers and planners are painstakingly calibrated for specific motions or gaits. Furthermore, model-based methods necessitate model simplification <cit.>, limiting their ability to exploit the full dynamics of the robot.

Reinforcement Learning (RL) emerged as a promising approach for dynamic motion control in legged robots. By effectively exploring the state and action spaces using simulations that encompass full-body dynamics, RL addresses issues tied to limited versatility and model simplification. Advances in RL have led to the development of robust policies capable of navigating challenging terrains in the real world <cit.>. Furthermore, a burgeoning interest in honing more advanced skills in bipedal and quadrupedal robots <cit.> is opening a new era of RL-based control in legged robotics.

However, there is one fundamental challenge with RL-based dynamic motion control, the so-called sim-to-real issue, and it hampers the deployment of simulation-trained policies in the real world. To address this problem, notable efforts have been made, including dynamics randomization <cit.>, meta learning <cit.>, and domain adaptation <cit.>. Among these, domain randomization is a frequently used method, but it often lacks a formal guideline for selecting both the randomization variables and the range, even though poorly implemented domain randomization can impair policy effectiveness <cit.>. 







Indeed, we can substantially reduce the gap between simulation and reality by synchronizing the robot's output in both realms, given identical command inputs. For instance, if the errors in joint position from the desired joint positions are consistent between the simulated and real robot, the discrepancy in overall locomotion behaviors should be minimal. Time domain system identification was briefly mentioned by <cit.> to align the actuation parameters between simulation and reality. Some research has also addressed this issue by modeling actuators <cit.> or learning actuator dynamics <cit.>, but they overlook physics engine implementation details and neglect modeling outside the actuators, such as belt and link contact friction, which can cause an increase in error magnitude when the commanded motion is rapid. 

This insight forms the foundation of our method: sim-to-real synchronization based on frequency-domain analysis. Instead of naively copying the feedback gains used in the real robot, we conduct a frequency sweep in both real and simulated robots and select appropriate actuator parameters for simulation by matching their bode plots. We refer to our framework as `impedance matching.' While we recognize that our use of impedance – referring here to joint stiffness and damping – diverges from its technical definition in <cit.>, we believe it effectively encapsulates our method's essence. Our framework offers two critical advantages: 1) It allows us to set up a simulation environment that mirrors a robot performing highly dynamic movements, as the frequency sweep can easily cover beyond 20, wide enough to encompass various motions involved in running and jumping, and 2) it enables us to reduce the randomization range based on experimental data, as we can approximate the true value and variance from multiple, real-world, hardware frequency analysis experiments.

In our RL training, we implemented function preserving transformations, typically utilized in supervised learning <cit.>, to maintain normal walking behavior while learning to jump in a curriculum learning setup <cit.>. Our method centers on developing a jumping behavior derived from an earlier-trained walking behavior. Unlike some research exploring simultaneous learning of multiple behaviors <cit.> or training an individual policy for each behavior <cit.>, we showed that a jumping behavior can be learned with only minor adjustments to a walking policy.


Our key contributions include: 1) The first introduction of frequency-domain analysis in RL, termed `impedance matching', to reduce the sim-to-real gap; 2) A versatile control policy enabling smooth transitions between dynamic movements such as walking, running, and jumping; 3) The successful real-world deployment of the policy on Mini-Cheetah-Vision, evaluated extensively in dynamic locomotion involving high and long jumping tasks.





§ RELATED WORKS

While there is an abundance of research enabling impressive acrobatic behaviors of robots in simulations <cit.>, actual demonstrations of jumping with real quadruped robots are relatively rare. Notably, <cit.> showcased an impressive running jump; however, it relied on a planar model for real-time trajectory optimization, limiting its applicability for 3D omnidirectional running jumps. Works such as <cit.> successfully pushed the Mini-Cheetah robot's physical capabilities by combining centroidal dynamics with variational-based optimal control. Yet, the method's offline optimization requirement constrains its capacity for real-time, spontaneous behavior. 

<cit.> used Depth-based Impulse Control to facilitate the RL-based running jumps over gaps, but at the cost of omnidirectional capabilities. Similarly, <cit.> managed to train generalist RL policies across multiple environments, but these policies lacked essential motor skills like walking backward, relying exclusively on forward movement and turning for navigation. Several other studies employed an imitation learning component in their RL approaches, where the policy learns by mimicking a reference motion <cit.>. However, the need for reference trajectories limits the scalability of the methods to address various situations including unseen environment. In contrast, our approach leverages an unique reward design in lieu of imitation learning. This strategy enables us to apply a simulation-trained policy directly in real world without the need for additional motion retargeting <cit.> or manual creation of reference trajectories <cit.>.

Recently, <cit.> proposed using policy distillation to combine walking, slope climbing, and jumping policies into a single generalist neural network, but they did not demonstrate on-the-fly policy transitions. For example, their policy could not transition from slope climbing to jumping without coming to a standstill. Our implementation, however, can easily transition between different behaviors, thereby allowing our robot to modulate its speed freely before executing a jump. Unlike previous studies, our policy supports omnidirectional walking and running jumps without requiring a reference motion.









§ SIM-TO-REAL SYNCHRONIZATION BASED ON FREQUENCY-DOMAIN ANALYSIS



To streamline our analysis, we formulate two assumptions. The first one is that the joint dynamics can be closely approximated by a second-order spring-damper system, represented by

    Iθ̈ + bθ̇ = τ( = K_p (θ_ des - θ) + K_d (θ̇_ des - θ̇) ), 
       Iθ̈ + (K_d + b)θ̇  + K_p θ = K_p θ_ des + K_d θ̇_ des,

where I and b refer to the actuator's inertia and viscous friction, respectively, while K_p and K_d denote the proportional (P) and derivative (D) feedback gains. The second assumption is that the inertia between the actual and simulated robot should be roughly equivalent. 
To maintain the veracity of this assumption, we disassembled the robot and measured the mass and center of mass (CoM) for each link element by element, and our inertia values were determined via CAD models. We also assume that non-viscous and state-dependent friction terms such as static/kinetic/Coulomb friction and load/temperature effects are negligible for high-speed locomotion.



Fig. <ref> (a) illustrates our experimental setup. We conduct frequency response experiments on each joint individually using a chirp signal, sweeping the joint position command from 0.1 to 25 with an amplitude of 0.25. The frequency range was determined based on the Nyquist frequency, which corresponds to the simulation data's sampling frequency of 50, set by our RL policy update frequency. The chosen amplitude is large enough to yield significant measurements given the motor encoder's resolution while remaining small enough to avoid physical damage from resonance or exceeding the motor's maximum torque. Before performing a sine sweep, we secured the robot's body to a stable platform, employing Proportional-Derivative (PD) feedback control to hold all joint positions at static posture except the joint under examination. When testing knee joints, we secured the thigh link, as depicted in Fig. <ref>(a), to avoid the coupled behavior of hip and knee flexion/extension joints. This frequency sweep procedure was reiterated for all joints. We executed the parallel frequency sweep experiment in simulation, as depicted in Fig.<ref>(c), testing various feedback gains for each actuator across a 50 × 50 grid. The values for the proportional gain, K_p, ranged from 15 - 30, while the derivative gains spanned a range of 0.1 - 0.7.

We employed MATLAB to estimate the transfer function and convert the measured and commanded joint positions in the simulation and real robots into Bode plots. The phase plot was disregarded for two reasons: 1) the time delay, a significant determinant of the phase plot, behaves differently in simulations than in physical systems and measuring exact delay is also difficult, and 2) the remaining information in the signal (bandwidth and overshoot) presented in the magnitude plot provide sufficient information to identify the system characteristics of interest. We identified the appropriate gains for use in the simulation by finding the gain pair that yielded the smallest mean-squared error between the Bode plots of the real and simulated systems over the frequencies near the natural frequency. This error computation in proximity to peak magnitude helps identify matches with similar bandwidth and overshoot. Thus, we employed data ranging from 0.1 - 15 for the knee joints and 1 - 10 for the hip abduction and flexion joints to find the best match. 



Our choice of feedback gains (17/0.4 for K_p/K_d) was an reimplementation of <cit.>. In theory, the selection can be arbitrary to an extent, as changing the feedback gains will only change the joint target position output from the policy for any given torque output, which is learnt via reinforcement learning. We found success in choosing the same gains to get the policy to converge, albeit perhaps choosing a set of critically damped gains would be more stable. 

Upon repeating the search across all twelve joints, we successfully established experimental gain pairs, as delineated in Table <ref>. We noted a substantial disparity between the feedback gains used in the robot hardware (17/0.4 for K_p/K_d) and those found in the simulated robots that exhibit similar impedance behavior to the physical system. As per Table <ref>, we set the feedback gains to be used during simulation training: 20, 17.5, 21.5 for K_p, and 0.45, 0.4, 0.55 for K_d, corresponding to the hip abduction/adduction, hip flexion/extension, and knee flexion/extension joints, respectively. Domain randomization can address changes in a robot's physical properties due to manufacturing tolerances, calibration or wear-and-tear <cit.>, so we roughly utilized the empherically determined gain variances in our experiments to roughly obtain the smallest domain randomization ranges encompassing our experimental data. We executed domain randomization in simulated robots by adding values sampled from 𝐔^12(-2.0,2.0) and 𝐔^12(-0.05,0.05).



We demonstrate through impedance matching that high-frequency sim-to-real transfer with robots with geared actuators is very difficult without addressing rotor inertia, which is often not mentioned in various RL locomotion papers. Isaac Gym enables rotor inertia to be approximately simulated via its rigid body armature paramater, which is a constant array added to the diagonals of the mass matrix of the robot, a critical element in fitting Bode plots from simulation to empirical measurements. Assuming rotor inertia is zero, the best-fit simulation parameters do not match real life dynamics, as shown in Fig. <ref>, as our grid-search across a wide range of gains yield no match to real life. The rotor inertia markedly influences the best fitted gains; thus, careful selection is crucial. We used 0.000072  × 9.33^2 (≃ 0.0063) for the reflected rotor inertia of knee joints and 0.000072  × 6^2 (≃ 0.0026) for the other joints. 

Note that we incorporated detailed actuator models  <cit.> into Isaac Gym, which include aspects such as rotor inertia, the back-emf effect, dry friction, and bus (battery) voltage limits, which were experimentally measured using a custom dynamometer. These additions allow us to accurately simulate actuator behavior, particularly at the edge of its operational conditions. 



    



§ TRAINING FRAMEWORK TO LEARN WALKING, RUNNING, AND JUMPING




In order to acquire multiple skills for a single RL agent, we adopted the idea of Net2Net <cit.> for multi-task RL. In particular, we use a modified Net2WiderNet implementation performed on the command inputs of a network. This is done by adding a blank neuron by adding a row of zeros to the input layer weight matrix. This blank neuron can be trained to signal the transition into and out of the new behavior, trained with conditional rewards.  To signal a jump, the blank neuron begins at 0 to walk, transitioning to 1 in the jumping state, and returning to 0 to land. We intend to train an agent to freely transition between walking and jumping states. We train in multiple phases. During Phase 1, we train the agent how to walk. During Phase 2, we add a jump command input neuron to the model's input layer and train both walking and jumping in a 50/50 split to avoid catastrophic forgetting of walking. Notably, the jump can be controlled using velocity commands just as walking could. To our knowledge, this is the first time Net2Net has been used for locomotion.

Our reward terms take inspiration from <cit.>. Additional rewards introduced starting in Phase 2 are shown in Table <ref>. Of note is the dense jump reward, which shapes the jumping behavior. This simplistic jump reward can notably train a jump without requiring a reference motion. The sparse jump is intended to further shape the jump to be large enough to cross gaps. Phase 2 is split into subphases 2a and 2b. The dense jump reward encourages jumping motions, but should be lowered after the robot is capable of jumping. The sparse jump reward encourages consistent jumps based off the desired liftoff velocity, which we set at 2.5. 



































In multi-task RL, it is often challenging for a single policy to acquire all the required skills due to the presence of opposite gradient directions. In our case, we note that training both walking and jumping simultaneously from scratch does not converge to distinct behaviors, whereas if we train them sequentially, we obtain distinct behaviors, leading us to believe that the gradients corresponding to one task opposes the gradients corresponding to the other. Similarly, <cit.> noted that agents trained on a variety of different environments without segmenting into various states will fail to learn basic motor skills such as walking backwards, relying entirely on walking forwards and turning to navigate, further suggesting that exploration is a challenging issue in RL. Segmenting different behaviors into different states not only grants the freedom to engineer different behaviors individually, but also grants interpretability in allowing a higher level policy to choose which behaviors are best. 
















 §.§ System setup:
 We use the MIT Mini Cheetah Vision as our experimental platform. The robot stands 30 tall and weighs 12. The robot features 12 custom-designed proprioceptive actuators, each with a maximum output torque of 17. Our model has a slightly longer body length compared to the original MIT Mini Cheetah <cit.>. Our robot utilizes a minimal sensing suite, allowing our framework to be generalizable to many robots, including relatively inexpensive ones. We utilize data from the robot’s accelerometer, gyroscope and joint encoders for the robot’s walking/running and jumping capabilities. We use Isaac Gym <cit.> to train the quadrupedal robot and adapted the code from <cit.> for the sim-to-real deployment. 



 §.§ Estimator network:
 We follow <cit.> in our estimator network implementation on the mini cheetah. Our estimator network takes in the base angular velocity, the projected gravity, the joint position history, the joint velocity history, the action history and the jumping mode. The joint position histories are sampled at t, t-0.02, and t-0.04, and the action history is sampled at t-0.02 and t-0.04. The estimator network predicts foot contact probability and the estimated linear velocity of the robot and is trained via supervised learning. The estimator network is implemented with a [256 × 128] structure.



 §.§ Control Policy:
 The control policy is trained with PPO <cit.>, with both actor and critic networks having a [1024 × 512 × 256] structure. The observation space consists of the estimated velocity, the foot contact probabilities, the base angular velocity, the projected gravity, the x, y, yaw velocity commands, the jump command, the joint position, the joint velocity, and the previous actions. The sensing and inference update loop runs at 50, while the actuator-level PD controller runs at 40. The action is a set of target joint position vectors that will be assigned to the PD controller. We sampled x velocity commands from 𝐔^1(-3.0, 3.0), y velocity commands from 𝐔^1(-1.0, 1.0), and yaw angular velocity commands from 𝐔^1(-2.0, 2.0). Jump commands are randomly sampled between 0 and 1.  



 §.§ Domain Randomization:
 Domain randomization is employed to prevent overfitting to the simulation dynamics. Decimation is randomized to 𝐔^1(-2,2) to mitigate the effect of variable system delay on the real robot. Ground friction is randomized to 𝐔^1(0.05,3.0). We randomize stiffness and damping by adding a value sampled from 𝐔^12(-2.0,2.0) and 𝐔^12(-0.05,0.05) to our commanded stiffness and damping, respectively, based off our impedance analysis. Shank length is randomized from 𝐔^4(0.18,0.20) to help mitigate the effects of foot deformation. Base mass is randomized from 𝐔^1(-0.4,1.6). 

We additionally simulate noise. Joint position noise is sampled from 𝐔^12(-0.05,0.05) to account for poor encoder measurements and deviations in the zero position of the motor. Joint velocity noise is sampled from 𝐔^12(-0.5,0.5). Angular velocity noise is sampled from 𝐔^3(-0.2,0.2). Projected gravity noise is sampled from 𝐔^3(-0.05,0.05)






§ EXPERIMENTAL RESULTS









Previous work largely focused on forward-running jumps. We investigate if a sideways running jump can cover larger gaps than a forward running jump. To prepare a consistent way to test each jump, we start the robot from a standstill and write a short script to accelerate to a specified velocity, jump for a specified time interval, and decelerate to a stop for a total of five jumps for each velocity. We perform this experiment with two trials, one trained with our experimentally determined gains, and another trained with the naive policy, which is trained with the naive gains. Table <ref> lists the mean and standard deviation jump height and distance of the robot at various speeds for both trials. A stable sim-to-real transfer is a consistant sim-to-real transfer, and a low variance in jump height and distance indicate a better sim-to-real transfer.



The data is obtained via a motion capture rig. We measure the difference between the minimum and maximum height of the tracker when the robot jumps to approximate the jump height, and we find the distance by taking the difference between the robot's X-Y position during the inflection points of the jump. Although the naive method sometimes matches or even exceeds the distance with the matched impedance method, the average jump distance standard deviation is 230% that of the matched impedance policy. Similarly, the jump height average standard deviation is 148% that of the matched impedance policy, further indicating inconsistent behavior in the naively trained policy. Fig <ref> illustrates an unstable but long sideways jump from the naive policy, which in our experience, was much more present in the naive policy. We attribute the inconsistancy and instability to the poorer sim-to-real transfer in the naive method. 




<cit.> provides a highly optimized upper bound on the jump height of the Mini-Cheetah, achieving jumps onto 34 platforms, roughly corresponding to approximately 45 jump heights. Treating their work as the robot's physical limit, we were able to achieve 85% of this height consistently while performing backwards running jumps. 



Motion tracking can tell us the distance of the jump, but it does not tell us the maximum gap the jump can cover. We place tape markers on the ground every 20 cm denoting the robot’s distance jumped and go frame-by-frame on the video to determine where the robot entered and exited its airborne phase to roughly estimate the maximum gap each jump can cover. In all trials, the maximum gap the robot can cross is 55 going forwards at 2, 50 going backwards at 2, and 40 going sideways. 

We record the roll and pitch velocity readings during the acceleration phase for both the naive and impedance matched policy, as shown in Fig <ref>. 





§ LIMITATIONS





Our method assumes good inertia estimations, which were determined using CAD models and difficult to verify. It is clear that the same actuators performing similar roles have vastly different experimentally determined gains. Although factors such as the simulation implementation, belt friction and link contact friction may account for some of these differences, it is unclear how much these differences are from inaccurate inertia estimations, and as such, applied loads on the robot may cause an imperfect sim-to-real transfer. Alternative approahes <cit.> can be to assume uniform mass distribution for each link, or perform domain randomization on inertia estimations, but even in those contexts, they still depend on an initial inertia estimation, which are often not verified experimentally. Future work can involve utilizing calibrated mass property measurement systems for empherical inertia verification.


Another limitation is that training with a focus on random state transitions leads policies to learn conservative behaviors that can be transitioned in at any given time. For instance, at higher forward speeds, a strange bounding-type gait emerges, and additional reward functions are sometimes necessary to prevent this type of policy convergance.

Lastly, another limitation of our method is that unlike methods described in <cit.>, our method never optimized for distance directly for our jumping policy, instead relying on maintaining a constant jumping liftoff velocity, which corresponds to a constant jumping height and a controllable velocity to control the distance of each jump. Although our method is competitive in jumping distance, there is still potential to further increase jumping distance via clever reward design by modulating the robot's orientation and leg placement while jumping.





§ CONCLUSION



We develop a new learning framework to enable highly dynamic maneuvering of a quadrupedal robot including stable walking, rapid running, and high/long jumping via RL. RL is a promising approach for training such controllers, but deploying the learned control policy in real life is notoriously difficult due to the gap between simulation and real life. We propose a method to minimize the sim-to-real gap through frequency-domain analysis with little physical risk to the robot. We provide a jumping controller enabling running omnidirectional jumps, trained with a novel, model-agnostic method. We show that our method enables jumps of a distance of 96 for the robot's center of mass which corresponds to a 55 gap and heights of 38, which is competitive with state-of-the-art performance in quadrupedal robot jumping in real-world tests in distance and height. 




§ ACKNOWLEDGMENT

We express our gratitude to Naver Labs and MIT Biomimetic Robotics Lab for providing the Mini-cheetah robot as a research platform for conducting dynamic motion studies on legged robots.


./IEEEtran 


