 componentLibrary/multibody/sensors/RelativeEulerAngles - Help

Relative Euler Angles

Calculate the relative Euler Angles between two frames Description The Relative Euler angles sensor calculates the Euler angles from the Relative Rotation Matrix that defines the rotation from frame_a to frame_b. The algorithm  is described in the Algorithm section.
 Limitations 1. Only one set of results is given by the sensor. Given the set of outputs and ${\mathrm{θ}}_{3}$, the alternate solutions can be obtained as:      - For the non-classical sequences (e.g. [1,2,3] or [2,3,1]):           ${\mathrm{θ}}_{3}±\mathrm{π}$.      - For classical or repeating sequences (e.g. [3,1,3] or [1,2,1]):              ${\mathrm{θ}}_{3}±\mathrm{π}$. 2. The output angles may become discontinuous if the rotation of the body goes through the singularity of the selected Euler Angle rotation sequence. For classical (repeating) sequences the singularity is at $\mathrm{sin}\left({\mathrm{θ}}_{2}\right)=0$. For non-classical (non-repeating) sequences the singularity is at $\mathrm{cos}\left({\mathrm{θ}}_{2}\right)=0$. 3. The output angles may also become discontinuous if they are close to the boundary of $±\mathrm{π}.$

Connections

 ame Description ${\mathrm{frame}}_{a}$ First Frame ${\mathrm{frame}}_{a}$ Second Frame $\mathrm{angles}$ Real signal of dimension 3x1 that specifies the Euler Angles (in radians) based on the rotation sequence selected via the Rotation Sequence parameter.

Parameters

 Symbol Default Units Description Modelica ID $\left[1,2,3\right]$ - The sequence of rotations. e.g. [1,2,3]: First rotation w.r.t. x, second rotation w.r.t. y', and third rotation w.r.t. z''. RotSeq

 Algorithm (The algorithm below is based on: G. Meyer and H. Q. Lee, "A Method for Expanding a Direction Cosine Matrix Into an Euler Sequence of Rotations," NASA TM X-1384, 1967)   Let       I = RotSeq;       J = RotSeq;       K = RotSeq; and rotation matrix A, is given by:     A = transpose(frame_a.R.T); where frame_a.R.T is the absolute orientation matrix of ${\mathrm{frame}}_{a}$.           if I <> K then             L = I - mod(J,3);             C = if L == 2 then -1 else L;             TH = -atan2(A[K,J]*C,A[K,K]);             X = -sin(TH);             Y = cos(TH);             X = A[I,K]*X - A[I,J]*C*Y;             Y = A[J,J]*Y - A[J,K]*C*X;             X = -A[K,I]*C;             Y = A[I,I]*Y + A[J,I]*C*X;         else             N = 6 - (K + J);             L = N - mod(I,3);             C = if L == 2 then -1 else L;             TH = -atan2(A[K,J],A[K,N]*C);             X = -sin(TH);             Y = cos(TH);             X = -A[N,N]*X + A[N,J]*C*Y;             Y = A[J,J]*Y - A[J,N]*C*X;             X = A[J,I]*X - A[N,I]*C*Y;             Y = A[K,K];         end if;         TH = -atan2(X,Y);         TH = -atan2(X,Y);         end EQs;