Position Analysis of Slider-Crank (R-RRT) Mechanism
Aim: The R-RRT (slider-crank) mechanism shown in Fig. .(a) has the dimensions! A" # $!% m and "C # % m. The dri&er link % makes an angle ' # '% # () $ with the hori*ontal a+is. Find the ,ositions of the -oints and the angles of the links with the hori*ontal a+is. Solution: The Matla. ,rogram starts with the statements clear / clears all &aria.les from the works,ace clc / clears the command window and homes the c0rsor close all / closes all the o,en 1g0re windows The Matla. commands for the in,0t data are AB=0.5; BC=1; The angle of the dri&er link % with the hori*ontal a+is ' # () $ . The Matla. command for the in,0t angle is phi=pi/4; 2here ,i has a n0merical &al0e a,,ro+imately e30al to 4.%(%)5. Position of joint A A Cartesian reference frame +6y is selected. The -oint A is in the origin of the reference frame7 that is7 A867 +A # $9 yA # $9 or in Matla. xA=0; yB=0; Position of joint B The 0nknowns are the coordinates of the -oint "7 +" and y". "eca0se the -oint A is fi+ed and the angle ' is known7 the coordinates of the -oint " are com,0ted from the following e+,ressions +" # A" cos ' # ($!)) cos ()1 # $!4)4))4 m9 y" # A" sin ' # ($!)) sin ()1 # $!4)4))4 m! (.:) The Matla. commands for ;3. (.:) are xB=AB*cosphi!; yB=AB*Sinphi!; where ,hi is the angle ' in radians. Position of joint C The 0nknowns are the coordinates of the -oint C7 +C and yC. The -oint C is located on the hori*ontal a+is yC # $ and with Matla. yC=0; The length of the segment "C is constant
;30ation (.5) with Matla. command is e"nC=#xB$xCsol!%&'yB$yC!%&=BC%&#; / where +Csol is the 0nknown. To sol&e the e30ation7 a s,ecific Matla. command will .e 0sed. The command sol(e#e"n1#)#e"n&#)...)#e"n*#)#(ar1#)#(ar&#)...#(ar*#! attem,ts to sol&e an e30ation or set of e30ations <e3n%<7<e3n<7...7<e3n=< for the &aria.les <e3n=<7<&ar%<7<&ar<7...<&ar=<. The set of e30ations are sym.olic e+,ressions or strings s,ecifying e30ations. For the R-RRT mechanism solC =sol(ee"nC)#xCsol#!; "eca0se it is a 30adratic e30ation two sol0tions are fo0nd for the ,osition of C. The two sol0tions are gi&en in a &ector form! solC is a &ector with two com,onents solC(%) and solC(). To o.tain the n0merical sol0tions the e&al command has to .e 0sed xC1=e(alsolC1!!; xC&=e(alsolC&!!; The command e&al(s)7 where s is a string7 e+ec0tes the string as an e+,ression or statement. These two sol0tions for +C are located at the intersection of the hori*ontal a+is $+ with the circle centered in " and radi0s C"7 as shown in Fig. .(.)7 and they ha&e the following n0merical &al0es! +C% # %!:5$ m and +C # - $!):%5 m! To determine the correct ,osition of the -oint C for the mechanism7 an additional condition is needed. For the first 30adrant7 $ > ' >5$ $ 7 the condition is +C ? +". This condition with Matla. is i+ xC1 , xB xC = xC1; else xC = xC&; en- The general form of the if statement is if e+,ression statements else statements end The +-coordinate of the -oint C is +C # +C% # %!:5$ m. The angle of the link (link "C) with the hori*ontal is or in Matla. phi& = atanyB$yC!/xB$xC!!; The statement atan(s) is the arctangent of the elements of s. The n0merical sol0tions for "7 C7 and 1 are ,rinted 0sing the statements +print+#xB = ./ m! nn#) xB!; +print+#yB = ./ m! nn#) yB!; +print+#xC = ./ m! nn#) xC!; +print+#yC = ./ m! nn#) yC!; +print+#phi& = ./ -e/rees! nn#) phi&*100/pi!; The statement f,rintf(f7format7s) writes data in the real ,art of array s to the 1le f. The data is formatted 0nder control of the s,ecified format string. The res0lts of the ,rogram are dis,layed as +" # $.4)4))4 (m) y" # $.4)4))4 (m) +C # %.$@:% (m) yC # %.::5A (m) ,hi # -$.A$(: (degrees) ?? The mechanism is ,lotted with the hel, of the command ,lotf. The statement ,lotf(+7y7c) ,lots &ector + &ers0s &ector +7 and c is a character string. For the R-RRT mechanism two straight lines A" and "C are ,lotted ,lot( B+A7+"C7ByA7y"C7<r-o<7 B+"7+CC7By"7yCC7<.-o< )7... The line A" is a red (r red )7 solid line (- solid)7 with a circle (o circle) at each data ,oint and the line "C is a .l0e (. .l0e )7 solid line with a circle at each data ,oint and the. The gra,hic of the mechanism o.tained with Matla. is shown in Fig. .4. The +-a+is and y-a+is are la.eled 0sing the commands +la.el(<+ (m)<)7... yla.el(<y (m)<)7... and a title is added title(<,ositions for n,hi # () (deg)<)7... 6n the 1g0re the -oints A7 "7 and C are identi1ed with the statements te+t(+A7yA7< A<)7... te+t(+"7y"7< "<)7... te+t(+C7yC7< C<)7... a+is(B-$. %.( -$. %.(C)7... grid The commas and elli,ses (...) after the command are 0sed to e+ec0te the commands together. 6therwise7 the data will .e ,lotted7 then the la.els will .e added and the data re,lotted7 and so on. The statement a+is(B+MD= +MAE yMD= yMAEC) sets scaling for the + and y a+es on the c0rrent ,lot. To im,ro&e the gra,h a .ackgro0nd grid was added with the command grid. 1A23AB 45675A1 % Program 2.1 % R-RRT % Position analysis clear % clears all variables from the workspace clc % clears the command window and homes the cursor close all % closes all the open figure windows % nput data !"#$.%& "'#1& phi # pi()& % Position of *oint ! +origin, -! # $& y! # $& % Position of *oint " - position of the driver link -" # !".cos+phi,& y" # !".sin+phi,& % Position of *oint ' y' # $& % /istance formula0 "'#constant e1n' # 2+ -" - -'sol ,32 4 + y" - y' ,32 # "'322& % 5olve the above e1uation sol' # solve+e1n'6 2-'sol2,& % solve symbolic solution of algebraic e1uations % Two solutions for -' - vector form -'1#eval+sol'+1,,& % first component of the vector sol' -'2#eval+sol'+2,,& % second component of the vector sol' % eval e-ecutes string as an e-pression or statement % 5elect the correct position for ' for the given input angle if -'1 7 -" -' # -'1& else -' # -'2& end % if conditionally e-ecutes statements % !ngle of the link 2 with the hori8ontal phi2 # atan++y"-y',(+-"--',,& fprintf+2Results 9n2,& fprintf+2 9n2,& % Print the coordinates of " fprintf+2-" # %g +m,9n26 -",& fprintf+2y" # %g +m,9n26 y",& % Print the coordinates of ' fprintf+2-' # %g +m,9n26 -',& fprintf+2y' # %g +m,9n26 y',& % Print the angle phi2 fprintf+2phi2 # %g +degrees, 9n26 phi2.1:$(pi,& % ;raphic of the mechanism plot+ <-!6-"=6<y!6y"=62r-o26 <-"6-'=6<y"6y'=62b-o2 ,6... -label+2- +m,2,6... ylabel+2y +m,2,6... title+2positions for 9phi # )% +deg,2,6... te-t+-!6y!62 !2,6... te-t+-"6y"62 "2,6... te-t+-'6y'62 '2,6... a-is+<-$.2 1.) -$.2 1.)=,6... grid % the commas and ellipses +..., after the commands were used % to e-ecute the commands together Path of a Point on a Link with General Plane Motion: The mechanism shown in Fig. 2.18(a) has A ! ":# m an$ % ! 1 m. The link 2 (connecting ro$ %) has a general &lane motion: translation along '(a'is) translation along *(a'is) an$ rotation a+o,t -(a'is. The mass center of link 2 is locate$ at %2. .etermine the &ath of &oint %2 for a com&lete rotation of the $ri/er link 1. 0ol,tion The coor$inates of the 1oint are: ' ! A cos 2 an$ * ! A sin 2) where " 32345" " . The coor$inates of the 1oint % are: '% ! ' 6 an$ *% ! ". The mass center of the link 2 is the mi$&oint of the segment % The Matla+ statements for the coor$inates of %2 are AB = .5; BC = 1; xA = 0; yA = 0; yC = 0; incr = 0; for phi=0:pi/10:2*pi, xB = AB*cos(phi); yB = AB*sin(phi); xC = xB + sqrt(BC2!yB2); incr = incr + 1; xC2(incr)=(xB+xC)/2; yC2(incr)=(yB+yC)/2; "n# $ "n# for For the com&lete rotation of the $ri/er link A) " 32345" " . ) a ste& angle of 781" was selecte$. For the coor$inates of %2 two /ectors '%2! 9'%2 (1) '%2(2) ... '%2(incr) ... : an$ *%2! 9*%2 (1) *%2(2) ... *%2(incr) ... : are o+taine$. The ;rst com&onents '%2(1) an$ *%2(1) are calc,late$ for &hi!" an$ incr!1. The &ath of %2 is o+taine$ &lotting the /ector *%2 in terms of '%2 &lot('%2) *%2) <(ko<))... 'la+el(<' (m)<)) *la+el(<* (m)<))... title(<Path $escri+e$ +* %2<)) gri$ Fig,re 2.18(+) shows two &lots: the mechanism for " 32345" " an$ the close$ &ath $escri+e$ +* the &oint %2 on the link 2 in general &lane motion. MATFA" C6G; % Program 2.> % R-RRT % Position analysis % Path of '2 +mass center of link "', clear& clc& close all !" # %& "' # 1& -! # $& y! # $& y' # $& incr # $ & for phi#$0pi(1$02.pi6 -" # !".cos+phi,& y" # !".sin+phi,& -' # -" 4 s1rt+"'32-y"32,& incr # incr 4 1& -'2+incr,#+-"4-',(2& y'2+incr,#+y"4y',(2& % ;raphic of the mechanism subplot+26161,6... plot+ <-!6-"=6<y!6y"=62r-26... <-"6-'=6<y"6y'=62b-2 ,6... hold on -label+2- +m,2,6 ylabel+2y +m,2,6... title+2;raphic of the mechanism2,6... te-t+-'26y'262'22,6... a-is+<-$.> 1.> -$.> $.>=,6... end % end for % Path of '2 +mass center of link 2, subplot+26162,6... plot+-'26 y'26 2-ko2,6... -label+2- +m,2,6 ylabel+2y +m,2,6... title+2Path described by '22,6 grid &. Simulation o+ Sprin/ 8 1ass 9 :amper System ;ritin/ 1atla< =unctions: :ampe- sprin/ system Dn this e+am,le7 we will create a Sim0link model for a mass attached to a s,ring with a linear dam,ing force. A mass on a s,ring with a &elocity-de,endant dam,ing force and a time-de,endant force acting 0,on it will .eha&e according to the following e30ation! The model will .e formed aro0nd this e30ation. Dn this e30ation7 <m< is the e30i&alent mass of the system9 <c< is the dam,ing constant9 and <k< is the constant for the stiffness of the s,ring. First we want to rearrange the a.o&e e30ation so that it is in terms of acceleration9 then we will integrate to get the e+,ressions for &elocity and ,osition. Rearranging the e30ation to accom,lish this7 we get! To .0ild the model7 we start with a <ste,< .lock and a <gain< .lock. The gain .lock re,resents the mass7 which we will .e e30al to ). 2e also know that we will need to integrate twice7 that we will need to add these e30ations together7 and that there are two more constants to consider. The dam,ing constant <c< will act on the &elocity7 that is7 after the first integration7 and the constant <k< will act on the ,osition7 or after the second integration. Fet c # $.4) and let k # $.). Fying all these .lock o0t to get an idea of how to ,0t them together7 we get! "y looking at the e30ation in terms of acceleration7 it is clear that the dam,ing term and s,ring term are s0mmed negati&ely7 while the mass term is still ,ositi&e. To add ,laces and change signs of terms .eing s0mmed7 do0.le-click on the s0m f0nction .lock and edit the list of signs! 6nce we ha&e added ,laces and corrected the signs for the s0m .lock7 we need only connect the lines to their a,,ro,riate ,laces. To .e a.le to see what is ha,,ening with this s,ring system7 we add a <sco,e< .lock and add it as follows! The &al0es of <m<7 <c< and <k< can .e altered to test cases of 0nder-dam,ing7 critical- dam,ing and o&er-dam,ing. To acc0rately 0se the sco,e7 right-click the gra,h and select HA0toscaleH. The mdl-file can now .e sa&ed. The following is a sam,le o0t,0t when the model is r0n for 4$ iterations. >. Sprin/ mass -amper 4. ?inematic 4ro<lem o+ a =our$Bar 3in@a/e +or the 1echanical :ynamics 2a@e print o+ the co-e +ile name: part>95.p-+. 5. ?inematic 4ro<lem o+ a Sli-er cran@ 3in@a/e +or the 1echanical :ynamics 2a@e print o+ the co-e +ile name: part>95.p-+. A. Cantile(er -ynamics Bser$:e+ine- Cantile(er Ci/en(alues/Ci/en(ectors! Chapter 14 p/:>AD! =rom Ei<ration Simulation Bsin/ 1A23AB an- A*SFS $ 1ichael 5 Gatch The MATFA" code cantH&elH/uyan.m sol&es for the eigen&al0es and eigen&ectors of a two-element steel cantile&er with dimensions of $. + + $mm. The code does the following7 where each time MATFA" calc0lates a res0lt it is com,ared to the hand-calc0lated res0lt! %) .0ilds mass and stiffness matrices element .y element ) deletes degrees of freedom associated with constrained left hand end 4) reorders the matrices and ,erforms I0yan red0ction () con&erts to state s,ace form )) calc0lates eigen &al0esJeigen &ectors 1A23AB Co-e cant<eamH/uyan.m 8 Bser$:e+ine- Cantile(er Ci/en(alues/Ci/en(ectors This MATFA" code sol&es for the eigen &al0es and eigen&ectors of a cantile&er with 0ser-defined dimensions7 material ,ro,erties7 n0m.er of elements and n0m.er of mode sha,es to ,lot. The code is similar to that in cantH&elH/uyan.m e+ce,t that I0yan red0ction is an o,tion for this code. Df I0yan red0ction is chosen7 all rotations are red0ced7 lea&ing only translations as master degrees of freedom. The code is listed .elow7 .0t is not .roken down and commented .eca0se the comments integrated with the code sho0ld .e s0fficient. Dn order to com,are res0lts with the A=SKS r0n .elow7 a %$-element .eam with the following ,ro,erties is 0sed! width # mm7 thickness # $.7 length # $mm7 mod0l0s # %5$e@ m=Jmm 7 density # A.:4e@ Lg Jmm4 . I. *eural *etJor@s 0. 7enetic Al/orithm