-
-
Notifications
You must be signed in to change notification settings - Fork 917
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
Mag cal values #3603
Mag cal values #3603
Conversation
This comment has been minimized.
This comment has been minimized.
AUTOMERGE: (FAIL)
|
samples_mag_i = addSampleToData(mag_data, samples_mag_i, FC.SENSOR_DATA.magnetometer); | ||
drawGraph(magHelpers, mag_data, samples_mag_i); | ||
|
||
// raw_data_text_ements.x[2].text(FC.SENSOR_DATA.magnetometer[0].toFixed(2)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still need these comments here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, not really, they can go away. Just kept them to remember the original code.
I'll remove them when the consensus is to merge or not merge.
What we really need is a dedicated 'Mag' tab, similar in concept to the dedicated 'GPS' tab, where we can perform calibrations, check raw values, etc.
@chmelevskij @nerdCopter @haslinghuis How could I display the 'root sum of squares' values? I would be grateful for a code suggestion. I would be happy to display it, and indeed the min, max and cal values, in a separate html element underneath the mag trace, rather than messing around with the raw sensor values, something like this:
My problem is that I'm not a js coder. I know how to insert a div element into the html under the waveform, but I don't know how to 'load' such an element with values like the above. The values already exist in the .js code, I just don't know how to add them to the UI. I would be very grateful if someone could explain how to do this, with clear instructions. |
SonarCloud Quality Gate failed. 0 Bugs No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
Do you want to test this code? Here you have an automated build: |
@ctzsnooze where about do you want to show those? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within a week. |
Pull request closed automatically as inactive. |
Closing since the basics have been done in a different PR. |
For testing only!
This PR makes two changes to the Sensors Tab display of Mag data.
Uses 'raw' Mag units in the display of Mag sensor data, using PR 3593
For each axis, shows, to the right of the instantaneous Mag sensor value, the average of the min and max values received on that axis since the Sensors Tab was opened. This value is preceded by 'C' for 'Cal`.
If the user goes
set mag_calibration = 0,0,0
and clears their existing cal values, they can move the quad around so that, sequentially, one Mag axis, and then its opposite end, is pointed North into the local magnetic field vector. When a max and min have been defined, the value after C is the cal value to use for the axis.Also a previous calibration can be checked. A good calibration will return within 1% of zero on each axis. This can be used to validate the 'hard iron' or 'zero point' calibration that Betaflight uses.
I also calculate the root (sum of squares of x,y,x) value, into
magSumSqR
which can be thought of as the 'radius' of the 'sphere' of mag readings. The value should equal the local value of the earths field, after correction for the internal gain of the sensor. Furthermore, if there are no soft iron effects, the value should remain constant regardless of the angle of the quad. If the 'sphere' appears deformed, the 'radius' will not be consistent, and the value will decrease, or increase, consistently, at certain angles. BUT... I can't figure out how to display thismagSumSqR
value; if anyone could help me with that, I'd be grateful.I made a small video temporarily here...
MagUnscaledCal.mov