0.6 C
New York
Wednesday, February 4, 2026

The best way to Setup and Calibrate Magnetometer (Compass) in Betaflight FPV Drone


A magnetometer (often known as a compass) may be very helpful for GPS Rescue and Place Maintain in Betaflight, because it improves accuracy and total efficiency. Nonetheless, it can be fairly complicated to arrange and calibrate accurately. If a magnetometer is misconfigured or poorly calibrated, it may truly 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 price to you) for those who make a purchase order after clicking on considered one of these affiliate hyperlinks. This helps help the free content material for the neighborhood on this web site. Please learn our Affiliate Hyperlink Coverage for extra data.

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 accountable for any harm ensuing from following these directions. Please check with Betaflight’s official documentation for particulars: https://www.betaflight.com/docs/wiki/guides/present/magnetometer

Take a look at my tutorials on:

What Is a Magnetometer (and Why It Issues)

The magnetometer tells the flight controller which course the quad is dealing with. This data helps the drone to:

  • Keep heading in Place Maintain mode
  • Enhance GPS Rescue mode accuracy
  • Scale 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/

High Performer: GEPRC M1025Q (With Compass)

High Performer: HGLRC M100 5883 (With Compass)

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

The best way to 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 hold the compass as distant as attainable 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 tougher to get clear compass readings just because every thing 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 high of the configurator ought to mild up. If it doesn’t, verify energy and wiring.

Betaflight Configurator Top Bar Gyro Accel Mag Baro Gps Icons

Establish Magnetometer Chip

Open the CLI and sort:

standing

This confirms whether or not the magnetometer is detected and in addition helps determine the chip. Frequent 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. Nonetheless, 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, chances are you’ll want to regulate the magnetometer alignment in Betaflight settings.

Magnetometer Axes Orientation Betaflight Drone

Why Alignment Is Typically Wanted

When you mount the magnetometer completely parallel to the flight controller, setup could be easy. Nonetheless, on most GPS modules the magnetometer is situated on the alternative aspect of the GPS antenna. And for the reason that GPS antenna should face the sky, the magnetometer often finally ends up being the wrong way up, which implies alignment adjustments are often inevitable.

If that is your first time utilizing a compass, hold 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 saved 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 should utilize for frequent compass alignments.

Betaflight Magnetometer Compass Orientation Alignment Relation To Drone

Customized Alignment (Superior)

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

Geprc Vapor Move Gps Front

That stated, the Alignment Software in iNav Configurator is extraordinarily useful—even for those who don’t use iNav.

The best way to use it:

  • Open iNav Configurator
  • Enter Demo Mode (so you may join with no FC)
  • Go to Alignment Software
  • Choose X, Y, Z (extra dependable than selecting magnetometer)
  • Alter the X, Y, Z sliders till they match your magnetometer’s bodily orientation
  • Pay attention to 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 through 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. You could find 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 must carry out compass calibration on the location the place you propose to fly. Keep properly away from something that would trigger magnetic interference, reminiscent of:

  • Metallic objects
  • Automobiles
  • Energy strains
  • Bolstered concrete

You’ll be able to provoke calibration both by clicking the Calibrate Magnetometer button in Betaflight Configurator (setup tab), or through the use of stick instructions. I personally desire stick instructions, because it permits me to unplug the USB cable and rotate the quad freely.

The best way to 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 must hear 2 beeps
  3. Spin the quad shortly 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 take a look at the FC LED as a substitute:

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

Betaflight Stick Commands 2024 11 30

The best way to 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 identical time, yaw the quad left and proper randomly
  • Slowly flip your whole physique by taking small steps. By the top of the calibration, you must have accomplished roughly a full 360° rotation.

Calibrate Magnetometer Compass Figure 8 Betaflight

Compass calibration often solely must be executed as soon as inside your native space. Nonetheless, for those who journey distant from residence, it’s a good suggestion to recalibrate.

Validate Heading

After calibration, confirm the heading rigorously:

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

Evaluate the heading in opposition to a smartphone compass app. Make certain the app is ready to true heading, not magnetic heading.

Take a look at by dealing with completely 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 mistaken:

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

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

Ultimate Ideas

You’ll be able to fly Betaflight with no magnetometer—however if you need dependable Place Maintain and correct GPS Rescue, a correctly configured and calibrated magnetometer could make a distinction. As soon as it’s arrange accurately, you not often want to the touch it once more except you modify {hardware} or GPS placement. And don’t neglect to recalibrate for those who fly distant out of your regular location.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

0FansLike
0FollowersFollow
0SubscribersSubscribe
- Advertisement -spot_img

Latest Articles