How to use quaternions to determine orientation given a specified torque

14 次查看(过去 30 天)
I am trying to determine the 6_DOF state (3-DOF position and 3-DOF orientation) of a solid perfect sphere undergoing know forces and torques. I am using a non-stiff differential equation solver "gni_vstrvl2" which takes the current state of position/orienation and their velocities then calculated the known forces and torques and the output of the solver is accelerations. I am confident that I am calculating the position correctly as it is just F=ma or a=F/m, but I'm not sure how to calculate my orientation acceleration. since the object is perfectly spherical the inertia and coriolis term are zero, but given a starting roll, pitch, and yaw. I don't think I can just calculate the new roll pitch and yaw using Torque = I theta_double_dot. I believe I need to use quaternions to do this right, I'm just not sure how. Any help would be appreciated. Let me know if my question doesn't make sense.

回答(1 个)

Nandini
Nandini 2023-7-22
Your question makes sense. Calculating the orientation acceleration of a solid perfect sphere using quaternions is indeed a suitable approach. Quaternions provide a convenient way to represent and manipulate orientations in three-dimensional space.
To calculate the orientation acceleration, you can follow these steps:
1. Represent the initial orientation of the sphere using a quaternion. Let's call it `q0`, where `q0 = [w0, x0, y0, z0]`. The quaternion represents the rotation from the reference orientation (e.g., identity quaternion) to the initial orientation.
2. Calculate the angular velocity of the sphere using the known forces and torques acting on it. Let's call it `omega = [p, q, r]`, where `p` represents the roll rate, `q` represents the pitch rate, and `r` represents the yaw rate.
3. Convert the angular velocity `omega` to a quaternion derivative `dq/dt` using the formula:
dq/dt=0.5*q*[0,p,q,r]
Here, `q` is the quaternion representing the current orientation of the sphere.
4. Integrate the quaternion derivative `dq/dt` over time to obtain the new quaternion `q` representing the updated orientation. You can use your non-stiff differential equation solver "gni_vstrvl2" to calculate the quaternion acceleration `dq/dt` and update the quaternion `q` accordingly.
By following these steps, you should be able to calculate the orientation acceleration of the sphere using quaternions and update the roll, pitch, and yaw angles accordingly.
Note: When using quaternions, it's important to normalize them after each integration step to ensure they remain unit quaternions (i.e., their magnitude is 1).

Community Treasure Hunt

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

Start Hunting!

Translated by