Skip to content

Navigation PID tuning (FW)

Jetrell edited this page May 17, 2025 · 6 revisions

This page is a work in progress until this message is removed

The aim of this page is to separate the tuning of the FW Navigation PIDs from the Navigation modes page. Its goal is also to have FW Nav PID tuning separate from MC Nav PID tuning. To de-clutter and make for easier reading.

Tip

There is also a companion wiki page GPS and Compass setup, that is essential reading beforehand. The Installation location, Setup and Calibration of the GNSS/Magnetometer module, to provide the best navigation performance achievable, is of absolute importance. Accounting for this detail can make your build a greater success, especially when using a magnetometer.

Caution

The Main Stabilization PID_FF, RATES and LEVEL controller MUST be tuned well before attempting to tune the navigation controllers. This is because the output from the navigation controllers are place into action through the main stabilization PID controllers. With incorrectly tuned FeedForward, noticeable impacting navigation performance.
Take note of how the Rate/FF Auto-tune process is performed.

Tuning Altitude Controller - Z axis:

Inability to obtain an accurate target altitude or climb rate can be caused by a number of reasons:

  • Poor GNSS satellite accuracy and EPV position data - Ensure you have a HDOP less than 1.2 for best precision. And never above 1.8. See here
  • Main stabilization PID_FF, RATES and LEVEL is poorly tuned. Or incorrectly setup control surface throws and/or C.G. - Setup hardware and Tune main PID's first.
  • Insufficient motor thrust - The airplanes thrust to weight ratio is too low.
  • High accelerometer vibrations from the motor(s) or prop(s).
  • Insufficient POS_Z_P, POS_Z_I or too much POS_Z_D and/or FW_FF_PITCH - Only if all the previous conditions are satisfied.

Make sure these hardware conditions are addressed first, before you even attempt to tune the navigation VEL PID's and climb rate settings.

ALTITUDE POS(VEL) PID Tuning:

Altitude is always referred too as the vertical or (Z) axis.

Tuning of an airplanes Z axis controller should be done on a day no colder than 5°C, for the best outcome. Due to the effect temperature has on the Baro and IMU.

The following settings can be accessed using the Configurator Tuning tab and Advanced Tuning tab. Or the CLI and CMS OSD stick menu's.

  • nav_fw_pos_z_p - Controls velocity to acceleration. Increasing the gain will provide a stronger elevator/pitch2throttle response to reach the required altitude target.
  • nav_fw_pos_z_i - Attempts to compensate for climb rate fluctuations cause by turbulence, thermals etc. Use sparingly. It can only do so much on a fixedwing platform.
  • nav_fw_pos_z_d - Attempts to smooth the POS(VEL)_Z_P and POS(VEL)_Z_I rate of response. Too much damping can weaken the response, leading to oscillations around the altitude target. Even becoming more exaggerated by an incorrectly tuned fw_ff_pitch response.
  • nav_fw_pos_z_ff - Attempts to provide a faster control response to meet the require target, based on altitude and gyro rate data. Depending on the aircraft's build specifics, lowering POS_Z_D and increasing POS_Z_FF can help.
  • nav_fw_alt_control_response - Alters the altitude control response as the airplane gets closer to reaching the altitude target.
  • fw_ff_pitch - Passes the angular rate target directly to the servo mixer, bypassing the gyro PID loop stabilization.
  • nav_fw_auto_climb_rate- Maximum climb/descent rate in [cm/s], the airplane is allowed to reach in modes that control altitude.

These settings should also be configured or tweaked to suit your aircraft. This will assist the Velocity Z controller.

Tuning Position Controller - XY axis:

Inability to obtain an accurate horizontal position can be caused by a number of reasons:

  • Poor GNSS satellite accuracy and EPH position data - Ensure you have a HDOP less than 1.2 for best precision. And never above 1.8. See here
  • Main stabilization PID_FF, RATES and LEVEL is poorly tuned. Or incorrectly setup control surface throws and/or C.G.- Setup hardware and Tune main PID's first.
  • Poorly Installed, Aligned or Calibrated magnetometer (compass) - If a magnetometer is used, read here to provide the best results.
  • Insufficient POS_XY_P, POS_XY_I or POS_HDG_P if nav_use_fw_yaw_control = ON - Only if all the previous conditions are satisfied.
  • High accelerometer vibrations from the motor(s) or prop(s). - Can lead to attitude and heading reference drift.

