# INDI control for fixed-wing airplanes

## Introduction

Incremental Nonlinear Dynamic Inversion (INDI) has the potential to revolutionize the way we control small fixed-wing airplanes. Nowadays PID with feed-forward is the most common control strategy, but it is difficult to tune and get the best performance.

I graduated on the subject in 2016, by applying a simplification to INDI that made it very suitable to control small
helicopters. The core idea of this simplification is that there is a direct relationship between the control input and
roll- and pitch *rates*.

In this post, I want to explore the possibility of applying a similar simplification for fixed-wing airplane control. My favorite autopilot software INAV already has an auto-tune procedure in place that assumes a direct relationship between control inputs and rotational rates. Perhaps these values can even be used in a new INDI rate controller.

## The core principle of INDI

The details of INDI for helicopter control can be read in my Graduation Thesis. The core principle of INDI is that we don't care about the absolute value of the controlled output. For example: when applying this idea to an airplane for pitch rate control: The controller does not calculate the absolute position of the elevator servo. Instead, the controller looks at the current pitch rate of the airplane. If this is not sufficient, more elevator deflection is commanded and vice versa.

Another way to look at it: Instead of a PID controller, it is just an I-controller. The I gain is set relatively high ( it is the inverse of the control effectiveness). Normally this would result in a very unstable system because the integrator keeps compensating for the same error. But the INDI controller internally keeps track of the part of the error that has already been compensated for. By doing so, the INDI controller is able to react very quickly to commands and disturbances. Also it eliminates steady-state errors much faster than a traditional PID controller.

In an ideal world, with no disturbances and a perfectly estimated control effectiveness, the response of an INDI controller is exactly the same as a feed-forward controller. But to handle to disturbances and control effectiveness mismatch, I think INDI is a more robust solution compared to PIDFF. I also think it will be much simpler to tune, as it requires less parameters.

## Fixed-wing rate dynamics

If I remember correctly from my flight dynamics class, the roll rate dynamics is typically an overdamped first order system. The pitch- and yaw rate dynamics can be approximated by a second order system. I will leave the equations for another time. In any case, the steady-state rates for all three axis are directly proportional with the control surface deflection.

The natural dynamics of a small model airplane are typically very fast. I do not aim to make the controller faster than the natural dynamics, although this would still be possible by increasing the control effectiveness gain.

To keep the controller simple, we estimate the rate dynamics for all three axis as a first order system. Technically that is incorrect for pitch and yaw, but from experience I know that an INDI controller is very robust against model inaccuracies. The first order model includes both the dynamics of the actuator and the dynamics of the airplane.

## Parameters of the controller

Similar to the PIDFF controller in INAV, we need the feedforward gain. This is effectively the inverse of the control effectiveness. We don't need P-, I- and D-gains. Instead, we just need 1 parameter (for each axis) to describe reaction speed of the airplane dynamics. This parameter is the cutoff frequency of the first-order dynamic model. So the only two parameters are:

- Control effectiveness (inverse of feedforward)
- Dynamic model cutoff frequency or reaction time

Because of the robustness of INDI, it is possible to start with a high value of control effectiveness and a low cutoff frequency for the dynamic model. INAV already has a procedure to estimate the control effectiveness (inverse of feedforward). It is technically also possible to automatically learn the cutoff frequency of the dynamic model. We can then get optimal performance out of the airplane without any tuning!

## Launching (integrator wind-up)

The only disadvantage of INDI is experienced when trying to launch the airplane. Because the controller is essentially an agressive integrator, the control surfaces will quickly reach their maximum deflections before the airplane is even launched.

Since a PIDFF controller has a similar problem with the integrator, I need to check how INAV handles integrator wind-up before launch. Perhaps the same logic can be applied for INDI.

Before the integrator is enabled, the controller could temporarily be only feed-forward. This works relatively well, because then the control surface deflections are determined by the pitch and roll angle errors. If the pitch trim is far off, there will be a large error in the pitch angle. Preferably the integrator is enabled as soon as possible after the airplane is released.

## Implementing in INAV

Since this type of control is considered experimental and we don't want any airplanes to crash, it should be possible to switch dynamically between a PIDFF controller and the new INDI controller. We should perform software in the loop simulations (SITL) before trying the algorithm on a real airplane. The next step is to work out the details on how to implement this controller in INAV.