This repository contains a simulation for a flexible spine quadruped robot, designed to model and analyze the dynamics of legged locomotion. The simulation incorporates both rigid and flexible spine models to investigate the effects of body compliance on gait efficiency, stability, and energy consumption.
Simulating a walking quadruped robot involves several critical steps:
- Construct the Body and Legs: Define the robot's physical structure, including the torso and limbs. Understand the frame transformations to derive forward and inverse kinematics for precise foot placement.
- Model Contact Forces: Develop a reliable ground contact force model. This is challenging due to the complexity of real-world interactions and the potential for computational stiffness in simulations.
- Design a Gait Planner: Implement a mechanism to move the robot's feet in a periodic, stable manner.
forward_kinematics.m
: Calculates forward kinematics for each leg (a three-joint manipulator).inverse_kinematics.m
: Computes inverse kinematics.init_flexible_spine_quadruped.m
: Initializes simulation parameters.
flexible_spine_quadruped.slx
: Simulink model for the quadruped simulation.
The development of a Simscape model for a flexible spine quadruped progresses through staged construction and refinement. This simulation provides insights into realistic motion, gait dynamics, and the role of body flexibility in quadrupedal locomotion.
- Represents the torso as a single, non-flexible segment.
- Baseline for performance evaluation.
- Includes a torso divided into two segments, connected by a torsional spring-damper joint.
- Simulates rotational compliance for energy absorption and adaptive motion.
- Double-leg Flight (DF): All legs off the ground.
- Fore-leg Stance (FS): Forelegs in contact with the ground.
- Hind-leg Stance (HS): Hind legs in contact with the ground.
- Double-leg Stance (DS): Both fore and hind legs in contact.
A variety of gaits exist for a four-legged robot. In these gaits, at each time step, one, two, three, or four legs may be on the ground. This study models the system dynamics, considering flight mode and constrained dynamics. The modeling process follows these steps:
- Deriving the Lagrangian and extracting equations of motion.
- Adding constraints based on the number of legs in contact with the ground.
- Modeling ground contact dynamics.
Validation of the derived equations was performed using MATLAB’s SimMechanics toolbox, confirming their accuracy.
The generalized coordinates fully specify the robot’s position during flight mode:
Here, (q_i, i=1,...,10) are relative joint angles, while (q_11, q_12) represent the horizontal and vertical positions of the first leg’s tip.
The Lagrangian is derived as:
Where:
- Kinetic energy:
- Potential energy:
The equations of motion follow:
Adding constraints for grounded legs modifies the equations of motion. For instance, if the first leg is on the ground:
For N legs on the ground, the augmented Jacobian matrix is:
The constrained system is described by:
Ground contact introduces impulse forces, leading to discrete velocity changes. The relationship is given by:
The updated velocities are:
Tracking error is defined as:
The desired error dynamics are:
Substituting into the system dynamics yields the required torque for trajectory tracking:
This formulation ensures asymptotic convergence of the tracking error to zero.
forward_kinematics.m
: Forward kinematics calculations.inverse_kinematics.m
: Inverse kinematics calculations.init_flexible_spine_quadruped.m
: Parameter initialization.flexible_spine_quadruped.slx
: Simulink model.
- Clone the repository.
- Initialize parameters using
init_flexible_spine_quadruped.m
. - Open and run
flexible_spine_quadruped.slx
in Simulink. - Analyze the simulation results to study the dynamics of rigid and flexible body models.
- Incorporate advanced contact models for more accurate simulations.
- Optimize gait planning for energy efficiency.
- Extend to uneven terrain simulation.
This work builds upon established biomechanical and robotic research on quadruped locomotion, emphasizing the role of body flexibility in improving gait stability and efficiency.
This framework combines modeling and control techniques to enable precise trajectory tracking and stable locomotion for quadruped robots. Further exploration may involve optimizing computational efficiency and extending the approach to different gaits and terrains.