IMUF 250
IMUF 250
IMPORTANT NOTES
This imuf needs far less filtering than before, as such set your imuf_lowpass_roll/pitch/yaw to 150-200+ hz. This seems to give users the best experience with this version of the imuf.
Changleog:
- Covariance math improvement.
- Non-dynamic BiQuad gyro LPF.
- Refactored sharpness,
sharpness=0
is OFF
Notes:
- Pilots are welcome to use any IMUF versions liked best. New IMUF releases are not requirements.
- If you've heard of test-versions 9001 and 9002, this is equivalent to 9002. To make it 9001, simply turn off sharpness.
Compatibility
- IMUF 250 binary for Helio/Strix hardware is compatible only with 0.3.X exclusively. Do not use for older 0.1.0 or 0.2.0.
- Pilots are still welcome to use any IMUF version based on their personal preferences, but only 225 and above make use of the sharpness feature which require newer EmuFlight (0.2.32+, 0.3.0+).
The Windows® based tool is still required for flashing. Keep the "Original Helio Firmware" UN-checked, or you are really going to have a bad time. If for some reason you flash wrongly, just plug usb, and wait 5 full minutes for the DFU to connect.
Imperative:
- Compatible only with 0.2.32+, 0.3.0+
- Save your
diff all
anddump all
prior to flashing IMUF. - Flashing may possibly cause invalid data in your settings, especially very-large LPF values that could cause fly-away. This is seldom; however, be sure to validate your LPF and other values. The CLI command
defaults
may not reset them properly, so set them manually if you see a problem. - The best option is to [re]flash EmuFlight 0.3.X firmware (with full-chip erase) after flashing the IMUF binary.
- If your LPF values are in a normal range, then there is no issue to fix.
Thanks to
- Paweł Spychalski for improved covariance math.
- Andrey Semjonovs for extensive code testing and differentiation.
Additional Information
- Sharpness math in IMUF250 is not applied same as previous versions, where:
src/filter/filter.c:83: sharpness = (float)filterConfig.sharpness / 250.0f;
src/filter/kalman.c:16: filter->s = sharpness * 0.01f;
- and where calculations in
kalman_process
(src/filter/kalman.c
) are:
[...]
if (kalmanState->s != 0.0f) { //if sharpness non-zero
float average = fabsf(target + kalmanState->lastX) * 0.5f;
if (average > 10.0f) {
float error = fabsf(target - kalmanState->lastX);
float ratio = error / average;
kalmanState->e = kalmanState->s * powf(ratio, 3.0f); //"ratio" power 3 and multiply by a gain (sharpness)
}
//prediction update
kalmanState->p = kalmanState->p + (kalmanState->q + kalmanState->e);
} else { //if sharpness zero (off)
if (kalmanState->lastX != 0.0f) {
kalmanState->e = fabsf(1.0f - (target / kalmanState->lastX));
}
//prediction update
kalmanState->p = kalmanState->p + (kalmanState->q * kalmanState->e);
}
[...]