ON THE AUTOMATIC GENERATION OF RECURSIVE ATTITUDE DETERMINATION - - PowerPoint PPT Presentation

on the automatic generation of recursive attitude
SMART_READER_LITE
LIVE PREVIEW

ON THE AUTOMATIC GENERATION OF RECURSIVE ATTITUDE DETERMINATION - - PowerPoint PPT Presentation

ON THE AUTOMATIC GENERATION OF RECURSIVE ATTITUDE DETERMINATION ALGORITHMS Presented at the AAS GN&C Conference in Breckenridge, CO, on February the 7th, 2017 by Tucker McClure @ An Uncommon Lab WHAT ARE THE GOALS? EXAMINE


slide-1
SLIDE 1

ON THE AUTOMATIC GENERATION OF RECURSIVE ATTITUDE DETERMINATION ALGORITHMS

Presented at the AAS GN&C Conference in Breckenridge, CO,


  • n February the 7th, 2017


by Tucker McClure @ An Uncommon Lab

slide-2
SLIDE 2

WHAT ARE THE GOALS?

EXAMINE METHODOLOGY

▸ Create a filter early with

very little wasted effort.

▸ Create a more mature

filter later.

▸ Try variations on the filter.

20 40 60 Time (s)
  • 0.2
0.2 0.4 Attitude Error (~deg) MRP1 MRP2 MRP3 95% ST Boresight Errors 95% ST Cross Errors 10 20 30 40 50 60 Time (s)
  • 0.2
  • 0.1
0.1 0.2 Bias Error (deg/s) b1 b2 b3 95% Bias Errors 20 40 60 Time (s)
  • 0.08
  • 0.06
  • 0.04
  • 0.02
0.02 0.04 0.06 0.08 0.1 Nondimensionalized State Error 1000-Run Normalized Mean Estimate Error 1000-run NE for x1 1000-run NE for x2 1000-run NE for x3 1000-run NE for x4 1000-run NE for x5 1000-run NE for x6 95.0% Bounds (Theoretical) 95.0% Bounds (Empirical)

Early Single Run Later Mature Results

slide-3
SLIDE 3

WHAT KIND OF FILTER?

CLASSIC ATTITUDE ERROR & BIAS ESTIMATOR

▸ Filter state is attitude error and gyro bias ▸ Gyro for propagation ▸ Star tracker for attitude measurements

This example is kept simple to focus on the process, but the process works well when the problem is more complicated.

slide-4
SLIDE 4

WHAT ARE THE DEVELOPMENT PATHS FOR DIFFERENT FILTERS?

UKF EKF UDKF Spacecraft Simulator Filter Wrapper (Attitude Propagation)

Propagation & Observation Functions Propagation Jacobian
 & Effective Process Noise UKF Implementation EKF Implementation UDKF Implementation Unit Testing Unit Testing Unit Testing

Integration & Testing in Simulation

slide-5
SLIDE 5

WHAT ARE THE DEVELOPMENT PATHS FOR DIFFERENT FILTERS?

UKF EKF UDKF Spacecraft Simulator Filter Wrapper (Attitude Propagation)

Propagation & Observation Functions Propagation Jacobian
 & Effective Process Noise UKF Implementation EKF Implementation UDKF Implementation Unit Testing Unit Testing Unit Testing

Integration & Testing in Simulation

SUNK COSTS

slide-6
SLIDE 6

WHAT ARE THE DEVELOPMENT PATHS FOR DIFFERENT FILTERS?

UKF EKF UDKF Spacecraft Simulator Filter Wrapper (Attitude Propagation)

Propagation & Observation Functions Propagation Jacobian
 & Effective Process Noise UKF Implementation EKF Implementation UDKF Implementation Unit Testing Unit Testing Unit Testing

Integration & Testing in Simulation

SUNK COSTS AUTOMATED

slide-7
SLIDE 7

WHAT ARE THE DEVELOPMENT PATHS FOR DIFFERENT FILTERS?

UKF EKF UDKF Spacecraft Simulator Filter Wrapper (Attitude Propagation)

Propagation & Observation Functions Propagation Jacobian
 & Effective Process Noise UKF Implementation EKF Implementation UDKF Implementation Unit Testing Unit Testing Unit Testing

Integration & Testing in Simulation

SUNK COSTS AUTOMATED MANUAL

slide-8
SLIDE 8

HOW ARE ALGORITHMS GENERATED?

POTENTIAL FILTER GENERATORS

*kf AUTOFILTER

