1. Matrix Method in Kinematics
| > | restart: |
| > | libname := `C:/libs/MBSymba.lib`, libname: with(MBSymba_r4): |
MBSymba release 4.1 - Copyright (C) 2006 - by Roberto.Lot@unipd.it & Matteo.Massaro@unipd.it
Warning, these protected names have been redefined and unprotected: *, +, -, union
1.1 Planar Kinematics
We have a moving reference frame (denoted with m ) and a fixed reference frame (denoted with f )
Define key points with respect to the appropriate reference frame.
| > | xm, ym; coordinates of point P with respect to the moving frame |
| > | xf, yf; coordinates of point P with respect to the fixed frame |
| > | xA,yA; coordinates of the origin of the moving frame with respect to the fixed frame |
Transformation of coordinates from the moving frame to the fixed one
The transformation equations are obtained by adding the vector components (wrt. the ground frame) to cooridinates of the origin of the moving frame.
| > | xf := xA + xm*cos(theta) - ym*sin(theta); |
| > | yf := yA + ym*cos(theta) + xm*sin(theta); |
Rotational transformation matrix
| > | R := linalg[genmatrix]({xf,yf},{xm,ym}); This command generates a matrix of the sines and consines represented by the equations above. |
transformation of coordinates from moving frame to the fixed one, with matrices and vectors
| > | <xA, yA> + evalm(R) &* <xm, ym>; |
| > | evalm(%); |
Augmented matrix fomulation ( {Pf} = [ T ] {Pm} )
transformation matrix, which contains the 2x2 rotation matrix plus the coordinates of the origin A
| > | T := <<cos(theta) | -sin(theta) | xA> , <sin(theta) | cos(theta) | yA> , <0 | 0 | 1>>; |
point P in the moving frame coords
| > | Pm := <<xm, ym, 1>>; |
point P in the fixed frame coords
| > | T &* Pm; Pf := evalm(%); |
inverse transformation (solution check)
| > | simplify(linalg[inverse](T)) &* evalm(Pf); |
| > | simplify(map(expand,evalm(%))); |
1.2 Spatial Kinematics
spatial kinematics: the augmented matrix has dimension 4X4
Coordinates of point P
| > | P := <<x, y, z,1>>; |
1.3 Rotation and Translational Operators
ground reference frame (default)
| > | evalm(ground); |
translational operator translate
| > | TA := translate(xA,yA,zA); |
apply transformation with values defined in TA
| > | evalm(TA &* P); |
rotation operator rotate
rotation about X axis by phi
| > | Rx := rotate('X',phi); |
| > | evalm(Rx &* P); |
rotation around Y axis by mu and around Z axis by psi
| > | Ry := rotate('Y',mu); Rz := rotate('Z',psi); |
1.4 Combination of Transformations
| > | alias (S=sin,C=cos); |
transformations may be combined by multiplying basic transformation operators, starting from left to right
Example
| > | psi, phi, mu; yaw, roll and pitch angle |
overall transformation matrix is
| > | TT := rotate('Z',psi) * rotate('X',phi) * rotate('Y',mu); |
BE CAREFUL
: transformation concatenation is not commutative, a change in the transformation order yields a different transformation matrix
example:
| > | rotate('X',phi) * rotate('Y',mu); rotate('Y',mu) * rotate('X',phi); |
1.5 Points and Vectors
define a reference frame
| > | T := translate(a,0,0) * rotate('Z',psi); |
definition of a POINT
we make use of the function
make_POINT,
which defines a point P of coordinates x,y,z in a reference frame defined by T;
show
is the function which displays the characteeristics of the point.
| > | P := make_POINT(T , x,y,z): show(P); |
Function project is used to project the point P into another frame.
| > | project(P,ground): show(%); #project(P,rotate('X',phi)): show(%); |
definition of a VECTOR
(while a point is fixed in the space, a vector is defined only in direction and magnitude, it can be moved everywhere in the space)
we use the function
make_VECTOR
which defines a vector with components vx,vy,vz in the reference frame defined by the 1st argument of the function [e.g. "rotate ('X', phi)"]
| > | v := make_VECTOR(rotate('X',phi), vx,vy,vz): show(v); |
projection of the vector v into another frame
| > | project(v,ground): show(%); |
geometrical operations
1. definition of a vector from two points
point P1 in the ground frame
| > | P1 := make_POINT(ground,x1,y1,z1): show(P1); |
point P2 in the frame defined by T2
| > | T2 := rotate('X',phi): |
| > | P2 := make_POINT(T2,0,b,0): show(P2); |
before subtracting the coordinates of P1 from P2, the vector P2 is projected on the frame of point P1.
vector P1P2 on the ground frame
| > | P1P2 := make_VECTOR(P1,P2): show(P1P2); |
vector P1P2 in the reference frame defined by T2
| > | project(P1P2,T2): show(%); |
2. vector + vector yields a vector
| > | show(v + P1P2); |
3. vector + point yields a point
| > | show(P1 + P1P2); |
point + point
it is not possible to add two points
| > | show(P1 + P1); |
Error, (in MBSymba_r4:-show) invalid input: MBSymba_r4:-show expects its 1st argument, A, to be of type {frame, OBJECT}, but received 2*P1
1.6 Euler's Angles
| > | TE := rotate('Z',alpha), rotate('X',beta), rotate('Z',gamma); |
| > | TE := rotate('Z',alpha) * rotate('X',beta) * rotate('Z',gamma); |
1.7 Cardano's Angles
| > | TC := rotate('X',alpha), rotate('Y',beta), rotate('Z',gamma); |
| > | TC := rotate('X',alpha) * rotate('Y',beta) * rotate('Z',gamma); |
1.8 Yaw, Roll, and Pitch Angles
| > | psi, yaw angle |
| > | phi, roll angle |
| > | mu; pitch aw angle |
| > | TYRP := rotate('Z',psi), rotate('X',phi), rotate('Y',mu); |
| > | TYRP := rotate('Z',psi) * rotate('X',phi) * rotate('Y',mu); |