Can't Get Compressor to Run

The compressor on our robot will not run. The Spike is not receiving a signal to give power to the compressor. We have checked wiring many times and we have also checked the programming a few times. It all seems to be correct. Any suggestions to what we should check to try to make it work? We have the pressure switch and the spike wired. The spike does turn on and we believe they are both wired correctly. We used the wiring diagrams available on the FIRST website to check the wiring. I’m not sure if it matters, but our programmer is using Java to program it and everything else on the robot besides the pneumatics works fine. Is there anything that needs to be done to make it work that we may be missing? Thanks. :slight_smile:

So when wiring the spike, what you need to do is Connect GND to black on PDB and 12v to red on PDB, make sure u use the smaller slots on the PDB. when you turn your bot on, your spike’s led should be glowing orange-ish or red-ish.

(make sure your fuse isnt broken)
then what you need to do is connect the 3pin cable from the relay ports on the digital sidecar to the spike.
relay ports are the ones next to the phone jack and right under the DIO ports.

On the spike, it has a B which means the black of the PWM cable goes on it. or what ever color ur GND is.

now coding wise, we used the Relay class
our code looked like:

if(forward == true)
else if (reverse == true)
if(!forward && !reverse)

now when you set forward, your LED on the spike should switch from orange to green and when you set reverse, the LED should switch from orange to red.

If that is working, then wire the compressor to the spike, Red to M+ and black to M- and get rid of the code that lets the relay go reverse. And then when you turn on the bot, the relay should start.

Let me know if this helps

Sand500, for the compressor, you really shouldn’t use your own code for controlling the spike…WPILIB has built in methods handling the compressor. You should be doing something like:

Compressor compressor = new Compressor(pressureswitch INT, relay INT);

Then in robotInit:


And your done. It handles all the safety hierarchies and controls the compressor based on the pressure switch which you MUST have in order to compete.

Correct any parts if they look incorrect anyone.

we were just testing our spike with our comressor. I had no idea there was a compressor class, thanks for the info.

(I’m the programmer for the team)

Yea, I was using the compressor class. I’ve even put a comressor.setRelayValue(Relay.Value.kOn) in my teleopPeriodic and it still doesn’t work. We just now wired the compressor straight to the battery and it works, so it’s either the spike or our wiring.

Just to be sure, the spike PWM is plugged into the Relay section and the pressure sensor to the Digital IO section, correct? I thought that last year we plugged one of them into the PWM section, though I wasn’t the electronics person.

EDIT: Which side is negative on the Spike PWM? I heard that it was towards the “B” but I don’t see anything on the spike datasheet.

EDIT2: Okay, it started randomly working. I guess we had a loose connection?

GND means ground which is negative.

Started not working again.

There is no GND symbol on the Spike relay.

The problem is in the pressure switch, because I can turn on the compressor manually. Are the pressure switches open or closed when low on pressure? Ours is open when low which doesn’t match the Java compressor code and it didn’t trip at 120psi.

How do you have the pressure switch wired?
It should be signal & ground, the outside wires of a PWM cable, no power.

To bypass it you can short across the pressure switch terminals. The compressor should turn on then.


Doesn’t seem to work. The switch seems to be closed normally (without pressure), so shorting them wouldn’t do anything afaik.

It just eliminates the switch as the cause of your problems.
It is closed below ~95psi, and open at ~115psi, remaining open until it drops below 95psi again.

So it’s not the switch, since it’s out of the picture when you short across it’s terminals.

Does the Digital Sidecar have all three power lights bright green? Some times it’s a lack of proper power, other times the DIO pins could be shorted improperly.

I assume the Relay indicator on the Sidecar is not turning green either.

After that it’s most probably your code.

The B symbol on the Spike is logically equivalent to a GND symbol. The reason is that PWM cables usually have the ground cable color coded black.

The point of shorting the circuit across the pressure switch is to see if the pressure switch itself is broken. Alternatively, take a multimeter to the switch and check continuity (can also be done by reading resistance) and see whether the switch is tripped when you reach 115 psi (note that the switch opens when you reach 115 psi and will not close until the system falls below 95 psi).

The thing started to work correctly, so thanks for all your help.

Great to hear.

What was the source of the problem?

Not really sure, we switched the pressure switch with another one we had laying around and it still seemed to be doing the same thing. Our programmer then said that he just fixed some indents or something in the code and resent it to the robot. It started working after that.