FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit switch always TRUE?

Hello,

We are currently trying to program our limit switch so that it limits the range of our arm (we have it so that when the arm hits the switch, the arm will be unable to move against the switch).

We have all the logic and programming finished, but the limit switch is always returning a true value. We have checked the wiring many times but the switch always shows up as a true value.

We are opening the DIO and getting the value from the DIO Get, and we tested the switch many many times, and unfortunately it always gives a true value, even if the switch is being pressed or not pressed.

Things we did: Changed Switches, Rewired, Changed DIO Slots, Tested Switch with an indicator and a probe.

The switches were actually working (electrical test), they registered a value of true or false. However, the DIO shows up as always true in the labview reference get.

Any help on debugging this issue would be very helpful!

FIRST Team 3019

Chaparral Firebirds

[Mentor posting on behalf of Students, Cross-posted on Chief Delphi]

0 Kudos
Message 1 of 5
(6,399 Views)

We are running into the exact same problem.  We have verified the switches are electrically functional, but we still return a value of 1 at all times in the code.  We are currently using DIO 1 for our pressure switch in the pnuematic setup, so we attached our limit switch to DIO 1 and  confirmed that switching the limit switch would turn the compressor on/off. 

We are also at a loss for why we can't get it to work in DIO 2 using the DIO get subVI.  Please help. 

Team 2396

Canadian Valley Technology Center SeeHawks

[Mentor Posting]

0 Kudos
Message 2 of 5
(3,664 Views)

You should only have signal and ground connected to the switch. Is this how your switches are wired? The digital sidecar has an internal pullup to 5v.

0 Kudos
Message 3 of 5
(3,664 Views)

Echoing ScienceWhiz... this is what user Alan Anderson on the Chief Delphi suggested...

"The DIO pins have an internal pullup resistor to +5 volts. When nothing is connected, or when your switch is open, the value will be TRUE. When your switch is closed, the value will be...TRUE.

You need to put the switch between the SIG and ( - ) pins (the white and black wires on a standard PWM extension cable). Do not connect anything to the center +5 pin. That way, when the switch is closed, the SIG pin will be pulled to ground and read FALSE."

We didn't have a chance to wire them before we wrapped up for the day, but our electrical mentor agrees that this is the root of the problem.

Sorry for the late post, I know this is the last minute for all of us!  Good luck!

0 Kudos
Message 4 of 5
(3,664 Views)

May be check you wire like said in http://www.chiefdelphi.com/forums/showthread.php?t=83000.

I have another problem, for me, when the limit switch is activated, all motors stop. I follow the tutorial in http://www.frcmastery.com/labview-for-frc/2011-frc-steps-to-robot-success/step-4-add-a-digital-input... but i added only déclarations into "Begin.vi" and into "Finish.vi" and nothing in "Teleop.vi". Does anyone have any suggestion ?

Team 3969.

0 Kudos
Message 5 of 5
(3,664 Views)