Autodesk Constraints
Autodesk Constraints
Autodesk Constraints
MA43-1 Are you having trouble explaining to others how your new mechanism works? For that matter, are you
fairly sure it is even going to work? Autodesk Inventor motion constraints can be a big help. In this
course, you will learn how to apply assembly constraints that will allow you to replicate the motion of
gears, pulleys, irregular cams, and rack-and-pinion mechanisms. This will include such topics as
analyzing mechanism motion during the design phase to ensure proper operation, to check for
interference within moving mechanisms, and to drive adaptive components. We will cover several
tips, tricks, and techniques that can take motion constraints far beyond the usual textbook coverage.
You will also learn how to capture assembly motions to an .AVI file so anyone can view them with the
generic Windows Media Player.
NOTE
This course is intended for intermediate users. I assume you have a working
knowledge of the basic assembly constraints in Autodesk Inventor TM, so now
we will go on to see some of the more advanced playing that can be done
with them. In particular, we will discuss the motion constraints and how to
add movement to your models.
The example files will all open in at least release 9 or later, but the basic principles work in many
earlier releases.
Wanna Drag?
One of the many features that I find intriguing in Inventor is its dynamic assembly constraint
analyzer. This means that it is not necessary for Inventor to have an “update” function when
dealing with changes to an assembly. Changes are analyzed continuously, and any necessary
updating takes place in real time. You can use your mouse to grab onto a partially-constrained
component and drag it to a new location. As you do so, any other components that are
constrained to it will follow along.
For example, consider the basic cylinder and crank assembly /IM-01-Piston & Cylinder/IM-01-
Cylinder.iam. Simply move your mouse until the cursor arrow is located within the circular end of
the crank pin.
Now press and hold the left mouse button down. While still pressing
the mouse button, move the cursor in a circular motion. Keep it
approximately within the circular crank pin end, and move it around
the main bearing portion of the crankshaft. Observe how the
connecting rod and the piston obediently follow along with proper
rotary-to-oscillating and oscillating motions respectively.
For this to work, the assembly must be slightly under-constrained.
Specifically, the piston cannot have a mate, flush, or insert
constraint that prevents up-and-down motion, and the crankshaft
cannot have an angle or other constraint that prevents rotation.
On the other hand, such lack of constraints can cause problems
when creating 2D drawing views of the assembly. The solution is to apply the desired constraints,
then suppress them when you want to study the mechanism’s motions. Just remember to
unsuppress them before plotting the 2D drawing views.
You have now seen and used the basic dynamic constraint analyzer. So what can be done with it?
It turns out that there are two major uses. Obviously, you can operate a mechanism in order to
test that works properly.
Not so obviously, you can test if a model is properly constrained. For example, in an engine the
crankshaft, connecting rods, and pistons should all move properly. On the other hand, you
probably do not want the cylinder head to be able to move relative to the block. If you can move
the head then it needs more restraints.
Let’s go back and look at the first use in more detail.
First, an observation. Notice how the piston pulls completely clear of the frame as it approaches
the bottom of the stroke, but re-enters the bore properly on the way back up. A mate constraint
was applied between the centerlines of the piston and the bore. They will remain aligned,
regardless of whether or not the cylindrical portions remain engaged. Obviously the real world
does not work this way. We can deduce a fundamental rule from this:
2/14
Moving Right Along: the Inventor motion constraints
NOTE
Just because a modeled mechanism works properly does not
necessarily mean that the real mechanism will work too!
Let’s Go For A Drive…
Having said that, a modeled mechanism can still be a very valuable tool both for analysis and
demonstration purposes. Let’s start with demonstration mode.
Once you have designed a mechanism there is often a need to explain it to others. Since a word is
worth .001 of a picture, an animated demonstration is usually better than a verbal description.
In the browser, you can expand the part entries to show their constraints. For example, I have
expanded the entries for the frame and the crank. Clicking on a constraint will highlight the related
items in the graphic window. The illustrations show the result of clicking on the Angle (325.00
deg) entry under the Crank. This constraint is grayed out in the browser to indicate that it is
currently suppressed. If it were not grayed out then you would not have been able to rotate the
crankshaft with your mouse. This “highlighting” step is not essential to the process, but it serves
to highlight the constraint that will be driven.
3/14
Moving Right Along: the Inventor motion constraints
Click on the Reverse button and the mechanism will run backwards for 5 revolutions.
The remaining buttons perform the indicated actions, much like a VCR.
Single-step in reverse
Closes the Drive Constraint dialogue box and re-sets the constraint to have the
current value.
Closes the Drive Constraint dialogue box and returns the constraint to the value it
had before you started driving it.
4/14
Moving Right Along: the Inventor motion constraints
Hints:
• You can rename any constraint in the browser to make its relationship more obvious. For
example, the meaning of a constraint called “Drive Me” is pretty obvious.
• They can be driven even if they are not suppressed.
• They work with linear (mate, flush) constraints as well as rotary (angular).
• For the smoothest operation of a rotary motion, the End angle should be 360 degrees minus
one increment (in our example, 360-12=348).
• Do not use an image or gradient background, or performance will plummet.
• Animating a mechanism like this is obviously an easy way of demonstrating it to other
people.
Now let’s move on to the analysis functions.
Captain, Sensors Indicate A Collision…
This time, we’ll drive the angle constraint with one minor difference. When we expand the dialog
box, we’ll click on the Collision Detection radio button to turn it on.
Now when we click on the Forward button we can watch in amazement as the mechanism only
completes part of a revolution. It will suddenly grind to a sickening halt and the Collision Detected
alert box pops up. The offending parts are highlighted in red, indicating that the piston skirt is
striking the crankshaft. The connecting rod is too short.
Hint:
Collision detection only works at the increment of each motion step. If there is only a slight
interference, and the step increment is large, your mechanism might “jump over” the collision.
We Must Adapt To Survive…
Now we see how Adaptivity works in conjunction with driven constraints. In the browser we’ll
right-click on the Con_Rod. When the context menu pops up, we’ll click on Adaptive to turn it on.
Next, we unsupress the grayed-out Tangent (0.010) constraint under the Crank, right below the
Angle (325 deg) constraint. The piston will move until its skirt edge is 0.010 units above being
tangent to the crankshaft, and the connecting rod will change length as required.
Now, we’ll drive our favorite Angle constraint on the crank, but before we actually run it we’ll turn
Collision Detection off and Adaptivity on. Now when we click on the Forward button the
crankshaft completes 5 revolutions. This time, the piston does not reciprocate. Instead, the
connecting rod lengthens and shortens to adapt to the changing geometry.
We can single-step the constraint until the connecting rod reaches its maximum length, when the
constraint angle equals 180 degrees. At this point we click on Apply to accept the current values
and to dismiss the Drive Constraint dialogue box.
Finally, we suppress the Tangent constraint under the crank, and turn Adaptivity off for the
connecting rod. The connecting rod freezes at its new length.
Now when we drive the crank angle constraint again, with Drive Adaptivity turned off and Collision
Detection turned on, we don’t get any collisions.
5/14
Moving Right Along: the Inventor motion constraints
Hints:
• Collision Detection and Adaptivity only work when you are driving a constraint, and not
when you drag parts around manually.
• Driving Adaptivity is a cool way of demonstrating things like rubber diaphragms that stretch
and shrink as a mechanism runs: /IM-02-Diaphragm/Assembly-diaphragm.iam.
Now we are ready to do the final showing of our mechanism. The problem is, the people who need
to see it do not have Inventor and wouldn’t know how to use it if they did. No problem.
You Send Me…
Inventor includes a provision for recording an AVI animation file while a constraint is being driven.
This file can be played back using the Media Player program that comes standard with Windows, so
everyone has it. The study of AVI files could be the subject of a full tutorial in its own right, so this
time we will just hit the high spots to get you started.
All we need to do to create an AVI file is to click on the red Record button in the Drive
Constraint dialogue box before we start the animation running. Supply a suitable file name when
the standard file dialogue box pops up, and then click on Open. The file dialogue box will close. If
a Video Compression dialogue box pops up, click on OK to accept the defaults.
Now click on the Forward button . The animation will run somewhat slower, because it is
producing and compressing a frame-by-frame video as it goes.
Hints:
• You may want to shrink the Inventor graphics window down to a smaller size before
recording to avoid producing MONSTER file sizes. The file size goes up as the square of the
window size.
• If you slowly pan, zoom, or orbit as the operation is proceeding, then those actions will be
recorded.
• Do not switch to another application while the video is recording. If you do, that excursion
will be included in the video!
As indicated earlier, we can e-mail the resulting AVI file to people who do not have Inventor. They
can play the AVI file back and can therefore be witness to the true genius of our design.
Get A Move On!
Now let’s explore the motion constraints in Inventor.
Wait a minute. Don’t all assembly constraints serve to prevent relative motion between parts in an
assembly?
Yes, most of them do. Inventor, however, has two constraints that serve to only partially limit
motion. A better description would be to say that they control motion rather than constraining
against it. They are intended specifically for use in studying
mechanism motions. There are two variants of the Motion
constraint, plus the one Transitional constraint.
Disk Looks Like An Interesting Assembly…
Consider the simplified assembly IM-03-Disks.iam. The two disks
are Insert constrained to circular features on a base plate. To
avoid cluttering the view, the base plate is small enough that it is
hidden behind the disks. The disks are free to rotate, so that we
6/14
Moving Right Along: the Inventor motion constraints
can drag either of them in a circular motion. For the time being, we’ll ignore the bar below the
disks.
We’ll now place a constraint between the disks. We’ll click on the Motions tab, then click on the
right-hand Solution button. The dialogue box should now look like this:
Next, we’ll click on the outer rim of the larger
circle, and then click on the outer rim of the
smaller one.
The Ratio window will automatically change to
2.0, because in our example the larger disk
has a diameter of 2 units and the smaller one
has a diameter of one unit. Inventor has
automatically calculated the ratio between
them. We’ll click on Apply and then on
Cancel.
Now we’ll drag the larger disk around in a
circular motion. Observe how the smaller
disk obediently follows, turning two
revolutions for each single revolution of the larger disk. This motion also works in reverse; we can
drag the smaller disk and the larger one will move appropriately.
Giving It The Gears…
The two “Solution” options for the Rotation constraint suggest it can be used for same-way (belt or
chain) mechanisms, or opposite-way (gear) mechanisms. Actually, it doesn’t really matter if you
are running belts or gears, what really matters is the relationship of the direction vectors that
appear when you select the linked details.
If both direction vectors face the same way then the resultant motion will match the “Solution”
button. If things turn the wrong way in your assembly, simply edit the constraint and either
change its solution type or the direction vector of one detail.
In the previous sample, we used plain “friction drive” disks. How about actual gears? Okay, here
is a fairly long list of hints that apply to the Rotation constraint.
Hints:
• You can select either a cylindrical surface or a circular face for the constraint. In fact, you
can mix & match within a single constraint. Inventor will automatically calculate the ratio
based on the diameters.
• Gears do not normally have a cylindrical/circular detail at the pitch diameter. No problem;
just pick any two details such as the bores, hubs, and/or faces, and then manually enter the
gear ratio. This can be entered directly as a fraction; for example, in IM-04-gears.iam you
would enter the ratio between a 39-tooth gear and a 20-tooth gear simply as 39/20 or
20/39, depending on which gear you picked first. Inventor will do the calculation.
• Gear teeth do not automatically mesh properly. They must be in the correct position before
you apply the Rotation constraint. Good practice is to apply one or more “timing”
constraints that set the correct mesh, such as the angle between bore keyways and the
machine frame, or a tangent constraint between two gear teeth. If the gearset gets out of
step, simply suppress the Rotation constraint, unsuppress the timing constraints, then
suppress the timing constraints again, and finally unsuppress the Rotation constraint.
7/14
Moving Right Along: the Inventor motion constraints
• The constrained parts don’t need to actually touch each other. They can be displaced both
radially and axially from each other.
• Gear axes need not be parallel. Bevel gears work quite nicely; IM-05-Bevel gears r9.iam.
Motion constraints cannot be “driven” directly, but they will function correctly if one of their linked
parts is driven.
Like any constraint, the motion constraint can be edited. Simply right-click on it in the browser,
then select Edit from the context menu. We can change the ratio, the solution, and even re-select
the rotating elements.
Rack ‘Em Up…
Now let’s investigate the “rack-and-pinion” option of the Motion constraint. In the Place Constraint
dialogue box, we click on the Motion tab then click on the right-hand Type button . This is the
Translation-Rotation function. Going back to our earlier “two disks” example, we’ll move the cursor
onto the rim of the larger disk and observe how the red arrow points “into” the disk as shown. We
click on the disk to select it.
Next, we’ll select the upper rear edge of the bar, as shown.
NOTE: We picked the edge of the bar, not a face. We’ll come back
to this later.
Having selected the edge of the
bar, the Distance window will be highlighted. This shows the
distance that the linear object will translate for each revolution
of the circular object. By a strange coincidence, it always
seems to be some multiple of 3.14159268…
We’ll click on Apply, and then Cancel. Now we’ll use the cursor
to rotate either disk, and to slide the bar back and forth.
Observe how all three objects are connected by and driven by
their motion constraints.
The Wheel Deal…
Now let’s have a bit of fun with another assembly file IM-06-
Steering.iam. This will show you some of the things that can be
done with motion constraints. We’ll use the cursor to rotate the
hand wheel. Watch in amazement as the entire mechanism
works from the hand wheel, through the universal joints, and to
the rack and pinion. Conversely, we can drag the rack back and
forth and the hand wheel and the u-joints will follow.
We can drive the angle constraint between the handwheel and its
bearing, and the mechanism will automatically go through six
cycles, being out and back three times.
Now that we have seen the basic motions, here are a few tips and pointers that apply to the
Translation-Rotation constraint.
8/14
Moving Right Along: the Inventor motion constraints
Hints:
• As we saw when constraining the gears, Inventor does not automatically apply the correct
ratio to a rack and pinion unless the pinion includes a circular feature at the pitch diameter.
We had to enter the ratio manually when constraining the assembly, based on the pitch
diameter of the pinion.
• Again, Inventor does not automatically mesh the rack and pinion teeth. We had to have
things correctly positioned before applying the constraint. Again, we should provide
suppressed “reset” constraints if things get out of step.
Note that I have been calling this the “Translation-Rotation” constraint, rather than the “Rack and
Pinion” constraint. Constrained objects do not have to touch each other. In this assembly, we
applied the Rotation/Translation constraint between the hand wheel and the rack as well as
between the pinion and the rack. The pinion then drives the constraints back up through the
universal joints. I found that this gave better performance, especially when driving the hand wheel
manually on a slower computer. I first tried constraining it the “logical” way, down from the hand
wheel and through the u-joints. I then applied the Rotation/Translation constraint between the
rack and the pinion, but I found that if I moved the hand wheel or the rack very quickly I could
confuse Inventor and things would get out of step.
I emphasized earlier that we had selected the edge of the bar. This is not strictly a fixed
requirement in its own right. You can select an edge or a face of the “rack” providing it is free to
move in the “vector direction” that was shown when it was selected. In our examples, we could
have selected a long edge or an end face of the rack, but not the top/bottom or front/back faces,
nor can we select any of the “short” edges.
Once again, the direction vectors determine which of the
two possible “solution” cases apply.
Assembly IM-07-Steering.iam shows that the axis of
rotation does not need to be at right angles to the
translation direction. This constraint simply says that there
is a relationship between the rotation of one detail and the
translation of another. This variant of the steering
assembly works just as well.
The People On The Bus...
Time to move on (pun intended) to explore the Transitional
motion constraint. The Transitional tab of the Place
Constraint dialogue box is simpler than the Motion tab, but it unleashes a very powerful constraint.
This constraint can best be described as a “cam and follower” motion constraint. It can be used to
model and simulate a range of motions far beyond that which can be accomplished with the regular
assembly constraints and the two Motion constraints. A quick demonstration using IM-08-
transition1.iam (see next page) will show you the some of the power of this constraint.
To apply this constraint, we must click on the curved face at the bottom of the vertical follower
first, and then click on the upper curved face of the cam. We cannot click on an edge or vertex.
For best results, the cam and follower should be in approximately the correct mating position, and
the selected face of the cam should be the first face the follower will touch when the constraint is
applied.
We can now drag the cam around or drive it and the follower will faithfully follow it.
9/14
Moving Right Along: the Inventor motion constraints
10/14
Moving Right Along: the Inventor motion constraints
11/14
Moving Right Along: the Inventor motion constraints
12/14
Moving Right Along: the Inventor motion constraints
However, when the angle d61 hits 15, then 15/15=1 plus 0 remainder and so the arc, and hence
the other three segments, snap back to 0.
As the angle d61 increases from 16-29, the remainder cycles through 1-15 again, and so on. The
belt appears to move continuously. To help understand this, turn off visibility of a straight section
and increase the pause delay to slow down the action.
This, of course, is the exact same principle as movies or TV. It isn’t really an optical illusion, it just
looks like one. I love lying to computers…
3. Spring Has Sprung…
I often get e-mails asking how to produce an associative spring that will automatically change
length as a mechanism operates. Unfortunately, part parameters are not directly available within
an assembly. I suppose you could do it with a pile of VBA programming…
…or you could cheat. To build this spring I first created a
part that is a simple half-coil; I revolved a circle 180°
about an axis.
I then created an assembly and inserted enough half-coils.
Now it was time to constrain it:
• Each end of each half-coil has an Insert constrain
to the next half-coil.
• The first coil has a Mate or Angle constraint to
prevent it from rotating about its central axis. It is
also Tangent to the base plate. Note that it must
be able to shift sideways a little bit.
• The centre point of all remaining half-coils except
the last one is Coincident with a suitable central
axis.
• The last segment is tangent to the upper plate,
which in turn is constrained so it stays parallel with
the base plate.
• Applying the Contact Solver between two segments
will prevent things from flipping inside-out if you
attempt to overtravel the spring.
The one serious limitation is that all segments and the
upper and lower plates must all exist in the final
assembly. You can build a spring sub-assembly and then
add it to a main assembly, but it won’t work until you
promote all of its components up to the assembly level in
one operation.
13/14
Moving Right Along: the Inventor motion constraints
14/14