# The Extended Kalman Filter

1. Sep 16, 2006

### Ultimâ

I've been asked to design a Kalman Filter where we can observe several states of a process (some of which being related to each other) and to use the Kalman filter to combine related observations to get a better estimate of each.

Some texts I've been reading seem to indicate instead of making a prediction and measurement and using these to form the best estimate, two measurements are combined to form the best estimate (of one of the measurements). In examples, the two measurements seem to be usually a state and its derivative.

I find all of this quite confusing - is this a proper technique?

Let's say, for example, we can measure
$$u,\ v,\ w,\ V_{tot}$$
where $$u,\ v\ and\ w$$ represent the speed in 3 dimensions and $$V_{tot}$$ is the total velocity - i.e. $$V_{tot}=\sqrt{(u^2+v^2+w^2)}$$

I guess the rates of change of these variables are also observable. How could the Kalman filter be used here (where functions to make predictions of the next step are unknown)...

Something else that would really be terrific would be a worked example of an ekf with a nonlinear system - many people seem to have difficulty understanding this (myself included, and I've been reading about them for over a year now!).

Last edited: Sep 16, 2006
2. Sep 16, 2006

### RainmanAero

EKF & Complementary Filters

Hello Ultima,
I know something of this, but am by no means the guru. Some people call what you describe "complementary filtering", and you are right it is good to be able to measure a state and its derivative (or integral) to make a good comp filter. My area of domain is aircraft flight controls, so the best example I can give you is one which is an important application in my field: Sensing the aircraft's speed (air speed). Aircraft flight controls can benefit from a comp filter for airspeed that removes some of the sensor errors associated with airspeed pressure-sensing systems.

When you sense atmospheric pressures around the airplane, it is a natural result that pressure measurements will have a high amplitude, high frequency noise content. This is a result of small and rapid pressure fluctuations as the airplane moves through an airmass. Since control surface effectiveness varies with dynamic pressure (airspeed squared), air speed becomes an important measurement for being able to "schedule" the control system's gain and phase frequency response.

I'd have to think some more on your problem, but instead let me give you the example of a Computed Air Speed (CAS) Comp Filter which seeks to restore high-frequency signal content which pressure sensing noise obliterates. The CAS Comp Filter uses as a second input the total inertial velocity measurements from DIS-SIMILAR sensors (Inertial Nav and GPS systems). INS and GPS sensors compute highly similar (inertial velocity) parameters to airspeed. The Comp Filter takes both Airspeed and Inertial (GPS) velocities and blends them (gain/phase-wise) to arrive at a better steady-state and dynamic estimate of the actual aircraft airspeed.

The Comp Filters I have seen, and the ones I have designed for my applications at work are protected designs, so I cannot share them. Sorry. But try to think of it this way and maybe this will help you as you move forward:

For any given system sensor (pressure sensor, rate sensor, temperature sensor, acceleration sensor...) the manufacturer of that sensor can tell you the sensor's performance in terms of its frequency response (gain and phase). The EKF/Comp Filter technique tells you to look at the freq responses of SIMILAR/RELATED sensor measurements and see where they complement each other in Gain and/or Phase.

For any given control application you can (as a result of plant dynamic analysis) define a required control frequency response for the overall vehicle/system. Your task in doing the filter design is to mathematically merge (in the frequency domain) the two signals to come out with an estimated signal that meets the system frequency response requirement.

I hope this helps. I know I did not get into specifics, but it was just to give you a flavor of the task.

Rainman

Last edited: Sep 16, 2006
3. Sep 17, 2006

### Ultimâ

Hi Rainman,

Thanks for replying. I wasn't expecting such a quick response.
You've certainly brought some things to my attention I was unaware
of and given me some interesting things to think about.

In actual fact, it's the states of an aircraft I'm looking at (about
12, including position, angle of attack, sideslip, attitude and
angular velocities) - but I want to keep things as simple as
possible for the moment. Currently I'm not worrying about control
(may incorporate that later), but rather just on how to improve the
sensor measurements (using a kf/efk), given other measurements, all
of which are assigned an arbitrary amount of noise.

Aside:I'm also trying to figure out equations that would allow the
normal predictive element of the ekf to be used (how to build a
state transition matrix) as the plane will be describing a diagonal
figure of 8 - so $$x_{k+1}=x_k + \dot{x_k}\Delta t$$ would be a bit inappropriate. (where x is any particular state)

Last edited: Sep 17, 2006
4. Sep 17, 2006

### Cyrus

Hi Ultima, your name isnt Pedro by any chance, is it?

Someone should make a tutorial on kalman filtering....any takers?

But I will admit, that stuff becomes way over my head after page 2! :surprised

I need to take that course in the future, what do you recomend in terms of math? I think a ton of linear algebra, and a ton of statistics? What courses specifically do you recomend I take?

I have taken basic linear algebra and engineering prob/stat.

Last edited: Sep 17, 2006
5. Sep 20, 2006

### Ultimâ

I know this is a tricky area, but I had kind of hoped for at least some light shed on my initial question.

Cyrus, there are several good tutorials about the basic Kalman filter on the internet that provide the ground-work. It's easy to implement on simple, linear systems. The EKF is the point when help fades away and you only find vague concepts and no fully worked examples.

I think reading on the modelling of dynamic systems, ODE's, and linearisation techniques (for using the EKF) are usually the biggest milestones when it comes to creating such a filter.