Checking Model Validity

Essential Tests for Model Validity

Simulink® can simulate a SimMechanics™ model only if it is valid. A model is valid if it satisfies the following rules:

Verifying Machine Topology

To avoid simulation failures, you must ensure that the topology of your block diagram is valid. A block diagram is topologically valid if each machine that it contains is valid. A machine is valid if its spanning tree is valid. Thus to determine if your model is valid, first determine the spanning tree of each machine that it contains and then the validity of each resulting tree.

Machine Topology and Subsystems

When examining your model's topology, be sure to inspect all its subsystems, including masked subsystems, down to the bottom of the model's subsystem hierarchy.

Determining a Machine's Spanning Tree

To determine the spanning tree of a machine, remove all blocks from the machine except Body and Joint blocks and open every closed loop in the resulting reduced machine. To open a closed loop, follow the loop-cutting rules in Cutting Closed Loops.

For example, here is a machine with two closed loops.

Cutting the top loop at the Disassembled Prismatic and removing the Parallel Constraint block (thus simultaneously cutting the bottom loop) yields the machine's spanning tree, as shown here.

Determining the Validity of a Spanning Tree

To be valid, a spanning tree must meet these requirements:

Examples of Invalid Machine Topologies

Here are some examples of invalid topologies:

The last two invalid examples are dynamically (but not topologically) equivalent, because a zero-mass body is dynamically no body at all.

Counting Degrees of Freedom

Identifying and counting the independent degrees of freedom (DoFs) of a machine are important for trimming and linearizing SimMechanics models (see Trimming Mechanical Models and Linearizing Mechanical Models in theAnalyzing Motion chapter) and for correcting simulation errors (see Troubleshooting Simulation Errors in the Running Mechanical Models chapter).

Your SimMechanics model must have at least one DoF to be valid. A free physical body has six DoFs: three translational and three rotational. But in a machine, connections between bodies by joints, constraints, and drivers, and motion actuation by joint and body actuators reduce the machine's independent DoFs to a smaller number. You also reduce a body's DoFs if you confine the machine's motion to one or two spatial dimensions.

A SimMechanics Body block has no DoFs. Connecting Joints to a Body adds DoFs to the machine. The joint primitives represent the Body's DoFs relative to other connected Bodies or Grounds. Connecting Constraint and Driver blocks to Bodies or motion-actuating joint primitives in Joints removes DoFs from the machine. A locked Joint Stiction Actuator also removes a DoF.

Degrees of Freedom in Subsystems

When you examine your model to identify and count its DoFs, be sure to open and inspect all its subsystems, including masked subsystems, to the bottom of the model's subsystem hierarchy.

Finding Independent Degrees of Freedom

Here is the formula for determining the number of independent DoFs your model has:

# of independent DoFs = # of body DoFs + # of primitive DoFs -
                                         # of motion restrictions

The following three steps define each term on the right side:

  1. Calculate the number of body DoFs from the number of Body and Joint blocks in your model:

    # of body DoFs = 6 * (number of Bodies - number of Joints)

    If you have confined the machine to move in only two dimensions, replace the 6 by 3. If you have confined the machine to move in only one dimension, replace the 6 by 1.

  2. Calculate the number of primitive DoFs by adding up the primitive DoFs from the Joint dialog boxes:

    Do not count a primitive DoF that is motion-actuated by a Joint Actuator.

  3. Calculate the number of motion restrictions by adding up the motion restrictions of each Constraint and Driver block and from each locked Joint Stiction Actuator. Different blocks from the Constraints & Drivers library impose different numbers of motion restrictions. Stiction actuators apply to individual joint primitives.

    Constraint BlockRestrictionsDriver BlockRestrictions
    GearOneAngleOne
    ParallelTwoDistanceOne
    Point-CurveTwoLinearOne
      VelocityOne

    Be sure not to count redundant motion restrictions. These are restrictions that forbid the motion of joint primitives that could not move anyway even if the constraint were removed, because of how the joints are configured.

    Example: A body is connected to a ground by a single prismatic. You place a constraint on the body that prevents it from moving perpendicularly to the prismatic axis. The body could not move in that direction even if you removed the constraint. So the constraint is redundant, and you would not count it as a motion restriction.

The Role of Joint Stiction Actuators

A Joint Stiction Actuator can remove or restore a DoF during a simulation. It is the only block that can change the number of independent DoFs after you start simulating. You must count an additional motion restriction during the period when a stiction-actuated primitive is locked. The primitive counts as another DoF if it is unlocked.

DoF Example: Double Pendulum

The mech_dpen model from the Demos library represents planar double pendulum motion actuated by a Joint Actuator.

The double pendulum has two rigid bodies, such as two rods, confined to move in two dimensions. Ignoring the Joint Actuator temporarily, there are two bodies, two joints, and two revolute primitives, and thus 3 * (2 - 2) + 2 = 2 independent DoFs. There are many ways to represent these two DoFs, but the two revolute primitives are the simplest way.

Including the Joint Actuator in the DoF count removes the revolute primitive in the Revolute block as an independent DoF. So this model actually only has one independent DoF, the revolute primitive in the Revolute1 block.

DoF Example: Four Bar Mechanism

The example in Creating a Closed-Loop Mechanical Model in the Building and Visualizing Simple Machines chapter has four revolutes. You can establish that only 3 * (3 - 4) + 4 = 1 of these DoFs is actually independent and arrive at the same result obtained in the example.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS