Skip to content
CREASE-gum-EAR edited this page May 6, 2024 · 1 revision

Important: INAV requires you to follow the accelerometer calibration steps below. These steps are different to Cleanflight & Betaflight. So don't skip reading this section, it's vitally important.

Modern accelerometer sensors are precise, but they require calibration if we want accurate measurements.

The sensors on your flight controller might be biased and gains on different axes might be different. INAV uses an advanced 6-point calibration to take care of all irregularities your flight controller sensors might have.

Accelerometer calibration steps

Unlike the simple level calibration used in cleanflight & betaflight INAV uses a "6 point accelerometer calibration" process.

You may find this easier to do more accurately prior to installing the flight controller in your model and this procedure MUST be done referenced to the marked orientation on the board.

See "calibration procedure" below:

Note: If the flight controller is mounted in another angle or upside down, do the calibration steps with the flight controller pointing as shown in the pictures, not based on the orientation of the quad or fixed wing model itself, otherwise calibration won´t work.

  1. Connect the model to the "Configurator" software, select the "Setup" tab.

  2. Place the model level (position 1 as shown in the picture) and press the "Calibrate Accelerometer" button. Advanced calibration has been activated and has recorded the first data point.

  3. Place model on all sides in sequence (positions 2 to 6): on its back, right side, nose up, left side, nose down. Press "Calibrate Accelerometer" button for in each position. The advanced calibration algorithm will record 2nd to 6th data points.

  4. After all 6 positions have been recorded advanced calibration will calculate offsets and gains, then store them in the flight controllers EEPROM. Accelerometer calibration complete (YAY!).

  5. Use the CLI tab to verify that accgain_x, accgain_y and accgain_z parameters are NOT 4096. If they are, algorithm failed to converge, calibration failed and needs to be repeated. In addition, acczero_x, acczero_y, acczero_z, should not be 0 any more.

There is no need to place the model perfectly aligned, the algorithm does not care about exact positions as long as they are close to 90 degree apart and copter is stationary in every position.

Board Orientation and Level Calibration

If you have your board rotated in any way, change board alignment to match (see the configuration tab in the INAV configurator).

You can verify the correct board orientation by banking your your aircraft left and right, forward and back and rotate left and right. In all examples the 3D model image in configurator must move accordingly.

Accelerometer calibration does not record a leveled model.

For level flight and navigation features to work you need to trim the firmware to level flight using "Board Alignment" on the "Configuration" tab. The readings should show close to 0.0 on all axis when the aircraft is laying flat.

To trim out unleveled flight / drift using stick commands is really useful.

Note: If using CLI to set up board alignment unlike Cleanflight firmware board alignment angles are set in degrees*10, so if you need to trim your board 1.5 degrees you should enter "15".

Compass Calibration

Accurately setting up the compass is vital because it is the primary source of heading information.

Without an accurate heading the drone will not move in the correct direction in autopilot modes (POSHOLD, RTH, Waypoint). This can lead to circling (aka “toilet-bowling”) or even fly-aways.

The magnetometer (basically a compass) measures magnetic field strength so it should be placed away from any sources of magnetic interference - power wires, ESCs, motors, beepers, metal parts of the frame, video transmitters, Llamas & so on...

The best way is to place the compass on a mast along with GPS module. When an external compass is used remember to set correct "align_mag", see the INAV CLI variables for more information. Compass must be mounted parallel to f/c. If not please follow the guide in setting-up-the-compass-alignment.

When using an external magnetometer 9/10 times you need to physically remove (remove chip from board or cut a trace) the internal one if you have on.

You can't use two identical chips/magnetometers on the same I2C bus. The 1/10 time you dont need to physically remove your internal mag is when you have different magnetometers on the flight controller and the external one. Example you cannot use two HMC5883L magnetometers.

Performing the Calibration

Calibrate with flight battery powering up the aircraft.

Press "Calibrate Magnetometer" button.

You have 30 seconds to hold the copter in the air and rotate it so that each side (front, back, left, right, top and bottom) points down towards the earth. However the algorithm is smart enough to calculate the proper calibration values even if you simply wave the copter in the air for 30 seconds after pressing "Calibrate Magnetometer" button.

Compass calibration using stick functions

Calibrating Mag/Compass without the need to be connected to a computer can extremely convenient while out in the field. The Controls.md wiki describes the various capabilities of adjusting the craft's controls using the TX sticks. As described in this document, calibrate the compass by moving the left stick up and to the right while at the same time, move the right stick down and to the center. The flight controller will sound two quick beeps indicating the start of the calibration. Move the craft as indicated in the paragraph above. After 30 seconds, the flight controller will sound a single beep indicating the completion of the process.

Verifying that compass is calibrated properly

  1. Use the CLI to verify that magzero_x, magzero_y and magzero_z parameters are NOT 0 any more. If they are, algorithm failed to converge, calibration failed and needs to be repeated.
  2. Connect the copter to iNAV Configurator and observe the attitude values on the "Setup" screen (values of Heading, Pitch and Roll). Point your models nose North and verify that heading is reading 0 deg. Tilt the copter 30 degrees forward, right, left and back while observing the Heading value. Value of 0 deg shouldn't change more than several degrees. Repeat the process with models nose pointing East (heading=90 deg), South (heading=180 deg), West (heading=270 deg).

If the value is incorrect when copter is level, you likely don't have align_mag CLI variable set to proper compass alignment value. If heading value is correct when copter is level but drifts when you tilt the model, then your should re-calibrate the compass.

  1. Also, remember to set magnetic declination to a proper value on the "Configuration" screen. The magnetic declination of your specific location can be found here: magnetic-declination.com.

If your magnetic declination readings are e.g. +3° 34' , the value entered in the INAV configurator is 3.34 (3,34 in some locales). In the CLI, the same effect would be set mag_declination = 334. For west declination, use a minus value, e.g. for 1° 32' W, set mag_declination = -132. In all cases (both CLI and GUI), the least significant digits are minutes, not decimal degrees.

Since INAV 1.2, on non-F1 targets, one can use an automatic declination setting, which is more than accurate enough for INAV. set inav_auto_mag_decl = ON.

Gyroscope Calibration

Gyroscope calibration, or rather bias recording, is performed on every startup. **Your model should be stationary while powering up. **

With most models, connecting batteries while keeping the craft still can be difficult, simply ensure the craft is placed on the ground (or somewhere solid and still) for 5 seconds as soon as possible after powering up. Gyro auto calibration will only run when no motion is detected

Note: Under normal conditions there is no need for a manual calibration procedure, but if required this can be performed via stick commands.

Backup and Restore the Settings

To avoid going through full calibration after resetting the configuration new CLI settings are introduced to get and set accelerometer offsets and gains: acczero_x, acczero_y, acczero_z, accgain_x, accgain_y, accgain_z. The same applies to magzero_x, magzero_y and magzero_z.

WIKI TOPICS

Wiki Home Page

INAV Version Release Notes

7.1.0 Release Notes
7.0.0 Release Notes
6.0.0 Release Notes
5.1 Release notes
5.0.0 Release Notes
4.1.0 Release Notes
4.0.0 Release Notes
3.0.0 Release Notes
2.6.0 Release Notes
2.5.1 Release notes
2.5.0 Release Notes
2.4.0 Release Notes
2.3.0 Release Notes
2.2.1 Release Notes
2.2.0 Release Notes
2.1.0 Release Notes
2.0.0 Release Notes
1.9.1 Release notes
1.9.0 Release notes
1.8.0 Release notes
1.7.3 Release notes
Older Release Notes

QUICK START GUIDES

Getting started with iNav
Fixed Wing Guide
Howto: CC3D flight controller, minimOSD , telemetry and GPS for fixed wing
Howto: CC3D flight controller, minimOSD, GPS and LTM telemetry for fixed wing
INAV for BetaFlight users
launch mode
Multirotor guide
YouTube video guides
DevDocs Getting Started.md
DevDocs INAV_Fixed_Wing_Setup_Guide.pdf
DevDocs Safety.md

Connecting to INAV

Bluetooth setup to configure your flight controller
DevDocs Wireless Connections (BLE, TCP and UDP).md\

Flashing and Upgrading

Boards, Targets and PWM allocations
Upgrading from an older version of INAV to the current version
DevDocs Installation.md
DevDocs USB Flashing.md

