Inside the imu.ccp at line 336 you can find the following code:
alt.EstAlt = (alt.EstAlt * 6 + BaroAlt ) >> 3; // additional LPF to reduce baro noise (faster by 30 µs)
In my opinion there's a bug.
The sum of the old and the new values should be equal with the divider.
But the sum is 7, the divider is 8.
So over the time alt.EstAlt will become the half of BaroAlt.
JayBee
possible a bug in the baro algorithm ?
-
- Posts: 1630
- Joined: Wed Jan 19, 2011 9:07 pm
Re: possible a bug in the baro algorithm ?
Hi,
Please look at r1628 change. not trivial to follow, but a little faster to do this way
Please look at r1628 change. not trivial to follow, but a little faster to do this way
Code: Select all
baroGroundTemperatureScale = ((int32_t)baroTemperature + 27315) * (2 * 29.271267f); // 2 * is included here => no need for * 2 on BaroAlt in additional LPF
Re: possible a bug in the baro algorithm ?
Hello Alex,
that make sense.
Thank you for the fast reply.
JayBee
that make sense.
Thank you for the fast reply.
JayBee