Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Debouncing (http://www.chiefdelphi.com/forums/showthread.php?t=51707)

gnirts 12-01-2007 23:58

Debouncing
 
One simple, quick question:

Do the joysticks (and other arbitrary toggle switches on the OI) need to be debounced in software, eg. checking to make sure that a joystick button value stays constant for a certain number of new data packets before accepting it?

Thanks in advance,
Robinson

Mike Betts 13-01-2007 00:35

Re: Debouncing
 
Robinson,

Most people do not because a switch bounce is usually 3 or more orders of magnitude faster than the OI update rate. Only once in 13 years has my team needed a debounce routine on an OI input.

However, your mileage may vary...

Regards,

Mike

gnirts 13-01-2007 08:57

Re: Debouncing
 
Thanks.

P1h3r1e3d13 14-01-2007 19:38

Re: Debouncing
 
I second.

Last year, on the advice of an electrical engineer mentor, I wrote a fairly long
debounce subroutine that I called for every switch input, totally forgetting how slow the processor is.
Long story short, it caused a lot of problems and wasted a lot of my time (a good half-week, and I was the only programmer). I realized later how silly that was, because we never ever had any bounce problems without it.

DonRotolo 14-01-2007 21:51

Re: Debouncing
 
I agree, we did not debounce our custom switches last year and saw no issues.

Don

Donut 15-01-2007 00:11

Re: Debouncing
 
Our team used a debouncer last year, because we've had issues with buttons in the past (notably a joystick trigger in 2005, where sometimes it would see itself flipping on/off very quickly and try to actuate a pneumatic cylinder equally as fast).

I plan on using it again this year, and for the magnetic reed switches on cylinders in addition to buttons.

However, whether or not they are necessary is entirely dependent on how you control things, and whether or not your team is having issues with buttons. It's not difficult to do, but if there's no problem, those few hours on that are better spent elsewhere.

gnirts 15-01-2007 00:39

Re: Debouncing
 
Thanks for the advice everybody. I guess while I have no robot to play with I will go ahead and write debouncing code to use with any toggle switches we may have on the OI. I don't see a disadvantage to the 100ms spent debouncing, as that is still an order of magnitude faster than the robot would operate anyway.

Thanks again,
Robinson


All times are GMT -5. The time now is 01:21.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi