SimMechanics    

Visualizing Bodies During Machine Building

One way to use the visualization tool is while you're building your machine:

The first approach is especially useful if you're just starting to learn how to use SimMechanics and/or modeling complex machines. In that case, visualization can guide you in assembling the body geometries and connections.

Representing Bodies

The visualization tools display your machine bodies in a virtual world or Handle Graphics window. The tools have two abstract shapes to represent the bodies, one derived from body mass properties, the other from bodies' attached Body coordinate systems (CSs). These shapes are geometric schematics, because SimMechanics accepts only limited body information:

Mass properties.   A rigid body's dynamics are partly determined by the body's total mass and how that mass is distributed in space, as encapsulated in its inertia tensor. Any rigid body has a unique corresponding homogeneous ellipsoid with the same mass and inertia tensor.

Using these equivalent ellipsoids is one visualization mode of representing a body in space. The relative sizes of the ellipsoid axes indicate the relative inertial moments about each axis.

Here is a rigid body represented by its virtual reality equivalent ellipsoid.

Geometric properties.   In SimMechanics, every body is represented by a Body block with at least one attached Body CS. The minimum Body CS origin is located at the body's center of gravity (CG).

Other Body CSs can also be attached to a Body. In particular, any Joint, Constraint/Driver, Actuator, or Sensor attached to a Body must be attached at a Body CS origin.

The set of Body CS origins can be enveloped by a surface; if there are more than three non-coplanar origins, the surface encloses a volume. The minimal surface with outward-bending curvature enveloping this set is the convex hull, which becomes the other abstract shape for visualizing a body in space. Fewer than four CS origins produce simpler Body figures.

Here is the same body as a convex hull in a virtual scene. The Body CS origins are coplanar in this case, and the hull is two triangles.

Animating Machine Motion During Simulation

Besides rendering your machine bodies either while you build a model or as a completed model, you can also keep the visualization tools open while a model is running in the Simulink model window. The Handle Graphics window or virtual reality viewer animates the simulation of the bodies' motions, whether you choose to render the bodies as ellipsoids or as convex hulls, and moves in parallel with however the model changes on the Simulink side.


  Visualizing and Animating Machines Learning Basic Procedures