Closed coryjonsmith closed 2 years ago
The tilt compensated compass code assumes that there is no acceleration other than due to gravity. It won't work at all in a rocket.
The AHRS code makes a similar assumption, although the gyro can partially correct for accelerations associated with rotation. In any case, during launch the rocket acceleration is much higher than can be measured by this sensor, so the sensor readings will be maxed out and meaningless.
I am looking to utilize an AHRS algorithm like this in a model rocket. The orientation of the IMU will be such that the x axis will be pointing into the sky perpendicular to the ground. If the x-axis was parallel with the ground the magnetometer would contribute to the yaw calculation relative to north. However, in my configuration it seems that the magnetometer would contribute to the roll calculation relative to north. Is this something that is taken into account in your tilt compensated compass code?