-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
calibrate function interpretes gravity as error #58
Comments
Thanks for this explanation, appreciated |
(sorry for late reaction, too busy with other things). You're right the Z should read 1 in case of a flat sensor. I like the idea of the parameter to indicate the orientation. calibrate(x_angle = 0, y_angle = 0); From these two angles the Z angle and the gravity vector are calculatable. Think that is a step too much for now, first step is to get it right for a flat lying sensor. |
Looked at the PR and it made 100% sense, so I merged it into the develop branch. Are you OK to be mentioned as I want to give credits where they should be? |
I'll try changing the |
A first version with AZE -= 1 and reset of the gyro integration is preferred. That would give a minimal correct release as reference. |
@mycosd |
@mycosd |
I've been using it in my project, in just X=0, Y=0 orientation. It does the job. Only tested few other orientations when implementing it. It gets rid of the major drift, however there is still a smaller drift which appears to come from the internal gyro integration ( |
Thanks for the update, |
The smaller drift is probably related to #47 Will merge the new calibrate into develop, and get it into master asap. |
|
@mycosd
|
Merged the improved calibrate() into master, will release 0.6.1 later today. In the mean time, I got about 15 new issues (other repos as well) so I need to attend some of them too. So it will take some time to investigate the drift of the sensor (gyroscope integration) which is possibly related to #47. |
Hi again,
In
calibrate
the accelerometer values read are automatically set as error (axe
,aye
,aze
). However if you have the MPU flat on a table then it should read az=1. So nowaze
will be set to 1 even if there is absolutely no error in the MPU.If you are only interested in relative accelerometer readings, this might be exactly what you would want. But for roll/pitch/yaw calculation which is also based on those measurements you get a lot of noise/drift, and the accelerometer angles become completely unusable.
To reproduce:
Now for comparison:
The easiest way I can think of handling this is: The calibrate function itself would need an argument that says, eg.
ORIENTATION_X_IS_DOWN
,ORIENTATION_Y_IS_DOWN
,ORIENTATION_Z_IS_DOWN
(this should be default) and then you would subtract 1 from the error which matches with the given orientation.However, this would limit the calibrate function, to be only allowed to be called when the MPU is perfectly aligned on an axis.
Maik
The text was updated successfully, but these errors were encountered: