-
Notifications
You must be signed in to change notification settings - Fork 24
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
bias applied incorrectly in magCalSlider and magCalVisualizer #15
Comments
If I understand correctly, the mag calibration routine must also return:
As the current implementation in
|
The current calibration routine calculates the bias and scale as follows:
so this bias is already scaled for the sensor range and corrected with the factory stored calibration values. It can be directly used in the program
However, it cannot be used in the current for of magCalSlider or magCalVisualizer since in those programs it is used as
So a scaled and calibrated bias is subtracted from a raw (unscaled and uncalibrated) measurement. In making this calculation and displaying the result, you will see that the circles/blobs are never centered around (0,0,0) and always require further manual adjustment because the bias is just too large. In the visulation program you can
|
Sorry I have been very busy; if you still require this fix I recommend you make a PR. |
In the main program magnetometer calibration routine the RAW magnetometer values are captured and the bias and scale factors are calculated.
The instructions say that the RAW values should be stored in data.txt and the bias and scale factor should then be defined in the two visualization programs. These will then display raw and corrected graphs.
In the main program : bias = RAWbias * scaleFactor * factorycalibration and scale=avgrange/axis-range
(where RAWbias=(maxRAW+minRAW)/2)
In the visualization programs however you are applying the bias to the RAW magnetometer values (retrieved from data.txt)
So you are subtracting a bias that is alread corrected with scalefactor and factorycalibration values from a RAW magnetometer value.
I think you should either subtract a raw bias from raw values or corrected bias from corrected values.
Also note that the scalefactor is calculated from RAW values but applied on corrected values. Since these are close to 1 anyway the impact is small.
That is why currently the magCalSlider each time requires further manual adjustment.
(notes :
The text was updated successfully, but these errors were encountered: