14 C
Canberra
Saturday, January 17, 2026

How you can Setup and Calibrate Magnetometer (Compass) in Betaflight FPV Drone


A magnetometer (also called a compass) might be very helpful for GPS Rescue and Place Maintain in Betaflight, because it improves accuracy and total efficiency. Nevertheless, it can be fairly complicated to arrange and calibrate appropriately. If a magnetometer is misconfigured or poorly calibrated, it will possibly really make issues worse—inflicting drifting, incorrect heading, and even flyaways.

A few of the hyperlinks on this web page are affiliate hyperlinks. I obtain a fee (at no further value to you) in the event you make a purchase order after clicking on one among these affiliate hyperlinks. This helps help the free content material for the group on this web site. Please learn our Affiliate Hyperlink Coverage for extra info.

On this information, I’ll stroll you thru magnetometer orientation, declination, calibration, and verification step-by-step to make the method simpler to know.

Disclaimer: This information displays how I personally arrange and calibrate a magnetometer. I’m not answerable for any harm ensuing from following these directions. Please seek advice from Betaflight’s official documentation for particulars: https://www.betaflight.com/docs/wiki/guides/present/magnetometer

Try my tutorials on:

What Is a Magnetometer (and Why It Issues)

The magnetometer tells the flight controller which path the quad is going through. This info helps the drone to:

  • Keep heading in Place Maintain mode
  • Enhance GPS Rescue mode accuracy
  • Cut back yaw drift throughout GPS-assisted flight modes

Some GPS modules have a built-in magnetometer.

Gps Module Magnetometer Compass 5883 Chip

GPS Suggestions

See my GPS testing right here: https://oscarliang.com/gps-review/

Prime Performer: GEPRC M1025Q (With Compass)

Prime Performer: HGLRC M100 5883 (With Compass)

Smallest Value Having: GOKU GM10 Nano V3 (With Compass)

How you can Join Magnetometer to Flight Controller

In case your GPS module features a compass, it ought to have two extra pads: SCL and SDA. These are for the I2C bus utilized by the magnetometer.

Wiring is straightforward:

  • SDA (GPS) → SDA (FC)
  • SCL (GPS) → SCL (FC)

The place to Mount Magnetometer

You need to maintain the compass as far-off as doable from sources of electromagnetic interference, together with:

  • ESC
  • Motors
  • Motor wires
  • Energy cables (e.g. XT60)
  • Motion cameras

Good places for mounting a GPS module embrace:

  • Above the FPV digital camera
  • On the rear of the drone (so long as it’s not too near the VTX antennas)
  • On the battery strap

For small quadcopters (e.g. beneath 5-inch), it’s more durable to get clear compass readings just because all the pieces is packed so carefully collectively.

Betaflight Setup

In Betaflight Configurator:

  • Go to Configuration → System Configuration
  • Allow Magnetometer
  • Save and reboot

Betaflight Configurator Configuration Accelerometer Barometer Magnetometer

After rebooting, the magnetometer icon (Magazine) on the prime of the configurator ought to gentle up. If it doesn’t, test energy and wiring.

Betaflight Configurator Top Bar Gyro Accel Mag Baro Gps Icons

Determine Magnetometer Chip

Open the CLI and kind:

standing

This confirms whether or not the magnetometer is detected and in addition helps establish the chip. Widespread magnetometer chips utilized in GPS modules embrace HMC5883 and QMC5883.

Betaflight Configurator Cli Status Magnetometer Icon

Understanding Magnetometer Orientation

Identical to a gyro, a magnetometer has three axes: X, Y, and Z. Nevertheless, these axes are outlined by the orientation of the magnetometer chip itself, not the way it’s mounted within the drone.

In your GPS module, search for a small dot on the magnetometer chip—this marks pin 1.

Gps Module Magnetometer Compass 5883 Chip

Google the chip’s datasheet on-line. It ought to embrace a diagram exhibiting how the X, Y, and Z axes are oriented relative to the chip and the small dot. For the QMC5883 magnetometer I’m utilizing:

  • X-axis factors down
  • Y-axis factors proper
  • Z-axis factors up

Qmc5883 Orientation X Y Z Alignment Arrow Direction

Betaflight expects the magnetometer to be oriented like this:

  • X-axis → pointing ahead
  • Y-axis → pointing left
  • Z-axis → pointing up

Relying on the way you mount your GPS module, it’s possible you’ll want to regulate the magnetometer alignment in Betaflight settings.

Magnetometer Axes Orientation Betaflight Drone

Why Alignment Is Typically Wanted

Should you mount the magnetometer completely parallel to the flight controller, setup could be easy. Nevertheless, on most GPS modules the magnetometer is positioned on the alternative aspect of the GPS antenna. And because the GPS antenna should face the sky, the magnetometer often finally ends up being the other way up, which suggests alignment modifications are often inevitable.

If that is your first time utilizing a compass, maintain issues easy:

  • Mount the GPS flat and degree relative to the body and FC
  • Keep away from angled or tilted mounts
  • Get it working first earlier than making an attempt customized alignment

In my setup, I stored issues easy by mounting the GPS on the entrance of the quad, degree with the body and FC (utilizing double-sided tape and zip tie).

Install Gps Magnetometer Compass Geprc M1025q Vapor Position Hold

