INAV compass alignment, declination and calibration
FlySpark's Magnetometer tab is the INAV screen for flight-controller alignment, compass alignment and magnetic declination. The alignment preview places the current aircraft model, the board and a compass module in one square view. Turn the flight controller so it matches how it sits on the aircraft, following the arrow printed on the board. Then pick the compass model, chip or axes and turn that to match. The orientation preset, align_mag, is relative to the board, so align the board first. Custom angles, align_mag_roll, align_mag_pitch and align_mag_yaw, are independent of that preset. Drag to orbit the preview and pinch to zoom. Open the tab from the INAV configurator once the board is connected.
The compass calibration sheet is the guided sweep beside that preview. It starts calibration on the flight controller, shows which directions the raw compass has seen, waits for the controller to finish, and reads the offsets back. On INAV the expected length is mag_calibration_time when that setting comes back as a number greater than 0. The sheet uses the whole seconds of that number. If the read fails, the expected length is 30 seconds. The sweep will not start while the craft is armed, and the sheet is not dismissible by tapping outside it.
In Chrome or Edge, connect over USB or Bluetooth. Wi-Fi is the Android or iPhone app only. An iPhone has no USB host. This page is INAV compass and magnetometer calibration. Return to home, speeds and holds are a different INAV screen, on INAV navigation. A map mission is the mission planner. The preview's aircraft is the current model; the airframe layout itself is the INAV mixer.
Free. Hardware connections need Chrome or Edge on a computer; phones use the FlySpark app.
- Free
- Nothing to install
- Demo without hardware
In short
FlySpark's INAV Magnetometer tab aligns the board and compass on a 3D preview and sets magnetic declination. The compass sheet times the sweep from mag_calibration_time, maps directions the raw compass has seen, and reads the offsets back. Chrome or Edge connects over USB or Bluetooth.
Key facts
- The Magnetometer tab is the INAV screen for board alignment, compass alignment and magnetic declination.
- Presets are Default, CW 0°, 90°, 180° and 270°, plus the same four with flip. align_mag is relative to the board.
- Alignment sliders run from −180° to 360° with 540 divisions. Stored board and compass angles are degrees times 10.
- Manual declination is −180° to 180°, step 0.1°. East is positive. −637 is stored for −6° 37′.
- On INAV the sweep length is mag_calibration_time when that value is greater than 0. A failed read uses 30 seconds.
- Start stays off while the craft is armed. The sheet cannot be dismissed by tapping outside it.
- The coverage bar is ok at 70% or more and warn at 40% or more. Fraction 0.9 or more is nearly done.
- The preview caption uses north 0°, east 90°, south 180° and west 270°. Heading is a whole number of degrees.
Betaflight
INAV
ArduPilot
PX4- BLHeli_S
Bluejay
AM32
ExpressLRS
EdgeTX
DroneCAN
MAVLink
Try it
Swing the compass
Heading plus magnetic declination is the number in the dial.
FlySpark
Features
- 01
Square alignment preview
The alignment preview is a square. It draws the aircraft, an INAV flight-controller model and the compass you picked. The corner lists heading, pitch and roll from saved attitude when attitude is available. Heading is rounded to a whole number of degrees. Pitch and roll use one decimal place. With no attitude, each of those three lines is a dash. The caption says the values follow the saved settings, and that north is 0, east is 90, south is 180 and west is 270. The camera starts at −95, 82, 50. Drag orbits the view and pinch zooms it.
- 02
Board roll, pitch and yaw
Flight controller alignment has a slider for roll, pitch and yaw. The settings are align_board_roll, align_board_pitch and align_board_yaw. The slider shows degrees. The number written to the board is that degree figure times 10, rounded. Each slider runs from −180° to 360° with 540 divisions, and the thumb snaps to a whole degree. A slider is marked when that one setting has changed in the draft. Under the row the tab prints a CLI line with the three tenth-degree integers.
- 03
Nine orientation presets
Magnetometer alignment offers an orientation preset, align_mag, relative to the flight controller. The choices are Default, CW 0°, CW 90°, CW 180°, CW 270°, CW 0° flip, CW 90° flip, CW 180° flip and CW 270° flip. The CLI names, in the same order, are DEFAULT, CW0, CW90, CW180, CW270, CW0FLIP, CW90FLIP, CW180FLIP and CW270FLIP. Picking a preset writes align_mag and sets align_mag_roll, align_mag_pitch and align_mag_yaw to 0. The card then says you are using the orientation preset, and that moving a slider switches to custom angles.
- 04
Custom angles, including 0.1° yaw
Custom roll, pitch and yaw are used when the stored align_mag_roll, align_mag_pitch and align_mag_yaw are not all zero. Those sliders use the same −180° to 360° span, and the stored value is degrees times 10. Setting all three to zero would look like the preset, so the tab stores yaw as 0.1° (one extra tenth) in that case. While custom angles are active, the preset row is labelled not used, and all three compass sliders are marked. The footer says to pick a preset to go back. The CLI line then prints the preset index's name plus the three custom tenth-degree fields. While a preset is active, those three CLI fields are 0.
- 05
Compass chip or module on the model
Element to show is a local choice, not a saved setting. It starts on Magnetometer axes. The list is compass and GPS modules INAV can show, plus chips and the axes. Axes are drawn at scale 0.45. Every other compass model, and the board, uses scale 0.6. The aircraft uses scale 15. Names on the picker include AK8963C, AK8963N, AK8975, AK8975C, IST8308, IST8310, LIS3MDL, MAG3110, MLX90393, QMC5833, HMC5833, GY-271, GY-273, MP9250, BN-880, MATEK M8Q-5833, MATEK M9N-5833, MATEK M10Q-5833, HOLYBRO Micro M9N IST8310, HOLYBRO Micro M10 IST8310, FOXEER-M10Q-120, FOXEER-M10Q-180, FOXEER-M10Q-250, DIATONE Mamba M10 PRO, FLYWOO GOKU M10 PRO V3, GEPRC GEP-M10-DQ, HGLRC-M100-5883 and WS-M181. HMC5833 and QMC5833 share one preview model. The two Holybro Micro rows share one preview model. Changing the element only changes the drawing.
- 06
Declination from GPS or by hand
The magnetic declination card is drawn when the board has mag_declination. The footer says declination is the angle between true north and compass north where you fly. Automatic from GPS is the switch inav_auto_mag_decl. With automatic on, INAV works the angle out from the GPS position. The manual value is used until GPS gets a fix. Manual declination runs from −180° to 180°, step 0.1°, shown to two decimal places. East is positive and west is negative. The stored integer packs degrees and minutes as dddmm, and the hint shows that packing next to the degree figure.
- 07
A sweep that will not start armed
The calibration sheet is a scrollable modal with a drag handle. Tapping outside it does not close it. Start is disabled while the sweep is running or while the craft is armed. The armed label tells you to disarm first. On INAV the sheet reads mag_calibration_time and, when the number is greater than 0, uses that many whole seconds. If that request fails, the length is 30 seconds. When the connected firmware is not INAV, the sheet does not read mag_calibration_time and keeps the 30 second default. The timing note in the sheet says Betaflight calibrates for a fixed 30 seconds, while INAV uses mag_calibration_time. That split is the sweep timer. It does not put this Magnetometer tab on a Betaflight board. Betaflight board setup stays on the Betaflight configurator and Betaflight setup.
- 08
Bottom and top coverage maps
Two maps sit side by side while the sweep runs. The left map is the bottom side and the right map is the top side. Each map is one half of the coverage sphere, seen from its pole: the centre is straight up or straight down, and the rim is the horizon. Filled cells are directions the raw compass has seen. The bar shows the covered fraction, and the label is that fraction times 100, rounded. The bar uses the ok colour at 70 percent or more, the warn colour at 40 percent or more, and the error colour below that. Under 10 samples the instruction is to rotate slowly. At a covered fraction of 0.9 or more, the sheet says the sweep is nearly done.
Match the board before the compass
The preview footer is a two-step order. First, turn the flight controller to match how it sits on the aircraft, following the arrow printed on the board. Second, pick the compass model, chip or axes and turn it to match. The orientation preset is relative to the board, so a compass preset chosen before the board is aligned is aimed at the wrong reference. Custom angles are the exception the footer names: align_mag_roll, align_mag_pitch and align_mag_yaw do not follow the preset, and they do not have to be left at zero for the board sliders to mean something. Orbit with a drag and zoom with a pinch while you compare the model with the hardware.
Presets, custom angles and the 0.1° yaw
The magnetometer alignment card is shown only when the board has align_mag_roll. Its preset control writes four settings at once: align_mag becomes the chosen index, and align_mag_roll, align_mag_pitch and align_mag_yaw become 0. Index 0 is Default. Indexes 1 to 8 are the eight named turns: CW 0°, CW 90°, CW 180°, CW 270°, then those four with flip. The CLI token is clamped to indexes 0 through 8, so the line can only name DEFAULT, CW0, CW90, CW180, CW270, CW0FLIP, CW90FLIP, CW180FLIP or CW270FLIP. While the three custom fields stay 0, the footer says the orientation preset is in use.
Which module the preview draws, and where it sits
Element to show does not write a chip id. It chooses the mesh. Index 0 is Magnetometer axes, drawn at scale 0.45. The other entries use scale 0.6, the same scale as the flight-controller mesh. The aircraft mesh uses scale 15. The picker includes AK8963C, AK8963N, AK8975 and AK8975C, IST8308, IST8310, LIS3MDL, MAG3110, MLX90393, MP9250, GY-271, GY-273, QMC5833 and HMC5833. QMC5833 and HMC5833 share the qmc5883 mesh. It also includes BN-880, WS-M181, HGLRC-M100-5883, DIATONE Mamba M10 PRO, FLYWOO GOKU M10 PRO V3, GEPRC GEP-M10-DQ, FOXEER-M10Q-120, FOXEER-M10Q-180, FOXEER-M10Q-250, MATEK M8Q-5833, MATEK M9N-5833 and MATEK M10Q-5833, plus HOLYBRO Micro M9N IST8310 and HOLYBRO Micro M10 IST8310. Those two Holybro names share one mesh. The choice is remembered only for this view. Leave the tab and it starts again on the axes.
Magnetic declination, packed as degrees and minutes
The declination card is omitted when the board has no mag_declination setting. When it is present, the footer defines the angle as true north versus compass north where you fly. Automatic from GPS turns on inav_auto_mag_decl. With that switch on, INAV works the angle out from the GPS position, and the manual value is used until GPS gets a fix. A fix is a position, not a compass sweep. The sweep on this page does not replace that wait. Navigation behaviour that uses the GPS position for return to home is the other INAV screen, INAV navigation. Betaflight GPS settings are a different firmware page, betaflight GPS.
How the calibration sheet times the sweep
The sheet opens as a modal that is not dismissible, with scrolling enabled and a drag handle. Its phases are ready, calibrating, reading and done. In the ready phase the intro text includes the expected number of seconds. Start is a filled button. It is disabled when a sweep is already running or when the craft is armed. Armed, the label tells you to disarm first. Cancel closes the sheet, except during the reading phase, when Cancel is disabled. During calibrating, a short note is shown under the buttons. The note's wording comes from the app strings. The sheet does not print a second timer of its own in that note.
FlySpark
How to align and calibrate an INAV compass
Connect in Chrome, Edge, or the app
Choose INAV in FlySpark and open the Magnetometer tab from the INAV configurator. In Chrome or Edge, connect over USB or Bluetooth. Wi-Fi is the Android or iPhone app only. An iPhone has no USB host, so the iPhone app does not see the board over USB.
Align the flight controller first
On Flight controller alignment, set roll, pitch and yaw so the board model matches the arrow on the hardware. The sliders run from −180° to 360°. The board stores each axis as degrees times 10. The preview footer says to do this before the compass, because align_mag is relative to the board.
Pick a preset or set custom angles
On Magnetometer alignment, choose Default or one of the CW 0°, 90°, 180° or 270° presets, with or without flip. That writes align_mag and clears the three custom fields. Or move roll, pitch or yaw to store custom tenth-degree angles. All three at zero is stored as yaw 0.1° so the board does not fall back to the preset. Pick the element only to change the drawing.
Set magnetic declination
If the board has mag_declination, turn on Automatic from GPS to let INAV use the GPS position, and remember the manual value applies until GPS gets a fix. Or enter a manual angle from −180° to 180° in steps of 0.1°. East is positive and west is negative. −6° 37′ is stored as −637.
Disarm, then start the sweep
Open the compass calibration sheet and disarm if the button says to disarm first. Start is refused while the craft is armed. On INAV the length is mag_calibration_time when that value is greater than 0, otherwise 30 seconds. Rotate the craft so both maps fill. Under 10 samples, keep rotating slowly. At a covered fraction of 0.9 the sheet calls the sweep nearly done.
Read the zero offsets
Wait until the phase reaches done. The sheet shows zero X, Y and Z, and gain X, Y and Z when the board returned a gain. The bar colour is only a coverage cue: ok at 70 percent or more, warn at 40 percent or more. The excellent, good, fair or poor badge is separate from those two cutoffs. Close the sheet when you have read the figures. Run it again from the same button if you need another pass.
FAQ
Frequently asked questions
Is this INAV compass page a return-to-home setup?
It is magnetometer alignment and compass calibration. Return to home, speeds and holds are on INAV navigation. Automatic declination does use the GPS position once there is a fix, and the manual angle is used until then. That wait is not a mission and not a return path. Missions are drawn in the mission planner.
How do I connect for the INAV compass tab?
Chrome or Edge connects over USB or Bluetooth. Wi-Fi is the Android or iPhone app only. An iPhone has no USB host. The rest of the INAV tabs are in the INAV configurator. A browser page does not join the craft's Wi-Fi.
What does align_mag mean?
align_mag is the orientation preset, and the hint says it is relative to the flight controller. The names are Default, CW 0°, CW 90°, CW 180°, CW 270°, CW 0° flip, CW 90° flip, CW 180° flip and CW 270° flip. Choosing one clears align_mag_roll, align_mag_pitch and align_mag_yaw to 0. Align the board first, as the preview footer says.
Why would yaw be stored as 0.1°?
Custom angles of roll 0, pitch 0 and yaw 0 would mean use the preset. When you set all three sliders to zero, the tab adds one tenth of a degree to yaw, so the stored yaw is 0.1°. Any other custom triple is stored as degrees times 10 with no extra tenth. Pick a preset when you want the three custom fields back at 0.
How long does INAV compass calibration run?
On INAV the sheet reads mag_calibration_time. If that number is greater than 0, the expected length is that many whole seconds. If the read fails, the length is 30 seconds. The busy flag can end the sweep earlier, after a 1500 millisecond grace, once the flag has been seen and then clears. If the flag never clears, the sheet stops at the expected length plus 15 seconds.
Why is the start button disabled?
Start is disabled while the sweep is running, which covers the calibrating and reading phases, and while the craft is armed. Armed, the label tells you to disarm first. Cancel stays available during calibrating, and a note is shown under the buttons. Cancel is disabled only while the offsets are being read. After done, the left button says Close.
What do the coverage colours mean?
The label is the covered fraction times 100, rounded. That rounded percent colours the bar: 70 or more uses the ok colour, 40 or more uses the warn colour, and below 40 uses the error colour. Separately, fewer than 10 samples asks for a slow rotation, and a fraction of 0.9 or more says the sweep is nearly done. Those tests are not the excellent, good, fair or poor badge.
How is magnetic declination stored?
The field shows degrees from −180 to 180, step 0.1, two decimals. East is positive and west is negative. The integer packs degrees and minutes as dddmm. −637 is −6° 37′. With Automatic from GPS on, INAV works the angle out from the GPS position, and this manual integer is used until GPS gets a fix.
Does the preview write the compass chip?
Element to show only changes the mesh. It starts on Magnetometer axes, drawn slightly smaller than the other modules. HMC5833 and QMC5833 share a mesh, and the two Holybro Micro IST8310 rows share a mesh. The saved compass orientation is the preset and the custom angles, not the element index.
What appears when the sweep finishes?
The done view prints zero offsets for X, Y and Z. Gain for X, Y and Z is printed only when a gain was returned, plus a line that names the source. If no offsets come back, INAV shows one explanation and the other firmware path shows another. A quality badge can read excellent, good, fair or poor, with a hint under it. You can run the sweep again without leaving the sheet.
Do Default and CW 270° flip look the same on a level board?
In the preview's preset math, both indexes use pitch 180°, roll 0° and yaw 270° when the board roll, pitch and yaw are all 0. The CLI line still says DEFAULT for index 0 and CW270FLIP for index 8, and the custom fields are 0 either way. On a board that is not level, both indexes start from that same angle triple and are then combined with the board rotation.
Where do I set a Betaflight board?
This Magnetometer tab is the INAV alignment screen. The calibration sheet's timing comment says Betaflight uses a fixed 30 seconds, and the sheet keeps that 30 second default whenever it is not reading INAV's mag_calibration_time. Betaflight GPS settings are on the GPS page. The rest of a Betaflight board is the Betaflight configurator and Betaflight setup.
References
Sources
The official documentation behind the background facts on this page.
- INAV WikiINAV on GitHub · github.com
- INAV NavigationINAV on GitHub · github.com
- Betaflight WikiBetaflight · betaflight.com


