Kinematics Analyses of the Spatial Mechanism Using Matlab

. The aim of this paper is to present a method of computer formulation and solution of equations of kinematics of spatial mechanical systems. The method of the vector closed loop is generally known way how to built the constraint equations. This method is recommended for planar kinematics. This paper shows the way how to take advantage of the vector cross product, vector magnitude and scalar product of two vectors for getting the constraint equations for spatial mechanism.


Introduction
The objective of computational methods in kinematics and dynamics is to create a formulation and digital computer software that allow the engineer to input data that define mechanical systems of interest and automatically formulate governing equations of kinematics, automatically solve non-linear equations for kinematic response, and provide computer graphics output of results of simulations to communicate results to the designer or analyst.The essence of this objective is to make maximum use of digital computer power for rapid and accurate data manipulation and numerical computation, hence relieving the engineer of tedious and error-prone calculations [1,2]. As suggested by advances in computer-aided finite element structural and electronic circuit analysis, a systematic approach to the formulation and solution of the equations of kinematics and dynamics of mechanical systems is required to implement computations in a user-oriented computer program [3][4][5][6]. Several computer programs for kinematic and dynamic analysis were developed in the late 1960s and early 1970s [7][8][9] using relative coordinates between bodies. These programs are satisfactory for many applications. An alternative method of formulating system constraints and equations of motion, in terms of global Cartesian coordinates, was introduced in the late 1970s [10][11][12], bypassing topological analysis and making it easier for the user to supply constraints and forcing functions. This approach leads to a general-purpose computer program, with practically no limitation on the type of mechanism or machine that can be analyzed. The penalty, however, is a larger system of equations to be solved [13,14]. Specific possibilities of alternative and compromise measures in the field of computational kinematics are presented in this article.

Theoretical background 2.1 Properties of the geometric vectors
The geometric vector̅beginning at point A and ending at point B, is defined as the directed line segment from A to B. The magnitude of a vector ̅is its length and is denoted by a or |a ̅|. A unit vector, that is, a vector having a magnitude of 1 unit.
Multiplication of a vector ̅by a scalar c> 0 is defined as a vector in the same direction as ̅but having magnitude c . Multiplication of a vector ̅by a scalar c< 0 is a vector with magnitude |c| and opposite direction of ̅. The scalar product of two vectors ̅ and b ̅ is defined as the product of the magnitudes of the vectors and the cosine of the angle between them.
Two nonzero vectors are said to be orthogonal vectors if their scalar product is zero. The scalar product satisfies these relations: are the unit coordinate vectors, which are directed along the x, y and z axis.
The cross product of two vectors ̅and ̅ is defined as the vector ̅ which satisfies the following conditions:  The line of action of ̅ is perpendicular to the plane containing ̅and ̅ .  The magnitude of ̅ is the product of the magnitudes of ̅and ̅ and of the sine of the angle formed ̅.and ̅ .(the measure of which will always be 180° or less). We thus have = sin .  The sense of ̅ is such that a person located at the tip of ̅ will observe as counterclockwise the rotation through qwhich brings the vector ̅in line with the vector ̅ . The cross product is represented by the mathematical expression:

Kinematic constraint equations
The position and orientation of body in a space may be determined three points A, B a C respective two vectors and . (The other combinations are possible.) Any set of variables that uniquely specifies the position and orientation of all bodies in a mechanism, that is, the configuration of the mechanism, is called a set of generalized coordinates.Generalized coordinates may be independent or dependent. Generalized coordinates are designated in this paper by a column vector: where is the totalnumber of generalized coordinates used to describe the configuration of the system. The bodies of the mechanism are interconnected by joints, there are equations of constraint that relate the generalized coordinates. We are pointed to holonomic joints with time independent kinematic couplings. When these conditions are expressed as algebraic equations in terms of generalized coordinates, they are called holonomic kinematic constraint equations. The system of ℎ holonomic kinematic constraint equations that does not depend explicitly on time can be expressed as: The equations of constraint must imply the geometry of the joint. If the constraints of Eq.7 are consistent and independent, then the system is said to have − degrees of freedom DOF. If DOF independent driving constraints are specified for kinematics analysis, denoted then configuration of the system as a function of time can be determined. That is, the combined constraints of Eqs7 and 8, can be solved for q(t). Such a system is kinematically driven [14].

Kinematic constraint equations in useful form for MATLAB
The one way how to get kinematic constraint equations (9) is presented in following example. We are using the properties of geometric vectors. Figure 1 depicts a three-dimensional four bar mechanism RSCR (Revolute-Sferical-Cylindrical-Revolute) modeled with natural coordinates [14]. This mechanism has three movable unit vector; that is, twelve dependent Cartesian coordinates and one degree of freedom. Also the input angle ψ has been introduced as an additional externally driven coordinate. Input constants: , , , 2 , 3 , 4 , 5 , and unit vectors , . Vector 0 is in the plane xy. Coordinates of points A and E. . − cos( 2 ) = 0revolute join, angle 2 is constant (13) . − 2 = 0 distance of point A and B is constant (14) The motion of elements 3 and 4 is completely defined Vector product (22) represents three scalar equations, from which only two are independent. Vectors in equations (10) -(22) may be formulated using three points B, C and D (9 unknown variables) and one unit vector uDC (3 unknown variables). We have got twelve nonlinear equations for twelve unknown variables.

Conclusions
The shown equations are visual. The equations 10 and 11 may be replaced one equation, which explicitly determines the vector. The equations 12 and 14 is better to replace explicit relation using rotation transformation matrix. These improvements bring us decreasing of nonlinear equation.