SimMechanics |
 |
Configuring the Mechanical Environment Settings
Open a new blank model window from the SimMechanics library. First you need to set the global mechanical environment.
On the model window toolbar, open the Simulation menu and click the Mechanical environment entry.

The Mechanical Environment Settings dialog box appears.
The Mechanical Environment Settings Dialog Box Panes
Click the four tabs in succession to expose each pane.
Pane
|
Function
|
Parameters
|
Controls general settings for mechanical simulations
|
Constraints
|
Sets constraint tolerances and how constraints are interpreted
|
Linearization
|
Controls how SimMechanics models are linearized with Simulink
|
Visualization
|
Configures the visualization tools
|
Note some important features of this dialog box:
- The Gravity vector field specifies the magnitude and direction of gravitational acceleration and sets the vertical or up-down direction.
- The Linear and Angular assembly tolerance fields are also set here. Change Angular assembly tolerance to
1e-3 deg
(degrees).
- Leave the other defaults, except Visualization.
Setting the Visualization Pane
Visualization
We recommend opening one of the visualization tools before building a model. With it, you can keep track of your model components and how they are connected, as well as correct mistakes. |
To visualize the bodies as you build the machine, go to the Visualization pane of Mechanical Environment Settings:
- In the Draw machine using menu, select either
Virtual Reality Toolbox
or MATLAB Graphics
(Handle Graphics).
- Leave Represent bodies as in default the
Equivalent ellipsoids
.
- Select the Draw machine in initial state check box. Leave the Update machine menu as default
When diagram changes
to see bodies appear and change in the virtual world as you add and change them in the model.
- If you want to animate the simulation later when you run the model, select the Animate machine during simulation check box as well.
- Click OK or Apply.
- If you chose Handle Graphics, an empty Handle Graphics window opens. If you chose virtual reality, an empty virtual world appears in a virtual reality viewer.
Either visualization window becomes populated with bodies as you add them to the model.
If you open visualization after the model is built, the finished machine appears.
| A Four Bar Mechanism | | Setting Up the Block Diagram |  |