View Single Post
  #2   Spotlight this post!  
Unread 16-02-2009, 00:05
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: coding for limit switch

Instead of forcing the motor to run for "a while" when a limit switch is tripped, you can just use the switch to keep the motor from going any further in the wrong direction. Don't worry about moving it away, just worry about keeping it from going past the limit.

The typical way to do this is to splice into the speed control value. Set it to zero if one limit switch is active and the incoming value is positive, or if the other switch is active and the value is negative. This will stop the motor as it drives into the limit, and you can rely on other signals to drive the motor back.
Reply With Quote