Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 1/33
Successive Loop Closure
Open-loop system
Closed-loop system
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 2/33
SLC: Inner Loop Closed
At frequencies below
inner-loop bandwidth,
approximate CLTF as 1,
then design middle loop
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 3/33
SLC: Two Loops Closed
At frequencies below
middle-loop bandwidth,
approximate CLTF as 1,
then design outer loop
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 4/33
Saturation Limits
uunsat
b0 k p c !n2 c
Y (s) = 2 Y (s) = 2 Y (s)
s + (a1 + b0 kd )s + (a0 + b0 kp ) s + 2⇣!n s + !n2
gives
2⇣!n a1 p
kd = , where !n = a 0 + b0 k p .
b0
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 5/33
Lateral-directional Autopilot
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 6/33
Roll Autopilot
max
a
kp a 2 !n2
H / c (s) = =
s2 + (a 1
+ a 2 kd )s + kp a 2
s2 + 2⇣ !n s + !n2
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 7/33
Linearization Effects and Disturbances
max
a
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 9/33
Add Integrator to Reject Disturbances
max
a
✓ ◆
s
= d
s3 + (a 1 + a 2 kd )s2 + a 2 kp s + a 2 ki 2
0 ⇣ ⌘ 1
ki
a 2 k p s + kp
B C c
+@ 3 A
s + (a 1 + a 2 kd )s2 + a 2 kp s + a 2 ki
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 10/33
Roll loop – Integrator – Root Locus
25
20
15
Axis
10
imaginary axis
5
Imaginary
−5
−10
−15
−20
−25
−30 −20 −10 0 10 20
real axis
Real Axis
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 11/33
Course Hold Loop
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 12/33
TF Zero Affects Response
10 1.4
−10 1.2
magnitude (dB)
−20
−30 1
−40
−50 0.8
−60
0
0.6
phase (deg)
−30
0.4
−60 0.2
−90 0
−2 −1 0 1 2 3
10 10 10 10 10 10 0 2 4 6 8 10 12
frequency (rad/sec) (sec)
2⇣!n s + !n2
H= 2 Canonical 2nd-order TF
s + 2⇣!n s + !n2
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 13/33
Course Hold Loop
1
!n = !n kp = 2⇣ !n Vg /g ki = !n2 Vg /g
W
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 14/33
Sideslip Hold
max
r
e
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 15/33
Lateral Autopilot - Summary
If model is known, the the design parameters are
Inner Loop (roll attitude hold)
• emax - Error in roll when aileron just saturates.
• ⇣ - Damping ratio for roll attitude loop.
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 16/33
Lateral Autopilot – In Flight Tuning
If model is not known, and autopilot must be tuned in flight, then the
following gains are tuned one at a time, in this specific order:
Inner Loop (roll attitude hold)
• kd - Increase kd until onset of instability, and the back o↵ by 20%.
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 17/33
Longitudinal Flight Regimes
Descend zone
Climb zone
Take-off zone
✓c
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 18/33
Pitch Attitude Hold
max
e
k p ✓ a ✓3 K✓DC !n2 ✓
H✓/✓c (s) = = 2
s2 + (a✓1 + kd✓ a✓3 )s + (a✓2 + kp✓ a✓3 ) s + 2⇣✓ !n✓ s + !n2 ✓
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 19/33
Altitude Hold Using Commanded Pitch
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 20/33
Altitude from Pitch – Simplified
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 21/33
Altitude from Pitch Gain Calculations
2⇣!n s + !n2
H= 2
s + 2⇣!n s + !n2
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 22/33
Airspeed Hold Using Commanded Pitch
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 23/33
Airspeed from Pitch Gain Calculations
0 ✓ ◆ 1
ki V
K✓DC gkpV2 s + 2 !
B kpV C c s
V̄a (s) = B C V̄ (s)+
2
@ s2 + (aV dV (s)
1
K✓ gkp )s
DC V2
K✓DC gkiV2 A a s2 + (aV1 K✓DC gkpV2 )s K✓DC gkiV2
2⇣!n s + !n2
H= 2
s + 2⇣!n s + !n2
Design parameters are bandwidth separation WV2 and damping ratio ⇣V2
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 24/33
Airspeed Hold Using Throttle
kiV
s
V̄ac ¯t V̄a
kpV
✓ ◆ ✓ ◆
aV2 (kpV s + kiV ) s
V̄a = V̄ac + dV
s2 + (aV1 + aV2 kpV )s + aV2 kiV s2 + (aV1 + aV2 kpV )s + aV2 kiV
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 25/33
Airspeed Hold Using Throttle
✓ ◆ ✓ ◆
aV2 (kpV s + kiV ) s
V̄a = V̄ac + dV
s2 + (aV1 + aV2 kpV )s + aV2 kiV s2 + (aV1 + aV2 kpV )s + aV2 kiV
⇤ k iV
t = t + kpV (Vac Va ) + (Vac Va )
s
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 26/33
we have described four different longitudinal autopilot modes: (1) pitch atti-
tude hold, (2) altitude hold using commanded pitch, (3) airspeed hold using
commanded pitch, and (4) airspeed hold using throttle. These longitudinal
control modes can be combined to create the altitude control state machine
Altitude Control State Machine
shown in Figure 6.20. In the climb zone, the throttle is set to its maximum
value ( t = 1) and the airspeed hold from commanded pitch mode is used to
Longitudinal Autopilot - Summary
If model is known, the the design parameters are
Inner Loop (pitch attitude hold)
• emax
✓ - Error in pitch when elevator just saturates.
• ⇣✓ - Damping ratio for pitch attitude loop.
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 29/33
PID Loop Implementation
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 30/33
PID Loop Implementation
Tustin’s rule or trapezoidal rule
Integrator term
Differentiator term
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 31/33
Integrator Anti-wind-up
control before anti-wind-up update
is anti-wind-up update
solving…
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 32/33
Transforming to the time domain, we have
# $ # $
2τ − Ts 2
D[n] = D[n − 1] + (E [n] − E [n − 1]) . (6.30)
2τ + Ts 2τ + Ts
PID Implementation
Matlab code that implements a general PID loop is shown below.
Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: 33/33