EE3901/EE5901 Sensor Technologies
Week 4 Tutorial

Last updated 21 March 2023

Question 1

Given a state prediction model of the form

the extended Kalman filter predicts the covariance using the equation:

where is the Jacobian of and is the process covariance.

Calculate the Jacobian for each prediction model given below.

(a)

(b)

(c)

(d)

(a) In this case the Jacobian is a scalar.

(b)

(c)

(d)

Question 2

Develop the equations for an extended Kalman filter for a vehicle moving in a 2D plane as shown in Figure Q2.

Figure Q2
Figure Q2:

Top-down view of a vehicle with the state variables labelled.

Zoom:

The vehicle is described by the state vector

where is the position along the east-west axis, is the position along the north-south axis, is the speed of movement (where positive means forward motion), and is the direction of heading measured clockwise from north.

(a) Write a prediction function .

(b) Calculate the Jacobian of and hence write the equation for the predicted covariance.

(c) Suppose that the sensors on the vehicle are GPS (measuring position), a speedometer, and a compass. Define which variables would go into the measurement vector and hence write down the measurement model in the expression

(d) Suppose that the vehicle has no GPS and the only sensors are a speedometer and compass. Repeat part (c) with a reduced set of sensors.

(a) Prediction step (based upon an assumption of constant speed)

If control inputs were available then additional terms could be added to reflect predicted changes in and .

(b) The Jacobian of is

for a covariance prediction of

where is the process covariance.

(c) The measurements can be arranged in a measurement vector

This is the same ordering as the state vector so the measurement model is linear and is given by

where the measurement matrix is

If your measurement vector had the measurements in a different order then the corresponding rows of would be swapped.

(d) In this case there are only two measurements

and the measurement matrix becomes

Question 3

Develop an unscented Kalman filter for the non-linear circuit shown in Figure Q3.1.

Figure 1
Figure 1:

The circuit to be analysed for Question 3.

Zoom:

This is a second-order system, so it requires two state variables. Choose the following state vector:

The measurements are the voltages,

The LED is described by the Shockley diode equation,

where the device parameters (e.g. reverse bias saturation current, ideality factor, and temperature) have already been substituted into the equation. Notice that the voltage across the diode is the same as the voltage across . Recall that capacitors are described by .

(a) Analyse the circuit and show that it is described by the following set of differential equations:

(b) At the point where the diode begins to turns on, these equations are highly non-linear and are numerically challenging to solve. A simple prediction model of the form

fails to converge to the correct solution (unless is made impractically small). Figure Q3.2 shows instability resulting from the inadequacies of such a simple prediction model.

Figure 2
Figure 2:

Notice the failure of the simple prediction model at the moment where the diode begins to turn on.

Zoom:

The instability (indicated with an arrow) would cause problems for any kind of Kalman filter since the prediction model is failing. An improved prediction model requires the use of a differential equation solver that can dynamically choose to maintain accuracy. Hence, the prediction step is a computer program, and a derivative-free method like the UKF is required.

Write code to implement an unscented Kalman filter for this system. Starter code is provided that implements an accurate prediction step. Based upon this predictive model, you can build a reliable filter. Write your code and evaluate its performance.

Using the parameters in the starter code, the working UKF produces output like Figure Q3.3.

Figure 3
Figure 3:

The expected output for Question 3.

Zoom: