SimMechanics    

Creating a Joint

A joint must connect exactly two bodies. To create a joint between two bodies:

  1. Select the Joint from the SimMechanics Joints library that best represents the degrees of freedom of the follower body relative to the base body.
  2. Connect the base Connector Port of the Joint block (labeled B) to the point on the base block that serves as the point of reference for specifying the degrees of freedom of the follower block.
  3. Connect the follower Connector Port of the Joint block (labeled F) to the point on the follower block that serves as the point of reference for specifying the degrees of freedom of the base block.
  4. Specify the directions of the joint's axes (see Directing Joint Axes).
  5. If you plan to attach Sensors or Actuators to the Joint, create an additional port for each Sensor and Actuator (see Creating Actuator and Sensor Ports on a Joint).
  6. If the joint is an assembled joint, assemble the bodies joined by the joint (see Assembling Joints).

Directing Joint Axes

By default the prismatic and revolute axes of a joint point in the same direction as the z-axis of the World coordinate system. To change the direction of the axis of a joint primitive:

  1. Open the joint's dialog box and select a reference coordinate system for specifying the axis direction from the coordinate system list associated with the axis primitive.
  1. The options are the World coordinate system or the local coordinate systems of the base or follower attachment point. Choose the coordinate system that is most convenient.

  1. Enter in the primitive's axis direction field a vector that points in the desired direction of the axis in the selected coordinate system.

Creating Actuator and Sensor Ports on a Joint

To create additional Connector Ports on a Joint for Actuators and Sensors, open the Joint's dialog box and set the Number of sensor/actuator ports to the number of Actuators and Sensors you plan to attach to the Joint.

Apply the setting by clicking OK or Apply.

Assembling Joints

You must manually assemble all assembled joints in your model. Assembling a joint requires setting the initial positions of its base and follower attachment points such that they satisfy the assembly restrictions imposed by the joint (see Assembly Restrictions). Consider, for example, the model discussed in A Four Bar Mechanism in the Learning Basic Procedures chapter. This model comprises three bars connected by revolute joints to each other and to two ground points. The model collocates the CS origins of the Body CS ports connected to each Joint, thereby satisfying the assembly restrictions imposed by the revolute joints.

Assembled Revolute Joint in the Four Bar Mechanism

Modeling with Massless Connectors

Massless connectors simplify the modeling of machines that use a relatively light body to connect two relatively massive bodies. For example, you could use a Body block to model such a connector. But the resulting equations of motion might be ill-conditioned, because that connecting body's mass is small, and the simulation can be slow or error prone. Similarly, a massless connector avoids global inconsistencies that can arise if you use a Constraint block to model the connector.

A massless connector consists of a pair of joints located a fixed distance apart. Think of a massless connector as a massless rod with a joint primitive affixed at each end.

The initial orientation and length of the massless connector are defined by a vector drawn from the base attachment point to the follower attachment point. During simulation, the orientation of the massless connector can change but not its length. In other words, the massless connector preserves the initial separation of the base and follower bodies during machine motion.

The SimMechanics Joints/Massless Connectors sublibrary contains three Massless Connectors:

You can set the direction of the axes of the revolute primitives.

Creating a Massless Connector

To create a massless connector between two bodies:

  1. Drag an instance of a Massless Connector block from the Massless Connectors sublibrary into your model and connect it to the base and follower blocks.
  1. If necessary, point the axes of the connector's revolute joints in the direction required by the dynamics of the machine you are modeling.

  1. Assemble the connector by setting the initial positions of the base and follower body attachment points to the initial positions required by your machine's structure.

During simulation, the massless connector maintains the initial separation between the bodies though not necessarily the initial relative orientation.

Massless Connector Example: Triple Pendulum

Consider a triple pendulum comprising massive upper and lower bodies and a middle body of negligible mass. The following model uses a Revolute-Revolute massless connector to model such a pendulum.

In this model, the joint axes of the Revolute-Revolute connector have their default orientation along the World z-axis. As a result, the lower arm (Body1) rotates parallel to the World's x-y plane.

