Compressor wont work with pressure switch

We at team 4110 have been having problems with our compressor & pressure switch. We have tested that the compressor works on its own with a button on the controller controlling it. We also have tested the pressure switch and it switched at 120. But we have yet to get the compressor and pressure switch to work together.

CodeSample.png


CodeSample.png

That’s the Periodic Tasks.vi part of the necessary code.

Now show us the Begin.vi part of your code.
That’s the part that tells the robot where everything should be connected. The compressor control output and the pressure switch sensor input to tell us when more pressure is needed and when we have enough pressure.

It should look like this:

Hi, So we actually have exactly what you have posted with the begin.vi and also have it close in the finish.vi i have searched a lot on the forums here and have seen that exact code but it hasn’t worked for us yet.

How do you have your pressure switch wired? Is it with the ground and signal wires? Does it plug into the first DIO slot on the Digital Sidecar?

You said that you have a controller button able to run the compressor.
Was that done by moving the compressor to a different Relay output on the Digital sidecar? I only ask because you could break the compressor code if you try to access the same Relay it is using.

I’d suggest testing your wiring setup by running the example compressor code provided under the pneumatics folder for Solenoid With Compressor.lvproj in:Getting Started -> Support -> Find FRC Examples…
That’ll isolate the problem to being code vs hardware.

Open up the front panel of that example to see a demonstration of the proper wiring.
It can be executed using the Run button in the upper left of the window.
You do have to set the IP to match your team. Do that by right-clicking on RT CompactRIO Target (10.0.0.2), choosing Properties and setting the IP to 10.41.10.2

We have now wired the pressure switch and compressor exactly as shown in the special compressor code but still nothing. We have also tried the special compressor code and the lights in the program lit up saying the compressor was running but it still wasn’t running.

It would seem to be a wiring problem if you are running the example code.

When the example code is running (and Robot is Enabled by the Driver Station) the Digital Sidecar status indicator in the slot in front of Relay 1 should turn green.

We tested the example code once more, and it does indeed work. We did not know that you still had to enable the program from the driver station when running it from the vi’s run button.

Thank you!
-Team 4110

It’s the little things that bite you. :slight_smile:
Good luck!

We got our actual program to work finally. I had to look our program a couple times though. I realized that I didn’t spell the reference name right. Thanks for all the help.:slight_smile: