SimMechanics    

Creating SimMechanics Models

To become comfortable building mechanical models, you might find it helpful to work through the guided examples in subsequent sections of how to configure and put together elements of SimMechanics to simulate simple machines. This section gives you an overview of the model-building process before you start:

The most important special terms used in this guide are summarized at the end of this chapter in Summary of Technical Vocabulary. In the online tutorials, special terms occurring in the text (such as coordinate system and reference frame) are linked to definitions in the Glossary.

Essential Steps to Build a Model

You use the same basic procedure for building a SimMechanics model regardless of its complexity. The steps are similar to those for building a regular Simulink model. More complex models add steps without changing these basics:

  1. Select Ground, Body, and Joint blocks. From the Bodies and Joints libraries, drag and drop the Body and Joint blocks needed to represent your machine, including at least one Ground block, into a Simulink model window.
  1. Position and connect blocks. Place Joint and Body blocks in proper relative position in the model window and connect them in the proper order. The essential result of this step is creation of a valid tree block diagram made of
  1.     Ground -- Joint -- Body -- Joint -- Body -- ... -- Body

    with an open or closed topology and where at least one of the bodies is a Ground block.

    A Body can have more than two Joints attached, marking a branching of the sequence. But Joints must be attached to two and only two Bodies.

  1. Configure Body blocks. Click the Body blocks to open their dialog boxes; specify their mass properties (masses and moments of inertia), then position and orient the Bodies and Grounds relative to the World coordinate system (CS) or to other CSs. You set up Body CSs here.
  2. Configure Joint blocks. Click each of the Joint blocks to open its dialog box and set translation and rotation axes and spherical pivot points.
  3. Select, connect, and configure Constraint and Driver blocks. From the Constraints & Drivers library, drag, drop, and connect Constraint and Driver blocks in between pairs of Body blocks. Open and configure each Constraint/Driver's dialog box to restrict or drive the relative motion between the two respective bodies of each constrained/driven pair.
  4. Select, connect, and configure Actuator and Sensor blocks. From the Sensors & Actuators library, drag and drop the Actuator and Sensor blocks that you need to impart and sense motion. Reconfigure Body, Joint, and Constraint/Driver blocks to accept Sensor and Actuator connections. Connect Sensor and Actuator blocks. Specify control signals (applied forces/torques or motions) through Actuators and measure motions through Sensors.
  1. Actuator and Sensor blocks connect SimMechanics blocks to non-SimMechanics Simulink blocks. You cannot connect SimMechanics blocks to regular Simulink blocks otherwise. Actuator blocks take inport signals from normal Simulink blocks (for example, from the Simulink Sources library) to actuate motion. Sensor block output ports generate Simulink signals that you can feed to normal Simulink blocks (for example, from the Simulink Sinks library).

    In the most straightforward model of a machine, you apply forces/torques and initial conditions, then start the simulation in the Forward Dynamics mode to obtain the resulting motions. In the Kinematics and Inverse Dynamics modes, you apply motions to all independent degrees of freedom. With these modes, you can find the forces/torques needed to produce these imposed motions.

  1. Encapsulate subsystems. Systems made from SimMechanics blocks can function as subsystems of larger models, like subsystems in normal Simulink models. You can connect an entire SimMechanics model as a subsystem to a larger model by using the Connection Port block in the Utilities library.

  Introducing the SimMechanics Block Libraries Essential Steps to Configure and Run a Model