Skip to content

Tune INAV PIFF controller for fixedwing

Niccolò Maggioni edited this page Mar 1, 2020 · 11 revisions

Description of PIFF controller:

The FF-gain should do most of the work steering the airplane, leaving only P and I controller to fight turbulence and drift.

1: Figure out the maximum rates your airplane can do for each axis (pitch, roll, and yaw)

  • Fly in MANUAL mode (called PASSTHROUGH mode up to version 1.8.1) with the manual_roll_rate, manual_pitch_rate and manual_yaw_rate settings set to 100%. Have some way of recording the flight: blackbox, DVR or both. Do hard rolls, hard loops and one 360° yaw turn. Use full stick deflection on all these maneuvers.

    • To calculate an axis' (approximate) rate from a DVR recording you'll need to count the number of frames it took for your aircraft to do a complete maneuver (roll/flip/yaw turn), determine the average FPS of the recording, and then use this formula: 360 / (number_of_frames / FPS). You can take multiples samples and average them for a better accuracy.
      You can also use a Python script to help automating the process.
  • Note down the maximum rates. Typical values are 360°/s on roll, 100°/s on pitch and 60°/s yaw.
    Enter these values as your rates in configurator.

2: Zero out P and I gain on Roll, Pitch and Yaw controller and set tpa_rate to 0. Increase FF-gain (D column in the PID tuning tab) until you get 90% of full servo throw when having sticks at full throw in ACRO mode (no flight mode enabled) compared to manual mode.

  • This is so the FF-gain does most of the work turning the airplane, but leaving some for the P and I gain to work with.
  • For this step it is convenient to have the two modes MANUAL (called PASSTHROUGH mode up to version 1.8.1) and ACRO available on a switch to be able to switch easily between the two to compare the throws.
  • The 90% deflection value can also be calculated by dividing 13950 by the maximum rate for the axis, e.g. 360deg/s maximum roll 13950/360=38.75 FF. For 80% deflection, divide 12400 by rate.

Now set a little P and I gain as a starting point, for example: 10 P-gain and 15 I-gain to Roll, Pitch and Yaw axis.

3: Go out and fly in acro mode.

  • If airplane drifts to one side or up and down add I-gain to the axis it drifts in.
  • If you want more stabilization against wind try and add more P-gain.

4: Want to calm your airplane down? Now is the time to reduce rates to fit your needs.

  • Note: It's normal to get reduced servo throw when reducing rates at this point, if you got full servo throw at this stages you would overshoot the target deg/s you wanted.

5: Tune Angle / Horizon mode

  • Enter Angle mode. If your aircraft doesn't fly straight and level your FC is probably not mounted flat relatively to the aircraft's natural attitude when flying (most planes and wings actually fly with a few degrees of nose-up attitude to maintain their altitude). You'll need to trim your board's alignment (align_board_roll, align_board_pitch, align_board_yaw) accordingly. After each adjustment fly again and check if the behavior has improved.
  • If you are unhappy with the value of maximum bank/pitch angles, you can adjust them via the max_angle_inclination_rll and max_angle_inclination_pit. Be aware that if you want the same amount of maximum angle for poshold/althold you will also need to increase their values (nav_fw_bank_angle, nav_fw_climb_angle, nav_fw_dive_angle).
  • If you are unhappy with the strength of the Angle mode, for example if it levels out too quickly/hard, adjust P-gain of the level controller via fw_p_level.

Other tuning tips:

  • Setup your TPA correctly. PID Attenuation and scaling

  • If your plane over corrects when RTH is engaged (symptom is a wave-like flight path), try increasing nav_fw_pos_xy_p and/or increasing nav_fw_pos_xy_i. Good values to start: set nav_fw_pos_xy_p = 50, set nav_fw_pos_xy_i = 5. You can also try lowering nav_fw_pos_xy_d.
    When P & I are too high the symptom is fast wandering left-right by a small amount (less than 5 deg). In that case you should try to decrease nav_fw_pos_xy_p and/or nav_fw_pos_xy_i or increase nav_fw_pos_xy_d. The behaviour of the plane is very different with or w/o wind, so it is necessary to test and tweak parameters in both scenarios.

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