View Single Post
  #8   Spotlight this post!  
Unread 23-02-2011, 00:47
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Code not responding to Limit Switch Signal

Quote:
Originally Posted by rwood359 View Post
Does the operation work if the arm is moving very slowly? Remember that the limit switch is only being tested once for each execution of the loop. If the limit switch is only set for a small period, it is possible for the switch to be set and then rotate past to the point that it is not set between executions of the loop. When you are using a limit switch, you will find that the ending position will not be exactly the same each time that the limit is reached. The speed of the arm and repetition rate of the loop cause some uncertainty.
Excellent point. I set up our code so that there is a dedicated, 10ms loop that just checks the limit switch and stops the motor.

However, that's probably not the real problem.

What did you check to make sure the limit switch worked? If it was somewhere within teleop (with a probe or an indicator or something), then it's probably just how you stopped the motor. If it was that your heard a clicky sound or used a multimeter, it could be anything.

EDIT: I just looked at the program, and it seems as if you will stop the actuator if either switch is pressed. If you have one at the top of the reach and one at the bottom, this is not what you want. I'll attach what we did for limit switches.
Attached Files
File Type: vi Limit motor.vi (6.5 KB, 16 views)

Last edited by WizenedEE : 23-02-2011 at 00:51.
Reply With Quote