Contact Dynamics, Hybrid Systems, and Locomotion in Robotics

Jul 16, 2024

Contact Dynamics, Hybrid Systems, and Locomotion in Robotics

Recap of Previous Lectures

  • Previous Topics: LQR with quaternions for quadrotors
    • Applied in convex MPC, drag&drop, and other tasks.
    • Mentioned no Euler angles in drone projects.
  • Upcoming Topics: Contact dynamics, hybrid systems, legged robots, and locomotion.
    • Applications in various engineering fields including aerospace and chemical engineering.

Introduction to Contact Dynamics

Key Examples

  • Bouncing Ball
    • In Air: Smooth dynamics, governed by classic ODEs.
    • On Impact: Discontinuous dynamics, jump discontinuities in velocity.
  • Concepts
    • Jump Discontinuities: Velocity has a discontinuous change upon impact.
    • Non-Smooth Dynamics: Cannot be described purely by traditional ODEs due to discontinuities at the points of impact.

Solutions for Modeling Contact Dynamics

  • Event-Based (Hybrid) Formulation

    • Smooth ODEs in between contacts with guard functions to detect impacts.
    • Guard Function: Condition to detect contact events.
    • Jump Map: Specifies state changes at the moment of contact.
    • Pros and Cons: Common in legged locomotion, easy to integrate, but requires pre-specified mode sequence.
  • Time-Stepping (Contact Implicit) Methods

    • Converts dynamics and contact conditions into constraint optimization problems.
    • Solves for contact forces jointly with states.
    • Contact Forces as Inequality Constraints
    • Pros and Cons: No need for pre-specified mode sequence but results in harder optimization problems.

Dynamics Inside Hybrid Systems

Mathematical Formulation

  • Smooth Vector Field (Continuous Dynamics)
  • Guard Function: Detects contact (e.g., ball hitting the floor).
  • Jump Map: Specifies changes in states (e.g., zeroing out vertical velocity).
  • Integration: High-order integrators possible (e.g., RK4).
  • Example: Bouncing ball with inelastic and elastic collisions.

Implementing Hybrid Dynamics

  • Pseudo-Code Workflow
    • Integrate using a high-order method (e.g., RK4).
    • Evaluate guard function to detect impact events.
    • Apply Jump Map on state when guard condition is met.
    • Continue integration.

Simulation Example

  • Falling Brick Simulation
    • Illustrates inelastic and elastic behaviors.
    • Showcased through a bouncing ball which either goes plop or bounces.

Hybrid Trajectory Optimization for Legged Robots

Simple Example: One-Legged Hopper

  • Model: Two-point mass system (body and foot) with prismatic joint.
  • State & Control Variables
    • State: Position and velocity of both masses.
    • Controls: Force and torque between body and foot.

Dynamics and Constraints

  • Flexible and Fixed Time Formulations
    • Mode Sequences: Alternating groups of stance and flight phases.
    • Continuous Dynamics: Different dynamics for stance and flight.
    • Jump Maps: Apply changes in state at contact transitions (e.g., zeroing the foot velocity on ground contact).

Implementing Trajectory Optimization

  • Cost Function: Quadratic costs for state and control.
  • Initial Guess: Helps with solver convergence, plausible but not necessarily physically accurate.
  • Constraints: Includes contact constraints (e.g., feet must not penetrate ground).
    • Example: Foot’s Z-coordinate in contact modes should be zero.

Simulation Results

  • Visualized hopping motion for one-legged Hopper.
  • Shows stance, flight, and transitions between modes.
  • Demonstrated on a simplified one-legged robot but can be extended to complex systems like bipeds and quadrupeds.

Practical Challenges and Q/A

  • Issue with Unplanned Contacts: Killer for robots; leads to unwanted behaviors.
  • Initial Guess Importance: Critical for solver performance; wrong guesses lead to poor solutions.
  • Adaptation in Hardware: Real-time control and disturbance rejection are significantly harder than offline trajectory planning.
  • Deviation from Constraints: Solver might fail if initial or boundary conditions are too inconsistent.

Conclusion

  • Hybrid system modeling and optimization is a powerful method in robotics.
  • Application expands beyond robotics into control and physics-based optimization in various fields.
  • The practical implementation requires careful consideration of dynamics, initial guesses, and solver techniques.