I am going to answer my own question. Got sick last week and had some time at home to look at this issue. Hope it helps people here as it seems to be an unresolved problem.
You can calibrate IMU permanently through UART shell. The downside is that the drone needs to be disassembled and soldering is required to connect to the UART pins. And at the moment of calibration the drone must me in assembled state and all the sensors connected and compass calibrated. Without all sensors respoding the drone will not reach the state where it can execute IMU calibration. So basically you need to disassemble the drone, solder some header with wires to UART so you can route it to outside and then reassemble the drone with the wires sticking out.
Ok step by step:
- connect to UART8 and set speed tp 57600 with the drone assembled and on level surface, compass needs to be already calibrated before this procedure. Power on the drone and while it is booting it pobably will start dropping sensor errors in standard output (in my case it was some Error 11) and messing up the info on the screen, just ignore that and keep going.
- there are buch of commands you can run once it reaches nsh shell prompt. Execute command "sensors status" and you should see that all senors are enabled and connected:
nsh> sensors status
INFO [sensors] gyro status:
INFO [Unknown] validator: best: 0, prev best: 0, failsafe: NO (0 events)
INFO [Unknown] sensor #0, prio: 100, state: OK
INFO [Unknown] val: -0.0042, lp: 0.0000 mean dev: 0.0000 RMS: 0.0041 conf: 1.0000
INFO [Unknown] val: 0.0073, lp: 0.0072 mean dev: -0.0000 RMS: 0.0014 conf: 1.0000
INFO [Unknown] val: -0.0012, lp: -0.0001 mean dev: 0.0000 RMS: 0.0007 conf: 1.0000
INFO [sensors] accel status:
INFO [Unknown] validator: best: 0, prev best: 0, failsafe: NO (0 events)
INFO [Unknown] sensor #0, prio: 100, state: OK
INFO [Unknown] val: 0.0869, lp: 0.0560 mean dev: -0.0003 RMS: 0.0233 conf: 1.0000
INFO [Unknown] val: -0.4212, lp: -0.4296 mean dev: -0.0007 RMS: 0.0251 conf: 1.0000
INFO [Unknown] val: -9.8764, lp: -9.8954 mean dev: 0.0026 RMS: 0.0217 conf: 1.0000
INFO [sensors] mag status:
INFO [Unknown] validator: best: 0, prev best: 0, failsafe: NO (0 events)
INFO [Unknown] sensor #0, prio: 255, state: OK
INFO [Unknown] val: -0.2125, lp: -0.2134 mean dev: 0.0001 RMS: 0.0019 conf: 1.0000
INFO [Unknown] val: -0.0216, lp: -0.0205 mean dev: 0.0001 RMS: 0.0015 conf: 1.0000
INFO [Unknown] val: 0.4751, lp: 0.4718 mean dev: -0.0000 RMS: 0.0028 conf: 1.0000
INFO [sensors] baro status:
INFO [Unknown] validator: best: 0, prev best: 0, failsafe: NO (0 events)
INFO [Unknown] sensor #0, prio: 75, state: OK
INFO [Unknown] val: -14.0850, lp: -14.0920 mean dev: 0.0036 RMS: 0.0220 conf: 1.0000
INFO [Unknown] val: 0.0000, lp: 0.0000 mean dev: 0.0000 RMS: 0.0000 conf: 1.0000
INFO [Unknown] val: 0.0000, lp: 0.0000 mean dev: 0.0000 RMS: 0.0000 conf: 1.0000
INFO [sensors] Temperature Compensation:
INFO [sensors] gyro: enabled: 1
INFO [sensors] using device ID 3670282 for topic instance 0
INFO [sensors] accel: enabled: 1
INFO [sensors] using device ID 3604746 for topic instance 0
INFO [sensors] baro: enabled: 1
INFO [sensors] using device ID 5600801 for topic instance 0
INFO [sensors] Airspeed status:
INFO [Unknown] no data
- execute "commander status" and you should see output like this which basically means that arming process is stuck in the INIT state:
nsh> commander status
WARN [commander] type: symmetric motion
WARN [commander] safety: USB enabled: [NO], power state valid: [OK]
WARN [commander] avionics rail: 5.05 V
WARN [commander] home: lat = xx.xxxxxx, lon = yy.yyyyyy, alt = 69.77, yaw: -3.04
WARN [commander] home: x = 0.0456430, y = 0.0074987, z = -0.04
WARN [commander] datalink: OK
WARN [commander] main state: 2
WARN [commander] nav state: 2
WARN [commander] arming: INIT
- at this point you can run IMU calibration procedure, execute "commander calibrate gyro". Leave your drone on level surface and watch calibration being performed, it will take a minute or so and the output should show countdown till 100. The output might get messed up with sensor errors but be patient and see thought it:
nsh> commander calibrate gyro
INFO [commander] [cal] calibration started: 2 gyro
INFO [commander] [cal] progress <5>
INFO [commander] [cal] progress <10>
INFO [commander] [cal] progress <15>
....
INFO [commander] [cal] progress <80>
INFO [commander] [cal] progress <85>
INFO [commander] [cal] progress <90>
INFO [commander] [cal] progress <95>
INFO [commander] [cal] progress <100>
INFO [commander] [cal] calibration done: gyro
INFO [commander] Disarmed by init -> standby
- now you can power down the drone and power it up again. Again execute "commander status" and you should see that now the arming was completed and drone is in sate STANDBY, ready to launch.
nsh> commander status
WARN [commander] type: symmetric motion
WARN [commander] safety: USB enabled: [NO], power state valid: [OK]
WARN [commander] avionics rail: 5.04 V
WARN [commander] home: lat = xx.xxxxxx, lon = yy.yyyyyy, alt = 70.16, yaw: -3.06
WARN [commander] home: x = 0.0593491, y = 0.0035389, z = -0.11
WARN [commander] datalink: OK
WARN [commander] main state: 2
WARN [commander] nav state: 2
WARN [commander] arming: STANDBY
The IMU should be calibrated and you can fly your Mantis-Q.