Automatic Parameter Tuning for INAV Firmware
I. Principles
The automatic tuning feature in INAV firmware is inspired by the Ardupilot Plane firmware. Getting good roll/pitch/yaw PIFF parameters for your aircraft is crucial for flight stability. To help achieve this, it is highly recommended that you use the AUTOTUNE (automatic tuning) system described below.
II. How AUTOTUNE Works
AUTOTUNE (automatic tuning) mode is a flight mode that operates based on normal flight modes (ANGLE, HORIZON, or ACRO). It learns and calculates roll, pitch, and yaw PIFF parameters through flight attitude changes input by the pilot.
Typically, the pilot needs to activate AUTOTUNE mode while the aircraft is in the air and then fly continuously for several minutes. During this process, the pilot should input as many dramatic attitude changes as possible (such as rapid roll or pitch maneuvers) so that the AUTOTUNE algorithm can fully learn the aircraft's response characteristics and automatically calculate appropriate PIFF gain values.
What you need to know before using AUTOTUNE:
Before takeoff, you need to set some parameters for your aircraft:
| Parameter | Explanation |
|---|---|
| roll_rate | Maximum roll rate limit for your aircraft. Must not exceed the aircraft's physical limits |
| pitch_rate | Maximum pitch rate limit for your aircraft. Must not exceed the aircraft's physical limits |
| yaw_rate | Maximum yaw rate limit for your aircraft. Must not exceed the aircraft's physical limits |
| fw_p_level | Auto-level strength. Higher values result in crisper response |
| fw_i_level | Auto-level filtering. Typical values for aircraft are 1-5 Hz |
| max_angle_inclination_rll | Maximum roll angle (in [0.1 degrees] units) |
| max_angle_inclination_pit | Maximum pitch angle (in [0.1 degrees] units) |
| tpa_breakpoint | Throttle position at which TPA (Throttle PID Attenuation) begins (expected throttle for most of your flying) |
| tpa_rate | Amount of TPA curve to apply (for most aircraft, typically should be in the 50-80 range) |
For most amateur aircraft, roll/pitch rate limits should be in the range of 70-120 degrees/second (values of 7-12). Small and agile flying wings can achieve 180-200 degrees/second.
Other items to check:
- It is recommended that you first fly in "MANUAL" mode and adjust the servo midpoints to ensure the aircraft can achieve stable flight.
- Also, ensure that the aircraft's center of gravity (CG) is set according to the recommended position in the aircraft's manual, as this may affect flight stability.
- Finally, check if the failsafe function can be triggered correctly. For safety, perform this test on the ground with the propellers removed.
III. Flying with AUTOTUNE Mode
Once all settings are complete, you can take off normally and switch to AUTOTUNE mode after reaching a certain altitude.
When entering AUTOTUNE mode, you need to pay attention to the following:
- Default parameter initialization: The automatic tuning system will immediately set some default values for the aircraft's roll, pitch, and yaw P (proportional) and I (integral) gains.
- Monitoring required rate and response learning: The system will monitor the roll and pitch rates you input through the RC transmitter sticks. When the required roll or pitch rate exceeds a set threshold, the system will use the aircraft's actual response to learn and adjust the tuning values for roll or pitch.
- Periodic parameter quick saving: Every 5 seconds, the AUTOTUNE system stores a snapshot of the current parameters. When you exit AUTOTUNE mode, the system will restore the last remembered parameters to the flight controller.
- Aircraft response is slower during initial tuning phase: When you first enter AUTOTUNE mode, the aircraft may appear sluggish. However, as tuning progresses, this sluggishness will gradually improve. Therefore, ensure your flying area is spacious enough to perform slow maneuvers with large turn radii.
- Do not land in AUTOTUNE mode: The aircraft cannot perform at full capacity during landing, which might be misinterpreted by the AUTOTUNE system as insufficient gain. Therefore, do not perform landing operations in AUTOTUNE mode.
- Quick input maneuvers: The key to successful tuning is inputting quick and large amplitude movements with the RC transmitter sticks. It is recommended to perform only one type of maneuver (either roll or pitch) at a time, and quickly push the stick to maximum deflection so that the system can accurately capture the aircraft's response and adjust appropriate PIFF gain parameters.
Important
The longer you fly with automatic tuning, the better the results. Allow autotune to analyze your aircraft's attitude and adjust to suitable tuning. After you feel the aircraft is flying stably in AUTOTUNE mode, continue flying for a while longer to complete the final parameter calibration.
After using AUTOTUNE to adjust appropriate PIFF parameters, you should switch AUTOTUNE to ANGLE or MANUAL mode to land the aircraft and complete the adjustment.
Please note that AUTOTUNE mode does not automatically save parameters to EEPROM. Therefore, after landing the aircraft, immediately move the RC transmitter sticks to the corners (outer position) to save the parameters

——This article is referenced from the INAV official website: https://github.com/iNavFlight/inav/blob/master/docs/Autotune%20-%20fixedwing.md**