Compressor Not Starting

Hello,

My name is Sukhjinder and I am a programmer for team 564. We recently tried to run a pneumatics board setup consisting of a compressor, spike, pressure switch, and a solenoid.

We code in Java, and I have thoroughly researched how to make a compressor object and start it even though it is the simplest of things.

I contruct a compressor object as follows:

Compressor comp = new Compressor(pressureSwitch, Spike Relay);

The two parameters represent the channel of the pressureSwitch and Relay.

In order to start the compressor, I just call comp.start();

Now assuming that the electrical components of the pneumatics are done correctly, this should run, am I correct? (And yes I am on the most recent updates and am getting communication)

I was looking at other constructors for the compressor object, and saw another constructor that required 4 parameters to be passed over.

The constructor would look like:

Compressor comp = new Compressor(pressureSwitchSlot, PressureSwitchChannel, RelaySlot, RelayChannel)

What I dont understand here is what the constructor means by “Slot”. What is the difference between slot and channel, since the Pressure switch and relay are only plugged into the digital sidecar?

To answer your last question first. Slot is where the card is in the cRIO. Slot 2 would be the digital slot if I recall correctly for the 4 slot cRio. It allows for you the deal with in the old chassis or the new one, 2 digital cards.

Your code looks right, the question is what part of the robot class are you putting it in?

Also, remember to enable the robot for it to start as well from the drivers station.

Randy

I am creating a constructor for my class in Java, and initializing the compressor in there. The comp.start() is called within robotInit(). We tested with an enabled robot.

Ex:

public class 564code extends IterativeRobot{

Compressor comp;

 public 564code(){

    comp= new Compressor(pressureSwitch, Relay);

}

public void robotInit(){

comp.start();

}

OK, so there are two things you can try.

First just validate the relay works.

Create a Relay object on the relay port you have set up.

Then in the init just set it on. You can even use another relay channel as the digital side card will light up when the relay activates.

Relay r1 = new Relay( 1 );

r1.setDirection( kForward ) (may need Relay.kForward)

If that turns your compressor on then you know that part is working.

The other check you can do is validate you are getting single changes on the digital in.

DigitalInput di1 = new DigitalInput( 1 );

In the periodic routine for teleop print it out.

System.out.println( "digital 1 : " + di1.get() );

Then run and see if you connect the two terminals together on the pressure relay does the value change.

If both of those are working then I am not sure why it may not be working.

There is a teleopInit() you can add to the Iterative Robot class that will run once going into teleop mode, you can try the comp.start(); there.

So by running the relay directly you do not have the pressure sensor safety net, so either leave the relief valve open or only run it for a short time.

Randy

Use the LEDs on the DSC and the Spike – does a little green light come on next to where you have plugged in the cable to the Spike? If so, does the LED on the Spike turn green? The compressor will only run (in the right direction) if both of these are green.

The other thing to check is the voltage between the GND (-) and the SIG pin on the digital input that is connected to the pressure switch. You should be able to see the state of this input using the driver station (as well as the state of the relay output)…

We had this same problem and spent a good chunk of time troubleshooting.

We kept everything the same except switched out the Vex Pro Spike Relay for an older Innovation FIRST Spike Relay. It has worked like a charm since then.

We had the same issue last year (took a student with a better memory than me to remember that) and we have no idea why…

Everything about the system stays the same, wiring, data, programming, everything, except the Spike.

Anyway, don’t know if that’s exactly the problem but thought I’d share.

BTW, we program in java and just do
“Compressor comp = new Compressor(pressureSwitch, Spike Relay)”

We tried running the relay by itself; and the light on the relay is glowing in an orange color. If I am not mistaken, that means there is no signal to the relay, right?

Correct – is there a green light on the DSC next to the relay port where the cable to the Spike is plugged?

There is no green light. There is actually no light at all

Have you been able to drive the robot? I am wondering if you are not getting a light on the Digital Side Card next to the relay block if your cable may be inverse. There have been some in the past that had the connectors on wrong.

Also make sure you have three green power lights on the Digital Side Car.

Attached an image where you can see the light change when you toggle the relay.

Can you share the code where you tried just the relay? The full class if possible.

Thanks!

Randy





Have you checked the automotive fuse in the Spike Relay? It could be burnt out

If there’s no light on the DSC, start there – the fuse or anything else on the Spike are downstream from the DSC. Look at the picture in the above post and send the code for your relay test.

Does the light on the DSC near where you plug in the robot signal light flash? When you enable the robot, what does this light do?

The problem has been resolved today. What I decided to do was specify the module number (in the code) of the cRIO to which the digital sidecar was plugged into and it all worked like a charm. For some peculiar reason, we had 2 digital slots in our 8-slot cRIO.

Now my next question is: what are the default locations for modules within a 4-slot cRIO?

Glad you got it working.

Basically the slots are Analog, Digital, Solenoid, then one additional module of any type. You can see that outlined here:

http://wpilib.screenstepslive.com/s/3120/m/8559/l/92626-wiring-the-2014-frc-control-system