As a result of the compass is solely flipped over on the pitch axis, I chosen “CW 0° Flip” beneath Magnetometer Alignment in Betaflight.

Betaflight Configurator Configuration Magnetometer Alignment Declination

Right here’s a helpful cheat sheet you need to use for widespread compass alignments.

Betaflight Magnetometer Compass Orientation Alignment Relation To Drone

Customized Alignment (Superior)

If you’re utilizing a GPS mount with a tilt angle, then Customized Alignment is required. This may be complicated for newcomers, which is why I strongly advocate mounting the GPS flat if doable so that you don’t should cope with this 🙂

Geprc Vapor Move Gps Front

That mentioned, the Alignment Device in iNav Configurator is extraordinarily useful—even in the event you don’t use iNav.

How you can use it:

  • Open iNav Configurator
  • Enter Demo Mode (so you may join with out a FC)
  • Go to Alignment Device
  • Choose X, Y, Z (extra dependable than selecting magnetometer)
  • Alter the X, Y, Z sliders till they match your magnetometer’s bodily orientation
  • Be aware of the ultimate Roll (X), Pitch (Y), and Yaw (Z) values

Inav Configurator Alignment Tool Magnetometer Compass Xyz Axes Slider

Now return to Betaflight:

  • Within the Configuration tab, choose Customized beneath Magnetometer Alignment
  • Enter the Roll, Pitch, and Yaw values

Betaflight Configurator Configuration Magnetometer Alignment Custom

Alternatively, you are able to do this by way of the CLI:

set align_mag = customized
set mag_align_roll = X
set mag_align_pitch = Y
set mag_align_yaw = Z
save

Set Magnetic Declination

Magnetic north is just not the identical as true north, and Betaflight wants your native magnetic declination worth to right this distinction.

Declination varies by location. Yow will discover it utilizing a trusted web site reminiscent of: https://www.magnetic-declination.com/

Instance:

  • For Los Angeles, USA, the magnetic declination is +11° 24′.
  • Convert this to decimal (Google can do that for you): 11.4°

Magnetic Declination Location Usa Los Angeles

Enter this worth within the Configuration tab

Betaflight Configurator Configuration Magnetometer Alignment Declination

Or enter it in CLI:

set mag_declination = 11.4
save

Calibrate Magnetometer

Ideally, you need to carry out compass calibration on the location the place you propose to fly. Keep nicely away from something that would trigger magnetic interference, reminiscent of:

  • Metallic objects
  • Vehicles
  • Energy traces
  • Strengthened concrete

You possibly can provoke calibration both by clicking the Calibrate Magnetometer button in Betaflight Configurator (setup tab), or by utilizing stick instructions. I personally choose stick instructions, because it permits me to unplug the USB cable and rotate the quad freely.

How you can Calibrate Magnetometer

  1. Take away propellers and energy up the quad
  2. Provoke calibration utilizing the stick command:
    1. Pitch down + yaw up-right → you need to hear 2 beeps
  3. Spin the quad rapidly to start out calibration
    1. You’ll hear 7 quick beeps indicating calibration has begun
  4. You now have 30 seconds to finish calibration
  5. The quad will make 3 beeps when calibration is full

In case your quad doesn’t have a beeper, you may have a look at the FC LED as an alternative:

  • Stable LED = calibration in progress
  • Regular blinking = calibration accomplished

Betaflight Stick Commands 2024 11 30

How you can Transfer the Quad Throughout Calibration

In the course of the 30-second calibration window:

  • Maintain the quad by the battery
  • Swing your arm in a figure-8 sample
  • On the similar time, yaw the quad left and proper randomly
  • Slowly flip your whole physique by taking small steps. By the top of the calibration, you need to have accomplished roughly a full 360° rotation.

Calibrate Magnetometer Compass Figure 8 Betaflight

Compass calibration often solely must be carried out as soon as inside your native space. Nevertheless, in the event you journey far-off from dwelling, it’s a good suggestion to recalibrate.

Validate Heading

After calibration, confirm the heading fastidiously:

  • Use the Betaflight Configurator dwelling display screen or
  • Allow the Compass Bar within the OSD

Examine the heading towards a smartphone compass app. Ensure that the app is ready to true heading, not magnetic heading.

Check by going through totally different instructions:

  • Face north → ought to learn north
  • Rotate east, south, and west → confirm accuracy

Validate Betaflight Magnetometer Compass Heading Smartphone True North

If the Heading Is Incorrect

If the heading is clearly fallacious:

  1. Recheck compass orientation
    1. Strive totally different Magazine Alignment choices in Configurator (CW0 / CW90 / CW180 / CW270)
  2. Redo calibration in a clear setting
  3. Re-test after each change

In some circumstances, the compass itself could also be defective. I examined 3 totally different GPS modules and located that one had a defective compass—so this isn’t unusual.

Remaining Ideas

You possibly can fly Betaflight with out a magnetometer—however if you’d like dependable Place Maintain and correct GPS Rescue, a correctly configured and calibrated magnetometer could make a distinction. As soon as it’s arrange appropriately, you hardly ever want to the touch it once more except you alter {hardware} or GPS placement. And don’t overlook to recalibrate in the event you fly far-off out of your common location.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles