In Phase Two of the INAV Plane Tuning Masterclass. We take the base tune from Phase One and start tweaking it, to get it the best we can. So, after finishing AUOTUNE and flying around for some packs; you should be more confident and want to fly in sub-optimal conditions, like gusty wind. Maybe you are pushing the hardware and fly with high speed? If so, you will likely recognise that not everything is perfect. The plane is wobbling around in the wind or jittering on full throttle and fast dives. Maybe it also overshoots when stopping from fast rolls or loops.

At this point, this is absolutely normal because AUTOTUNE is only able to give you a basic PIFF controller tuning. But to get a perfect tune, there are some more things to set up that can not be determined automatically. This is the point where we need to look exactly how the plane behaves to analyse what needs to be optimised in the tune. The INAV Plane Tuning Masterclass will take you through all the steps.

PIFF Optimisation

In this section of the INAV Plane Tuning Masterclass, we will be optimising the PIFF controller. PIFF is the an abbreviation of the three values that we can change to tune the model. P is short for Proportional, I is Integral, and FF is FeedForward.

As you may remember, AUTOTUNE is done in very calm conditions. This is necessary to avoid the influence of wind turbulence. AUTOTUNE can wrongly see the turbulence as overshoots, causing incorrect values. Therefore, the P value is set very low. So there will be only minimal stabilisation to counteract wind gusts. We need to optimise that manually and I’ll explain how. Also, the I term is set relatively low to avoid rebounds. But sometimes it can be too low and cause slight drifting. We need to be careful with the I term to avoid strong oscillations.

All the upcoming flights have to be done in ACRO mode. Do not use ANGLE or any other self levelling mode!

INAV Configurator - PID Tuning - PID Gains

Proportional Tuning

To get a good P Value for descent stabilisation, it is important to find the correct weather conditions. A slightly windy day with some gusts is perfect for this but be careful that the wind is not too strong to be able to land safely.

  1. Start flying straight lines first
    • Always fly at medium speeds (same as in AUTOTUNE before) but not at full throttle or close to stall speed
  2. Take note of how much the wind bumps the plane around, with hands off the sticks
  3. Now do some hard manoeuvres, rolling left and right and watch for oscillations
    • The plane should not rapidly swing back and forth (Oscillate)
    • There might be a small bounce back especially on smaller planes, that’s okay
    • If the bounce back is very strong and more than a few degrees, you need to lower the Feed Forward, as it does not match the desired roll or pitch rate. Or you might have too much throttle applied compared to the AUTOTUNE before.
  4. If the plane does oscillate multiple times but settles down after a few oscillations, your P gain is too high and you need to lower it
    • Lower the P value by 20% or 1, whichever is more.
    • Fly again and do the same manoeuvres, until the end of the roll or pitch manoeuvre is smooth. When you release the stick, there should not be more than a slight bounce back.
  5. If there is no bounce back at all, but the wind bumps the plane around in the wind a fair amount. You might want to raise the P gain a little to see how much stabilisation is possible
    • Raise the P value by 20% or a value of 1, whichever is more.
    • Fly again and do the same manoeuvres until you feel a slight bounce back after a quick roll or pitch manoeuvre.
  6. We need to get to the point that the model settles after just a slight bounce back
  7. This will give you the best stabilisation in turbulence. But without overshooting or nasty oscillations when flying aggressively in calm conditions
  8. Once you are happy with one axis, repeat this process on the other axis too. We will get rid of the last overshoot oscillations later.

Keep in Mind: The wind will influence an Airplane of any kind, and it can never be as stable as a quadcopter; due to the low density and slow servos. Therefore the tuning of P can only reduce the amount of movement, caused by wind gusts, but never eliminate it completely.
Moving the CG a bit forward by adding nose weight will also help for more stable flights but is only recommended for light weight setups.

Integral Tuning

The I Term tuning is a little bit delicate and usually not necessary after AUTOTUNE. But, if your plane has some strange aerodynamic properties, it can be useful. Planes like the Dart XL from ZOHD tend to nose up on high throttle. So here it makes sense to have a higher I Term to compensate for that. Also, if a plane is nose heavy, it would cause a ‘nose up’ on high speeds. This is due to the reflex that it needs to counteract the nose weight. But the I Term will compensate for that too. For this we need to have a calm day with not much wind.

The I term counteracts slow drifts of attitude. I values that are too high can cause a stall or even flat spin if the airspeed gets too low. Because the plane will try aggressively to keep the nose up, instead of letting it drop and gain speed. It can also cause violent oscillations when set too high, especially in dives. The I term should never be set higher than it really needs.

AUTOTRIM has to be done before tuning the Integral. The linkages should be trimmed mechanically too, so we have a neutral starting point here!

  1. Fly the plane at the same throttle value as for the P Tuning and in AUTOTUNE
  2. Fly level at a safe altitude and take your hands off the sticks
  3. Watch if the plane drifts on one axis (pitching up or down or rolling to the side)
    • If the plane drifts away on one axis to more than 25° after 5s, you need to raise the I value
    • Don’t change that yet as we need to test the plane stability next, during this same flight.
  4. Now we need to test the stall behaviour in ACRO mode when not touching the sticks. It should behave in the same way as the model did in the MANUAL mode stall test in Phase One. So, if your plane has a stable stall behaviour that only dips the nose, it should do the same now
  5. Fly level and cut the throttle down to zero, then release the sticks
    • If the plane dips the nose and does not tip stall, you can raise the I value if needed (depends on the result in step 3)
    • If the plane tip stalls, you need to lower the I gain on your pitch axis and maybe even raise it on roll (if it drifted on the pitch axis in step 3, add nose weight instead)
    • Having a stable stall behaviour is important to have a reliable autopilot in a FAILSAFE situation.
    • Repeat that process from step 3 if you had to change the I term
  6. When we pass tests 3 and 5, we are done.

FeedForward Tuning

The last value should not be touched after Autotune. But it can be checked to see if it is still fine after the P and I optimisation. The FF Term does the most work when flying a plane. It translates the user input into the correct control surface movement. To keep some room for P and I to work, even on hard manoeuvres, the FF value should not use the full servo throw. You can check this on the bench by doing the following.

Plug a battery in the plane and make sure you have MANUAL mode on a switch. Start in ACRO and give the plane a full pitch input on your transmitter. Look at the control surfaces. While holding the stick at full deflection, switch into Manual mode. At this moment, the control surfaces should move a bit to give even a bit more throw. Switching back to Acro mode should reduce the control surfaces throw again. Do that also for the roll axis.

If there is no difference between MANUAL and ACRO mode after you have done the Autotune. Your target rates on that axis are higher than the plane can physically achieve. Look into the INAV Plane Tuning Masterclass Phase One again how to determine them. Then lower the rate on that axis and start with the AUTOTUNE again. This is important as too high rates will over-saturate the PIFF controller, causing overshoots and unstable acro manoeuvres. It will also over-tune the FF value causing oscillations in self levelling modes.

TPA -Tuning for High-Speed

Now we will come to the point that is very interesting for speed wing pilots, especially if you do proximity flying. All of the tuning we have done so far in the INAV Plane Tuning Masterclass, was done at specific throttle values and speeds. This was to get as much stability as possible on the plane. The issue now is that high air speeds will cause much more aggressive reactions, while low air speeds will feel sluggish. As INAV does not account for that by default, we need to tell the FC when to lower or raise the control movements to stabilise the plane.

The system that does this is called TPA, short for Throttle PID Attenuation. The TPA system relies on two values, TPA Percentage and TPA Breakpoint. TPA Breakpoint will set the throttle value where INAV uses the basic PIFF values we have tuned. The TPA Percentage is the modifying factor for the PIFF values depending on throttle value. This will counteract the over correction at high speeds and keeps the stabilisation at a constant level when gliding.

This is how to determine these values.

INAV Configurator - PID Tuning - PID Gains - TPA

First of all we set the TPA Breakpoint to the throttle value that we have used for AUTOTUNE and our manual tuning. This will be our center point where the basic PIFF values are active.

Getting the correct TPA Percentage is kind of a trial and error process. Rule of thumb: The higher your motor power, the higher the TPA Percentage.

On low powered planes that are tuned at 60% throttle, the TPA Breakpoint should be set to 1600. Set the TPA Percentage to an initial value of 40%.

  1. Launch the plane and fly level first
  2. Fly the plane around at the tuned throttle value; the value that is set as TPA Breakpoint
  3. Check how the plane behaves on roll and pitch inputs. Does it drift? Does it feel locked in?
  4. Ramp up the throttle to full power and check the behaviour again
    • If the plane starts to oscillate on one axis, you need to raise the TPA Percentage to limit the PIFF more at full speed
    • It is unlikely that the plane feels sluggish at high speeds due to the physical characteristics of a plane.
  5. Now lower the throttle down and fly at the minimum safe cruise speed we have determined in Phase One
    • If the plane gets sluggish and starts to wobble around, you need to raise the TPA Percentage
    • But continue to the next test before changing the value
  6. Fly at a high altitude to do a safe long dive
  7. Cut the throttle and push the nose down at a 45° angle and go into a fast glide dive
    • If the plane starts to oscillate in this case, the TPA Percentage is too high, lower it down to get a smooth dive
    • If the plane does dive smoothly, you can change the value if needed related to the previous tests

How INAV implements the TPA right now is not perfect, and can’t be optimised for all three situations. You need to find the correct balance between fast flight, slow flight and glide dives. This might change in the future if INAV starts supporting Airspeed Sensors, to attenuate the PIFF values to the actual airspeed instead to the throttle. The biggest issue is the glide dive on heavy long range setups as they can gain fast speeds on a dive and a high TPA boost on low throttle can cause oscillations.

Rate acceleration for smoother flights

At this point, your plane is now tuned very well and hopefully nicely locked in, in flight. Now its time to make hard manoeuvres a bit smoother. As you might remember during PIFF Optimisation, we left some overshoots in favour to more intense stabilisation, when coming out of fast rolls and loops. To counteract that, we will now physically limit the acceleration for starting and stopping roll and pitch movements.

On the Advanced Tuning page there is a section called Rate Acceleration Limit. As the name suggests, the function limits the rate acceleration on the roll and pitch axis. By default, the limit is disabled. Limiting the rate acceleration forces the flight controller to incrementally raise the roll and pitch movement. Instead of trying to force the full speed instantly, which is physically not possible.

Smaller builds can easily reach their maximum rates quickly. But larger planes need some time to gain their full axis rates. For starting a roll or pitch movement, this limit is more an optical benefit, to have a smoother and more natural movement. But when stopping a rapid movement, this can massively increase the stabilisation behaviour. This is because it lowers the amount of overshoot and oscillation on high P Gains.

  • On small builds like 600mm race wings, a value between 1500 and 2000°/s² is a good value to start with.
  • Crafts up to 1000mm can use lower values like 1200-1500°/s².
  • Large Long-range crafts like a Skyhunter can be set to 1000°/s² or even lower.

As a side effect, this limit will also apply to automatic flight modes, like way points. It will avoid the rapid and stiff direction changes that INAV usually does.

WARNING: Setting the rate limit lower, will also reduce your maneuverability in case of an obstacle avoidance situation. So double-check what you set here before the flight to avoid a situation where you can barely control your craft. For proximity flying, this rate limit should be kept very high; bcause it can cause a slight delay in your controls.

Since INAV 2.5 there is a new CLI Value called “nav_fw_control_smoothness”. This value will smooth out navigation modes to do softer bank and pitch manoeuvres, especially when navigating between way points or turning into RTH. This will also help for more natural flying but only applies to navigation modes and is more effective there than a low Acceleration limit only.

INAV Plane Tuning Masterclass – Phase Two Conclusion

At this point of the INAV Plane Tuning Masterclass, you have a craft that can be flown well in any situation. It has good stabilisation, optimal rates and smooth flight. This counts for flights not only in ACRO mode but also for ANGLE and HORIZON flight modes.

In Phase Three of the INAV Plane Tuning Masterclass, we will further optimise some configurations for automated flight modes like POSHOLD (loiter), RTH, CRUISE and NAV WAYPOINT. From here on you definitely need a working GPS module and also either black box recording or DVR recording of your OSD. We will set up some values, that are hard to figure out just by your naked eye, but still are important for the flight behaviour.