Accelerometer Coordinate system rotation

34 次查看(过去 30 天)
I am using accelerometers to measure body accelerations and am trying to rotate them to the global coordinate sysyem. As they are placed on the body they are slightly rotated. How do I rotate it to the global coordinate system so that all of the acc takes place in the Y(-9.81) and none in the x or z? I am able to calucate the roll and pitch angles using the Following values below:
x (ML)= 1.2332
y(SI)= -7.6718
z(AP)= 5.3360

采纳的回答

Jim Riggs
Jim Riggs 2019-1-24
编辑:Jim Riggs 2019-1-24
In general, you can construct a 3-dimensional transformation matrix using a sequence of three 2-dimensional planar rotations. First, we have to define our terms.
We define Phi as the rotation angle about the X-axis
Theta is the rotation angle about the Y axis.
Psi is the rotation angle about the Z axis.
All rotations are performed according to the right-hand rule (positive rotation is a positive right-hand curl)
Reference frame A is fixed and used to observe the motion of frame B, so frame B is said to be displaced from frame A. Let's assume frame A is the inertial frame and B is the body frame.
(NOTE that the angles are defined as the displacement of B from A . Think about it as if B starts out in alignment with A, and the three rotation angles are used to describe how B moves from A)
Now you can define the 2 dimensional transformations that will rotatre a set of coordinates from the displaced frame (B) to the fixed reference frame (A).
ROLL = [1, 0, 0; 0, cos(Phi),-sin(Phi); 0, sin(Phi), cos(Phi)];
PITCH = [cos(Theta), 0, sin(Theta); 0, 1, 0; -sin(Theta), 0, cos(Theta)];
YAW = [cos(Psi), -sin(Psi), 0; sin(Psi), cos(Psi) 0; 0, 0, 1];
Now the three dimentional transformation matrix may be constructed by providing the appropriate sequence of the three planar rotations. Note that the order of the rotations is not commutative, so the problem geometry will dictate what order must be used. In aerospace systems, we usually construct the attitude of an aircraft using the Z-Y-X or YAW-PITCH-ROLL sequence. In this case, the transformation matrix T = YAW * PITCH * ROLL. This is usually accompanied by a frame where Z is the "down" axis. Then any vector in the displaced frame (V_measured) can be rotated into the Inertial frame by multiplying it by T:
V_inertial = T * V_measured.
If your system is using Y as the "down" axis, you might need to alter the rotation sequence. I can't tell without being able to visualize how you move the sensor to align with the inertial frame.
Also, to rotate a vector from the inertial frame to the sensor frame (i.e. the inverse rotation) simply use the transpose of T:
V_measured = T' * V_inertial
  8 个评论
KJ
KJ 2023-4-8
@Jim Riggs thank you for the thoughtful answer and comments — it's helped me to better understand coordinate transformations. Does the approach you mention in the accepted answer and comments suffer from gimbal lock?
Jim Riggs
Jim Riggs 2023-4-8
编辑:Jim Riggs 2023-4-8
No, not really. This discussion pertains to how a vector can be represented in one or more reference frames.
Gimbal lock is a phenomenon associated with resolving angular motion. In the days of mechanical gimbals, it was possible for an aircraft to get into an orientation where two of the gimbal axes were parallel with each other. At this point, the system could not determine which of these two axes the motion was to be assigned. It eliminates one degree of freedom from the 3-axis rotation equations and the motion becomes indeterminant.
Modern navigation systems use strapdown sensor suites with sensing axes that always remain orthogonal, so the motion is always resolvable in 3 dimensions. There are no 'gimbals'. The trick is in the mathematics of how the angle changes are resolved. One popular approach is to use a quaternion. This is a mathematical device for expressing angles in 3 dimensions and has no singularities. (=Gimbal lock problem solved using mathematical algorithms)
So the subject of gimbal lock pertains to how a vehicle orientation angles are resolved in 3 dimensions.
Our discussion in this answer involves how a given vector in one reference frame is expressed in a different frame.
[EDIT] OK I see how I may have initiated some confusion in this area. I used an example of a gimballed system, above, to illustrate how some situations have implied relationships between the different axes with respect to rotation. In the most general sense, you may construct a 3-dimentional direction cosine matrix using 3 planar rotations, and you can do this using just about any sequence that you want. But in a system using mechanical gimbals, one axis is attached to another axis and it moves when the axis it is attached to moves. This implies a specific sequence - the outer gimbal motion effects the inner one, but the inner gimbal movement has no effect on the outer one. This is a case where the sequence of rotations used is dictated by the system architecture. The point I am trying to make is that constructing a direction cosine matrix from planar Euler rotations provides many options in the general case and you are free to choose, but sometimes the problem geometry will dictate an appropriate sequence.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by