State estimation · University · about 35 min
Where the weighting comes from: two variances, one line of arithmetic, no taste involved.
[1 mark]A scalar Kalman filter has p = 100 and R = 25. What is the Kalman gain k?
[1 mark]One full predict and correct of the scalar filter. What does it print?
x, p = 0.0, 100.0 v, dt, Q, R = 20.0, 0.1, 0.5, 25.0 measured = 5.0 x = x + v * dt p = p + Q k = p / (p + R) x = x + k * (measured - x) p = (1 - k) * p print(round(k, 3), round(x, 3), round(p, 3))
[1 mark]The steady state gain from the lesson's formula, checked by running the filter. What does it print?
Q, R = 0.5, 25.0
p = (Q + (Q ** 2 + 4 * Q * R) ** 0.5) / 2
print(round(p / (p + R), 3))
p = 100.0
for i in range(200):
p += Q
k = p / (p + R)
p = (1 - k) * p
print(round(k, 3))[1 mark]Q stays at 0.5 and R is doubled from 25 to 50. What happens to the steady state gain?
[1 mark]The filter is started with p = 0.01 while the estimate is in fact badly wrong. What happens for the first second or so?
[1 mark]Once the gain has settled, which statements are true?
Tick every answer that is true.
Run the scalar filter while driving at the wall. Plot measured, estimate and gain, with the gain as a percentage so that it shows. Print my y: and final gain:, the gain itself as a number between 0 and 1. No position().
from bugbot import * connect() DT, START_GAP = 0.1, 110.0 R = 25.0 Q = 0.5 est, p = 0.0, 100.0
Plan your program here, then type it in and press Run.
est at 30, which is wrong, and p at 0.01, which says you are sure of it. How long does the filter take to believe the measurements, and how does that compare with p at 100?R and halve it. Which way does the gain go, and does that match the sentence "R is how noisy the measurement is"?