Setup Tab
Live 3D Graphic & Pre-Arming Checks

Calibration Tab
Accelerometer, Compass, & Optic Flow Calibration

Alignment Tool Tab
Adjust mount angle of FC & Compass

Ports Tab
Map Devices to UART Serial Ports

Receiver Tab
Set protocol and channel mapping

Mixer

Mixer Tab
Custom mixes for exotic setups
DevDocs Mixer.md

Outputs

DevDocs ESC and servo outputs.md
DevDocs Servo.md

Modes

Modes
Navigation modes
Navigation Mode: Return to Home
DevDocs Controls.md
DevDocs INAV_Modes.pdf
DevDocs Navigation.md

Configuration

Sensor auto detect and hardware failure detection

Failsafe

Failsafe
DevDocs Failsafe.md

PID Tuning

PID Attenuation and scaling
Fixed Wing Tuning for INAV 3.0
Tune INAV PIFF controller for fixedwing
DevDocs Autotune - fixedwing.md
DevDocs INAV PID Controller.md
DevDocs INAV_Wing_Tuning_Masterclass.pdf
DevDocs PID tuning.md
DevDocs Profiles.md

GPS

GPS and Compass setup
GPS Failsafe and Glitch Protection

OSD and VTx

DevDocs Betaflight 4.3 compatible OSD.md
OSD custom messages
OSD Hud and ESP32 radars
DevDocs OSD.md
DevDocs VTx.md

LED Strip

DevDocs LedStrip.md

ADVANCED

Advanced Tuning

Fixed Wing Autolaunch
DevDocs INAV_Autolaunch.pdf

Programming

DevDocs Programming Framework.md

Adjustments

DevDocs Inflight Adjustments.md

Mission Control

iNavFlight Missions
DevDocs Safehomes.md

Tethered Logging

Log when FC is connected via USB

Blackbox

DevDocs Blackbox.md
INAV blackbox variables
DevDocs USB_Mass_Storage_(MSC)_mode.md

CLI

iNav CLI variables
DevDocs Cli.md
DevDocs Settings.md

VTOL

DevDocs MixerProfile.md
DevDocs VTOL.md

TROUBLESHOOTING

"Something" is disabled Reasons
Blinkenlights
Pixel OSD FAQs
TROUBLESHOOTING
Why do I have limited servo throw in my airplane

ADTL TOPICS, FEATURES, DEV INFO

AAT Automatic Antenna Tracker
Building custom firmware
Default values for different type of aircrafts
Features safe to add and remove to fit your needs.
Developer info
INAV MSP frames changelog
INAV Remote Management, Control and Telemetry
Lightweight Telemetry (LTM)
Making a new Virtualbox to make your own INAV
MSP Navigation Messages
MSP V2
OrangeRX LRS RX and OMNIBUS F4
Rate Dynamics
Target and Sensor support
UAV Interconnect Bus
Ublox 3.01 firmware and Galileo
DevDocs 1wire.md
DevDocs ADSB.md
DevDocs Battery.md
DevDocs Buzzer.md
DevDocs Channel forwarding.md
DevDocs Display.md
DevDocs Fixed Wing Landing.md
DevDocs GPS_fix_estimation.md
DevDocs LED pin PWM.md
DevDocs Lights.md
DevDocs OSD Joystick.md
DevDocs Servo Gimbal.md
DevDocs Temperature sensors.md

OLD LEGACY INFO

Supported boards
DevDocs Boards.md
Legacy Mixers
Legacy target ChebuzzF3
Legacy target Colibri RACE
Legacy target Motolab
Legacy target Omnibus F3
Legacy target Paris Air Hero 32
Legacy target Paris Air Hero 32 F3
Legacy target Sparky
Legacy target SPRacingF3
Legacy target SPRacingF3EVO
Legacy target SPRacingF3EVO_1SS
DevDocs Configuration.md
Request form new PRESET
DevDocs Introduction.md
Welcome to INAV, useful links and products
iNav Telemetry
DevDocs Rangefinder.md
DevDocs Rssi.md
DevDocs Runcam device.md
DevDocs Serial.md
DevDocs Telemetry.md
DevDocs Rx.md
DevDocs Spektrum bind.md

Clone this wiki locally