UNIVERSITY OF KWAZULU-NATAL EXAMINATIONS: NOVEMBER 2013 COURSE, SUBJECT AND CODE: THEORY OF MACHINES ENME3TMH2 DURATION: 3 Hours MARKS: 100 MECHANICAL ENGINEERING Internal Examiner: Dr. R.C. Loubser Indeendent Moderator: Prof G. Bright INSTRUCTIONS: 1. The aer consists of two questions. Answer both questions. 2. The questions may be answered in any order but start each question on a new age. 3. Pencil may be used. 4. Illegible work will not be marked. 5. Students are ermitted to bring to the examination an A4 age with information hand written on one side only. 6. Calculators may NOT be used in this examination all calculations must be coded in the MATLAB. 7. A worksheet is rovided. Make sure you hand this in with your exam book. 8. Changes may be made to the text in the temlates if necessary.
Question 1 [45 marks] The mechanism shown in figure 1 consists of rods. The end of link 2 at A is constrained to move vertically and the end at B is constrained to move horizontally. The centre of link 2 is attached to a slide through a revolute oint at C. The slider slides on link 3. Link 3 is attached to the inertial frame through a revolute oint at O. Link 2 and link 3 are L=200 mm long. The distance OA is y and the distance OB is x. Link 3 is driven according to the relationshi ( ) where and The co-ordinate vector for the system is q=[ 2, 3,x,y,s]T The following imlementation of the Newton Rahson exists and may be used where necessary in the code. Do not write out this function. function q=osmech(q,l,th3) esilon=1.e-9; Phi= mech(q,lth3); while norm(phi)>esilon J=gradmech(q,L); dq=j\phi; q=q-dq; Phi= mech(q,l,th3); end Question 1a [5] Noting that OCB and OAB form closed loos derive the constraint equations for the mechanism in the horizontal and vertical directions for each loo. Aend the driving constraint after the geometric constraints. Do not substitute values. Question 1b [5] Derive the Jacobian for the system. Question 1c [10] Differentiate the equations twice and extract the b and vectors being the right-hand side of the velocity and acceleration equations resectively. Question 1d [10] Write the following functions in your answer book: function gam= gammech(q,l,al) function Phi=mech(q,L,theta) returns the vector returns the value of the constraint equations
Question 1e [5] Write a function that returns a wireframe image of the mechanism at coordinate q suitable for creating an animation of the mechanism. The wireframe must be ositioned within the figure so that all ositions can be accommodated with a small border. function frame=drawmech(q,l) Question 1f [10] Use the attached worksheet to write a scrit file which uses to above functions together with a function gradmech(q,l), which may be assumed to exist, to calculate the osition, velocity and acceleration of the system. Store the results in arrays called qq, vv, and aa resectively. The calculation must be erformed from 0 to 5 seconds in increments of 0.01 seconds. Use the lot function to lot the velocity,, and acceleration, of the slider as a function of crank angle, 3 on searate grids on a single figure window. Include the code necessary to accumulate the sequence of images returned by drawmech that will allow an animated version of the mechanism to be dislayed with the movie command. Figure 1 Sliding bars
Question 2 (55 Marks) Figure 2 shows a mechanism which consists of two rods linked by a sring loaded slider. Link 2, OB, is attached to the inertial frame through a revolute oint at O. The other end is attached to a slider, link 4, through a revolute oint at B. The other bar, link3, is attached to the inertial frame through a revolute oint at A. The slider, link 4, slides without friction on link 3. Both the rods are uniform and have their mass centres at their midoints. The horizontal distance between O and A is d=200 mm and the vertical distance is e=250 mm. Use the co-ordinates q=[x 2,y 2, 2, x 3,y 3, 3, x 4,y 4, 4 ] T The mass of link 2 is 0.4 kg and its length is 200mm. The mass of link 3 is 1.2 kg and its length is 600mm. The mass of link 4 is 0.05 kg and moment of inertia 0.0002 kgm 2 Initially link 2 is horizontal and link 3 vertical. The sring is comressed by 30mm and has a stiffness k=60 N/m. n T M J J n x i 0 cos sin x i q f i i i cos sin 0 1 yi i sin i i cosi y sin cos 0 I m 12 2 Do not substitute values for questions 2a to 2d Figure 2 Mechanism
Question 2a [12] Using the co-ordinate vector q=[ x 2,y 2, 2, x 3,y 3, 3, x 4,y 4, 4 ] T derive the kinematic constraint equations. Arrange the equations starting at oint O then A and B followed by slider 4-3 Question 2b [8] Derive the Jacobian matrix for the system. A grid is rovided in the worksheets for this urose. Fill in the non-zero terms only. Question 2c [10] Derive the vector that is the right hand side of the acceleration equations Question 2d [5] Give the vector f of external forces. The sring force must be in terms of the lengths and angles given. Either Question 2e [20] If the mechanism is initially at rest write a MATLAB scrit to calculate the acceleration vector q and the reaction forces in terms of the Lagrange multiliers at the instant of release. Exlain, in detail, each comonent of the vector of reaction forces. Use the table rovided in the worksheet. Use units rad, rad/s, rad/s 2, m, m/s, m/s 2, kg and N Use the worksheet rovided for the aroriate functions: gradmech forcemech returns the Jacobian returns the force vector Use the worksheet rovided to comlete the MATLAB scrit file. Or Question 2f [20] Assume that a function, gammech, to calculate the vector calculated in 2c above exists and may be used. Do not write this function yourself. Use the worksheets rovided to write the MATLAB ode45 (ydot) function named diffmech to simulate the dynamic resonse of the mechanism. The ODE function must be a comuter model of the mechanism shown in figure 2. Use the worksheets rovided to comlete the functions: gradmech forcemech returns the Jacobian returns the force vector Use the worksheet rovided to comlete the MATLAB scrit file. The scrit file must lot the vertical osition and velocity of link 4, as a function of time for the time interval [0;1]s on searate grids on a single figure window. Label the axes accordingly. Angles must be in radians.
UNIVERSITY OF KWAZULU-NATAL EXAMINATIONS: NOVEMBER 2012 COURSE, SUBJECT AND CODE: THEORY OF MACHINES ENME3TMH2 Worksheets Student Number : Seat Number: These worksheets must be laced inside your answer book
% WORKSHEET FOR QUESTION 1f % Define inut data % Set the educated initial guess q= % Initialize arrays % select figure for animation % Carry out the calculations for i=1:n ; ;......; q=.; qq(i,:)=...; J=...; v=...; vv(i,:)=...; gam=...; a=...; aa(i,:)=...;
; ; end figure(1) clf
WORKSHEET FOR QUESTION 2b x 2 y 2 2 x 3 y 3 3 x 4 y 4 4 1 2 3 J= 4 5 6 7 8 WORKSHEET FOR QUESTION 2e Comonents of vector calculated: X(1)= X(2)= X(3)= X(4)= X(5)= X(6)= X(7)= X(8)= X(10)= X(11)= X(12)= X(13)= X(14)= X(15)= X(16)= X(17)= X(9)=
% WORKSHEET FOR QUESTION 2e % Simulation inut data:...; th2=...; th3=...; th4=...; x2=...; x3=...; x4=...; y2=...; y3=.....; y4=...; q=[x2;y2;th2;x3;y3;th3;x4;y4;th4]; m= diag([m2,m2,i2,m3,m3,i3,m4,m4,i4]); J=gradmech(q,...); A=[...]; gam=..; f=forcemech(q,...); b=[...]; X=A\b
% WORKSHEET FOR QUESTION 2f global... % Simulation inut data:...; th2=...; th3=...; th4=...; x2=...; x3=...; x4=...; y2=...; y3=.....; y4=...; y0=[x2;y2;th2;x3;y3;th3;x4;y4;th4......]; [t,y]=ode45(...); figure(1)
% WORKSHEET FOR QUESTION 2f function ydot=diffmech(t,y) global............... m= diag([m2,m2,i2,m3,m3,i3,m4,m4,i4]); J=gradmech(y,...); A=[...]; gam=gammech(y, ); f=forcemech(y,...); b=[...]; X=A\b; ydot=[.]; % WORKSHEET FOR QUESTION 2e and f function J=gradmech(...)...... J=[........................];
% WORKSHEET FOR QUESTION 2e and f function f=forcemech(...);......; f = [...;...;......;......;......;......;......;......;......];