Go to Post Obviously, really large issues need to be addressed, and if you feel there is a huge problem, by all means, go ahead, if you can be polite, productive, and graciously professional, address it. - Amanda Aldridge [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 12-01-2007, 23:58
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Question 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
  #2   Spotlight this post!  
Unread 13-01-2007, 00:35
Unsung FIRST Hero
Mike Betts Mike Betts is offline
Electrical Engineer
no team
Team Role: Engineer
 
Join Date: Dec 2001
Rookie Year: 1995
Location: Homosassa, FL
Posts: 1,442
Mike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond reputeMike Betts has a reputation beyond repute
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
__________________
Mike Betts

Alumnus, Team 3518, Panthrobots, 2011
Alumnus, Team 177, Bobcat Robotics, 1995 - 2010
LRI, Connecticut Regional, 2007-2010
LRI, WPI Regional, 2009 - 2010
RI, South Florida Regional, 2012 - 2013

As easy as 355/113...
  #3   Spotlight this post!  
Unread 13-01-2007, 08:57
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Re: Debouncing

Thanks.
  #4   Spotlight this post!  
Unread 14-01-2007, 19:38
P1h3r1e3d13's Avatar
P1h3r1e3d13 P1h3r1e3d13 is offline
Unregistered User
FRC #0295
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2006
Location: San Diego/Granite Bay
Posts: 46
P1h3r1e3d13 is an unknown quantity at this point
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.
  #5   Spotlight this post!  
Unread 14-01-2007, 21:51
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 6,998
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: Debouncing

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

Don
__________________

I am N2IRZ - What's your callsign?
  #6   Spotlight this post!  
Unread 15-01-2007, 00:11
Donut Donut is online now
The Arizona Mentor
AKA: Andrew
FRC #2662 (RoboKrew)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2004
Location: Goodyear, AZ
Posts: 1,292
Donut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond reputeDonut has a reputation beyond repute
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.
__________________
FRC Team 498 (Peoria, AZ), Student: 2004 - 2007
FRC Team 498 (Peoria, AZ), Mentor: 2008 - 2011
FRC Team 167 (Iowa City, IA), Mentor: 2012 - 2014
FRC Team 2662 (Tolleson, AZ), Mentor: 2014 - Present
  #7   Spotlight this post!  
Unread 15-01-2007, 00:39
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
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
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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