Determining variance of pulse sensors used by Kalman filter?

11 views (last 30 days)
Hi,
I've constructed a Kalman filter that uses a position sensor data obtained from a pulse sensor. The sensor reads a toothed wheel and announces a pulse when the tooth passes the Hall-sensor. From the tooths I calculate the position of a rotating object with a microcontroller. This microcontroller then provides this position data through a field bus to my Kalman filter (thus there can't be any measurement errors, I think). I was just wandering how to determine a covariance matrix (usually denoted with R) for the pulse sensor measurement? As well known, the Kalman filter needs to know the uncertainty of the measurement.
I totally understand that covariance is necessary with continuous-time sensors (f.g a voltage level sensor) but is there really any uncertainty in measurements when a sensor that sends pulses is used? Thus should I keep the uncertainty matrix R as zero in Kalman filter?
Thanks for any ideas!

Answers (1)

Roger Labbe
Roger Labbe on 9 Nov 2015
Moved: Sabin on 4 Oct 2023
Maybe I am misunderstanding, but you have a rotating shaft with a toothed gear on it. As a tooth passes by the Hall-sensor records the event.
However, there must be some error involved. You will be reading from an analog circuit which has resistance, capacitance, and induction. During each rotation, as the tooth reaches the hall sensor, it will eventually trigger the sensor. It is likely that that will occur at a slightly different position each time. There will be biases due to things like temperature changes. I don't know much about Hall sensors, but googling 'hall sensor error' yields tons of apparently relevant literature. The model is very likely to be nonlinear, and so you will need a nonlinear filter to handle it. It outputs an analog signal, and it will take time for the voltage to settle at its new value. I wouldn't be surprised if the angular velocity of the sensed tooth could effect this. There will be noise in your input voltage, in the EM field in the vicinity of the sensor, variance in the temperature, and so on. You can use datasheets for your device to figure out its performance under varying conditions, and perhaps calculate its performance based on how much variance you will see (automotive might see high variance in operating temperature, but a temperature controlled factory might not).
I don't know enough about your design, but there are probably timing issues as well. Time will pass from when the tooth is close enough to the sensor to trigger it and that signal gets into the microprocessor. If you are running a typical discretized KF than of course the reading could apply to any point in that time period, in which case your error would be proportional to the angular velocity of the shaft. I haven't written a continuous time KF so I cannot speak to that.
If error was zero you would just set the covariance to 0. The would cause the KF to treat the measurements as perfect, entirely ignoring the process model. In which case, why the Kalman filter - after a few update/predict cycles the KF will output the measurement as its state estimate.
In the end you need to figure out what your mathematical model of your system is, as defined by your measurement matrix/function (usually called H or h(x)), and then describe the errors relative to that model. You need to figure out if those errors are approximately Gaussian, or if perhaps there is a bias (such as always having a lag in time for detection), that you can perhaps correct for with an augmented KF.
I know that is all hand-wavey, but this is the hard part of the KF - figuring out your errors. I may have some books at home that would offer a better answer, but I am travelling at the moment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!