Simulation of four-bar linkages
With SVG and Flash embedded graphics
|
Version 0.2 – Written by Gildas Trébaol – August
30, 2008
|
|
|
| Figure 1: The simulation software four_bar.exe
V0.1 – SVG views displayed in a Flash window |
Introduction
The four-bar linkage is a versatile planar mechanism, used
extensively in articulated systems:
 |
- In wheel vehicles:
- For the Ackerman steering in all automobiles and trucks.
- For automotive and bicycle suspensions.
- For hydraulic tail lifts, and scissor tippers on dump
trucks.
- In hydraulic machinery:
- For tilting the bucket on hydraulic excavators and
loaders.
- For the blade actuators of earth
moving equipment.
- For the three-point hitch of agricultural tractors.
- In industrial automation and material handling:
- For the needle mechanism on sewing
machines.
- For scissor lifts and conveyor ancillary equipment.
- For packaging machines.
- In doors and covers, instead of a simple hinge:
- For garage lifting doors.
- For engine hoods.
- In hand tools:
- For locking pliers.
- For bolt cutters.
- For manual clamps.
- Etc.
|
| Figure 2: a four bar linkage and his coupler curve |
Empirical design
In mechanical engineering, when you are designing a four bar
mechanism for a given application, there is no analytic way for
computing the parameters of
such a mechanism. Consequently, different techniques have been
developed for finding the best parameters with empirical methods:
- In order to find a path for your application, you can refer to
the standard Hrones and Nelson Atlas of four bar mechanisms:
in 1951, these two scientists established at the MIT a large catalogue
of coupler curves, generated with a mechanical simulator.
- If you want to experiment your own parameters, you can also
compute and simulate the geometry on a computer,
and use vector graphics for
displaying the results of the 2D simulation.
 |
| Figure 3: a coupler curves from the Hrones and Nelson Atlas |
Parts of a four-bar linkage

Figure 4: parts and parameters of a four-bar linkage.
The mechanism of a four-bar linkage is composed of:
- Four mechanical parts:
- A fixed link OD (considered as the static frame of
the machine).
- A crank lever OA (considered as a pilot element).
- A connecting rod AB.
- A rocker lever DB (considered as a follower element).
- Four simple hinges for the joints O A B
D
between consecutive links.
- A coupler point C
fixed on the connecting rod:
- When A, B and C are aligned, the
rod is a
straight lever.
- When A, B and C are not aligned,
the rod has a
triangular shape.
Parameters of the mechanism
The geometry of the mechanism is defined by the following parameters:
- 6 dimensional parameters:
- The length of each bar:
- lp for the crank lever.
- lq for the connecting rod.
- lr for the rocker lever.
- ls for the static frame.
- The coordinates of the coupler point, which may be specified by:
- Cartesian coordinates cu and cv, relative
to the base segment AB.
- Or polar coordinates, sometimes used in other simulators.
- 3 variable parameters, computed by the simulation loop:
- The rotation angle φ of the crank.
- The rotation angle ψ of the rocker.
- The rotation angle θ of the connecting rod.
- Different utility parameters:
- Computed length and angles of the segment AD
- Computed position of the coupler point C
The following table summarizes these parameters:
| Name |
Input / Output / Utility |
Description |
| lp |
I |
length of the input crank 0A |
| lq |
I |
length of the connecting rod AB |
| lr |
I |
length of the the rocker BD |
| ls |
I |
length of the static bar OD |
| lt |
U |
length of the geometric segment AD |
| cu cv |
I |
relative coordinates of the coupler point C |
| φ |
I |
input angle of the crank |
| ψ |
O |
output angle of the rocker |
| θ |
O |
output angle of the connecting rod |
Geometric analysis
Computation of the position with trigonometry
To compute the position of the joint A on the crank, we
use the input angle φ :
xA = xO + lp * cos( φ )
yA = yO + lp * sin( φ )
To compute the position of the joint B between connecting
rod AB and the rocker BD :
- The rotation angle of the rocker BD is double-valued and
it depends on whether the point B is below or above the
segment AD.
- On the geometry, it means that joint B is on the
intersections
of two circles having a radius of lq and lr,
centered on the joints A and B.
- To compute the position of B, we use the the 3
triangles ABD, AHB, and DHB.
- To compute these triangles, we study the right triangle DHB.
To compute the β angle in the triangle DHB :
- The variable lt = distance( A, D ) is defined by:
lt = sqrt( (xD - xA)2 + (yD - yA)2)
- The lt length is the sum of AH and HD
:
lt = AH + HD
- On the right triangle AHB, the Pythagorean theorem
defines the expression :
AB2 = AH2 + HB2
- On the right triangle DHB, the Pythagorean theorem
defines the expression :
DB2 = DH2 + HB2
- The subtraction of the 3rd and 4th
equations gives :
DA2 - DB2 = lq2 - lr2
= AH2 - HB2
- The 2nd and 5 th equations can be combined :
lq2 - lr2 = (AH + HB) * (AH - HB) = lt *
(AH – HB)= lt * (lt - 2 * HB)
- The distance HB is defined by the 6th
equation :
HB = (lt2 - lq2 + lr2) / (2 *
lt)
- The distance HB and the radius lr define the
cosine of the β angle:
cos( β )= HR / lr
- The 7th and the 8th equations give :
β = acos( (lt2 - lq2 + lr2) /
(2 * lr * lt) )
To compute the α angle between the segment DA
and the static bar OD :
α = atan2( yA – yD, xA - xD )
Now, we can compute the two possible ψ angles between the
rocker DB and the static bar OD :
ψ = α ± β
The sign of the β angle is:
- <0 when the joint B is above the line
segment AD (case of the direct circuit configuration).
- >0 when the joint B is below the line
segment AD (case of the crossed circuit configuration).
Now, we can compute the two positions of the B joint :
xB = lr * cos( ψ ) + ls
yB = lr * sin( ψ )
Now, we can compute the θ angle (-π ≤ θ ≤ π )
between the rod AB and the static bar OD :
θ = atan2( yB – yA, xB - xA )
Finally, we can compute the position of the coupler point C,
using the relative coordinates cu and cv :
xC = xA + cu * cos( θ ) - cv * sin( θ )
yC = yA + cu * sin( θ ) + cv * cos( θ )
Usage of the Grashof condition
 |
