1 of 53

Chapter 8

State Estimation

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

2 of 53

Architecture

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

3 of 53

Why estimate states?

  • State information needed to control aircraft
  • We measure many things
    • accelerations, angular rates, pressure altitude, dynamic pressure (airspeed), magnetic heading (sometimes), GPS position
  • Don’t have direct measurements of everything we need

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

4 of 53

Benchmark Maneuver

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

5 of 53

Inverting Sensor Measurement Model

  • Several states can be estimated by inverting sensor measurement model
    • Angular rates, altitude, airspeed
    • LPF denotes low pass filter

Mathematical Model

State Estimate

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

6 of 53

The alpha-filter

Suppose that your sensor gives noisy data as shown on the right.

The objective is to process this data to smooth out the noise.

The standard method is to use an alpha-filter:

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

7 of 53

The alpha-filter

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

8 of 53

The alpha-filter

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

9 of 53

The alpha-filter: a deeper look

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

10 of 53

The alpha-filter: a deeper look

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

11 of 53

The alpha-filter: �Python Implementation

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

12 of 53

Inverting Sensor Measurement Model

  • Several states can be estimated by inverting sensor measurement model
    • Angular rates, altitude, airspeed
    • LPF denotes low pass filter

Mathematical Model

State Estimate

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

13 of 53

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

14 of 53

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

15 of 53

Inverting Sensor Measurement Model

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

16 of 53

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

17 of 53

Inverting Sensor Measurement Model

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

18 of 53

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

19 of 53

Dynamic Observer Theory

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

20 of 53

Predictor-Corrector Structure

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

21 of 53

Predictor-Corrector Structure

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

22 of 53

Kalman Filter

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

23 of 53

Quadratic Forms

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

24 of 53

Multivariate Gaussian

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

25 of 53

Kalman Filter

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

26 of 53

Kalman Filter Derivation

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

27 of 53

Kalman Filter Derivation

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

28 of 53

Kalman Filter Derivation

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

29 of 53

Kalman Filter Derivation

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

30 of 53

Kalman Filter Derivation

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

31 of 53

Kalman Filter Derivation

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

32 of 53

Covariance Update

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

33 of 53

Covariance Update

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

34 of 53

Covariance Update

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

35 of 53

Kalman Filter Derivation

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

36 of 53

Extended Kalman Filter

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

37 of 53

Extended Kalman Filter, cont.

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

38 of 53

EKF Algorithm

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

39 of 53

Attitude Estimation Using EKF

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

40 of 53

Attitude Estimation Using EKF

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

41 of 53

Attitude Estimation Using EKF

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

42 of 53

Attitude Estimation Using EKF

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

43 of 53

Attitude Estimation Results

Not perfect, but significantly better!

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

44 of 53

GPS Smoothing

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

45 of 53

GPS Smoothing

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

46 of 53

GPS Smoothing

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

47 of 53

GPS Smoothing

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

48 of 53

GPS Smoothing

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

49 of 53

GPS Smoothing

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

50 of 53

GPS Smoothing Results

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

51 of 53

Measurement Gating

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

52 of 53

Measurement Gating

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

53 of 53

Suggestions for Tuning Your EKF

  • Implement EKF in steps
    • Attitude estimation
    • GPS smoother
  • Test and tune each component independently and thoroughly
    • Attitude estimator first
    • GPS smoother second
  • As a first step, make sure your filter estimates track the states when sensors are perfect (no sensor error). This will expose coding errors and show the limits of performance of your filter.
  • Keep the wind set to zero until you are confident that your filter is well tuned.
  • We know R pretty well typically. Tune filter by changing Q.
  • Tune filter by focusing on individual states. Give inputs to those states while keeping other states “quiet”. Adjust Q value corresponding to state of interest. Tune by trial and error (use your brain to make a good guess!).
  • Don’t put extreme inputs into the system when tuning the filter (e.g., large steps). Your filter will have its own dynamic limits – don’t make the problem impossibly difficult.
  • Tune your controllers so that the response of the aircraft to typical inputs is smooth and graceful. Abrupt and jerky state dynamics are difficult to estimate.
  • Check your equations AGAIN!

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