Live data from Hacker News

Rudolf Kálmán Has Died

hungarytoday.hu

41–50 of 74 posts

Re: Rudolf Kálmán Has Died

#41

Just last week I needed to smooth out a display reading on an oven controller. The RTD was being read way too fast so I'd get a lot of flicker between values due to ADC resolution. In the back of my head I remembered one word: Kalman. This line of code fixed it right up: static float display_temp = 0; display_temp += 0.04 * (adc_temp - display_temp);

If you're really trying to find a cooler name than the obvious low-pass IIR filter, you could call it an "alpha filter", which is equivalent to a position only (no derivatives) Kalman filter in steady-state, using a precomputed gain (called alpha, here equal to 0.04). The alpha-beta filter is the position/velocity version, and is commonly seen in settings where less is known about the system dynamics, or there's not…

Are alpha-beta (or alpha) filters a subset of Kalman Filters?

I ask because I don't know enough about the Kalman Filter. But it seems that the parent post could also be accurate.

I imagine many implementations of the Kalman Filter take advantage of the local use case, and don't necessarily have to carry a fully generalised Kalman filter.

Re: Rudolf Kálmán Has Died

#42

Just last week I needed to smooth out a display reading on an oven controller. The RTD was being read way too fast so I'd get a lot of flicker between values due to ADC resolution. In the back of my head I remembered one word: Kalman. This line of code fixed it right up: static float display_temp = 0; display_temp += 0.04 * (adc_temp - display_temp);

Despite some saying this is not a Kalman filter I'd argue that it is, although a quite simple stationary Kalman filter. I'm not saying calling it a low-pass filter or IIR is wrong, but that there is not a clear distinction in this case. Hear me out:

The general model for a linear system is: x(t+1) = A * x(t) + B * u(t) + v1(t) y(t) = C * x(t) + D * u(t) + v2(t)

Generally, x (state), y (measurement) and u (input) are vectors, A,B,C,D matrices and v1, v2 noise.

The optimal Kalman estimate for this system is: xhat(t+1|t) = A * xhat(t|t-1) + B * u(t) + K(y(t) - C * x(t|t-1)

where K is the Kalman gain which might be calculated for each update step or in the case of a stationary Kalman filter will be calculated to a fix value. The idea behind using a fix value is that generally, K(t) will converge as the filter runs.

Now say the state x is scalar, the model is that x is always the same and unaffected by input (A = 1, B = 0) and that we measure the state directly and that also the measurement is unaffected by input (C = 1, D = 0). Let's also say K = 0.04, it might well be.

Then: xhat(t+1|t) = xhat(t|t-1) + 0.04 * (y(t) - x(t|t-1) display_temp += 0.04 * (adc_temp - display_temp)

Thus for the model that 1) the oven temperature is constant and 2) unaffected (at least not quickly affected) by the temperature control and 3) that we measure temperature directly and 4) the assumption that the stationary Kalman gain is 0.04, this is a (stationary) Kalman filter.

Re: Rudolf Kálmán Has Died

#43

Just last week I needed to smooth out a display reading on an oven controller. The RTD was being read way too fast so I'd get a lot of flicker between values due to ADC resolution. In the back of my head I remembered one word: Kalman. This line of code fixed it right up: static float display_temp = 0; display_temp += 0.04 * (adc_temp - display_temp);

You can do better by having the 0.04 parameter follow an exponential decay as well. Start at 1.0 and have it decay to 0.04 or even 0.01 over time. That would make it more like a real Kalman filter for such a simple measurement. You'll get fast convergence to an initial value and then very smooth response after that. A classic example is a fuel gauge where you want to reject low frequency sloshing but have a rapid sta…

Something that Toyota apparently doesn't do; their fuel gauges take over a minute to react fully when you turn on the car after filling the tank.

Re: Rudolf Kálmán Has Died

#44
post #15

The Kalman Filter was used the in the Apollo 11 Guidance Computer [0] (discussed in the past on HN [1]). As someone linked previously, here is a historical perspective [2], and a link to the actual state vector update computations [3]. The AGC maintained the state vectors for the KF. Ground control would run batch mode least squares solutions, and pass it on to the LM, where the updates to the state vector would be a…

Thank you. I saw his name, immediately knew what his contribution was, but wasn't familiar with his work in a historical context.

Re: Rudolf Kálmán Has Died

#45
post #15

The Kalman Filter was used the in the Apollo 11 Guidance Computer [0] (discussed in the past on HN [1]). As someone linked previously, here is a historical perspective [2], and a link to the actual state vector update computations [3]. The AGC maintained the state vectors for the KF. Ground control would run batch mode least squares solutions, and pass it on to the LM, where the updates to the state vector would be a…

FYI: I was reading the README to understand what Kalman Filters are. This section seems to end abruptly mid-sentence at "You might imagine" without explaining what Kalman filters are: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Pyt...

Re: Rudolf Kálmán Has Died

#47
post #21

If you are interested in learning about them in depth, I'll toot my own horn and point you to my interactive book on them: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Pyt... It uses Jupyter Notebooks to run code in the browser. Check out the book, or run online using Binder.

Looks great! But since I'm lazy, can you just point to a PDF version?

Re: Rudolf Kálmán Has Died

#49
post #47
post #21

If you are interested in learning about them in depth, I'll toot my own horn and point you to my interactive book on them: https://github.com/rlabbe/Kalman-and-Bayesian-Filters-in-Pyt... It uses Jupyter Notebooks to run code in the browser. Check out the book, or run online using Binder.

Looks great! But since I'm lazy, can you just point to a PDF version?

https://drive.google.com/file/d/0By_SW19c1BfhTHRXWFJ1RUtvaDQ...

Re: Rudolf Kálmán Has Died

#50

Edit: This is wrong. This is a particle filter, another type of Bayesian filter. I can't delete now, so please downvote to hide. I made a Kalman Filter visualization[1] last year to learn more about them. It's amazing to see how good a result you can get from very poor sensor data. In the visualization, a lawnmower (green dot) is tracked (blue circle) using triangulation. The distance sensors have very low accuracy (…

Never mind it not being a Kálmán filter; it's cool anyway.

What is the cloud of small dots?

Edit: Oh, they are samples from the hypothesis space, I suppose.

Post reply on HN