3 ms·
I love when the reality of the physical world crashes into the precision of the software world like this. Many years ago I was working with ultrasonic distance
by gregmac 10y ago
I love when the reality of the physical world crashes into the precision of the software world like this.
Many years ago I was working with ultrasonic distance sensors to measure water levels in cisterns. These things had a pretty good resolution: something around 2-3mm (cisterns were typically 6' to 12' deep/high). Enough that the waves/splashing during filling could cause the level to fluctuate and so we'd build the software so alarms had a separate 'on' and 'off' level. If you were to just say '<1500L = alarm', it would rapidly trigger on and off, so instead it would turn on at <=1500L and off at >1800L to both account for splashing and reduce repeat/nuisance alarms due to regular fluctuation in use.
I regularly use this as my go-to example whenever I'm talking with someone about why you can't directly map the physical world to binary state.
- Ericson2314 10y agoI would say this is a triumph of imposing precision on the real world.
- lfowles 10y ago> I regularly use this as my go-to example whenever I'm talking with someone about why you can't directly map the physical world to binary state. Just like the classic genies, "be careful what you wish for"! This is also called hysteresis filtering for anyone wondering.
- DigitalJack 10y agoI believe this is an example of hysteresis. Often used to avoid the exact situation you describe of rapid state changes. You will see it in web page menus, or rather the easier to use web page menus, where when your mouse leaves briefly the menu does not instantly disappear.
- __jal 10y agoHysteresis also has to be taken into account in systems monitoring - if an alert on, say, IO wait > 5% or whatever is desired, it generally needs to enter an "OK" state at some value under .05 for the same reason.
- deleted 10y ago[deleted]
- rrauenza 10y agoI discovered this to my dismay when building a simple cutoff switch for my fish tank's pump. The pump would turn off/on, water would back flow into the reservoir, turning the pump back on. The pump cycling then caused waves to hit the float switch. It would cycle on/off at about 1-2 Hz. This was built before Arduino's and Raspberry Pi's were around (and the environment is humid), so I devised a fairly simple mechanical solution of just enclosing the float switch inside a pipe that had a small hole in the bottom. The water level inside the pipe would change slower than the real level, providing the needed hysteresis.