Skip to content

Physics simulation using MATLAB and Simulink's Simscape Multibody

License

Notifications You must be signed in to change notification settings

NUbots/Simscape

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Simscape

Physics simulation using Simulink's Simscape Multibody.

Acknowledgements

  • Physical modelling performed within this codebase is based on the Simscape simulation by MRL-HSL.

Requirements

  1. MATLAB (tested with r2018A and r2019A)
  2. Simulink
  3. Simscape
  4. Simscape Multibody

Running Simulations

Ensure that the src folder and all subfolders are in MATLAB's search path and all relevant dependencies are installed.

Static Simulation

This simulation will display physically-constrained, static poses of the robot, based on predefined joint positions. To run the static simulation, open the static Simulink Solution and run a script to assign joint positions.

NUgus_static    % Opens the Simulink static simulation
zombie          % Runs the "zombie" script and calls the static simulation

Contact Simulation

This simulation models contact forces and friction to a free-body robot. This simulation is run in a similar way to the static simulation, opening the Simulink Solution and defining joint positions via a script. However, parameters to define the contact physics must be initialised.

init            % Loads contact configuration parameters into the workspace
NUgus_contact   % Opens Simulink contact simulation
stand           % Runs the "stand" script to set robot pose and calls the static simulation
                % To use this loaded pose, run the simulation with CTRL+T

Servo Simulation

This simulation replaces the default Simscape Multibody revolute joints with Dynamixel MX64 and MX106 servo motors. This allows for the real simulation-time modification of the robot pose for each servo.

init            % Loads configuration for the contact forces, as well as initialising motor params
NUgus_servo     % Opens Simulink servo simulation, run the simulation with CTRL+T or run button

The pose for the robot can be modified using the Write to Servos inputs seen in the Simulink solution window.

About

Physics simulation using MATLAB and Simulink's Simscape Multibody

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages