NUMERICAL ANALYSIS FOR ENGINEERING MEAE - 4960 H02 Prof. Ernesto Gutierrez - Miravete Kinematic Analysis of a Four-Bar Crank Mechanism with a Redundant Constraint Roberto A. Alzaga December 9, 1999 INDEX Introduction…………………………………………………………………………..3 Theory and Analysis………………………………………………………………..4 General Coordinates…………………………………………………………4 Kinematic Constraint Equations………………………………………..4 Detection of Redundant Constraint…………………………………….5 Degrees of Freedom………………………………………………………….7 Driving Constraint……………………………………………………………7 System Constraint Equations…………………………………………….7 Determinant of System Constraints Jacobian Matrix…………….8 Evaluation of System Constraints Jacobian Matrix at Singular Point…………….…9 Evaluate Newton's Method for Position………………………………..9 Velocity Approximation………………………………………………….…10 Acceleration Approximation……………………………………………...10 Results………………………………………………………………………………..12 Results of the Double Pendulum Mechanism………………………..12 Results of the Four Bar Linkage Mechanism………………………..16 Four-Bar Linkage Position Error Comparison……………………….19 Conclusions………………………………………………………………………….21 Bibliography…………………………………………………………………………22 Appendix……………………………………………………………………………..23 Gaussian Elimination with Maple Commands and Inverse of Jacobian………………...23 Newton's Method for Double Pendulum………………………………..28 Newton's Method for Four-Bar Linkage…………………………….….35 2 INTRODUCTION Mechanical Systems are an integral part of our everyday life. Anything that is comprised by linkages, cams and gears is defined as a mechanical system. A mechanical system is defined as a collection of interconnected rigid bodies that can move relative to one another, consistent with joints that limit relative motion of pairs of bodies. The motion of a mechanical system may be prescribed by defining the time history of the position or relative position of some of its bodies. The motion of the system is then determined by algebraic kinematics relations or from differential equations of motion and externally applied forces, in which case the motion of the system is determined by laws of physics. Kinematics and dynamics of mechanical systems are characterized by large amplitude motion, which leads to geometric nonlinearity that is reflected in the algebraic equations of constraint and differential equations of motion. Three basically different kinds of analysis are employed in the design of mechanical systems: Kinematic, Dynamic and Inverse Dynamic analysis. This project is related to a Kinematic analysis of a Four-Bar Crank Mechanism with a Redundant Constraint. A Kinematic analysis of a mechanical system concerns the motion of the system independent of forces that produce the motion. Typically, the time history of position or relative position of one, or more bodies in the system is prescribed. Time histories of position, velocity, and acceleration of the remaining bodies are then determined by solving systems of nonlinear algebraic equations for position and linear algebraic equations for velocity and acceleration. The Kinematic analysis of a Four-Bar Crank Mechanism with a Redundant Constraint will be performed using computerized numerical analysis methods. This analysis will result in an approximate of the solution of the governing kinematic equations of this mechanism. The system of equations will be solved to determine the position, velocity and acceleration of the mechanism for a given driving condition. 3 THEORY AND ANALYSIS The Four-Bar Crank Mechanism with a Redundant Constraint to be analyze is illustrated in the following diagram: General Coordinates General Coordinates are defined as any set of variables that uniquely specifies the position and orientation of all bodies in a mechanism. These coordinates may by independent (i.e., free to vary arbitrarily) or dependent (i.e., required to satisfy equations of constraint). General coordinates are designated by a column vector q = [q1, q2,…,qnc]T, where nc is the total number of generalized coordinates used to describe the configuration of the system. For this Four Bar Linkage mechanism, we have three rigid bodies, each one defined by their position with respect to x, y and the angle orientation . In other words q = [x1, y1, 1, x2, y2, 2, x3, y3, 3]T. Since x1, y1, x3 and y3 are stationary points, x1 = 0, y1 = 0, x3 = 1 and y3 = 0, they are not used in the analysis to simplify the matrices. The vector of generalized coordinated that best describes the configuration of this system is: q = [1, x2, y2, 2, 3]T Kinematic Constraint Equations Since joints interconnect rigid bodies that make up a mechanism, there are equations of constraint that relate the generalized coordinates. Therefore, Cartesian generalized coordinates are generally dependent. A kinematic constraint between two bodies imposes conditions on the relative motion 4 between the pair of bodies. When expressed as algebraic equations in terms of generalized coordinates, they are called holomonic kinematic constraint equations. This equations are expressed as a vector K(q) = [K1(q),…, Knh(q)]. The equations of constraint must imply the geometry of the joint. For this Four-Bar Linkage, the equations are develop as follows: Position of x2 (1) x2 = cos 1 + cos 2 (2) x2 = 1 + cos 3 Position of y2 (3) y2 = sin 1 + sin 2 (4) y2 = sin 3 Length of Segment AB (Redundant Constraint) (5) (x2 + cos 2 - 2)2 + (y2 + sin 2)2 = 1 Expressed as a vector, we have: x 2 cos 1 cos 2 y 2 sin 1 cos 2 K (q ) x 2 cos 3 1 0 y 2 sin 3 ( x 2 cos 2 2) 2 ( y 2 sin 2 ) 2 1 Detection of Redundant Constraint This matrix includes one redundant constraint for the system, in other words, a constraint that is already satisfied by one or a combination of the other constraints already established. As is geometrically clear, 1 = 3 and 2 = 0, thus, from the kinematic constraints (1) and (3), x2 = 1 + cos 1 and y2 = sin 1. Substituting these results into kinematic constraint (5) shows that it is identically satisfied, in other words, kinematic constraint (5) is a redundant constraint. The Constraint Jacobian row rank criterion identifies this redundancy. The Jacobian Kq (q) of the Kinematic Constraint Vector is as follows: qK (q) i q q j nxk 5 sin 1 cos 1 K q (q ) 0 0 0 sin 2 0 1 cos 2 0 1 0 0 sin 3 0 1 0 cos 3 2( x2 cos 2 2) 2( y 2 sin 2 ) 2 sin 2 ( x2 cos 2 2) 2 cos 2 ( y 2 sin 2 ) 0 1 0 0 The row rank (column rank) of a matrix is defined as the largest number of linearly independent rows (columns) in the matrix. A square matrix with linearly independent rows (columns) is said to have full rank or nonsingular, meaning that for such matrix, there is an inverse A-1 such that AA-1 = A-1A = I. This property is necessary for the solution of the kinematic analysis. The rank of a matrix can be established using Gaussian Elimination. The Jacobian of the Kinematic Constraints is evaluated at the assembled configuration with 1 = 3 = /3 (60), 2 = 0, from kinematic constraints (1) and (2), x2 = 1.5 and y2 = 0.8660 respectively. 0.8660254037 0.5 K 0 q (q ) 0 0 0 1 0 1 0 1 1 1 0 0 0 0.8660254037 1 0 0.5 1.73205087 1.73205087 0 0 0 0 Using Gaussian Elimination Command in Maple for this matrix, the Jacobian is reduced to 0.8660254037 0 qK (q 0 ) 0 0 0 1 1 0 0 0 0 0 0.8660254037 1.732050807 1.732050807 0.8660254037 0 0 0.11 0 0 0 0 0 0 The reduced Jacobian is rank deficient and the last constraint is identified as the redundant constraint and is removed from the Kinematic Constraint Matrix. Even if a small change is made in 10, and hence 30, the same conclusion follows, so the redundancy is not an isolated singular point. An isolated singular point occurs at a configuration of the mechanism where a unique solution of the equations of kinematics cannot be determined. 6 Degrees of Freedom If the kinematic constraints are consistent and independent as evaluated by detecting the redundant constraint, the system is said to have nc (# of generalized coordinates) - nh (# of independent kinematic constraints) degrees of freedom. In other words, the degrees of freedom identify the number of drivers needed to give movement to the mechanism. Again, nc is equal to 3 times (x, y ) the number of bodies in the mechanism. DOF = 3(nb) - nh where: nb = number of bodies is 3 neglecting ground and nh = number of holonomic kinematic constraint equations is 8, which are not reflected in the Kinematic Constraint Equation Matrix because we did not include x1 = 0, y1 = 0, x3 = 1, y3 = 0 to simplify the analysis due to the fact that these are static values The degrees of freedom for this mechanism is DOF = 3(3) - 8 = 1 This means that we need only one Driving Constraint to be able to move the mechanism. Driving Constraint The Driving Constraint selected for this mechanism is: 1 = t/180 for 0 ≤ t ≤ 180 System Constraint Equations When we combine the Kinematic Constraint Equations with the Driving Constraint we obtain the System Constraint Equations K ( q) KD (q, t ) D 0 ( q, t ) 7 x 2 cos 1 cos 2 y sin cos 1 2 2 KD (q, t ) x 2 cos 3 1 0 y 2 sin 3 t 1 180 We now again, evaluate the Jacobian Matrix of the System Constraint Equations, to verify for Singular Points in the movement of the mechanism, and also, the Jacobian will be used in the calculation of the Velocity and Acceleration of the Four Bar System. sin 1 1 0 sin 2 cos 0 1 cos 1 2 q ( q, t ) 0 1 0 0 0 1 0 0 1 0 0 0 0 sin 3 cos 3 0 0 Determinant of System Constraints Jacobian Matrix By calculating at which conditions the determinant of the Jacobian is equal to zero (singular points, at which no solution exists), we can determine the intervals at which the mechanism can be analyze, |q| = -(cos 2*sin 3 + sin 2*cos 3) Since this Four Bar Linkage has 2 = 0 always because of its configuration (r1 = r2 = r3), the determinant is reduced to |q| = -sin 3 The mechanism encounters singular points when 1 = k, where k = 0,1,2,…,n. At those points the Jacobian is singular or rank deficient. The Implicit Function Theorem summarizes the importance of this finding. Let q0 be a solution of the System Constraint Matrix KD(q) at t = t0 and let the function (q,t) be twice continuously differentiable with respect to its arguments. Then if, the Jacobian is nonsingular at (q0, t0) there exists a unique solution q = f(t) in some interval of time about t0, such that f(t0) = q0. Furthermore, the solution of q = f(t) is 8 twice continuously differentiable with respect to time, that is, velocity q' = f'(t) and acceleration q'' = f''(t) are continuous. Evaluation of System Constraints Jacobian Matrix at Singular Point To demonstrate one of the singular points in this mechanism, lets take k = 0, we have 1 = 3 = 0, 2 = 0, from kinematic constraints (1) and (2), x2 = 2 and y2 = 0 respectively. 0 1 q (q 0 , t ) 0 0 1 1 0 0 1 1 0 0 1 0 0 0 1 0 0 0 0 1 0 0 0 Using Gaussian Elimination Command in Maple for this matrix, the Jacobian is reduced to: 1 0 q (q 0 , t ) 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 The reduced Jacobian is rank deficient, which might suggest that there might be another redundant constraint in the System Constraint Equations. However, an arbitrarily small perturbation of 10, and hence, 30, yields a matrix with full rank. Thus, proving that the mechanism has a singular point at 1 = 0, specifically a lock-up configuration. This configuration indicates that there is a solution at one or both sides of an isolated singular point. With this evaluation, we can conclude that the range of movement for this Four Bar Linkage occurs from 0 < 1 < . Evaluate Newton's Method for Position To approximate the Position of the Four- Bar Linkage, the Newton's Method for Nonlinear Systems was used. This is an iterative technique that begins with an estimate q(0) of a configuration that satisfies the System Constraint 9 Equations KD(q) at time t. At a typical iteration k, the following equation is solved for a correction q(k): q(q(k),t) q(k) = -(q(k),t) which is then added to the estimate q(k) to obtain an improved estimate q(k+1) = q(k) + q(k), for k = 0,1… Iteration is continued until an error tolerance in satisfied. This method has the property that it is quadratically convergent if a right initial estimate is establish. For the Four-Bar Linkage analyzed, the initial approximation used was q(0) = [ /180, 1 + cos (/180), sin (/180), 0, /180]T after that, the solution of q(t-1) was used as an initial estimate for the solution process of q(t). Velocity Approximation Presuming that the Jacobian Matrix is nonsingular and that a solution of the kinematic equations for position has been obtained numerically. If we differentiate the System Constraint Equations with respect to time: qq' = - t = where q is the Jacobian of the System Constraint Equations q' is the velocity components of the general coordinates q' = [ 1', x2', y2', 2', 3' ]T t is the derivative of the System Constraint Equations with respect to time - t = [0, 0, 0, 0, /180]T Here is where the property of the nonsingular Jacobian Matrix comes into account. The velocity equations can be re-arrange to q' = q-1(- t) Acceleration Approximation Just as the velocity equations were obtained by differentiating the System Constraint Equations, differentiating both sides of the velocity equations with respect to time: qq'' = - ( qq' )q - 2qtq' - tt = where 10 q is the Jacobian of the System Constraint Equations q'' is the acceleration components of the general coordinates q'' = [ 1'', x2'', y2'', 2'', 3'' ]T qt is the Jacobian Matrix differentiated with respect to time 2i qt 0 q j t nhxnc tt is the double derivative of the System Constraint Equations with respect tt = 0 to time 2 tt 2 i 0 t nhx1 The term ( qq' )q is the result of the chain rule of differentiation, this term is calculated as follows: q' q q nc 2 i q' k ncxnc k 1 q j qk 1 ' sin 1 x2 ' 2 ' sin 2 ' cos y ' ' cos 1 2 2 2 1 x 2 ' 3 ' sin 3 (1) q q' y 2 ' 3 ' cos 3 1 ' 1 ' cos 1 ' sin 1 1 (2) ( q q' ) q 0 0 0 0 0 2 ' cos 12 0 0 2 ' sin 2 0 0 0 0 0 0 0 0 0 0 3 ' cos 3 3 ' sin 3 0 0 (1 ' 2 cos 1 2 ' 2 cos 2 ) 2 2 (1 ' sin 1 2 ' sin 2 ) (3) ( q q' ) q q' 3 ' 2 cos 3 2 3 ' sin 3 0 By substituting in the acceleration equations and using the nonsingular property of the Jacobian q'' = q-1 [-( qq' )q] 11 RESULTS The programming tool used to model the Four-Bar Linkage Mechanism was Maple. Although, the solution for the position of this specific Four-Bar Linkage is close form (because 2 = 0) and can be easily compared to approximated value obtained with the Newton's Method, actual velocity and accelerations solutions were not available. I did find a solution for position, velocity and acceleration of a Double Pendulum Mechanism. To certify the Maple Program created for the Four-Bar Linkage, I first ran a case for the Double Pendulum at only one configuration and compared it to the textbook solution found. Results of the Double Pendulum Mechanism The Double Pendulum Mechanism is illustrated in the following diagram: Please refer to the Theory and Analysis section if you have any questions on how the following equations were derived: Cartesian Generalized Coordinates q = [x1, y1, 1, x2, y2, 2]T Kinematic Constraints Position of x1 (1) x1 = cos 1 Position of y1 (2) y1 = sin 1 Position of x2 (3) x2 = cos 1 + cos 2 Position of y2 (4) y2 = sin 1 + sin 2 12 (5) y2 = -1 x1 cos 1 y1 sin 1 K (q ) x 2 cos 1 cos 2 0 y 2 sin 1 sin 2 y2 1 Degrees of Freedom DOF = 3(nb) - nh = 3(2) - 5 = 1 This means that one driving condition is needed for movement of the mechanism. Driving Constraint 1 = 5/3 + t/6, 0 ≤ t ≤ 3/2 System Constraint Equations x1 cos 1 y1 sin 1 x cos cos 1 2 KD (q ) 2 0 y sin sin 2 1 2 y2 1 1 5 / 3 / 6 Jacobian Matrix 1 0 0 q ( q, t ) 0 0 0 0 sin 1 0 0 1 cos 1 0 0 0 sin 1 1 0 0 cos 1 0 1 0 0 0 1 0 1 0 0 0 sin 2 cos 2 0 0 0 Determinant of Jacobian |q| = -cos 2 Singular when 2 = /2 + k, for k integer. Evaluate Newton's Method for Position The solution of this mechanism was only calculated for t = 0 and compared to the textbook results to validate the Four Bar Linkage Model Program. The initial approximation to solve the System Constraint Equations is q(0) = [ 0.5, -0.866, 5/3, 1.5, -1.0, 6.14]T 13 Velocity Approximation qq' = - t = where q is the Jacobian of the System Constraint Equations q' is the velocity components of the general coordinates q' = [x2', y2', 1', x2', y2', 2']T t is the derivative of the System Constraint Equations with respect to time - t = [0, 0, 0, 0, /6]T Acceleration Approximation qq'' = - ( qq' )q - 2qtq' - tt = where q is the Jacobian of the System Constraint Equations q'' is the acceleration components of the general coordinates q'' = [x2'', y2'', 1'', x2'', y2'', 2'']T qt is the Jacobian Matrix differentiated with respect to time qt = 0 tt is the double derivative of the System Constraint Equations with respect tt = 0 to time The term ( qq' )q is the result of the chain rule of differentiation 1 ' 2 cos 1 1 ' 2 sin 1 (1 ' 2 cos 1 2 ' 2 cos 2 ) ( q q' ) q q' 2 2 (1 ' sin 1 2 ' sin 2 ) 0 0 Results and Comparison The following table summarizes the results for position, velocity and acceleration obtained with the Maple Program for the Double Pendulum Mechanism at t = 0. 14 Position Results Comparison X1 Y1 Phi1 X2 Y2 Phi2 (IN) (IN) (RAD) (IN) (IN) (RAD) Textbook Results 0.5000 -0.8660 5.2360 1.4910 -1.0000 6.1488 Program Results 0.5000 -0.8660 5.2360 1.4910 -1.0000 6.1488 0.00% 0.00% 0.00% 0.00% 0.00% 0.00% X1' Y1' Phi2' X2' Y2' Phi2' (IN/SEC) (IN/SEC) (RAD/SEC) (IN/SEC) (IN/SEC) (RAD/SEC) Textbook Results 0.4534 0.2618 0.5236 0.4180 0.0000 -0.2642 Program Results 0.4534 0.2618 0.5236 0.4181 0.0000 -0.2642 0.00% 0.00% 0.00% 0.01% 0.00% 0.00% Phi2'' X2'' Y2'' Phi2'' Actual Error Velocity Results Comparison Actual Error Acceleration Results Comparison X1'' Y1'' (IN/SEC^2) (IN/SEC^2) Textbook Results -0.1371 0.2374 0.0000 -0.2397 0.0000 -0.2490 Program Results -0.1371 0.2374 0.0000 -0.2396 0.0000 -0.2490 0.00% 0.00% 0.00% 0.01% 0.00% 0.00% Actual Error (RAD/SEC^2) (IN/SEC^2) (RAD/SEC^2) (RAD/SEC^2) These results show zero error in almost every parameter from position to acceleration, validating the Maple Program of Newton's Method developed specifically for the Four Bar Linkage Mechanism discussed. 15 Results of the Four-Bar Linkage Mechanism The Four-Bar Linkage Mechanism was analyze for a range of movement driven by the time variable in the driving constraint of 1 = t/180 for t = 1, 2,…179. The results were tabulated and graphed as follows: q = [1, x2, y2, 2, 3]T General Coordinate 1 Position, Velocity & Acceleration vs. Time for Phi1 3.5 3 2.5 2 1.5 1 0.5 0 0 20 40 60 80 100 120 140 160 180 Time (sec.) Angle Velocity Acceleration Angle 1 is the one driven by the input. It has a constant velocity of /180 and acceleration is zero due to the contant velocity . Since 3 = 1 because of the mechanism configuration, the same solution is expected for 3. 16 General Coordinate x2 Position, Velocity & Acceleration vs. Time for x2 2.5 2 1.5 1 0.5 0 0 20 40 60 80 100 120 140 160 180 -0.5 Time (sec) Position Velocity Acceleration The position of x2 goes from 2 when t =1 and rotates counter clockwise until it reaches almost the origin of the global Cartesian coordinates. Velocity and acceleration numbers are close to zero following the derivatives of the position graph. 17 General Coordinate y2 Position, Velocity & Acceleration vs. Time for y2 1.2 1 0.8 0.6 0.4 0.2 0 0 20 40 60 80 100 120 140 160 180 -0.2 Time (sec) Position Velocity Acceleration The position of y2 starts close to zero at t =1 and reaches a maximum when t = 90 or 1 = /2. General Coordinate 2 Basically since all the length are equal to 1, 2, its velocity and acceleration will always be 0, . This is part of the inherent restriction due to the configuration of the Four-Bar Linkage. General Coordinate 3 Since 3 = 1, the graph for the position, velocity and acceleration are the same as for 1. 18 Four-Bar Linkage Position Error Comparison Since the solution of the position vector for the Four-Bar Linkage System Constraints is of close form, due to the fact that for this particular mechanism 2 = 0, the actual calculated positions and angles can be compared to the approximated results from Newton's Method. We will compare the results for t = 30, 60, 90, 120 and 150 or 1 = /6, /3, /2, 2/3 and 5/6. From the System Constraint Equations x 2 cos 1 cos 2 y sin cos 1 2 2 KD (q, t ) x 2 cos 3 1 0 y 2 sin 3 t 1 180 it is seen, that because 2=0 throughout the movement of the mechanism, direct calculation of the position vector can be obtained: 1 = *t/180 x2 = cos 1 + cos (0) y2 = sin 1 + sin (0) 3 = 1 = sin-1(y2) Calculated Close Form Time (SEC) Phi1 (RAD) X2 (IN) Y2 (IN) Phi2 (RAD) Phi3 (RAD) 30 0.5236 1.8660 0.5000 0.0000 0.5236 60 1.0472 1.5000 0.8660 0.0000 1.0472 90 1.5708 1.0000 1.0000 0.0000 1.5708 120 2.0944 0.5000 0.8660 0.0000 2.0944 150 2.6180 0.1340 0.5000 0.0000 2.6180 19 Newton's Method Time (SEC) Phi1 (RAD) X2 (IN) Y2 (IN) Phi2 (RAD) Phi3 (RAD) 30 0.5236 1.8660 0.5000 0.0000 0.5236 60 1.0472 1.5000 0.8660 0.0000 1.0472 90 1.5708 1.0000 1.0000 0.0000 1.5708 120 2.0944 0.5000 0.8660 0.0000 2.0944 150 2.6180 0.1340 0.5000 0.0000 2.6180 Time (SEC) Phi1 (RAD) X2 (IN) Y2 (IN) Phi2 (RAD) Phi3 (RAD) 30 0.00% 0.00% 0.00% 0.00% 0.00% 60 0.00% 0.00% 0.00% 0.00% 0.00% 90 0.00% 0.00% 0.00% 0.00% 0.00% 120 0.00% 0.00% 0.00% 0.00% 0.00% 150 0.00% 0.00% 0.00% 0.00% 0.00% Actual Error No actual errors were found for the position vector. 20 CONCLUSIONS The use of computer aided kinematic analysis is a very powerful tool when it comes to new designs. It enables the engineer to iterate quit rapidly the configuration of the mechanism without consuming too much time. The key to the ease of the use of a computer is that time has to be spent to make sure that the program is correctly modeling the real mechanism by the incorporation of the correct Kinematic Constraints. All the basic steps to put together a simple model for computer analysis were discussed in this project. First, we had to define the General Coordinates of the Four-Bar Linkage mechanism presented. Then, the Kinematic Constraints that relate the General Coordinates were established. To verify that we did not establish a redundant constraint, the Jacobian of the Kinematic Constraints was evaluated at the assembled configuration. After performing Gaussian Elimination to this matrix, we determined that it was rank deficient related to a redundant constraint already satisfied by the other Kinematic Constraints established. After eliminating the redundant constraint and calculating the Degrees of Freedom, one Driving Condition was incorporated to be able to give movement to the mechanism. The Jacobian of the now System Constraint Equations was calculated. When the determinant of this matrix is zero, singularity occurs and the mechanism cannot be defined at that specific point. For this Four Bar Linkage, we demonstrated that isolated singular points occur at 1 = k for k integer. Furthermore, the mechanism analyzed can only move between 0 < 1 < . Finally the matrix equations for position, velocity and acceleration were established and used as an input to the Newton Method for Nonlinear System. Since no data was on hand to compare errors, another mechanism was used in the same process just described and compared to known values at only one point, yielding errors from 0% to 0.01%. 21 BIBLIOGRAPHY (1) Burden, R., and Faires, J.D., Numerical Analysis, Brooks/Cole Publishing Company, Pacific Groove, CA, 1997. (2) Haug, Eduard J., Computer-Aided Kinematics and Dynamics of Mechanical Systems Volume 1: Basic Methods, Allyn and Bacon, Needham Heights, MA, 1989. (3) Analytical Tool Used Maple V Relese 5 Waterloo Maple Inc. 22 APPENDIX 23