Log in

View Full Version : Weird behavior in our code


Landonh12
01-02-2014, 17:04
We are having problems getting our pressure switch for the compressor working. Here's what's happening:

- When the robot is disabled and the code is deployed, I can see the pressure switch state by an indicator in Periodic Tasks.vi.
- When the robot is enabled, the state goes false, not changing no matter what the pressure switch reads.

It's like the robot just does not want to read the inputs we have in DIO on the sidecar while the robot is enabled.

Invictus3593
01-02-2014, 22:43
Can you post a picture of the code you are running? This can help us better identify the problem!

Alan Anderson
02-02-2014, 00:31
False on a DIO means the signal is being pulled low. A properly wired pressure switch will do that when the pressure is too low and it is calling for the compressor to run.

What do you see the indicator doing when you completely disconnect the pressure switch? If it still says the switch state is false, there's something very wrong. Either the hardware (or the cRIO image) is faulty, or your code isn't reading the input properly.

Joe Ross
02-02-2014, 01:55
If you remove the DB-37 cable from the digital sidecar, are all three power LEDs brightly lit?

Landonh12
03-02-2014, 13:44
Can you post a picture of the code you are running? This can help us better identify the problem!

It is the example compressor code. I'm opening the Compressor in DIO 1 and Relay 1, and setting the RefNum to Compressor. In Periodic Tasks, I am doing a RefNum Get (Compressor) and feeding that into the Compressor Control Loop.

False on a DIO means the signal is being pulled low. A properly wired pressure switch will do that when the pressure is too low and it is calling for the compressor to run.

What do you see the indicator doing when you completely disconnect the pressure switch? If it still says the switch state is false, there's something very wrong. Either the hardware (or the cRIO image) is faulty, or your code isn't reading the input properly.

I'll check that today. I'll get back to you later.

If you remove the DB-37 cable from the digital sidecar, are all three power LEDs brightly lit?

BATT doesn't come on. 5V and 6V is on, though.
This is our 3rd Digital Sidecar. I highly doubt all 3 are bad. The new one we got in the KOP was bad because 6V wouldn't come on. We know we are supplying 6V because it showed up on 2 other Sidecars and we checked it with a multimeter.

Mark McLeod
03-02-2014, 13:57
BATT doesn't come on. 5V and 6V is on, though.

So you have the Sidecar wired to the power distribution board at a pair of the 20/30a red/black wago connectors with a 20a breaker and it still isn't receiving power (no BATT LED)?
Once the sidecar is getting proper 12v power from the battery all three power LEDs will be brightly lit.
example (http://www.chiefdelphi.com/forums/attachment.php?attachmentid=9743&d=1295532854) - top DSC is with no 12v power, bottom is with 12v power

It's not going to work until you can get 12v into it.

Landonh12
03-02-2014, 16:27
So you have the Sidecar wired to the power distribution board at a pair of the 20/30a red/black wago connectors with a 20a breaker and it still isn't receiving power (no BATT LED)?
Once the sidecar is getting proper 12v power from the battery all three power LEDs will be brightly lit.
example (http://www.chiefdelphi.com/forums/attachment.php?attachmentid=9743&d=1295532854) - top DSC is with no 12v power, bottom is with 12v power

It's not going to work until you can get 12v into it.

This is what we have now: http://m.imgur.com/Zo5pqK0

Looks like our electrical team wired it up in the wrong spot. It should come out of one of the 30A MAX ports with a 20A breaker, correct?

Ether
03-02-2014, 16:47
Looks like our electrical team wired it up in the wrong spot. It should come out of one of the 30A MAX ports with a 20A breaker, correct?


USFIRST and ScreenstepsLive web pages have all the info you need to wire the bot properly.


USFIRST.ORG "Power Connectivity Diagram"
http://www.usfirst.org/sites/default/files/uploadedImages/Robotics_Programs/FRC/Game_and_Season__Info/2014/ElectricalLayout.pdf

DSC Excerpt from above:
http://www.chiefdelphi.com/forums/attachment.php?attachmentid=15847&d=1389920308



WPI ScreenstepsLive "Wiring the 2014 FRC Control System"
http://wpilib.screenstepslive.com/s/3120/m/8559/l/92626-wiring-the-2014-frc-control-system

DSC excerpt from above:
http://www.chiefdelphi.com/forums/attachment.php?attachmentid=16082&stc=1&d=1391464067



USFIRST.ORG "Data Connectivity Diagram"
http://www.usfirst.org/sites/default/files/uploadedImages/Robotics_Programs/FRC/Game_and_Season__Info/2014/SignalLayout.pdf

Mark McLeod
03-02-2014, 17:27
It should come out of one of the 30A MAX ports with a 20A breaker, correct?
Correct.
You can see that on Ether's first DSC link.

Joe Ross
03-02-2014, 19:49
Please let us know if that fixes the issue.

Landonh12
04-02-2014, 07:58
Please let us know if that fixes the issue.

Yep, that fixed it. Thanks for the help!