# Multi-Modal Locomotion

 Executables (v1): Mac Windows For Developers (v2): MATLAB codes GitHub Project

* Note 1: A license-free MATLAB Runtime will be automatically installed for executables.

* Note 2: After installation, you can launch the program by searching “Walking3LP” in your applications.

* Note 3: For development, you need a MATLAB 2014 or above. # Research Topics

* Note: Click on the GIFs for extended movies.

### Inverse Dynamics

We are interested in using dynamic equations of our robot to control it for different tasks better. Knowing the system model, we can find only enough actuator inputs to perform the task (e.g., keeping balance against gravity) while using minimal closed-loop gains to account for errors. This makes the system compliant, robust and safe. Our inverse dynamics problem is formulated as a quadratic optimization and solved in less than a millisecond with >100 variables. Reference here and here.

### Compliant Balance

Simulating compliant behaviors is easy, but challenging to realize on the real robot. We have developed precise state estimation algorithms and high bandwidth torque controllers to interface our inverse dynamics with the real hardware. This involved identifying a model for the actuators and formulating other optimization problems to fuse the sensory data in the form of a Kalman filter. Reference here.

### Model Predictive Control (MPC)

Inverse dynamics makes the robot compliant and robust against perturbations but is not enough to plan locomotion. However, we can simplify the robot model into a single inverted pendulum that is always falling and find footstep locations that capture the motion and create a walking gait. This can be done by an MPC controller which is formulated as a quadratic optimization and solved in less than a millisecond. The controller brings robustness against sensory noises, delays, model errors and external perturbations to some extent (The right movie, for example, shows a robot with a very heavy left foot). Reference here and here

### 3LP Model, Time- Projection Control, Geometric Conversion

3LP Model: The legs are relatively heavy in our robot which make the single-mass inverted pendulum model too simplistic for faster walking conditions where swing and torso balancing dynamics become important. We developed a similar model called 3LP with three pendulums to account for these effects (shown in dashes below). This model can simulate walking at different frequencies, speeds, double support times, torso angles, step widths and terrain slopes. Reference here.

Time-Projection Control: On top of the 3LP model, we developed a foot-stepping controller very similar to MPC. While taking a step and being pushed at the same time, the robot would adjust the footstep location online to capture the push with a proper stepping. Our MPC could do this but needed a numerical optimization. The time-projecting controller performs the same job using a DLQR controller which is optimal like MPC, but without any optimization. We take the state at each instant and project it back to the beginning of the phase where the DLQR controller (with a sample time equal to step time) suggests footstep adjustments. These adjustments are then used online at each control tick (e.g., millisecond). Reference here.

Geometric Conversion: 3LP trajectories are stabilized with the time-projection controller, but yet in template space, i.e., there are no knee or ankle joints. We have developed a geometric conversion algorithm that takes the 3LP pelvis and feet positions and produces human-like kinematic features. This conversion works for all periodic and non-periodic conditions. Reference in preparation. The following picture shows the above three components all together in a single interactive software. ### Walking and Push Recovery

The 3LP model and time-projecting controllers are validated on the real hardware. The robot can perform walking gaits, recover pushes and comply with external dragging forces very easily. There are plenty of low-level hardware challenges like sensory noise, actuator backlash, actuator speed saturation and communication delays that the framework can overcome. Reference here and here.

### Molecule Inspired Modeling

Posture Planning: Inspired by methods popular in computational chemistry, we can model the robot by Cartesian points instead of joint angles. Each limb is the segment between two points; it has a certain length (holonomic constraint) and dynamic equations. Using nonlinear optimizations, we can find multi-contact optimal static postures in very short time (few milliseconds) and good convergence properties. Reference here.

Motion Planning: A similar formulation can be used for motion planning which helps to simulate the swing dynamics of robot limbs in fast motions. Our formulation currently allows for contact adjustment and variable timing, but for a fixed sequence. Reference in preparation.  ### Reinforcement Learning

Inverse dynamics implements virtual compliance and brings robustness in case of perturbations. We used a reinforcement learning algorithm to optimize a foot-stepping controller in this work. We were able to achieve fast locomotion on rough-terrains and slopes with a realistic monopod hopper that had considerable swing dynamics. Reference here.

### Singularity

Planning and control are not trivial in the joint space. Instead of thinking about individual joint angles, we prefer to think about the center of mass or feet positions, and that’s why we use template models such as inverted pendulum or 3LP. However, when converting the Cartesian positions into joint-angles via inverse kinematics or task-space inverse dynamics, we might face infeasible conditions. A nonlinear optimization can realize hard constraints like balance (e.g., keeping the center of mass in the middle of the support polygon) or joint limits while finding the closest solutions possible. The following robot, for example, is commanded a very high center of mass position which can’t be reached. The robot goes to singular postures (stretched knees) without any numerical difficulty. Reference here.   ### Force Estimation

Dynamic equations can help identifying external forces. We can take all the sensory data from the robot (joint angles, velocities, torques and contact forces), put them in the equation of motion and find a residual which possibly corresponds to an external force. We have developed closed-form equations that estimate the magnitude and the application point of such a force during robot motion in ideal simulation environments. Reference here.   