SimMechanics    

How SimMechanics Works

You might find a brief overview of how SimMechanics works helpful for understanding and fixing errors, a topic discussed in the next section, Troubleshooting Simulation Errors.

There are four major steps of machine simulation. The first two occur before SimMechanics actually starts machine motion.

Model Validation

SimMechanics first checks your data entries from the dialogs and the local connections among neighboring blocks. It then validates the Body coordinate systems; the joint, constraint, and driver geometries; and the model topology.

Machine Initialization

The assembly tolerances of Joints that you manually assembled are checked next.

SimMechanics then cuts each closed loop once. An invisible internal constraint replaces each cut Joint, Constraint, or Driver block. SimMechanics checks all constraints and drivers for mutual consistency and eliminates redundant constraints.

Any Joint Initial Condition Actuators now impose initial positions and velocities, changing body geometries from their dialog box configurations as necessary. SimMechanics then finds an assembly solution for disassembled joints and initializes them in position and velocity. Assembly tolerances are checked again.

A "sticky" joint primitive, actuated by a Joint Stiction Actuator, can be in one of three stiction modes: locked, waiting, or unlocked. SimMechanics finds a mutually consistent set of stiction modes for all sticky joints.

Force Analysis and Motion Integration

In the Forward Dynamics or Trimming analysis modes, SimMechanics now begins the solution of machine motion by applying and integrating external forces and torques, stepping in simulation time. It maintains assembly, constraint, and solver tolerances and checks constraint and driver consistency. It also detects whether, within one Joint block, distinct joint primitive axes align and destroy an independent DoF (joint axis singularity).

In the Inverse Dynamics and Kinematics modes, SimMechanics now applies motion actuators and drivers to find the machine motion and derive forces and torques. It also checks tolerances and consistency and detects singular alignment of joint primitives.

Stiction Mode Iteration

If stiction is present, SimMechanics checks at each time step whether the sticky joints transition from one stiction mode to another, then checks for mutual consistency of locked and unlocked sticky joint primitives across the whole machine.


  Linearizing SimMechanics Models Troubleshooting Simulation Errors