Massless Connector Example: Four Bar Mechanism

The following model replaces one of the bars (Bar2) in the mech_four_bar model from the Demos library with a Revolute-Revolute massless connector.

This model changes the Body CS origins of Bar3 to the following values.

Name
Origin position vector
Translated from origin of
CG
[-0.027 0.048 0]
CS1
CS1
[0.054 0.096 0]
GND@Ground_2
CS2
[0 0 0]
GND@Ground_2

This creates a separation between Bar3 and Bar1 equal to the length of Bar2 in the original model.

Try simulating both the original and the modified model. Notice that the massless connector version moves differently, because you eliminated the mass of Bar2 from the model. Notice also that the massless bar does not appear in the animation of the massless connector version of the model.

Modeling with Disassembled Joints

The SimMechanics Joints/Disassembled Joints sublibrary contains a set of joints that SimMechanics automatically assembles at the start of simulation; that is, SimMechanics positions the joints such that they satisfy the assembly restrictions imposed by the type of joint, e.g., prismatic or revolute. Using these joints eliminates the need for you to assemble the joints yourself.

Disassembled joints differ from assembled joints in significant ways. An assembled joint primitive has only one axis of translation or revolution or one spherical pivot point. A disassembled prismatic or revolute primitive has two axes of translation or rotation, one for the base and one for the follower body. A disassembled spherical primitive similarly has two pivot points.

The dialog box for a disassembled joint allows you to specify the direction of each axis.

During model assembly, SimMechanics determines a common axis of revolution or translation that satisfies model assembly restrictions, and aligns the base and follower axes along the common axis.

Controlling Automatic Assembly

During model assembly, SimMechanics might move bodies connected by assembled joints from their initial positions in order to assemble the disassembled joints. SimMechanics' solution to the assembly problem cannot be predicted beforehand, except in simple cases. To prevent SimMechanics from moving bodies during model assembly, use Joint Initial Condition Actuator (JICA) blocks to specify the initial positions of bodies whose positions you want to remain fixed during the assembly process. This forces SimMechanics to find assembly solutions that satisfy the initial conditions specified by the JICA blocks.

Disassembled Joint Example: Four Bar Mechanism

This example creates and runs a model of a disassembled four bar machine.

Refer to the tutorial, A Four Bar Mechanism in the Learning Basic Procedures chapter, and the mech_four_bar demo:

  1. Disconnect the Joint Sensor1 block from the Revolute3 block.
  2. Replace Revolute3 with a Disassembled Revolute block from the Joints/Disassembled Joints sublibrary.
  3. Open the Disassembled Revolute dialog box and, under Axis of rotation for both Base and Follower axes, enter [0 0 1]. Close the dialog.
  4. Open the Bar2 dialog box and displace its CS2 origin from Bar 3's CS1 origin, thus dislocating the joint.
  5. Rerun the model.
  1. Note that the motion is different from the manually assembled case.

Cutting Closed Loops

Simulink cannot solve models whose block schematics contain closed loops. To simulate a model containing closed loops, SimMechanics internally converts a closed-loop model to an open-loop model, by cutting each of the model's closed loops once, at a Joint, Constraint, or Driver block.

You can specify the Joint to cut if the loop does not contain a disassembled joint. To do this, open the Joint's dialog box and select the Mark as the preferred cut joint option check box on the Advanced pane in that Joint's dialog Parameters area. If you do not specify a preference, Simulink cuts the loop at a Disassembled Joint block if the loop contains one; otherwise, at a Constraint or Driver block if the loop contains a Constraint block; otherwise, at the Joint that has the fewest degrees of freedom.

To display automatically cut joints, select the Mark automatically cut joints check box on the Constraints pane of the Mechanical Environment Settings dialog box (see Constraints Pane in the Running Mechanical Models chapter).

Refer to Modeling with Disassembled Joints for more on disassembled joints. Consult Checking Schematic Topology to see how SimMechanics analyzes closed loops in the model schematic.


  Modeling Joints Modeling Constraints and Drivers