How to disable a problematic IMU properly?

I was quite unlucky to seriously injure one of the IMUs on PixRacer when the copter drained the very last bits of the battery after falling in the fields. It seems to function, but it would die with Internal Error 0x1000000 imu_reset at any convenient moment.

How do I turn it off properly?

Dropping the zeroth bit from INS_ENABLE_MASK seems to renumber IMUs and messes a lot of things, such that even accel calibration seems to not work. On the other hand, just removing the bit from EK3_IMU_MASK kind of works, but notch filtering seems to still filter the wrong IMU, and vibration logging seems to have broken.

That is the correct way. It must not renumber anything at all. If it does there is a bug. Are you using ArduCopter 4.2.2?

The problem with INS_ENABLE_MASK is that it represents the driver ordering in the hwdef. If the hwdef contains driver entries for different variants of boards (i.e. IMUs not present on your board) then the numbering will not be what you expect. Unfortunately the only way to figure out the proper numbering is to look at the hwdef.

I did have a change to fix this but it was rejected because it changes the current behaviour

@andyp1per I believe PixRacer is easy in this regard.

@amilcarlucas I use 4.2.2.

Maybe the main question is whether I shall change anything other than INS_ENABLE_MASK.

Assuming nothing is renumbered, why does it ask me to recalibrate accelerometers? And, based on what INS_ACC*_ID and INS_GYR*_ID tell me, some renumbering indeed happens (what was INS_ACC2_ID becomes INS_ACC_ID, same for gyros). Is that intended or not?

@andyp1per I belive that must be classified as a bug. Disabling a sensor must not force one to re-calibrate the sensors. Maybe add this one to the next Dev meeting?
In the past there were no side effects in disabling a sensor. When did this start?

1 Like

No there are no side effects - its the numbering that I tried to fix

1 Like