Overview
This is an attempt to finalize a well-documented procedure for calibrating the magnetometer, detailing needs and insights discovered from testing at the UA MIL. It exists as a GitHub Issue as we need to make sure that our sensors, pointing, and commanding code are compliant with our nominal procedure. Some of the information listed in this issue is speculative and based on our best guess of what the current BLAST flight code is attempting to do.
Current mcp behavior
We use a three-axis (say, Z towards the pivot, X "towards" boresight) magnetometer that measures fields from -2 to 2 G, mounted on the outer frame's static sunshield. During the flight, the two dominant sources the magnetometer is sensitive to are the gondola and the Earth.
Calibration on the ground, close to flight at LDB, seems to involve rotating the gondola through full rotations, and extracting the constant offset in X, Y, and Z components of the gondola (say B_x, B_y, B_z), as well as the "amplitude" of the Earth's magnetic field (say, A_x, ...). These are #DEFINE#s in magnetometer.h for Z or command-able fields for X & Y.
In pointing.c:MagConvert, the WMM is used to figure out the "declination" and the "dip" of the magnetic field given our known lat, long, and altitude. To get azimuth, we compare this declination to the angle of the XY vector formed by linearly scaled versions of the magnetometer readings. We subtract the offset B and then divide by the slope A.
Suggested changes and questions
- Subtracting the offset term B_* makes sense, getting rid of the gondola's magnetic field. The scaling term A_* does not. The best explanation could be the past magnetometer(s) used had different sensitivities along different axes. For us, the scaling does not help,
atan2 is similar precise over its domain, and A_x and A_y should be the same value, unless the pivot axis precesses by a lot. remove scaling by magx_m and like in pointing.c.
- Currently, the command-able fields for X and Y are not
A_*, B_* directly. Rather, we set the maximum and minimum of the curves we obtain on the ground when performing the calibration operation, and the code calculates A_*, B_*. This makes A_*, B_* related and toughens removing the scaling. make the gondola field offset the command-able term.
- Cannot see a reason to not have the Z axis offset also be command-able.
Acceptance
A coherent procedure that several of us agree is the right thing to do pre-flight, corresponding code changes code in magnetometer. and pointing., and changes to command-able fields to ensure the sufficient flexibility during operations.
Overview
This is an attempt to finalize a well-documented procedure for calibrating the magnetometer, detailing needs and insights discovered from testing at the UA MIL. It exists as a GitHub Issue as we need to make sure that our sensors, pointing, and commanding code are compliant with our nominal procedure. Some of the information listed in this issue is speculative and based on our best guess of what the current BLAST flight code is attempting to do.
Current
mcpbehaviorWe use a three-axis (say, Z towards the pivot, X "towards" boresight) magnetometer that measures fields from -2 to 2 G, mounted on the outer frame's static sunshield. During the flight, the two dominant sources the magnetometer is sensitive to are the gondola and the Earth.
Calibration on the ground, close to flight at LDB, seems to involve rotating the gondola through full rotations, and extracting the constant offset in X, Y, and Z components of the gondola (say B_x, B_y, B_z), as well as the "amplitude" of the Earth's magnetic field (say, A_x, ...). These are
#DEFINE#s inmagnetometer.hfor Z or command-able fields for X & Y.In
pointing.c:MagConvert, the WMM is used to figure out the "declination" and the "dip" of the magnetic field given our known lat, long, and altitude. To get azimuth, we compare this declination to the angle of the XY vector formed by linearly scaled versions of the magnetometer readings. We subtract the offset B and then divide by the slope A.Suggested changes and questions
atan2is similar precise over its domain, andA_xandA_yshould be the same value, unless the pivot axis precesses by a lot. remove scaling bymagx_mand like inpointing.c.A_*, B_*directly. Rather, we set the maximum and minimum of the curves we obtain on the ground when performing the calibration operation, and the code calculatesA_*, B_*. This makesA_*, B_*related and toughens removing the scaling. make the gondola field offset the command-able term.Acceptance
A coherent procedure that several of us agree is the right thing to do pre-flight, corresponding code changes code in
magnetometer.andpointing., and changes to command-able fields to ensure the sufficient flexibility during operations.