This document presents supplemental notes to accompany the ME 3011 NotesBook. The outlinegiven in the Table of Contents on the next page dovetails with and augments the ME 3011 NotesBookoutline and hence is incomplete here.

The phasoriPeis a polar representation for vectors, where P is the length of vectorP, e is thenatural logarithm base,1i  is the imaginary operator, and  is the angle of vectorP.iegives thedirection of the length P, according to Euler’s identity.

cos sinie i 

ieis a unit vector in the direction of vectorP.

Phasor Re-Im representation of a vector is equivalent to Cartesian XY representation, where the real (Re)axis is along X (orˆi) and the imaginary (Im) axis is along Y (orˆj).

Matrixan m x n array of numbers, where m is the number of rows and n is the number of columns. 11 12 121 22 21 2nnm m mna a aa a aAa a a   

Matrices may be used to simplify and standardize the solution of n linear equations in n unknowns(where m = n). Matrices are used in velocity, acceleration, and dynamics linear equations (matrices arenot used in position analysis which requires a non-linear solution).

Matrix Multiplication with Scalarmultiply each term and keep the results in place

a b ka kbkc d kc kd     

Matrix Multiplication

C A B

In general,AB B A

The row and column indices must line up as follows.

( x ) ( x )( x )C A Bm n m p p n

That is, in a matrix multiplication product, the number of columnspin the left-hand matrix must equalthe number of rowspin the right-hand matrix. If this condition is not met, the matrix multiplication isundefined and cannot be done.

The size of the resulting matrix [C] is from the number of rowsmof the left-hand matrix and thenumber of columnsnof the right-hand matrix,mxn.

Multiplication proceeds by multiplying like terms and adding them, along the rows of the left-hand matrix and down the columns of the right-hand matrix (use your index fingers from the left andright hands).

Since we cannot divide by a matrix, we multiply by the matrix inverse instead. GivenC A B, solve for [B].

C A B 

           1 1AC A A BI BB 

1BA C 

Matrix [A] must be square (m=n) to invert.

1 1AA A A I  

where [I] is the identity matrix, the matrix 1 (ones on the diagonal and zeros everywhere else). Tocalculate the matrix inverse use the following expression.

 1adjoint( )AAA

whereAis the determinant of [A].

adjoint( ) cofactor( )TAA

cofactor(A)( 1)i jij ija M 

minor minor Mijis the determinant of the submatrix with row i andcolumn j removed.

For another example, givenC A B, solve for [A]

C A B 

         1 1C B A B BA IA

 1AC B 

In general the order of matrix multiplication and inversion is crucial and cannot be changed.

9

Matrix Determinant

The determinant of a square n x n matrix is a scalar. The matrix determinant is undefined for anon-square matrix. The determinant of a square matrix A is denoted det(A) orA. The determinantnotation should not be confused with the absolute-value symbol. The MATLAB function for matrixdeterminant isdet(A).

If a nonhomogeneous system of n linear equations in n unknowns is dependent, the coefficientmatrix A is singular, and the determinant of matrix A is zero. In this case no unique solution exists tothese equations. On the other hand, if the matrix determinant is non-zero, then the matrix is non-singular, the system of equations is independent, and a unique solution exists.

The formula to calculate a 2 x 2 matrix determinant is straight-forward.

 a bAc d   

Aad bc

To calculate the determinant of 3 x 3 and larger square matrices, we can expand about any onerow or column, utilizing sub-matrix determinants. Each sub-determinant is formed by crossing out thecurrent row and its column and retaining the remaining terms as an n–1 x n–1 square matrix, each ofwhose determinant must also be evaluated in the process. The pivot term (the entry in the cross-out rowand column) multiplies the sub-matrix determinants, and there is an alternating + / – / + / – etc. signpattern. Here is an explicit example for a 3 x 3 matrix, expanding about the first row (all other optionswill yield identical results). a b cAd e fgh k     

For a 3 x 3 matrix only, the determinant can alternatively be calculated as shown, by copying columns 1and 2 outside the matrix, multiplying the downward diagonals with + signs and multiplying the upwarddiagonals with – signs (clearly the result is the same as in the above formula).

Where aijare the nine known numerical equation coefficients, xiare the three unknowns, and biare thethree known right-hand-side terms. Using matrix multiplication backwards, this is written as Ax b.

There is a unique solution  1xA b only if [A] has full rank. If not,0A (the determinant ofcoefficient matrix [A] is zero) and the inverse of matrix [A] is undefined (since it would require dividingby zero; in this case the rank is not full, it is less than 3, which means not all rows/columns of [A] arelinearly independent).Gaussian Eliminationis more robust and more computationally efficient thanmatrix inversion to solve the problem Ax bfor {x}.

The first solution of the linear equations above uses the matrix inverse. To solve linearequations,Gaussian Eliminationis more efficient (more on this in the dynamics notes later) and morerobust numerically; Gaussian elimination implementation is given in the third to the last line of theabove m-file (with the back-slash).

Since the equations are linear, there is a unique solution (assuming the equations are linearlyindependent, i.e. the matrix is not near a singularity) and so both solution methods will yield the sameanswer.

Remembering the earlier definition for t, this result is the second derivation we need, i.e.

22sin1tt 

The tangent half-angle substitution can also be derived using a graphical method as in the figurebelow.

17

Alternate solution method

The equation form

cos sin 0E F G 

arises often in the position solutions for mechanisms and robots. It appeared in the4solution for thefour-bar mechanism in the ME 3011 NotesBook and was solved using the tangent half-anglesubstitution.

Next we present an alternative and simpler solution to this equation. We make two simpletrigonometric substitutions based on the figure below.

and the quadrant-specific inverse tangent functionatan2must be used in the above expression for.

There are two solutions for, indicated by the subscripts 1,2, since the inverse cosine function isdouble-valued. Both solutions are correct. We expected these two solutions from the tangent-half-anglesubstitution approach. They correspond to the open- and crossed-branch solutions (the engineer mustdetermine which is which) to the four-bar mechanism position analysis problem.

For real solutions forto exist, we must have

2 21 1GE F  or2 21 1GE F  

If this condition is violated for the four-bar mechanism, this means that the given input angle2isbeyond its reachable limits (see Grashof’s Law).

Grashof’s Law was presented in the ME 3011 NotesBook to determine the input and output linkrotatability in a four-bar mechanism. Applying Grashof’s Law we determine if the input and outputlinks are a crank (C) or a rocker (R). A crank enjoys full 360 degree rotation while a rocker has arotation that is a subset of this full rotation. This section presents more information on Grashof’s Lawand then the next subsection presents four-bar mechanism joint limits.

Grashof's condition states "For a four-bar mechanism, the sum of the shortest and longest linklengths should not be greater than the sum of two remaining link lengths". With a given four-barmechanism, the Grashof Condition is satisfied ifL S P Q where S and L are the lengths of theshortest and longest links, and P and Q are the lengths of the other two intermediate-sized links. If theGrashof condition is satisfied, at least one link will be fully rotatable, i.e. can rotate 360 degrees.

For a four-bar mechanism, the following inequalities must be satisfied to avoid locking of themechanism for all motion.

2 1 3 44 1 2 3r r r rr r r r  

With reference to the figure below, these inequalities are derived from the fact that the sum oftwo sides of a triangle must be greater than the third side, for triangles4 1 1O AB and2 2 2O A B, respectively.Note from our standard notation,1 2 4r O O,2 2r O A,3r AB, and4 4r O B.

ABAO22O4A1B1B2

21

Four-Bar Mechanism Joint Limits

IfGrashof's Lawpredicts that the input link is a rocker, there will be rotation limits on the inputlink. These joint limits occur when links 3 and 4 are aligned. As shown in the figure below, there willbe two joint limits, symmetric about the ground link.

This example is shown graphically in the ME 3011 NotesBook, in the Grashof’s Law section (2. Non-Grashof double rocker, first inversion).

Caution

The figure on the previous page does not apply in all joint limit cases. ForGrashofMechanismswith a rocker input link, one link 2 limit occurs when links 3 and 4 fold upon each otherand the other link 2 limit occurs when links 3 and 4 stretch out in a straight line. See Example 4 (andExample 3 for a similar situation with the output link 4 limits).

23

Joint Limit Example 2Given1 2 3 410,4,8,7r r r r  

L S P Q  (10 4 8 7 )

Since the S link is adjacent to the fixed link, we predict thisGrashof Mechanismis a crank-rocker.Therefore, there are no 2joint limits.

This is the four-bar mechanism from Term Example 1 and it is a four-bar crank-rockerGrashofMechanism. There are no limits on 2since link 2 is a crank.

The 4limits are

4120.1L (links 2 and 3 stretched in a line)

4172.5L (links 2 and 3 folded upon each other in a line)

The output angle range is

4120.1 172.5  

and 2is not limited. This example is NOT shown graphically in the ME 3011 NotesBook Grashof’sLaw section. However, these 4limits are clearly seen in the F.R.O.M. plot for angle 4in TermExample 1 in the ME 3011 NotesBook.

25

Joint Limit Example 4Given1 2 3 410,8,4,7r r r r  

L S P Q  (10 4 8 7 )

so we predict thisGrashof Mechanismis a double-rocker (S opposite fixed link). The 2joint limitsare no longer symmetric about the ground link, as was the case in theNon-Grashof Mechanismdoublerocker (Example 1). For 2min, links 3 and 4 are folded upon each other (their absolute angles areidentical).

In this plot we can see the minimum and maximum values we just calculated for links 2 and 4.

Note at2min14.4 ,3138.6 and3221.4  are the same angle.

Again, this example is NOT shown graphically in the ME 3011 NotesBook Grashof’s Law section.However, a similar case with the same dimensions, in different order, is shown in the ME 3011NotesBook (1 2 3 47,10,4,8r r r r    , 1d. Grashof double rocker).

Grashof’s Law only predicts the rotatability of the input and output links; it says nothing aboutthe rotatability of the coupler link 3 – in this case, what is the rotatability of the coupler link? (In thiscase the coupler link S rotates fully, proving that the relative motion is the same amongst all four-barmechanism inversions, though the absolute motion with respect to the possible 4 ground links is verydifferent.)

This establishes the rectangular corner coordinates for the slider link, centered at the origin of yourcoordinate frame. It can be done once, outside the loop. Instead of typing numbers forLpandHp, Iscale them to a fraction of r2, for generality in different-sized slider-crank mechanisms. Note I onlyincluded the four corner points – MATLABpatch(below) closes the rectangular figure, i.e. back tothe starting point.

Inside the loop(right after theplotcommand where links 2 and 3 are drawn to the screen)

patch(Xp+x(i),Yp+h,'g'); % draw piston to screen

wherex(i)is the variable horizontal slider displacement andhis the constant vertical offset. Theseposition parameters shift the piston coordinates from the origin to the correct location in each loop. Youcan use any piston color you like (I showgreenhere,'g').

Inside the loop(right after theplotcommand where links 2 and 3 are drawn to the screen)

line(Xpt,Ypt,'LineWidth',2); line(Xpb,Ypb,'LineWidth',2);

Set the piston wall widthwallto allow a small clearance between the piston and the walls. Again, itcan be scaled to a small fraction of r2for generality. The-1000and1000coordinates used above areto extend the piston wall lines off the screen to the left and to the right.

30

MATLAB subplot feature

In a slider-crank mechanism full-range-of-motion (F.R.O.M.) simulation you will need to plotboth 3and x vs. the independent variable 2. Since the units of 3(deg) and x (m) are dissimilar, theymay not fit clearly on the same plot. In this situation you should use a sub-plot arrangement.

Now, you can use the standard axis labels, linetypes, titles, axis limits, grid, etc., for each plot within asubplot (repeat these formatting commands after eachplotstatement above to use similar formattingfor each). These options are not shown, for clarity.

The generalized usage ofsubplotis shown below.

subplot(mni); % m x n arrangement of plots, ithplotplot( . . . );

As seen in the example syntax above, the integers need not be separated by spaces or commas.However, I believe they may be so separated if you desire.

31

2.1.3 Inverted Slider-Crank Mechanism Position Analysis

This slider-crank mechanism inversion 2 is an inversion of the standard zero-offset slider-crankmechanism where the sliding direction is no longer the ground link, but along the rotating link 4.Ground link length r1and input link length r2are fixed; r4is a variable. The slider link 3 is attached tothe end of link 2 via an R joint and slides relative to link 4 via a P joint. This mechanism converts rotaryinput to linear motion and rotary motion output. Practical applications include certain doors/windowsopening/damping mechanisms. The inverted slider-crank is also part of quick-return mechanisms.

Link 1 is the fixed ground link. Without loss of generality we may force the ground link to behorizontal. If it is not so in the real world, merely rotate the entire inverted slider-crank mechanism so itis horizontal. Both angles 2and 4are measured in a right-hand sense from the horizontal to the link.

Step 2.

State the Problem

Givenr1, 1= 0, r2; plus 1-dof position input 2

Findr4and 4

2143

32

Step 3.Draw theVector Diagram. Define all angles in a positive sense, measured with the right handfrom the right horizontal to the link vector (tail-to-head; your right-hand thumb is located at the vectortail).

Step 4.Derive theVector-Loop-Closure Equation. Starting at one point, add vectors tail-to-head untilyou reach a second point. Write the VLCE by starting and ending at the same points, but choosing adifferent path.

2 1 4r r r

Step 5.Write theXY Componentsfor the Vector-Loop-Closure Equation. Separate the one vectorequation into its two X and Y scalar components.

2 2 1 4 42 2 4 4r c r r cr s r s

Step 6.

Solve for the Unknownsfrom the XY equations. There are two coupled nonlinear equations inthe two unknowns r4, 4. Unlike the standard slider-crank mechanism, there is no decoupling of X andY. However, unlike the four-bar mechanism, there is only one unknown angle so the solution is easierthan the four-bar mechanism. First rewrite the above XY equations to isolate the unknowns on one side.

4 4 2 2 14 4 2 2r c r c rr s r s

A ratio of the Y to X equations will cancel r4and solve for 4.

4 4 2 24 4 2 2 1r s r sr c r c r

4 2 2 2 2 1atan2(,)r s r c r

Then square and add the XY equations to eliminate 4and solve for r4.

2 24 1 2 1 2 22r r r rr c  

214

33

Note the same r4formula results from thecosine law. Alternatively, the same r4can be solved fromeither the X or Y equations after is 4known.

X)2 2 144r c rrcY)2 244r srs

Both of these r4alternatives are valid; however, each is subject to a different artificial mathematicalsingularity (490  and40,180 , respectively), so only the former square-root formula should beused for r4, which has no artificial singularity. The X algorithmic singularity490  never occursunless2 1r r, which is to be avoided (see below), but the Y algorithmic singularity occurs twice per fullrange of motion.

Technically there are two solution sets – the one above and2 24 1 2 1 2 22r r r rr c  ,4.However, the negative r4is not practical and so only the one solution set (branch) exists, unlike mostplanar mechanisms with two or more branches.

Full-rotation condition

For the inverted slider-crank mechanism to rotate fully, the fixed length of link 4, L4, must begreater than the maximum value of the variable r4.

The Inverted Slider-Crank mechanism position analysis may be solved graphically, by drawingthe mechanism, determining the mechanism closure, and measuring the unknowns. This is an excellentmethod to validate your computer results at a given snapshot.

This Term Example 3 position solution is demonstrated in the figure below.

Term Example 3 Position Snapshot-0.1-0.0500.050.10.150.2-0.1-0.0500.050.10.150.2X(m)Y (m)

36

Full-Range-Of-Motion (F.R.O.M.) Analysis: Term Example 3A more meaningful result from position analysis is to report the position analysis unknowns forthe entire range of mechanism motion. The subplots below gives r4(m) and 4(deg), for all20 360  , for Term Example 3.

Thus far we have presented position analysis for the single-loop four-bar, slider-crank, andinverted slider-crank mechanisms. The position analysis for mechanisms of more than one loop ishandled using the same general procedures developed for the single loop mechanisms. A good rule ofthumb is to look for four-bar (or slider-crank) parts of the multi-loop mechanism as we already knowhow to solve the complete position analyses for these.

This section presents position analysis for the two-loop Stephenson I six-bar mechanism shownbelow as an example multi-loop mechanism. This is one of the five possible six-bar mechanisms shownin the on-line Mechanisms Atlas.

Stephenson I 6-Bar Mechanism

We immediately see that the bottom loop of the Stephenson I six-bar mechanism is identical toour standard four-bar mechanism model. Since we number the links the same as in the four-bar, and ifwe define the angles identically, the position analysis solution is identical to the four-bar presentedearlier. With the complete position analysis of the bottom loop thus solved, we see that points C and Dcan be easily calculated. Then the solution for the top loop is essentially another four-bar solution:graphically, the circle of radius r5about point C must intersect the circle of radius r6about point D toform point E (yielding two possible intersections in general). The analytical solution is very similar tothe standard four-bar position solution, as we will show.

For multi-loop mechanisms, the number of solution branches for position analysis increasescompared to the single-loop mechanisms. Most single-loop mechanisms mathematically have twosolution branches. For multi-loop mechanisms composed of multiple single-loop mechanisms, thenumber of solution branches is 2n, where n is the number of mechanism loops. For the two-loopStephenson I six-bar mechanism, the number of solution branches for the position analysis problem is 4,two from the standard four-bar part, and two for each of these branches from the upper loop.

38

Now let us solve the position analysis problem for the two-loop Stephenson I six-bar mechanismusing the formal position analysis steps presented earlier. Assume link 2 is the input link.