| S = shortest link, L = longest link |
Source: Wikipedia |
| Figure 5: types of four bar linkages |
The Grashof condition determines different types of four-bar
linkages:
- The mechanism can have either a continuous or an alternative
rotation:
- Depending of the dimension of each link, there are different
kinds
of four-bar linkages,
the crank and the rocker may either follow a complete rotation,
or just oscillate on a limited dwell angle.
- When designing a linkage where the input linkage is
continuously
rotated (for example, driven by a motor),
it is important that the input link can
freely rotate through complete revolutions.
- The Grashof's law provides a simple test for checking this
condition:
- For a planar four bar linkage having a continuous relative
rotation between
two members,
the sum of
the shortest and longest links must be less than the sum of the
remaining links.
- In other words, if the crank has to rotate on a whole turn, the
mechanism must respect the following conditions:
- S + L < P + Q
- S and L are the lengths of the
shortest and the longest links respectively.
- P and Q are the lengths of the remaining
two links.
- The figure above shows different configurations:
- The Grashof condition is respected in the 1st, 2nd
and 4th cases.
- For a drag link configuration, S
is the
length of the fixed link ls.
- For a crank-rocker configuration, S is the
length of the crank lp.
- For a double-rocker configuration, the linkage will
lock at the ends
of the stroke of the crank
- For a parallelogram configuration, the mechanism has 2
mathematic singularities,
but the two cranks can still follow a whole turn because we have S
= P and L = Q.
The four-bar simulation software
Usage of vector graphics for displaying the simulation sequence
Here we use SVG and Flash techniques for
displaying the simulation:
- SVG for generating the analysis report in XML format.
- Flash for embedding it in a Windows application.
Configuration files and result files
- Configuration files:
- The simulator is configured with the text files in the test/config
directory.
- In order to load a configuration file, you can:
- Either run the program with the path of a configuration file:
four_bar.exe -f config/crank_rocker.txt
- Or just drag another configuration file over the window of
the simulator:
the mechanism is rebuilt as specified in the configuration file.
- Result files:
- For each simulation cycle, the program generates .SVG
and .SWF files.
- If you want to save them, you can rename or copy the last .SVG
or .SWF files generated in the test directory.
- The Flash movie of a simulation can be embedded in a HTML page
with the following syntax:
<embed src="triangle_path.swf" width="400" height="300" quality="high" type="application/x-shockwave-flash" >
|
|
|
Demonstration with well known mechanisms
Straight line linkages
In the steam engines developed in the 19th
century, the translation of the piston is often guided by an
articulated system,
instead of a sliding system. For such applications, different
inventors,
engineers and
mathematicians disvovered interesting four bar linkages where a part of
the coupler curve is almost a straight line.
These mechanisms only approximate a straight line. An exact straight
line linkage was discovered in 1864 and
1871 by Peaucellier and Lipkin:
- Charles Nicolas Peaucellier (1832-1913), French military engineer.
- Independently discovered by Lipmann I. Lipkin (1846-1876),
Lithuanian mathematician.
- Although it is mathematically perfect, it is not presented
here because it is complex (8 independent solids)
whereas the straight line linkages presented above are still
used today in various applications.
References
- Introduction to the four bar linkages:
See on Wikipedia – http://en.wikipedia.org/wiki/Four_bar_linkage
- History of the straight line linkages:
"How to Draw a Straight Line", by Daina
Taimina – http://kmoddl.library.cornell.edu/tutorials/04/
- Analysis of the Four-Bar Linkage
by John A Hrones and George L. Nelson – M.I.T. Press and John Wiley
& Sons – 1951
- A animated presentation of the Hrones and Nelson coupler curves:
Matlab simulation developed by Fan (Michael) Mo
taken from the page 116 of "Design of Machinery", 3rd
edition – by Robert L. Norton – McGraw-Hill – 2004
http://dynaden.wonkwang.ac.kr/data file/kinematics/animation/WM/ch3/coupler_curve_atlas/coupler_curve_atlas.htm
- Animated images showing straight line linkages:
at the IEL department at UC Davis – http://iel.ucdavis.edu/design/fourbar/fourbarStraight.html
- Synthesis of Four-Bar Linkage Mechanisms
using Pattern-Matching Approach and Genetic Algorithms
by Vipul Kumar and Gupta Shorya Awtar – http://www.cse.iitk.ac.in/~amit/courses/751/97/LINKAGE_SYNTHESIS
- An open-source simulator of four-bar linkages :
"Logiciel de visualisation de mécanismes à quatre
barres" – 1995
by Jean-Pierre
Merlet – INRIA Sophia Antipolis – ftp://ftp-sop.inria.fr/coprin/4bar/
- A commercial simulator of four-bar linkages :
Four-Bar Linkage Analysis and Synthesis – http://www.softintegration.com/chhtml/toolkit/mechanism/fourbar/
- A commercial simulator for designing different types of linkages :
Linkage Design Tools – by Robert L. Norton
– http://www.designofmachinery.com/Linkage/index.html
A zipped
version of this example is available in http://gtrebaol.free.fr/doc/flash/four_bar/doc/