Combining One- and Three-Dimensional Mechanical Elements

About Interface Elements

SimMechanics™ software is built on the Simscape™ environment, which supports one-dimensional domains of translational and rotational motion, along or about a single axis for one body at a time. The mechanical elements of the Simscape Foundation library include masses, inertias, and internal forces and torques, as well as sensors and actuators. The blocks of the Interface Elements library allow you to selectively couple a SimMechanics machine to a mechanical circuit.

Consult the Simscape documentation for more about Physical Networks and one-dimensional domains.

How Mechanical Interface Elements Couple Motion and Forces Between SimMechanics Machines and Simscape Circuits

Because Simscape models simulate motion along or about one axis, one Interface Element block can couple only one SimMechanics joint primitive at a time to a Simscape circuit, interfacing through a Sensor/Actuator port on a Joint block. An Interface Element neither adds nor subtracts degrees of freedom (DoFs) to or from the combined machine-mechanical circuit. Its coupling is like a force element between the two domains (see Adding Internal Forces preceding):

  • From the point of view of the SimMechanics machine, an Interface Element behaves like a force actuator acting on the selected joint primitive. The interface block injects force or torque from the mechanical circuit between the Bodies connected to either side of the Joint.

  • From the point of view of the Simscape mechanical circuit, an Interface Element behaves like a motion actuator. The interface block injects translational or rotational motion from the machine into the circuit connection line.

  • The directionality or sense of motion, established by the base (B)-follower (F) order in the SimMechanics Joint, is preserved in the Simscape mechanical circuit.

  • An Interface Element preserves the force or torque flowing through the Interface Element into the machine and the motion acting across the Joint transmitted into the mechanical circuit. Interface Elements thus conserve mechanical power, transferring it without loss between the two domains.

Interface Elements can couple prismatic or revolute joint primitives to translational or rotational motion, through the Prismatic-Translational Interface or Revolute-Rotational Interface blocks, respectively.

Limitations on the Interfaced Simscape Mechanical Circuit

SimMechanics and Simscape mechanical simulations are separately valid. However, simulation of moving bodies modeled as Simscape mass and inertia elements coupled through Interface Elements to a SimMechanics machine is not complete and requires care to avoid unphysical results. These limitations arise from their different representations of motion and dynamics coming into conflict:

  • One-dimensional motion in Simscape circuits versus three-dimensional motion in SimMechanics machines.

    A Simscape circuit does not model the motion of such bodies along or about axes orthogonal to the coupled primitive axis chosen in the interfaced Joint.

  • Absolute motion of each Simscape mass and inertia represented by connection lines versus relative motion, represented by Joints, between SimMechanics bodies.

    All masses in Simscape models live in an implicit inertial reference frame. A Simscape mechanical circuit interfaced to a SimMechanics machine in general moves in an accelerated frame. A simulation with such a circuit does not include the pseudoforces acting on the Simscape mass and inertia elements as experienced in such a noninertial frame and thus violates Newton's second law of mechanics.

As the mass and/or inertia modeled in the interfaced mechanical circuit is increased, so is the violation of Newton's second law. As such mass and/or inertia is decreased, so is the violation.

    Warning   Model all masses and inertias in your system as Bodies in the SimMechanics machine and avoid placing mass and inertia elements into any interfaced Simscape mechanical circuits.

    Models with mass and inertia elements in Simscape mechanical circuits interfaced to a SimMechanics machine are not physically valid. Simulating with such models does not yield valid results.

Working with Interface Elements

To interface a Joint with a Simscape mechanical circuit:

  1. Select the appropriate Interface Element block, prismatic or revolute, from the Interface Elements library.

    • If you wish to couple a translational mechanical circuit to a prismatic primitive, select Prismatic-Translational Interface.

    • If you wish to couple a rotational mechanical circuit to a revolute primitive, select Revolute-Rotational Interface.

    You cannot mix translational and rotational motion with an Interface Element.

  2. Copy the selected Interface Element block into your model.

  3. Open the Joint dialog and add an extra Sensor/Actuator port. Close the dialog.

  4. Connect the Interface Element mechanical connector port to the new Sensor/Actuator port on the Joint.

  5. Open the Interface Element dialog. The Connected to primitive pull-down menu contains a list of all the primitives of appropriate type (prismatic or revolute) in the interfaced Joint.

    Select the primitive you want to interface. The Simscape circuit will move along or about that axis. Click OK or Apply.

On the machine side, the Joint must follow the standard rules for Joints and in particular be connected to a Body on each side. (See Modeling Degrees of Freedom preceding.) You should connect the Interface Element with the rest of the mechanical circuit.

Example: Rotational Spring-Damper with Hard Stop

The mech_interface_rot_spr_dampermech_interface_rot_spr_damper example illustrates proper interface of Simscape mechanical elements with a three-dimensional SimMechanics machine.

The interfaced mechanical circuit has no inertia or mass elements, which prevents the problems discussed in Limitations on the Interfaced Simscape Mechanical Circuit preceding. It contains only force elements: a rotational spring, a rotational damper, and a rotational hard stop. Together, these force elements create a hard stop for the Revolute block. This block contains only one primitive, R1, which you can view by opening its dialog. Through this primitive, the Simscape force elements act between Body A and Body B, limiting their relative angular motion about the revolute R1 axis to ±π/6 radians.

Was this topic helpful?