Generates custom code; has run in embedded environment. Filter architecture is emergent,
 not specified. Uses template for architecture. Pieces together best “snippets” that fit user’s “assumptions”. Fills in architecture with best components for user’s functions. Integrates user’s functions
 as black boxes. Manipulates fully symbolic
 user functions. Currently supported; has flight heritage Not funded; Dr. Johann Schumann may be able to provide code.

S E L E C T E D

  • J. Whittle & J. Schumann, “Automating the Implementation of Kalman Filter Algorithms”
slide-9
SLIDE 9

UKF

slide-10
SLIDE 10

WHAT’S THE FILTER WRAPPER DO?

FILTER WRAPPER: PROPAGATE, RUN FILTER, & CORRECT

▸ Subtract estimated bias from gyro measurement. ▸ Propagate the attitude. ▸ Calculate measurement residual (innovation vector). ▸ Run the UKF/EKF/UDKF filter. ▸ Correct the propagated attitude and bias.

slide-11
SLIDE 11

WHAT’S NEEDED FOR THE UKF?

TWO FUNCTIONS FOR THE UKF

Follows Crassidis & Markley, “Unscented Filtering for Spacecraft Attitude Estimation”.

f h

slide-12
SLIDE 12

WHAT’S NEEDED FOR THE UKF?

TWO FUNCTIONS FOR THE UKF

▸ Propagation function ▸ Given hypothetical attitude error, bias, and gyro noise

for last sample, determine current attitude error and bias (~six lines).

▸ Observation function ▸ Given hypothetical attitude error and bias, determine

current measurement error (one line).

Follows Crassidis & Markley, “Unscented Filtering for Spacecraft Attitude Estimation”

ẟxi,k = f(ẟxi,k-1, 𝜉i,k-1) ẟzi,k = h(ẟxi,k)

slide-13
SLIDE 13

HOW TO IMPLEMENT THE UKF?

UKF IMPLEMENTATION

▸ Sigma point propagation function name: f ▸ Sigma point observation function name: h ▸ Process noise covariance: Q (constant in workspace) ▸ Measurement noise covariance: R (constant in workspace) ▸ Measurement noise: additive (simplifies calculations) ▸ Specify when a new measurement is available. ▸ Output innovation covariance (for analysis).

slide-14
SLIDE 14

HOW TO IMPLEMENT THE UKF?

GENERATED FILES

▸ Initialization function (sets parameters, constants) ▸ Filter function (performs one step of the filter algorithm) ▸ Example simulation (used to unit-test filter) ▸ Example Monte-Carlo wrapper (used to unit-test filter

consistency)

slide-15
SLIDE 15

DOES IT WORK?

UKF UNIT TESTING

▸ Does filter appear to work? ▸ Is the covariance matrix consistent with real errors?

5 10 15 Time
  • 0.02
0.02 State 1 5 10 15 Time 0.02 0.04 State 2 5 10 15 Time
  • 0.04
  • 0.02
State 3 5 10 15 Time
  • 2
2 State 4 10-3 5 10 15 Time
  • 1
1 State 5 10-3 5 10 15 Time
  • 2
2 State 6 10-3 Truth Estimate 5 10 15 Time (s) 1 2 3 4 5 6 7 50-Run Normalized Estimation Error Squared 50-run Average NE 95.0% Bounds (Theoretical) 95.0% Bounds (Empirical)
slide-16
SLIDE 16 10 20 30 40 50 60

Time (s)

2 4 6 8

Total Error Squared 1000-Run Normalized Estimate Error Squared

1000-run Average NE 95.0% Bounds (Theoretical) 95.0% Bounds (Empirical)

HOW’D WE DO?

UKF SIMULATION RESULTS

20 40 60 Time (s)
  • 0.2
0.2 0.4 Attitude Error (~deg) MRP1 MRP2 MRP3 95% ST Boresight Errors 95% ST Cross Errors 10 20 30 40 50 60 Time (s)
  • 0.2
  • 0.1
0.1 0.2 Bias Error (deg/s) b1 b2 b3 95% Bias Errors

Single Run MC Results

▸ Results are as expected. ▸ Filter is consistent.

slide-17
SLIDE 17

EKF

slide-18
SLIDE 18

WHY TRY AN EKF?

EKF VS. UKF

▸ Embedded performance ▸ EKFs are much faster, especially when using sequential

scalar updates.

▸ EKFs require less RAM.

slide-19
SLIDE 19

WHAT’S NEEDED FOR THE EKF?

TWO MATRICES FOR THE EKF

Follows Lefferts, Markley, & Shuster, “Kalman Filtering for Spacecraft Attitude Estimation”.

F Qeff

slide-20
SLIDE 20

WHAT’S NEEDED FOR THE EKF?

TWO MATRICES FOR THE EKF

▸ Propagation Jacobian Function ▸ Produces Jacobian matrix for given state. ▸ Easy for this example problem; more difficult for bigger

states.

▸ Effective process noise ▸ Based on gyro’s angular random walk and bias random

walk.

Follows Lefferts, Markley, & Shuster, “Kalman Filtering for Spacecraft Attitude Estimation”

ẟxk ≅ F ẟxk-1 Qeff = Fq Q FqT

slide-21
SLIDE 21

ARE THE JACOBIAN AND PROCESS NOISE RIGHT?

QUICK VERIFICATION OF JACOBIAN AND PROCESS NOISE

▸ Can use finite-difference method with the UKF’s

propagation function to spot check Jacobian and effective process noise covariance matrix — a nice advantage to starting with the UKF.

slide-22
SLIDE 22

HOW TO IMPLEMENT THE EKF?

EKF IMPLEMENTATION

▸ Propagation function: none (filter wrapper does this) ▸ Propagation Jacobian function: F (our custom function) ▸ Process noise covariance: Qeff (constant in workspace) ▸ Observation function: first 3 indices of error state (simplifies calculation) ▸ Measurement noise covariance: R (constant in workspace) ▸ Correction method: sequential scalar updates ▸ Specify when a new measurement is available. ▸ Output innovation covariance (for analysis)

slide-23
SLIDE 23

HOW’D WE DO?

EKF RESULTS

20 40 60 Time (s)
  • 0.2
0.2 0.4 Attitude Error (~deg) MRP1 MRP2 MRP3 95% ST Boresight Errors 95% ST Cross Errors 10 20 30 40 50 60 Time (s)
  • 0.2
  • 0.1
0.1 0.2 Bias Error (deg/s) b1 b2 b3 95% Bias Errors

Single Run MC Results

▸ Virtually identical to

UKF.

20 40 60 Time (s) 1 2 3 4 5 6 7 Total Error Squared 1000-Run Normalized Estimate Error Squared 1000-run Average NE 95.0% Bounds (Theoretical) 95.0% Bounds (Empirical)
slide-24
SLIDE 24

HOW’D WE DO?

EKF RESULTS

20 40 60 Time (s)
  • 0.08
  • 0.06
  • 0.04
  • 0.02
0.02 0.04 0.06 0.08 0.1 Nondimensionalized State Error 1000-Run Normalized Mean Estimate Error 1000-run NE for x1 1000-run NE for x2 1000-run NE for x3 1000-run NE for x4 1000-run NE for x5 1000-run NE for x6 95.0% Bounds (Theoretical) 95.0% Bounds (Empirical) 10 20 30 40 50 60 Samples of Lag
  • 0.01
  • 0.005
0.005 0.01 0.015 Total Autocorrelation 1000-Run State Autocorrelation of Residuals y1 y2 y3
slide-25
SLIDE 25

UDKF

slide-26
SLIDE 26

WHY TRY A UDKF?

UDKF VS. EKF

▸ Operates directly on UD factors of covariance matrix ▸ Better stability of underlying covariance ▸ Little additional run-time cost ▸ Much longer to code by hand

slide-27
SLIDE 27

WHAT’S NEEDED FOR THE UDKF?

NOTHING ELSE NEEDED FOR UDKF

▸ Just change an option in *kf from “Covariance” to “UDU”.

Follows Bierman, Factorization Methods for Discrete Sequential Estimation

slide-28
SLIDE 28

HOW’D WE DO?

UDKF RESULTS

▸ Identical to EKF,

as expected.

Single Run MC Results

20 40 60 Time (s) 1 2 3 4 5 6 7 Total Error Squared 1000-Run Normalized Estimate Error Squared 1000-run Average NE 95.0% Bounds (Theoretical) 95.0% Bounds (Empirical) 20 40 60 Time (s)
  • 0.2
0.2 0.4 Attitude Error (~deg) MRP1 MRP2 MRP3 95% ST Boresight Errors 95% ST Cross Errors 10 20 30 40 50 60 Time (s)
  • 0.2
  • 0.1
0.1 0.2 Bias Error (deg/s) b1 b2 b3 95% Bias Errors
slide-29
SLIDE 29

SUMMARY

▸ Write sim and filter wrapper (necessary anyway) ▸ Two functions → UKF (sensor trade studies, control development) ▸ One function and one matrix → EKF (checked against UKF, runs

  • n flight computer!)

▸ A changed option → UDKF (checked against EKF, more stability

with no additional development time)

▸ Result: estimator available early, little wasted work, mature 


end product