We have a problem with our compressor going on and off during charge up. We have the spike connect to a relay output and the pressure switch to a digital output. Although it goes on and off it does charge all the way to 120 psi and cuts off like it should. We dont know what is causing it to go on and off like it is. We look and the wiring and is seems to be good. The only error we get is on the driver station with a code error 44002 44007. One of our mentors suggest it may be a watchdog error. We gone though our code and everything looks fine. We get no errors in the lines of code only on the driver station. We are using java by the way.
And if i didnt see it im sorry but i tried looking up this issue and couldnt find any post about this. Im sorry if i did miss it though.
What is the light on the spike doing when it is working, and when it is not (but before 120 PSI)? Same question for the LED on the sidecar corresponding to that relay output?
What size circuit breaker on the PDB is the spike connected to? And what size circuit breaker is installed in the Spike? The compressor typically draws about 10A, and can draw more. A 5A, or even 10A, breaker will repeatedly trip and reset, causing the same symptoms you describe. I’ve seen it, because that’s exactly what we did at a Fall workshop in which we were teaching all about pneumatics. The wonderful thing about non-build-season workshops is that mistakes don’t hurt so much, so we can learn more from them.
One thing our team has found out if you have the pressure switch right off of the compressor or near it, every time the compressor strokes it creates pulses of high pressure which cause the pressure switch to turn on and off when it reaches near 120. What we did this year was have two pressure tanks before the switch to ensure that the raise in pressure is not pulses from every time the compressor strokes.
Take a screwdriver or a short piece of wire and short the pressure switch (connect the two terminals). This will completely take the switch out of the picture. You’ll see one of two results:
The compressor runs constant until you remove the short (keep an eye on the pressure gauge, don’t let it get too high!).
You continue seeing the same behavior you saw before.
In the case of situation 1, you now know that the code is fine, and the problem is the pressure switch. This is because you gave the Digital Sidecar a constant signal from the switch indicating that you were below pressure.
In the case of situation 2, you know the issue is in your code. Look for a possible path where the relay is being turned off and then back to forward. For example, something like this:
relay.set(Relay.Value.kOff);
if (pressureSwitch)
{
relay.set(Relay.Value.kForward);
}
Also, please note that the commands don’t have to be this close together… look at ALL commands sent to the relay and make sure you don’t end up with a situation like this.
We also done the short out test to the pressure switch with a screwdriver and it works but does the same thing as if it was shorted out. The spike goes green then orange over and over til it hits 120 psi and then stops. We are going to try adjusting or replacing the relieve valve as soon people i have spoken to have sugguested that this may be the issue. We are going to try this on Sat. at our meeting. I will update if this doesnt work.
The sidecar light says the code is turning the compressor on and off. It is not a problem between the cRio and compressor.
The shorted switch test shows that the switch is not “bouncing” as suggested by Vikingtech2054. Verify wiring is OK by shorting the pins at the Digital Sidecar. If you get the same behavior, the problem is not between the switch and the digital sidecar.
Check (replace) the 37-pin cable between sidecar and cRio. If this is OK, then the issue must be in the cRio
This would mean, 99.999%, that it is your code that is turning the compressor on and off until it reaches 120, which then shuts it off properly.
Try the sample code Jon Stratis suggested, or write your own, but your code is the issue.
It is much less than 0.001% chance, but the cRio or digital module can be bad, but this is extraordinarily rare.
That covers 100% of the possible failure scenarios.
Don’t try my code above - that was an example of what could be causing your problem. Instead, you should have code like this:
If (pressureSwitch)
{
Relay.set(kForward);
}
Else
{
Relay.set(kOff);
}
Note the difference between this and the code I posted above - above, the code would stop it, then start it every single time we read the value of the pressure switch. With this code, it will either star it or stop it, but can never do both at once.