A 4-link planar snake robot simulation in Simscape Multibody, controlled using a PD controller for lateral undulation locomotion.
This project demonstrates:
- Multi-body dynamics modeling in Simscape Multibody
- Control for underactuated systems
- Contact dynamics and friction modeling for snake locomotion
- CAD integration with Simulink
- 4-link serial chain with 3 actuated revolute joints
- Planar motion constraint (X-Y plane)
- Ground contact forces with stick-slip friction model
- PD controller for coordinated joint actuation
- Real-time visualization in Mechanics Explorer
- MATLAB R2024a or later (adjust based on your version)
- Simscape Multibody toolbox
- Simulink
- Clone this repository:
git clone https://github.com/YOUR_USERNAME/snake-robot-control.git cd snake-robot-control - Open MATLAB and navigate to the project directory.
- Run the model (for example, open the Simulink model file and press Run).
Physical System Links: 4 identical segments (mass: 0.042 kg each) Joints: 3 revolute joints (Z-axis rotation) Base: Planar joint (X-Y translation + Z rotation) Ground contact: Spatial contact forces on each link
Input: Joint angles and velocities (θ₁, θ₂, θ₃, ω₁, ω₂, ω₃) Output: Joint torques (τ₁, τ₂, τ₃)
% Link properties
link_mass = 0.042; % kg
link_length = 0.072; % m (2 × 0.036)
% Contact parameters
friction_static = 1.2;
friction_dynamic = 0.8;
stiffness = 1e6; % N/m
damping = 1e3; % N/(m/s)
% Control parameters
amplitude = 0.5; % rad
frequency = 1.0; % Hz
phase_shift = pi/3; % radThe snake robot successfully exhibits:
- Lateral undulation gait
- Forward locomotion on flat terrain
- Stable planar motion (no out-of-plane deviation)
- Smooth joint trajectories
This project was developed to demonstrate:
Multi-body system modelling capabilities in Simscape Multibody Advanced control theory implementation CAD integration with simulation tools
The link geometry (TEST_SNAKE_BRACKET) is from: CAD file
This project is licensed under the MIT License - see the LICENSE file for details.
Maria Luisa Scarpa PhD in Control Theory (Dynamical Systems, Optimal Control, Game Theory) Background: Aeronautical Engineering LinkedIn: My profile Email: [scarpa.mari@gmail.com/ mls18@ic.ac.uk]
CAD model from CAD file Simscape Multibody documentation and examples