Build a Piston Engine Model in MSC
Build a Piston Engine Model in MSC
C H A P T E R 7
Building a Model
This exercise shows you how to create constraints and assemble bodies in
[Link] Desktop and how to access data from the simulation
through meters. The target model is a simple piston engine consisting of a
crankshaft, a connecting rod, and a piston. The engine has a skewed
7-2 Chapter 7—Building a Model
crankshaft (i.e., the rotation axis is not orthogonal to the translation axis of
the piston); therefore, the model can be illustrated only in a three-
dimensional simulator.
In the initial steps that follow, you will adjust the animation frame rate and
the unit system in the [Link] Desktop file. The unit system
adjustment is to accommodate small mechanisms such as a piston engine.
The default unit system employs the SI unit system (where distance is
measured in meters). You will change the distance unit to millimeters, while
leaving all other units (such as time and mass) intact.
4. Click Close.
Figure 7-1
Display Settings Window
(Units Page)
1. Choose Grid in the View menu. Next, choose Show Grid in the Grid
submenu. The Edit Grid appears in the modelling window.
2. Choose Grid in the View menu. Then choose Grid Settings in the
Grid submenu.
3. Click Grid to view the Grid page of the Display Settings dialog.
7-4 Chapter 7—Building a Model
Figure 7-2
Display Settings Window
(Grid Page)
The Zoom tool allows you to zoom into the document with a
particular focus. The first mouse click becomes your focus for zooming.
7. Click the global coordinate origin, hold down the mouse button, and
drag the mouse downward to zoom in. Note that if you move the mouse
in the other direction, you can zoom out.
8. Release the mouse button when the Edit Grid fills a reasonable portion
of your document window. You can repeat the previous step to zoom
in further.
If your Edit Grid does not appear to be quite centered, use the Pan
tool to shift the view laterally.
Create a Piston Model 7-5
You will specify the geometry and position of the body using the Properties
window.
2. Click once anywhere on the Edit Grid, then press the Enter key on your
keyboard. A small cylinder appears where you clicked.
Figure 7-3
Properties Window
(Position Page) for the Cylinder
Figure 7-4
Properties Window
(Cylinder Page)
7. Enter Radius = 25, Height = 10. Note that all the numbers are
interpreted in millimeters.
You can use the tab key to move from one field to another.
Figure 7-5
Crankshaft Sized and
Positioned
Currently, the crankshaft is oriented so that it lies flat on the xy plane. You
will reorient the crankshaft so that it is slightly skewed.
Figure 7-6
Properties Window
(Position Page)
11. Enter the orientation of the cylinder: (Rx, Ry, Rz) = (0, 35, 0).
The crankshaft is reoriented as soon as you tab out of the Ry field. You do
not need to close the Properties window to have the changes take effect.
Figure 7-7
Properties Window
(Appearance Page)
2. In the Name field of the window, type crankshaft in the edit box. Press
the Enter key on your keyboard.
7-8 Chapter 7—Building a Model
To see how the custom name helps you in identifying bodies, simply “hover”
the mouse over the crankshaft cylinder. The body’s variable name is
displayed at the location of the mouse pointer. The status bar in the bottom
left corner of the modeling window also identifies the body with the variable
name (body[n]) as well as the custom name you have just assigned. See
Figure 7-8 for an example.
Figure 7-8
Status Bar Identifying Object
The custom name for this body also appears in the Object List.
Figure 7-9
Create Constraint Window
Constraint
Type
The Create Constraint window is best understood when you read the first
few lines of the window as a complete sentence. In our case, the dialog
reads:
Create a Piston Model 7-9
Therefore, the dialog is set up to create a motor between the crankshaft and
the background.
The bottom half of the window provides only one option, which reads:
The option indicates that the motor will be attached to the crankshaft at its
center and that the crankshaft will not move—the body will be joined “in
place.”
Note that a motor icon appears at the center of the cylinder. Also, notice
that:
• The motor icon has a green cube around it (when it is selected) with an
axis that shows the plane in which the motor allows rotation.
• [Link] Desktop created a red disk-shaped object called a
Coord. The model actually has two Coords at the same global position,
where one is attached to the crankshaft and the other to the
background. (Figure 7-10 displays only one of them, because the two
Coords for the motor are overlapped at this point.)
You may wish to zoom in further to gain a better view of these symbols.
motor icon. Notice that a set of coordinate axes appear and that the red
circle is a representation of the xy-plane of the Coord. You may wish to use
the Zoom tool to get a closer look.
Figure 7-10
Coord and Motor
Coord Symbol
Figure 7-11
Concept: Construction of a
Constraint
Coord Coord
Create a Piston Model 7-11
Figure 7-12
Properties Window (Constraint
Page)
As Figure 7-12 illustrates, each constraint shows you the free rotational or
translational directions. In the case of this motor, the Properties window
shows that the motor allows rotation about the z-axis.
Figure 7-13
Properties Window
(Motor Page)
Specify angular velocity
here.
Specification is expressed
in the z-axis of the Coord
on Ground.
Figure 7-13 illustrates that the angular velocity specification uses the z-axis
of the Coord on Ground, one of the two Coords associated with the motor.
7-12 Chapter 7—Building a Model
NOTE: By modifying the position and the orientation of Coords, you can
create a full range of constraints. For more information, please see the
Online Help.
Note that the crankshaft rotates counterclockwise (if seen from the positive
z). Also, note that the frame indicator at the bottom shows the current frame
being calculated.
Before constructing the rest of the model, we will modify the motor function
so that it only generates some torque at the beginning of the motion, just like
a starter motor would.
5. Double-click the motor icon. The Properties window shows the motor
characteristics.
6. Under the Motor tab, select Torque as Motor Type, and click the
Formula button.
Figure 7-14
Entering an Expression in the
Formula Editor Dialog
8. Click OK. The expression with units appears in the Value text region
as shown in Figure 7-15.
Figure 7-15
Specifying Motor Properties
Select Torque as the
motor specification.
Click to type
the expression.
If the elapsed time is less than 0.3 seconds, apply the torque
of 5.0 N-mm; otherwise, apply no torque.
For more information on the formula language, please refer to the Online
Help.
7-14 Chapter 7—Building a Model
2. Click once anywhere on the Edit Grid and press the Enter key on the
keyboard.
Figure 7-16
Connecting Rod
Connecting Rod
As with the crankshaft, you will assign a custom name to this body as well.
9. In the name field type the name con_rod and press Enter.
Again, notice how the hoover tool and status bar identify the connecting rod
and the crankshaft as you move the mouse over the bodies.
You will create one Coord on the crankshaft, another Coord on the
connecting rod, and create a spherical joint based on these two Coords.
2. Click anywhere on the top surface of the crankshaft; you will position
the Coord precisely in the later steps.
Figure 7-17
Properties Window
(Position Page)
8. Click anywhere on the connecting rod. (You will position the Coord
precisely in the later steps.)
9. Double-click the Coord and click the Pos tab of the Properties window.
10. In the region labeled Position and Orientation, enter position (x, y, z)
= (0, 35, 0), and orientation (Rx, Ry, Rz) = (-90, 0, 0).
This specification (relative to the body) positions the Coord at the right end
of the connecting rod. This time we are specifying the position as well as
orientation because the Coord may have attached to the side surface of the
connecting rod and not have the correct orientation.
1. Select the Coord on the connecting rod (if it is not already selected).
2. While pressing the Control key, select the Coord located at the
perimeter of the crankshaft.
Figure 7-18
Create Constraint Window
As discussed earlier, you should read the first few lines of the window as a
complete sentence: “Create a spherical joint from coord[x] on con_rod to
coord[x] on crankshaft.” [Link] Desktop automatically selects
the remaining options depending on the objects you selected.
5. Click the option Join (move con_rod to crankshaft). See Figure 7-18.
The Create Constraint window closes. The connecting rod is moved to the
crankshaft, and a spherical joint icon appears at the attachment point, as
shown in Figure 7-19.
Figure 7-19
Bodies Connected with a
Spherical Joint
After the simulation runs for a while, the connecting rod swings out as the
crankshaft rotates, as shown in Figure 7-20.
Figure 7-20
Connecting Rod Swung Out by
the Crankshaft
2. After running for a dozen frames or so, click the Reset button in the
Tape Player Control.
If the model did not behave as discussed, you should review your model. A
few hints are:
• If the motor is not rotating, you may have forgotten to specify the
motor’s property. Review the section Attach a Motor to the
Crankshaft.
• If the connecting rod is falling downward, you probably have failed to
attach it to the crankshaft. Review Create Attachment Coords.
Validating a large model is not always an easy task. As discussed in this
section, you should periodically verify your model’s assembly before
proceeding.
2. Click once on the Edit Grid, then press the Enter key on the keyboard.
4. Click the Position (Pos) tab. Enter the position (x, y, z) = (0, 0, 60).
5. Click the Cylinder tab. Enter the geometry (Radius, Height) = (20, 25).
Create a Piston Model 7-19
The piston is sized accordingly and positioned on the screen (see Figure 7-
21).
Figure 7-21
Piston Sized and Positioned
If the piston appears cut off at the top of your document window, click the
Pan tool to shift the view.
The window presents a single option: Join piston in place (at center of
piston).
7-20 Chapter 7—Building a Model
Figure 7-22
Create Constraint Window
Since you selected a single body (you did not select Coords),
[Link] Desktop presents the only reasonable join option.
[Link] Desktop will create two Coords (one attached to the
piston, the other attached to the background), and create a rigid joint on slot
to connect the body to the background. One of the Coords will be attached
to the body at its origin (coordinate origin).
A rigid joint on slot icon appears at the center of the piston (see Figure 7-
23). You may want to zoom in with the zoom tool to obtain a better view.
Figure 7-23
Rigid Joint on Slot Created
Note that the small green line segment indicates that this slot joint allows
single degree of freedom (translation in the z direction). The piston can slide
“up-and-down;” this is the desired behavior.
Figure 7-24
Attaching a Coord
to the Connecting Rod
If you attached the Coord on a side surface of the connecting rod, do not be
alarmed; you will correct it in the next step.
5. Click the Position (Pos) tab, and verify that the Coord is attached to the
connecting rod, and the configuration is given as (X, Y, Z) = (0, -35, 0),
and (Rx, Ry, Rz) = (90, 0, 0). Correct any values that are different.
Figure 7-25
Properties for Coord Attached
to the Connecting Rod
1. Use the Rotate Around tool to position the piston so that its bottom
surface is facing you.
Do not worry if you attached the Coord on a side surface of the piston; you
will correct it in the next step.
5. Click the Position (Pos) tab, and verify that the Coord is attached to the
piston, and the configuration is given as (X, Y, Z) = (0, 0, -12.5), and
(Rx, Ry, Rz) = (0, 180, 0). If any values are different, correct them.
2. Hold down the Control key, and select the Coord attached to the
piston.
If you have trouble selecting these Coords in the modeling window, try
selecting them in the Object List.
Figure 7-26
Create Constraint Window
4. Select Spherical Joint as the constraint type, and click the option
labeled Split constraint (Don’t move anything).
You can assign the constraint and leave the bodies intact this way. You will
assemble the joint in a later step.
A line appears between the two Coords, and a split spherical joint icon
appears in the Object List. At this point, the constraint is defined, but the
bodies are not assembled.
A dialog appears that offers you the choice of moving the bodies to satisfy
the constraints or adjusting the coord location without moving the bodies, as
shown in Figure 7-27.
Figure 7-27
Join Options Dialog
NOTE: If you do not see the progress dialog, you may have accidentally split
another constraint by mistake. In that case, choose Select All in the Edit
menu, and click the Join/Create Constraint button in the Edit toolbar.
[Link] Desktop will attempt to resolve all constraints
simultaneously.
Figure 7-28
Joining Process
After a short while, the progress bar reaches the completion, and the
progress dialog disappears. At this point the model is fully assembled, as
shown in Figure 7-29, and you are ready to run the simulation.
1. Click the Undo tool. This returns the spherical joint to its split state.
3. Drag the connecting rod to reposition it so that the Coord on its end is
near the Coord on the piston.
Figure 7-29
Fully Assembled Piston Engine
The simulation starts, showing the motion of the piston engine mechanism.
Note that the Tape Player Control located near the bottom of the modeling
window shows the current frame number.
2. Let it run for 40 frames or so, and click the Reset button on the toolbar.
Use the Pan, Zoom, and Rotate tools to obtain different view angles and
repeat the simulation. Note that the simulation runs much faster the second
time around, because [Link] Desktop stores the simulation
time history after the first calculations. The history remains in memory until
you change the initial conditions.
Take Measurements
The simulation model you have just created serves as a powerful
visualization tool to observe the general motion of your mechanism.
[Link] Desktop allows you to take numerical measurements
on various aspects of your simulation.
In this section, you will create a meter to measure the angular velocity of the
crankshaft cylinder as well as the forces on the joint between the piston and
the connecting rod.
Now, you will create a meter to measure the angular velocity of the
crankshaft:
Take Measurements 7-27
2. Choose Meter in the Insert menu and then choose Angular Velocity
in the submenu.
3. In the Tiling Options dialog, select Tile Vertically and then click OK.
Figure 7-30
Angular Velocity Meter
Note that when the meter window is active, the toolbar icons for tools which
do not apply to meters are disabled (appear grayed out).
In this simulation, the crankshaft rotates with its z-axis fixed, so you are only
interested in observing wz, or the z-component of the angular velocity.
4. Double-click the meter in the graph area. The Properties window for
the meter is displayed, as shown in Figure 7-31.
Figure 7-31
Properties Window for Meter
As you remove items from the Label column, the formula is also deleted, as
shown in Figure 7-32.
Figure 7-32
Properties Window for Meter
after Removal of Unwanted
Plots
You will now create another meter to measure the forces on the spherical
joint between the piston and the connecting rod.
8. Select the spherical joint between the connecting rod and the piston in
the Object List.
When a spherical joint is selected, it shows a green cube with short lines to
show the allowable rotations.
Figure 7-33
Meter Dialog for Constraint
Force
11. In the Tiling Options dialog, select Tile Vertically and then click OK.
Another meter window appears.
The simulation begins to show the model in motion and the meters display
the data. Note that the meters rescale the graph axes automatically as the
data grows in magnitude.
13. Run the simulation until several rotation cycles are completed, then
click the Reset button on the toolbar.
Note that the simulation runs faster during the playback; observe the “jerky”
rotation of the crankshaft due to gravity.
1. Select the force meter. Then choose Properties in the Edit menu (or
double-click the force meter window).
2. Click the Meter tab, then choose the Graph radio button.
The digital meter changes to the graph format (if not already in graph
format) to show the history. Note the series of spikes seen in the force
meter, as shown in Figure 7-34.
Figure 7-34
Force Meter and History
To avoid excessive wear and tear on the components, suppose you would
like to put a simple control system on the crankshaft motor to smooth the
rotation.
3. Double-click the motor icon located at the center of the crankshaft. The
Properties window appears to show the motor specification.
5. Choose the Angular Velocity radio button, then enter the following
expression in the Value field.
0.2*(3600 deg/s-body[1].w.z)
Note that the force curve on the spherical joint is much smoother.
8. Run the simulation until several rotation cycles are completed, then
click the Reset button in the Tape Player Control.
Improve the Model 7-31
You can export the meter data to a text file for further analysis by
another application program. For more information, please see the Online
Help.
7-32 Chapter 7—Building a Model