Make sure these hardware conditions are addressed first, before you even attempt to tune the navigation POS, VEL and HEADING PID's.

Horizontal POS + HEADING PID Tuning:

Tuning of an airplanes XY axis controllers should be done on a day no colder than 5°C, for the best outcome. This is due to the effect temperature has on the IMU.

When tuning the Nav XY controllers, you require a means to reference the WP markers, to real-time heading and turning positions.
This is best done by logging flight controller data. And gauging the changes with one or all of the following software: MWP Tools , INAV Blackbox Explorer or Blackbox Tools

The following settings can be accessed using the Configurator Tuning tab and Advanced Tuning tab. Or the CLI and CMS OSD stick menu's.

Position XY gains:

  • nav_fw_pos_xy_p - Controls how fast the airplane will attempt to use the roll and yaw axis to align its trajectory with the target position. This includes the strength it will apply to turning and re-aligning with the track after a turn.
  • nav_fw_pos_xy_i - Increasing this gain can compensation for trajectory drift caused by the wind. But should be used sparingly on elevon aircraft.
  • nav_fw_pos_xy_d - Increasing this gain can help smooth the P gain response. But if increased too much, it can cause over-shooting of the target trajectory alignment.
  • nav_fw_cruise_thr - Should be set to the airplanes optimal cruise speed. Keeping the average airspeed less than 75km/h, will obtain the highest target position accuracy.

Heading gains:

  • nav_fw_heading_p - Sets the strength the IMU heading target will hold. Heading data is updated from the GNSS course and/or mag bearing.
  • nav_use_fw_yaw_control- When enabled, it allows the use of the yaw heading controller settings below, for a fixedwing. It can be used with elevon aircraft via turn assist, but will not experience the full benefits of an airplane that has yaw control.
  • nav_fw_pos_hdg_p - Sets the strength the heading trajectory target is tracking.
  • nav_fw_pos_hdg_i - When used sparingly, it can filter-out heading target drift.
  • nav_fw_pos_hdg_d - Can smooth abrupt heading irregularity. But better suited to aircraft that have a means of yaw control.
  • heading_hold_rate_limit - Limits the yaw induced rotation rate the HEADING_HOLD controller can request from PID controller inner loop. It's independent from manual yaw rate and only active when HEADING_HOLD NAV flight modes are in use.
  • These settings can also influence WP tracking accuracy.

In my experience. Enabling the nav_fw_pos_hdg controller combined with an airplane that has yaw control. i.e. A Rudder, Differential thrust or Vectored thrust, when those yaw gains are tuned. Always provides the most accurate turn response in a waypoint mission or RTH Trackback.

Tuning Rangefinder:

The Rangefinder (surface) gains should only be tuned after the XYZ navigation PID's are optimally tuned.

Rangefinder - Lidar or Sonar altitude terrain settings and sensor weights:

  • rangefinder_median_filter - Enables a 3-point median filter to helps smooth out altitude variations in the readout.
  • nav_max_terrain_follow_alt - Maximum allowable distance above the ground for altitude tracking in [CM], that directly maps throttle to altitude.
  • inav_max_surface_altitude - Maximum allowable altitude [CM] for the vertical position estimators validity check over a set time period.
  • inav_w_z_surface_p - Weight applied to the Rangefinders estimated altitude. When a rangefinder is present, within its operational distance above the ground.
  • inav_w_z_surface_v - Weight applied to the Rangefinders estimated climb rate. When a rangefinder is present, within its operational distance above the ground.

Optical-flow is not available for fixedwing use, due to the speed airplanes travel across the ground. And the inherent inaccuracy of Optical Flow under such conditions.

WIKI TOPICS

Wiki Home Page

INAV Version Release Notes

8.0.0 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
FW Launch Mode
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

Navigation PID tuning (FW)
Navigation PID tuning (MC)
EZ-Tune
PID Attenuation and scaling
Fixed Wing Tuning for INAV 3.0
Tune INAV PID-FF 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