- #1
DarthBane
- 11
- 0
So I have been trying to figure out some orientation data that I gather from a triaxial gyroscope, and figure out my orientation using only initial conditions and angular velocity from the gyroscope's current axes.
The data is all relative to the current orientation, so if I rotate the device about the x-axis 90 degrees and then flip it to some other orientation and rotate again about the "new" x-axis 90 degrees, the data will remain the same. The axes of the gyroscope are fixed to its orientation, and I want to map these rotations back to a fixed coordinate system, namely the Earth's. I am working with the classic "yaw", "pitch", and "roll" angles, psi, theta, and phi respectively for aircraft orientation. Trying out a hobby UAV with my own coding.
The ωn terminology refers rotational velocity about axes n relative to the gyroscope, and then the greeks are for my fixed coordinate system that I have established
The current equations that I have are:
∂[itex]\phi[/itex](t)/∂t = ωx(t) + tan(θ(t-1))*( ωy(t)*sin([itex]\phi[/itex](t-1))) + ωz(t)*cos([itex]\phi[/itex](t-1));
∂θ(t)/∂t = ωy(t)*cos([itex]\phi[/itex](t-1)) - ωz(t)*sin([itex]\phi[/itex](t-1));
∂ψ(t)/∂t = sec(θ(t-1))*(ωy(t)*sin([itex]\phi[/itex](t-1)) + ωz(t)*cos([itex]\phi[/itex](t-1)));
Some of my rotations aren't quite coming out as expected, and I know that it isn't noise from the gyroscope, so I assume I have implemented something wrong with my rotations.
Any help would be appreciated, thanks in advance.
The data is all relative to the current orientation, so if I rotate the device about the x-axis 90 degrees and then flip it to some other orientation and rotate again about the "new" x-axis 90 degrees, the data will remain the same. The axes of the gyroscope are fixed to its orientation, and I want to map these rotations back to a fixed coordinate system, namely the Earth's. I am working with the classic "yaw", "pitch", and "roll" angles, psi, theta, and phi respectively for aircraft orientation. Trying out a hobby UAV with my own coding.
The ωn terminology refers rotational velocity about axes n relative to the gyroscope, and then the greeks are for my fixed coordinate system that I have established
The current equations that I have are:
∂[itex]\phi[/itex](t)/∂t = ωx(t) + tan(θ(t-1))*( ωy(t)*sin([itex]\phi[/itex](t-1))) + ωz(t)*cos([itex]\phi[/itex](t-1));
∂θ(t)/∂t = ωy(t)*cos([itex]\phi[/itex](t-1)) - ωz(t)*sin([itex]\phi[/itex](t-1));
∂ψ(t)/∂t = sec(θ(t-1))*(ωy(t)*sin([itex]\phi[/itex](t-1)) + ωz(t)*cos([itex]\phi[/itex](t-1)));
Some of my rotations aren't quite coming out as expected, and I know that it isn't noise from the gyroscope, so I assume I have implemented something wrong with my rotations.
Any help would be appreciated, thanks in advance.
Last edited: