jremington / LSM9DS1-AHRS

Mahony 3D fusion filter and tilt compensated compass, with sensor calibration code
44 stars 11 forks source link

Tilt compensation for model rocket #4

Closed coryjonsmith closed 2 years ago

coryjonsmith commented 2 years ago

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?

jremington commented 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.