|
Re: Sensor "de-noising"
If you have the resources, you should hook the sensor up to an oscilloscope to determine how fast it is bouncing.
Another approach is to use interrupts to set flags. When the sensor is tripped, an interrupt sets the value of a variable and stores the time the interrupt was triggered.
When the main loop runs through, it checks the flag and compares the time it was triggered to the last. If the flag is set and time delta is great enough, you do whatever action you want (stop motors, for instance), then clear the flag and store the last time.
A problem I foresee with this implementation is you'll be accessing variables on different threads, you'll need to be careful with the way you declare the variables (use a mutex in C++ or atomic variables in java, not sure about LabView).
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
|