1 of 62

Chapter 6

Autopilot Design

TexPoint fonts used in EMF.

Read the TexPoint manual before you delete this box.: AAAAA

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 1

2 of 62

Architecture

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 2

3 of 62

Outline

  • Different Options for Autopilot Design
    • Successive Loop Closure
    • Total Energy Control
    • LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 3

4 of 62

Successive Loop Closure

Open-loop system

Closed-loop system

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 4

5 of 62

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: Slide 5

6 of 62

SLC: Two Loops Closed

At frequencies below

middle-loop bandwidth,

approximate CLTF as 1,

then design outer loop

Key idea: Each successive loop must be lower in bandwidth� --- typically by a factor of 10 or more

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 6

7 of 62

Lateral-directional Autopilot

Yaw Damper

Roll Control

Course Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 7

8 of 62

Roll Autopilot

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 8

9 of 62

Roll Autopilot

  • The book suggests using an integrator on roll in the roll loop to correct for any steady-state error due to disturbances

  • Our current suggestion is to not have an integrator on inner loops, including the roll loop

    • Integrators add delay and instability -> not a good idea for inner-most loops

    • An integrator will be used on the course loop to correct for steady-state errors

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 9

10 of 62

Lateral-directional Autopilot

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 10

11 of 62

Course Hold Loop

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 11

12 of 62

TF Zero Affects Response

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 12

13 of 62

Course Hold Loop

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 13

14 of 62

Yaw Damper

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 14

15 of 62

Lateral Autopilot - Summary

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 15

16 of 62

Lateral Autopilot – In Flight Tuning

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 16

17 of 62

Longitudinal Flight Regimes

Take-off zone

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 17

18 of 62

Altitude Hold Using Commanded Pitch

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 18

19 of 62

Pitch Attitude Hold

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 19

20 of 62

Altitude Hold Using Commanded Pitch

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 20

21 of 62

Altitude from Pitch – Simplified

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 21

22 of 62

Altitude from Pitch Gain Calculations

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 22

23 of 62

Airspeed Hold Using Throttle

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 23

24 of 62

Airspeed from Throttle Gain Calculations

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 24

25 of 62

Longitudinal Autopilot - Summary

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 25

26 of 62

Longitudinal Autopilot – In Flight Tuning

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 26

27 of 62

Python Implementation

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 27

28 of 62

Wrap Function

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 28

29 of 62

PID Loop Implementation

PID continuous time

Taking Laplace transform…

Use bandwidth-limited differentiator to reduce noise

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 29

30 of 62

PID Loop Implementation

Tustin’s rule or trapezoidal rule:

Integrator:

Differentiator:

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 30

31 of 62

Integrator Anti-wind-up

control before anti-wind-up update

control after anti-wind-up update

is anti-wind-up update

subtracting top two equations

Let

value of control after saturation is applied

solving…

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 31

32 of 62

PID Implementation (Python)

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 32

33 of 62

PID Implementation (Matlab)

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 33

34 of 62

Yaw Damper Implementation

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 34

35 of 62

Yaw Damper Implementation

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 35

36 of 62

Yaw Damper Implementation

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 36

37 of 62

Yaw Damper Implementation Alternative

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 37

38 of 62

Simulation Project

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 38

39 of 62

Outline

  • Successive Loop Closure
  • Total Energy Control
  • LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 39

40 of 62

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 40

41 of 62

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 41

42 of 62

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 42

43 of 62

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 43

44 of 62

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 44

45 of 62

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 45

46 of 62

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 46

47 of 62

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 47

48 of 62

Step in Altitude, Constant Airspeed

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 48

49 of 62

Step in Airspeed, Constant Altitude

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 49

50 of 62

Step in Altitude and Airspeed

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 50

51 of 62

  • Observations
    • TECS seems to work better than successive loop closure.
    • Removes needs for different flight modes.
    • Nonlinear TECS seems to better, but the Ardupilot controller works very well.

Total Energy Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 51

52 of 62

Outline

  • Successive Loop Closure
  • Total Energy Control
  • LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 52

53 of 62

LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 53

54 of 62

LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 54

55 of 62

LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 55

56 of 62

LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 56

57 of 62

LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 57

58 of 62

LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 58

59 of 62

LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 59

60 of 62

LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 60

61 of 62

LQR Control

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 61

62 of 62

Python Code

Beard & McLain, “Small Unmanned Aircraft,” Princeton University Press, 2012, Chapter 6: Slide 62