Seeing the essence of linear transformation from the attitude control of airplane

When fighters make maneuvers, they often perform yaw, pitch, and roll actions to change the trajectory of the aircraft. This also contains a wealth of ideas and applications of linear space transformation. This article attempts to use the theory of linear algebra to explain how these operations are done. Of course, the same explanation can also be applied to the movement of robots and robotic arms.

For convenience, choose the coordinate system on the plane, assuming that the plane is on a xOyplane, the nose is pointing to xthe positive direction of the axis, and the left wing is pointing to the positive direction of the Yaxis. The xOyplane is flying on a plane, and the withaxis is defined in the normal direction of the flight plane. The above is positive. As shown below:

When the plane is flying, the three coordinate axes and the plane move at the same time.

We respectively talk about:

1. yaw

 Yaw is a xOyrotation in a plane. As shown in the figure below, it is a schematic diagram of yaw 45°. At this time, the aircraft turns right 45° (clockwise). From the perspective of three-dimensional linear transformation, yaw is about the withaxis Rotation, if the initial coordinates of the aircraft nose are expressed as a vector \begin{bmatrix} 1 & 0 & 0 \end{bmatrix}^T, its coordinates will still be after the yaw \begin{bmatrix} 1 & 0 & 0 \end{bmatrix}^T. This is because the coordinate axis rotates together with the aircraft. For the time being, the coordinate system before the transformation becomes the initial coordinate system, and the yaw is 45° After that, the position of the nose relative to the initial coordinate system is 

\begin{bmatrix} \frac{\sqrt{2}}{2}\\ -\frac{\sqrt{2}}{2}\\ 0 \end{bmatrix}

If the yaw transformation L can be called the transformation of the initial coordinate system, it is easy to find its representation matrix. If the yaw angle of L to that is \theta, then L will be (1,0,0) and (0,1,0 ) Respectively rotate to points

\begin{bmatrix} cos(\theta) & -sin(\theta) & 0 \end{bmatrix}^T

with

\begin{bmatrix} sin(\theta) & cos(\theta) & 0 \end{bmatrix}^T

The point \begin{bmatrix} 0 & 0 & 1 \end{bmatrix}^Twill remain the same when yaw, because it is on the axis of rotation. For the column vector, if it \ vec {y} _1, \ vec {y} _2, \ vec {y} _3is R^3the coordinate vector of L , then

\vec{y}_1 = L(e_1)=\begin{bmatrix} cos(\theta)\\ -sin(\theta)\\ 0 \end{bmatrix}

\vec{y}_2 = L(e_2)=\begin{bmatrix} sin(\theta)\\ cos(\theta)\\ 0 \end{bmatrix}

\vec{y}_3 = L(e_3)=\begin{bmatrix} 0\\ 0\\ 1 \end{bmatrix}

Then, the transformation matrix of yaw is:

Y=\begin{bmatrix} L(\vec{e}_1) & L(\vec{e}_2) & L(\vec{e}_3) \end{bmatrix} = \begin{bmatrix} cos(\theta) & sin(\theta) & 0\\ -sin(\theta) & cos(\theta) & 0\\ 0 & 0 & 1 \end{bmatrix}


2. Pitch

The pitch of the aircraft is xOzthe rotation in the plane. When the angle is negative, the nose rotates downward, otherwise, it rotates upward. From the perspective of the linear transformation of the three-dimensional space, the pitch is Ythe rotation about the axis. Just like the yaw, there is also a transition matrix relative to the initial coordinate system. If L is a \thetapitch transformation with a rotation angle of , then the matrix represented by L is:

P=\begin{bmatrix} L(\vec{e}_1) & L(\vec{e}_2) & L(\vec{e}_3) \end{bmatrix} = \begin{bmatrix} cos(\theta) & 0 & -sin(\theta)\\ 0 & 1 & 0\\ sin(\theta) & 0 & cos(\theta)\end{bmatrix}


3. Tumble

The roll of the aircraft is yOzthe rotation of the plane, the left wing is up, the right wing is down, and the rotation is in the positive direction. From the perspective of the linear transformation of the three-dimensional space, roll is xthe rotation about the axis, similar to yaw and pitch, the transfer matrix of the initial coordinate system can be transformed by the roll of the i-ball.

R=\begin{bmatrix} L(\vec{e}_1) & L(\vec{e}_2) & L(\vec{e}_3) \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0\\ 0 & cos(\theta) & -sin(\theta)\\0 & sin(\theta) & cos(\theta)\end{bmatrix}


If the yaw angle first \theta_1, then the pitch angle \theta_2, this compound transformation is linear, and its transformation matrix is ​​not a product PY. The function of yaw is to convert the standard basis vector \ vec {e} _1, \ vec {e} _2, \ vec {e} _3to a new direction \ vec {y} _1, \ vec {y} _2, \ vec {y} _3, so the vector \ vec {y} _1, \ vec {y} _2, \ vec {y} _3will be used to define the new pitch x,y,zThe direction of the axis, the next pitch transformation is Ycarried out for the new axis (that is \ vec {y} _2, the direction indicated by the vector ), the vectors \ vec {y} _1, \ vec {y} _3form a plane, and when pitching, they will rotate together in the plane by an angle \theta_2, and the vector \ vec {y} _2will not be affected when pitching Because it is on the axis of rotation. Therefore, the effect of the consistent transformation L on the standard basis vector is:

\ vec {e} _1 \ stackrel {yaw} {\ longrightarrow} \ vec {y} _1 \ stackrel {pitch} {\ longrightarrow} cos (\ theta_2) \ vec {y} _1 + sin (\ theta_2) \ vec { y} _3

\ vec {e} _2 \ stackrel {yaw} {\ longrightarrow} \ vec {y} _2 \ stackrel {pitch} {\ longrightarrow} \ vec {y} _2

\ vec {e} _3 \ stackrel {yaw} {\ longrightarrow} \ vec {y} _3 \ stackrel {pitch} {\ longrightarrow} -sin (\ theta_2) \ vec {y} _1 + cos (\ theta_2) \ vec {y} _3

The image of the standard basis vector constitutes a column vector conforming to the transformation representation matrix.

\\ \begin{bmatrix} cos(\theta_2)\vec{y}_1+sin(\theta_2)\vec{y}_3 & \vec{y}_2 & -sin(\theta_2)\vec{y}_1+cos(\theta_2)\vec{y}_3 \end{bmatrix} = \begin{bmatrix} \vec{y}_1 & \vec{y}_2 & \vec{y}_3 \end{bmatrix}\begin{bmatrix} cos(\theta_2) & 0 & -sin(\theta_2) \\ 0 &1 & 0 \\ sin(\theta2))&0 & cos(\theta_2) \end{bmatrix}=YP

Therefore, the representation matrix conforming to the transformation is the product of the two matrices representing yaw and pitch, but the product must be performed in the reverse order, that is, the yaw matrix is Yon the left and the pitch matrix is Pon the right. Similarly, the yaw angle \theta_1, Then the coincidence transformation of the pitch angle \theta_2and the roll angle \theta_3indicates that the matrix should be a product

YPR

It can be understood this way, assuming that after three transformations of yaw, pitch, and roll, the vector in the new coordinate system\ vec {v}

Then before the roll transformation, the vector isR \ vec {v}

Before pitch transformation, the vector isPR \ vec {v}

Before the yaw transformation, the vector isYPR \ vec {v}

and so

\ vec {v '} = YPR \ vec {v}

Among them \ vec {v '}are the coordinates measured in the coordinate system before the transformation, and the coordinates in \ vec {v}the new coordinate system

\ vec {y} = A \ vec {x}

The \ vecvector in the standard coordinate system is equal to the vector in the Acoordinate system \ vec {x}, which can be written as:

E \ vec {y} = A \ vec {x}

It is similar to the variable definition in C language programming.

int a;

double abc;

Follow the form of "type + object", where the matrix is ​​the type, and the object is the vector coordinate.


Think of another way to understand compound transformation:

Assuming that the initial coordinate system is the standard coordinate system and remains unchanged, the Rtransformation is Ybased on the basis. Therefore, relative to the original coordinate system, assuming the coordinate vector is \ vec {x}, the new coordinate in the original coordinate system after transformation is Y \ vec {x}, The transformation operator is Y.

After the transformation, the coordinates become in the original coordinate system, YPY ^ {- 1} \ vec {x}and the transformation operator isYPY^{-1}  

Therefore, after comprehensively performing Y and R transformations, \ vec {x}the new coordinates in the original coordinate system after the transformation of the original vector are multiplied by the transformation operator:

Perform Y transformation first, and then perform R transformation to get:

 YPY^{-1}\cdot Y=YP

In the same way, it is YPregarded as a transformation, Rand then the transformation is carried out on the basis of it , then the R transformation is YPcarried out on the basis. The same reason, in the original coordinate system, the Rtransformation operator should be(YP) R (YP) {{- 1} = YPRP {{- 1} Y {{- 1}

Therefore, the composite transformation obtained by performing Y, P, and R transformations in turn should be the multiplication of the cubic transformation matrix in composite intuition:

T(\vec{x}) =(YPRP^{-1}Y^{-1})\cdot (YPY^{-1})\cdot (Y)\vec{x} = YPR

Wherein YPRP -1 Y -1YPY^{-1}Yrespectively, from the original coordinate system the angle, seen R,P,Ytransformation matrix, thus in line with the right by an intuitive understanding of the process as shown below:

As shown below:

Here must just distinguish between space transformation and perspective transformation:

Viewing angle change: Observing the change of the angle, the control itself has not changed, the rectangle is still the original rectangle, the square is still the original square, and the spatial structure has not changed.

Space transformation: the space itself changes, the space is distorted, stretched, etc., for example, a rectangle becomes a parallelogram, etc. Here we should pay attention to a special kind of space transformation, that is, the orthogonal transformation caused by the normal matrix. Orthogonal transformation will not distort or deform anything, but it belongs to space transformation.

Of course, it may need to be assumed here that the space has an absolute orientation, that is, there is a real identity matrix $$I$$. From this perspective, the perspective transformation can be regarded as a special spatial transformation.

In fact, there is a theorem in the advanced course of linear algebra (the Tongji version of non-mistakers), which is described as follows:

make

E=\begin{bmatrix} \vec{v_1} & \vec{v_2}& \cdots & \vec{v_n} \end{bmatrix}

as well as

F=\begin{bmatrix} \vec{w_1} & \vec{w_2}& \cdots & \vec{w_n} \end{bmatrix}

Vector space is a Vtwo ordered groups, and so Lis a Vlinear operator on, so that Sfrom Fthe Etransfer matrix represents, if Ais Lcorresponding to the Erepresentation matrix, and Bis Lcorresponding to Fthe representation matrix, then B=S^{-1}AS, orA=SBS^{-1}

The proof of this theorem is also very simple:

The Sas identity transformation  \yourcorresponding to the ordered group

F=\begin{bmatrix} \vec{w_1} & \vec{w_2}& \cdots & \vec{w_n} \end{bmatrix}

with

E=\begin{bmatrix} \vec{v_1} & \vec{v_2}& \cdots & \vec{v_n} \end{bmatrix}

The representation matrix, then:

SIs the representation matrix \yourcorresponding to the Fsum E: because the identity transformation is applied to the median Fvector (that is, it remains unchanged), it is equivalent to the coordinates in the\ vec {x}IES \ vec {x}

AIs the representation matrix Lcorresponding to E: so    [L (S \ vec {x})] _ E = AS \ vec {x}

S^{-1}Is the representation matrix \yourcorresponding to the Esum F: because the Eidentity transformation Iis applied to the middle vector (that is, it remains unchanged), it is equivalent to Ethe left multiplication of the coordinates in the middle S^{-1}, that is,S ^ {- 1} AS \ vec {x}

Therefore, it is equivalent to the vector in F. \ vec {x}After A transformation, the coordinates in F are obtained S ^ {- 1} AS \ vec {x}. Therefore, for the same transformation, the representations in E and F are different, but they have a similar relationship.


Map the above theorem to Ythe problem of pitch after transformation:

L:Pitch \thetaangle

E:Initial coordinate system

F:New coordinate system after transformation

B:Relative to Fthe transformation of the new coordinate system , here is P

A:EThe representation matrix of the  P transformation relative to .

S:The transformation relative to the new coordinate system F, here isY

Applying the above formula, you can get:

P'=YPY^{-1}


Example:

Hypothesis
\theta_1 = \frac{\pi}{4}, \theta_2=\frac{\pi}{6},\theta_3=\frac{\pi}{3}

Y=\begin{bmatrix} L(\vec{e}_1) & L(\vec{e}_2) & L(\vec{e}_3) \end{bmatrix} = \begin{bmatrix} cos( \frac{\pi}{4}) & sin( \frac{\pi}{4}) & 0\\ -sin( \frac{\pi}{4}) & cos( \frac{\pi}{4}) & 0\\ 0 & 0 & 1 \end{bmatrix}=\begin{bmatrix} \frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} & 0\\ -\frac{\sqrt{2}}{2} & \frac{\sqrt{2}}{2} & 0\\ 0 & 0 & 1 \end{bmatrix}

P=\begin{bmatrix} L(\vec{e}_1) & L(\vec{e}_2) & L(\vec{e}_3) \end{bmatrix} = \begin{bmatrix} cos(\frac{\pi}{6}) & 0 & -sin(\frac{\pi}{6})\\ 0 & 1 & 0\\ sin(\frac{\pi}{6}) & 0 & cos(\frac{\pi}{6})\end{bmatrix}=\begin{bmatrix} \frac{\sqrt{3}}{2} & 0 & -\frac{1}{2} \\ 0 & 1 & 0\\ \frac{1}{2} & 0 & \frac{\sqrt{3}}{2}\end{bmatrix}

R=\begin{bmatrix} L(\vec{e}_1) & L(\vec{e}_2) & L(\vec{e}_3) \end{bmatrix} = \begin{bmatrix} 1 & 0 & 0\\ 0 & cos(\frac{\pi}{3}) & -sin(\frac{\pi}{3})\\0 & sin(\frac{\pi}{3}) & cos(\frac{\pi}{3})\end{bmatrix}=\begin{bmatrix} 1 & 0 & 0\\ 0 & \frac{1}{2} & -\frac{\sqrt{3}}{2} \\0 & \frac{\sqrt{3}}{2} & \frac{1}{2}\end{bmatrix}

Q=YPR=\begin{bmatrix} 0.612372 & 0.047367 &-0.789149 \\ -0.612372 & 0.659740 & -0.435596\\ 0.500000 & 0.750000 & 0.433013 \end{bmatrix}

According to the eigenvalues ​​and eigenvectors calculated by octave, it can be seen that the two complex eigenvalues ​​share each other, and the corresponding eigenvectors are also in a mutual relationship. The combined vector has an eigenvalue of 1, and the corresponding feature The vector is a real vector. In fact, the orthogonal transformation in the three-dimensional space must have an eigenvalue with an eigenvalue of 1 (a rigid body transformation does not change the length of the rigid body in any direction). This eigenvalue and eigenvector have very profound meanings. It can classify the above three transformations into one transformation, and the direction corresponding to the feature vector is the symmetry axis of the new transformation, which we will talk about later. For the proof of bars, please refer to my blog post Proving some basic properties of linear space 30. (The basic conclusion is: in the transformation of a rigid body in three-dimensional space, there must be an axis of symmetry. In the direction of the axis of symmetry, the scale of the rigid body does not change. (The characteristic value is 1))

The following figure shows \ vec {OP}the symmetry axis, \ vec {OA}, \ vec {OB}, \ vec {OC}which is the original x,y,zaxis after transformation. Note that the entire transformation is equivalent \ vec {OP}to a rotation of the coordinate system .

The relationship of symmetrical rotation around the direction of the feature vector can be intuitively illustrated by the following figure.

Here is a close-up of the shaft:

In summary, yaw

\theta_1 = \frac{\pi}{4}

Pitch

\theta_2=\frac{\pi}{6}

roll

\theta_3=\frac{\pi}{3}

The comprehensive effect of is equivalent to centering the coordinate system around the unit feature vector

\vec{v}=\begin{bmatrix} -0.63347\\0.68880 \\ 0.35250\end{bmatrix}

Rotate 69.36° to transform the effect completed at one time, so there is no need for the fighters to do the actions step by step. As long as you do a 69.36° rotation according to the calculated vector direction, you can get it in one step. Here the direction of the feature vector is the axis of symmetry. , This is the physical meaning of eigenvectors in engineering.

end

Guess you like

Origin blog.csdn.net/tugouxp/article/details/112346249