|On this page…|
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.
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.
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.
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.
To interface a Joint with a Simscape mechanical circuit:
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.
Copy the selected Interface Element block into your model.
Open the Joint dialog and add an extra Sensor/Actuator port. Close the dialog.
Connect the Interface Element mechanical connector port to the new Sensor/Actuator port on the Joint.
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.
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.