Live data from Hacker News

Rudolf Kálmán Has Died

hungarytoday.hu

11–20 of 74 posts

Re: Rudolf Kálmán Has Died

#11

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);

Well, I guess, but, I mean, really… that's a first-order low-pass filter.

Indeed; it's a discrete approximation to the infinite impulse response exhibited by all sorts of physical systems leading to the characteristic exponential decay.

Re: Rudolf Kálmán Has Died

#12
post #2

Kalman filters are really neat. I wrote one when learning C a while ago and it is just cool what some matrix math can do with practical data. https://github.com/lacker/ikalman Although I guess I should have been calling it a "Kálmán filter" this whole time.

Interesting. I don't see generic Kalman filter implementations too often. Thanks for sharing. I've always found that determining where to put outputs from disparate sensors as opposed to just filtering a single observation like the GPS output in your example is challenging. Have you tried extending this to include input from other sensors (e.g. accelerometer, gyroscope, magnetometer, etc.)?

That, and tuning the covariance matrices can be tough and time-consuming.

Re: Rudolf Kálmán Has Died

#13
there's an unobserved state that changes over time according to relatively simple rules, and you get indirect information about that state every so often. In Kalman filters, you assume the unobserved state is Gaussian-ish and it moves continuously according to linear-ish dynamics (depending on which flavor of Kalman filter is being used)

Re: Rudolf Kálmán Has Died

#14

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);

[deleted]

Re: Rudolf Kálmán Has Died

#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 applied by hand. The variables of the state vector were a 6x6 matrix of position and velocity in X, Y, and Z or a 9x9 matrix when including radar/landmark bias.

I have great admiration for Mr. Kalman. Controls engineering has greatly benefited from his work.

[0] http://en.wikipedia.org/wiki/Apollo_Guidance_Computer

[1] https://news.ycombinator.com/item?id=8063192

[2] http://www.ieeecss.org/CSM/library/2010/june10/11-Historical...

[3] http://www.ibiblio.org/apollo/listings/Comanche055/MEASUREME...

Re: Rudolf Kálmán Has Died

#17

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 startup without knowing in advance what the level really is.

Re: Rudolf Kálmán Has Died

#18
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 (grey regions). When the mower reaches the edge of the yard, its position and velocity are randomized, but the filter is not told, so it has to reacquire.

1. https://jsfiddle.net/bendykst/tfcub3tj/

Re: Rudolf Kálmán Has Died

#19
I'm always surprised when people talk about Kalman filters without mentioning the killer app, which is weather prediction. Quite a few weather prediction organisations are at least experimenting with Kalman filters, and some are running whole ensemble forecasts using the method. It may sound strange, but the Kalman filter can be a less CPU-intensive (or at least more parallelisable) way of calculating atmospheric state than the current variational data assimilation methods.

Re: Rudolf Kálmán Has Died

#20
post #2

Kalman filters are really neat. I wrote one when learning C a while ago and it is just cool what some matrix math can do with practical data. https://github.com/lacker/ikalman Although I guess I should have been calling it a "Kálmán filter" this whole time.

Interesting. I don't see generic Kalman filter implementations too often. Thanks for sharing. I've always found that determining where to put outputs from disparate sensors as opposed to just filtering a single observation like the GPS output in your example is challenging. Have you tried extending this to include input from other sensors (e.g. accelerometer, gyroscope, magnetometer, etc.)?

I actually found it to be such a pain in the ass to tune, it didn't even seem that great on iPhones with plain old GPS compared to a hacky bundle of heuristics. I left the code on github because why not, and it turned out over the years people have used it for various things.
Post reply on HN