-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lsm303d & l3gd20 can not calibrate level horizon #14505
Comments
Would you be able to get a log from boot (SDLOG_MODE 2) with an attempted calibration? Capturing this output from the console might also help.
|
@dagar log below as you requested. Update Below's log is recorded from a Pixhawk running pr-new_invensense_drivers branch, with mpu6k driver disabled.
sensors status:
listener sensor_accel:
listener sensor_gyro:
work_queue status:
|
@dagar I need to add an update from my testings, might be helpful: |
@rolandash I believe the problem here is the estimator not initializing with the data from the lsm303d + l3gd20 combo. Does it work if you do a clean accel + gyro calibration, reboot, then try level horizon? |
@dagar My testings confirms with your judgement. Expecting the fix from you soon. |
@rolandash could you please give current master another try? It's about to be tagged as v1.11.0-beta2. If it's still a problem a log from boot (SDLOG_PROFILE) would help. |
@dagar Just saw your message. Will test it and feedback to you in one day or two. |
@dagar |
Please check the SDLOG attached. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
Hi @dagar Is this issue considered been addressed in latest 1.11 ? |
Well yes and no. It appears to be an issue with ekf2 where if the IMU has a sufficiently large offset it won't initialize. If you calibrate first, the estimator will initialize (and start publishing vehicle_attitude) and the level horizon calibration will then work. We could open a PX4/ecl bug and investigate it there, but I'm wondering if we simply need a better error message to suggest calibrating before trying again. |
I loaded up 1.11 RC3 zeroed all accel, gyro and mag calibrations and calibrated all in one go including leveling the horizon and it worked. Sensors onboard were LSM303D for compass (1114122), MPU600 for gyro (2162698). Gyro 2 as L3GD20 (2228234). Offsets would have been zero since I did it all from zero but it does work. Soft reboot and leveled again and leveled fine. No external sensors. All internal. |
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions. |
So this is interestingly back. On release 1.11.2 if i follow the above and calibrate gyro and accel first, i can calibrate the horizon but once i reboot i cant calibrate it. Looking at the offsets of the accels, one of them has offsets of around 3 (MRO Pixhawk and i tried 3 different ones). Presumably all hardware will have an offset different between two different sensors so this not being able to cope with that is probably the change needed. At the same time it isn't really feasible to have to calibrate gyro and accel every time you want to level the horizon (mag doesn't seem to matter here). The shortcut I've been using is if you hit calibrate on the horizon and let it sit for a few seconds, it will get to the end, just not complete. Then exiting out the calibration pane (not hitting cancel) and checking the Sens board offset has the new offsets in there. That seems to get the level horizon done as a hack. |
It should be better in master now (what will be v1.12), I relaxed the acceleration threshold slightly for ecl/EKF initialization not too long ago. |
OK Cool - Will the hack im currently doing be sufficient though for leveling in the mean time? |
I would say yes only if you're not having to redo it more than once per vehicle. What's happening is the lsm303d + l3gd20 combo is being given the same initial priority as the mpu6000, but since it has a much faster reset it ends up publishing data first and becomes the selected sensor. I would either lower the priority of the lsm303d + l3gd20 (CAL_ACCx_PRIO/CAL_GYROx_PRIO) or in startup add a delay between starting the mpu6000 and lsm303d + l3gd20 so that you get the mpu6000 first (which has much smaller offsets). All of this becomes irrelevant with Multi-EKF. |
I'll try lowering the priority right now. It happens to every vehicle on 1.11.2 after every reboot. Excited about multi-ekf, just want to get this useable in the mean time. |
Ah - 1.11.2 doesn't have sensor priority yet. Ok so how to delay them and by how much? |
@dagar This sounds though like the condition for sensor usage in EKF2 should be reset once the system goes out of calibration mode. |
It already works that way, it's just really unintuitive if you fall into that hole because there's nothing that directly connects the underlying problem and what to do about it.
To sidestep the issue I bumped the threshold a few weeks ago. https://github.com/PX4/PX4-ECL/blob/18f334f4dbca61e3bcd1743c22cf820b5a8ff7ef/EKF/ekf.cpp#L239-L240 The vast majority of sensors we support are nowhere need bad enough to have this problem. |
If ecl/ekf is refusing to initialize is this a problem for flight or only for sensor calibration? Meaning if the horizon doesn’t need to be leveled again as it was done previously are there concerns ekf still won’t initialize? |
It's only a problem at initialization/startup, and only for particularly bad sensors old sensors. |
Thanks. Was worried for a moment to fly with them. |
As @dagar pointed out here https://px4.slack.com/archives/C0V533X4N/p1609285210239700?thread_ts=1609283837.239400&cid=C0V533X4N adding a sleep 1 to the line fixes this but just remember that when you startup you need to wait ~3 seconds before leveling the horizon or you will get "attitude estimator not running - check system boot”. Attached is the binary compiled (and compressed to GitHub accepts the file type) so you can just flash it. No other changes made and built from 1.11.2 release |
Could this somehow be related to how I'm connected? When I try and level the horizon via USB it works fine but when wireless it does not. |
So if I set MAV_0_rate to 1200 it doesn't even finish (when connected wirelessly). When I set it to 0 (aka half of max), the vehicles beeps that it is complete but QGC hangs at the very end of the cal. |
Describe the bug
lsm303d & l3gd20 can not be calibrate leveled in single calibration process.
This issue should infect all FCUs have these 2 sensors onboard (>= v1.10).
This issue can only be visible/detected when FCU has only these 2 sensors on-board (or uses these 2 as primary motion sensors? or equivalent to disable other sensor's driver?)
This issue does not exist in earlier version of version (<=v1.9).
This issue is not observed with other type of IMU sensors so far.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The attitude gadget should be leveled.
Additional context
The issue can be corrected by a second 'level horizon' action.
The text was updated successfully, but these errors were encountered: