Guidance, Navigation and Control · Theory · M5
M5-T3 — Dynamic Inversion and Its Incremental Form
Inversion makes a nonlinear plant look like a double integrator and then designs for the double integrator. It is only as good as the model it cancels. The incremental form cancels what it measures.
A linear design asks the plant to behave like its linearization. Dynamic inversion asks instead for the control that makes the plant behave like a chosen linear system, whatever the nonlinearity is, provided the nonlinearity is known. This lesson derives the method for Hopper's pitch channel, shows what happens when the model is wrong, and presents the incremental form (INDI), which uses a measured angular acceleration in place of the model and needs only the control effectiveness.
Learning objectives
After this lesson, you should be able to:
- Derive the dynamic-inversion law for a plant of the form θ̈ = f(x) + bδ and the resulting linear error dynamics.
- State what the method assumes and show the steady-state error caused by an unmodelled term.
- Write the incremental law and show that it does not need the model of f.
- State the condition on the control-effectiveness estimate under which INDI converges.
The intuition
UAV M5-T5: Attitude control used a law that cancels the gyroscopic term of a multirotor and UAV M5-T16: Disturbance rejection and wind compensation estimated a disturbance so as to subtract it. Both are special cases of one idea: if the plant says acceleration equals something plus effectiveness times input, pick the input that makes the acceleration what you want.
Cancel and command
Hopper's pitch obeys . The function holds everything the vehicle does by itself: the unstable gravity-gradient-like term , aerodynamic moments, and any other term. Choose : then , and the plant has become a double integrator driven by a virtual input . Design with the poles you like. That is dynamic inversion, and one design serves every flight condition for which and are known.
Where it breaks
The cancellation is exact only if the model is. Give Hopper an aerodynamic moment of rad/s² that the model omits, and the loop settles with pitch at 0.20 rad: the error stays whenever is nonzero, held by a force the controller never sees. The method has no integral action, and its accuracy is the accuracy of the model.
The incremental form
The remedy replaces the model of by a measurement. If the angular acceleration is measured, the change of the command needed to move it from where it is to where it should be is . So . Whatever is, it is already contained in the measured acceleration, so only the control effectiveness appears. The same loop, with the same unmodelled moment, goes to zero. The price is a measurement of angular acceleration (a filtered derivative of the gyro) and a loop that must be fast enough that the previous command is still the right basis for the next.
Dynamic inversion trusts the model of the nonlinearity. INDI trusts a measurement of the acceleration and a rough value of the control effectiveness, which is much easier to know.
Definitions
- Control-affine plant
- A plant of the form , linear in the input with effectiveness .
- Virtual input
- The acceleration the loop asks for. The inversion turns the real input into whatever produces it.
- Feedback linearization
- A change of input that cancels the nonlinearity so that the loop from to the output is linear. It needs a model of and .
- INDI
- Incremental nonlinear dynamic inversion: , using the measured acceleration. It needs only .
Derivation: the inversion, its steady-state error, and the INDI condition
The pitch channel with a model of f that is wrong by an amount .
The plant and the inversion law, taking .
Substitute. The model error enters as an additive acceleration that the loop does not see.
With the virtual input of the design.
At a steady state the derivatives vanish. For the unmodelled moment of the example, and give 0.197 rad.
INDI
The acceleration at step , for whatever the unknown is.
For a fast loop changes little in one step, so it drops out of the difference. This is the step that removes the model.
Insert the incremental law. The acceleration error is multiplied by at each step.
The error decays exactly when the multiplier is smaller than one in magnitude. Within that range the loop follows the commanded acceleration whatever is.
Inversion removes the nonlinearity by trusting a model; INDI removes the need for the model by trusting a measurement of the acceleration. What remains is the control effectiveness, which must be known to a factor of two, and a loop fast enough that the previous step is a good base.
A worked example
Hopper's pitch channel with the poles at (), an unmodelled moment rad/s², a start at 0.3 rad and a 100 Hz loop.
- Dynamic inversion, exact effectiveness. After 12 s the pitch is +0.197 rad, held there by the unmodelled moment, and the gimbal is at −0.166 rad (beyond the 0.15 rad limit, so saturation would make it worse).
- INDI, exact effectiveness. The pitch goes to 0 (to 10⁻¹⁶ rad) and the gimbal settles at −0.102 rad, the value that cancels the moment at the equilibrium.
- INDI with an estimate of the effectiveness that is wrong. For = 0.5, 1.0, 1.5, 1.9 the pitch converges to zero and its largest excursion stays at the initial 0.3 rad. For 2.1 it diverges: the acceleration error is multiplied by −1.1 at every step, so it grows without bound and the pitch reaches 10⁷⁴ rad within the 12 s simulated.
- Dynamic inversion with the same errors. Because the effectiveness error scales the whole control, leaves the pitch at 0.625 rad and 1.9 at 0.080: the error depends smoothly on the estimate and never vanishes.
- Reading. INDI is exact for any unmodelled moment, and it is bounded by a sharp threshold on the effectiveness. Inversion degrades gently and never reaches zero.
import math
import gnckit as g
lam2, b = 0.49, 19.62
wn, zeta = 4.0, 0.7
kp, kd = wn ** 2, 2 * zeta * wn # the desired acceleration nu = -kp theta - kd q (a double integrator with these poles)
def f_true(th):
return 2.0 + 3.0 * math.sin(2 * th) # an unmodelled aerodynamic moment per inertia (rad/s^2)
def rate(th, q, d):
return lam2 * th + b * d + f_true(th)
dt = 0.01
def simulate(controller, bhat, T=12.0, th0=0.3):
th, q, d_prev = th0, 0.0, 0.0
hist = []
for k in range(int(T / dt)):
a_meas = rate(th, q, d_prev) # the measured angular acceleration, produced by the previous command
nu = -kp * th - kd * q
if controller == 'DI':
d = (nu - lam2 * th) / bhat
else:
d = d_prev + (nu - a_meas) / bhat
# advance one step with the command held (RK4 on the two-state system)
def fn(t, s):
return [s[1], rate(s[0], s[1], d)]
th, q = g.rk4_step(fn, 0.0, [th, q], dt)
d_prev = d
hist.append((th, q, d))
return hist
print('pitch with an unmodelled moment 2 + 3 sin(2 theta) rad/s^2, desired poles (wn 4, zeta 0.7):')
for name in ('DI', 'INDI'):
h = simulate(name, b)
print(f' {name:4s} with the exact b: pitch after 12 s = {h[-1][0]:+.4f} rad, command {h[-1][2]:+.4f} rad')
print('INDI with a wrong estimate of the control effectiveness bhat (ratio b / bhat), 12 s from 0.3 rad:')
for ratio in (0.5, 1.0, 1.5, 1.9, 2.1):
h = simulate('INDI', b / ratio)
mx = max(abs(s[0]) for s in h)
print(f' b/bhat = {ratio:3.1f}: pitch after 12 s = {h[-1][0]:+.2e} rad, largest |pitch| = {mx:.2e}')
print('DI with the same wrong estimate:')
for ratio in (0.5, 1.0, 1.5, 1.9, 2.1):
h = simulate('DI', b / ratio)
print(f' b/bhat = {ratio:3.1f}: pitch after 12 s = {h[-1][0]:+.4f} rad')pitch with an unmodelled moment 2 + 3 sin(2 theta) rad/s^2, desired poles (wn 4, zeta 0.7): DI with the exact b: pitch after 12 s = +0.1970 rad, command -0.1655 rad INDI with the exact b: pitch after 12 s = -0.0000 rad, command -0.1019 rad INDI with a wrong estimate of the control effectiveness bhat (ratio b / bhat), 12 s from 0.3 rad: b/bhat = 0.5: pitch after 12 s = -1.89e-16 rad, largest |pitch| = 3.00e-01 b/bhat = 1.0: pitch after 12 s = -7.67e-16 rad, largest |pitch| = 3.00e-01 b/bhat = 1.5: pitch after 12 s = -6.61e-16 rad, largest |pitch| = 3.00e-01 b/bhat = 1.9: pitch after 12 s = -5.56e-16 rad, largest |pitch| = 2.99e-01 b/bhat = 2.1: pitch after 12 s = +1.18e+74 rad, largest |pitch| = 1.18e+74 DI with the same wrong estimate: b/bhat = 0.5: pitch after 12 s = +0.6250 rad b/bhat = 1.0: pitch after 12 s = +0.1970 rad b/bhat = 1.5: pitch after 12 s = +0.1093 rad b/bhat = 1.9: pitch after 12 s = +0.0804 rad b/bhat = 2.1: pitch after 12 s = +0.0710 rad
In robotics
INDI flies in research aircraft and in the cascaded attitude controllers of agile multirotors.
- Aircraft and multirotors. INDI replaces a model of aerodynamic moments, which is hard to identify, by a measurement of angular acceleration from the gyro, and needs only the control effectiveness, which is much easier to identify. This is why the method has been adopted for high-angle-of-attack flight and aggressive multirotors.
- Dynamic inversion alone. Where the model is very good (a rigid arm with known inertia, a spacecraft with reaction wheels) inversion is accurate and has no derivative noise. Robotics calls it computed torque.
- The measurement. The acceleration comes from differentiating a gyro, which amplifies noise. A low-pass filter is applied, and the same filter must be applied to the actuator command so the two are synchronized. The delay of the filter limits how fast the loop can be, as in M3-T6: Limits of Performance: Delay, Right-Half-Plane Zeros and the Bode Integral.
- Actuator limits. An inversion law has no notion of saturation or rate limit. The commanded increment can ask for more than the gimbal gives, and the allocation of M5-T6: Control Allocation is the place where limits are respected.
- Robustness. The cancellation is high gain in disguise. The loop with delay and actuator lag must be checked with the tools of module 3; disk margins in M5-T7: Robustness Beyond Gain and Phase Margin are a good measure.
The robot-learning counterpart, with a learned model in place of , is in Robot Learning M9-T4: Hybrid Learning and Control Systems.
Common misconceptions
“Dynamic inversion makes the loop linear regardless of the plant.”
Only if the model of the plant is exact. With an error, the loop has an additive disturbance equal to the model error, and the steady-state offset is that error divided by the position gain.
“INDI needs no model at all.”
It needs the control effectiveness to within a factor of two, a measured acceleration, and a loop fast enough that the unmodelled term changes little in one step. It removes the model of the dynamics, not of the actuator.
“Cancelling a stable nonlinearity is harmless.”
The cancellation puts a high gain in the loop, whose cost is margin against delay and noise. A nonlinearity that was helping (damping) is also thrown away.
“A larger estimate of effectiveness is safer.”
It is safer against divergence, which needs , but the loop is slower: the error shrinks by per step, closer to 1 as grows. Too large an estimate gives a sluggish loop.
“The measured acceleration is free.”
It is a differentiated, filtered gyro signal, with noise and delay. The quality of INDI is limited by this signal and by the actuator lag, which has to be modelled in the filter.
Key takeaways
- Dynamic inversion picks the input that makes the plant a double integrator driven by the virtual input .
- A model error enters as a disturbance; for Hopper's unmodelled moment the loop settles at 0.197 rad.
- INDI uses the measured acceleration: , and removes the dependence on .
- INDI converges if and only if in the ideal discrete loop; at 2.1 the pitch of the example diverges.
- Both methods are high-gain cancellations: they need margin checks, and they know nothing about saturation.
- The practical cost of INDI is a filtered acceleration measurement, with its delay and noise.
References and further reading
Each source is marked free or paid. Free to read does not mean free to reuse: the course resources page lists every source with its licence.
- K. J. Åström and R. M. Murray, Feedback Systems, 2nd edition, Princeton University Press, 2021 , the discussion of feedback linearization in the nonlinear control sections. Free to read as the authors' PDF; the book is copyrighted.
- R. Tedrake, Underactuated Robotics, the sections on feedback linearization and computed torque . Free to read; licence CC BY-NC-ND 4.0.
- E. J. J. Smeur, Q. P. Chu and G. C. H. E. de Croon, "Adaptive incremental nonlinear dynamic inversion for attitude control of micro air vehicles", Journal of Guidance, Control, and Dynamics 39(3), 2016. Paid (AIAA); the TU Delft repository holds free copies of related theses.
- H. K. Khalil, Nonlinear Systems, 3rd edition, Prentice Hall, 2002, the chapter on feedback linearization. Paid.
Knowledge check
Three questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
Hopper's inversion law uses a model whose unmodelled moment is a constant 2 rad/s² and kp = 16. What pitch does the loop settle at, and what would INDI do?
Explanation
The model error enters as a constant disturbance, so at a steady state kp θ = 2 and θ = 2/16 = 0.125 rad (for a constant error: the example had a state-dependent term, and settled at 0.197). INDI measures the acceleration, which includes the 2 rad/s², and changes the command until the measured acceleration equals ν, so the steady state has ν = 0 and the pitch goes to zero, however large the constant is, until the gimbal saturates.
Question 2
In INDI the estimate b̂ is twice the true b. What happens to the speed of the loop and does it still converge?
Explanation
The ratio b/b̂ is 0.5, inside the interval (0, 2), so it converges. The error is multiplied by 1 − 0.5 = 0.5 at each step, so it halves every sample: stable, but slower than the dead-beat response obtained with b̂ = b, which removes the error in one step. A conservative (larger) estimate gives a safe but sluggish loop.
Question 3
Why must the loop of INDI be fast compared with the unmodelled dynamics f?
Explanation
The step from the second derivation line assumes f does not change between samples, so the measured acceleration of the previous step contains the same f as the present one and drops out of the difference. If f changes appreciably in a step, the measurement is stale and the cancellation is partial, and the unmodelled change acts as a disturbance. The loop has to be several times faster than the changes in f it is meant to reject.
What’s next
Related content
Nothing below is required to finish this lesson.
- BeforeM5-T2: Gain Scheduling
Schedule a linear design on a measured variable such as dynamic pressure, and name the conditions under which the scheduled loop is no longer the designed loop.
Other courses on this site treat neighbouring topics from their own angle:
- Lab: Build a CBF Safety Filter
- Navigation M7-T2: Safety Filters: Control Barrier Functions
- UAV M5-T5: Attitude control
- UAV M5-T16: Disturbance rejection and wind compensation
- UAV M1-T6: Roll, pitch, yaw and thrust generation
- Linear Algebra M6-T7: The Moore-Penrose Pseudoinverse
- Linear Algebra M8-T9: Null-Space Control
- Robot Learning M9-T4: Hybrid Learning and Control Systems
This course leaves the following to the pages that already teach them:
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.