-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Support magnetometer compensation based on throttle / current #12254
Comments
@AdyashaDash did quite some work on this type of mapping during her Masters Thesis at ETH, maybe you could chat with her on how to implement? ;) |
Now that I think of it, won't this need to handled per mag, or at least a known set? Thinking of internal vs external. |
@dagar You could do that. The most important thing is definitely to make sure that you only apply the correction to the mag for which the calibration is meant. |
@tstastny Thanks for the info! |
@tstastny thanks for drawing my attention! I wanted to take a look at the latest master before summarizing my thoughts. Some comments from my side @RomanBapst:
Let me know if this helps already, @RomanBapst, otherwise happy to have a quick chat over coffee to flesh out the details. Would be glad to help out with reviewing too in case you go ahead with the implementation! |
@AdyashaDash Thanks for you input!
Yes, my plan was to implement this as a first step.
Yeah, I can confirm this observation. However, if the mean of the signal still reflects a somewhat accurate signal then you could maybe still get away with it, at least for the sake of navigation. It would maybe require the noise param of the ekf to be adjusted. And probably you would not be able to use this heading for e.g. accurate gimbal pointing but maybe for navigation it would be ok.
For now I was not planning to calculate the coefficients online. The only easy way I can image at the moment how this could be done is strap the drone down and perform a calibration process where you increase throttle from 0 to 100% and capture the data. Then you could perform a linear fit and directly apply the params. I will not work on this for now.
That would be awesome! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@Stale get lost |
How's this going? |
I’m pretty interested in this too. Would this be similar in practice to what compassmot does on Ardupilot? |
@ryanjAA I can give it a rebase if you can test it.
I'm not familiar with what they do but I suppose it's something similar. You could go one level fancier and make the model depend on the current of each ESC (or use the pwm output going to the ESC). |
@RomanBapst We plan to use this kind of compensation for our small 23cm frame which suffers of magnetic disturbances. |
@dMarragonis Glad to hear you are interested in this. |
@dMarragonis It would be great if you could share a log file which contains data that can be used to proof the effectiveness of this approach. You should strap the vehicle down somewhere, arm, and apply combinations of thrust, roll, pitch and yaw. Since we know the initial magnetic field vector before there is any current flowing we can easily verify how well the per motor current model performs. |
Yes sure, i think i can do that on the next week, i travelling this week. |
I did not think to use the total current of the escs but the independent current of each escs |
@dMarragonis Sorry, I meant individual current. |
Ok 👍 |
done (#12329 (comment)) |
Sometimes design constraints prevent magnetometers to be placed further away on the vehicle and there is a clear correlation between vehicle throttle demand or measured vehicle current and mag hard iron effects.
I would like to implement a simple compensation (hard iron effect).
The main question is where to implement this and for which magnetometers:
Idea:
The text was updated successfully, but these errors were encountered: