How do you code the compressor?

please help!

What programming language are you using?

The C++ compressor class works well. You just need to tell it the digital I/O pin that you read the pressure switch from and which relay to turn on/off to charge the system when needed.

This class is a standard part of the WPI lib and is covered in the WPI documentation.

why don’t they make it a closed, automatic system within the compressor? it would make thing much easier, and save cRio processor power, and eliminate the need to program the compressor, and probably make inspection easier for FIRST volunteers.

You mean we can’t do that?

Currently, we just have our analog pressure switch wired to battery terminals and a spike relay to automatically turn on the compressor with no programming.

No, you cant. The sensor is not allowed to directly affect power pathways between the Spike and the compressor.

You must wire the sensor to a digital input, and use that input in your code to switch the compressor on and off.

I’ve always thought this was silly too, but maybe there’s a reason for it.

What you describe is forbidden by Rule <R78>:

<R78> The Nason pressure switch must be connected to the high-pressure side of the pneumatic circuit (i.e. prior to the pressure regulator) to sense the “stored” pressure of the circuit. The two wires from the pressure switch must be connected directly to a digital input and ground port on the Digital Sidecar, and the cRIO-FRC must be programmed to sense the state of the switch and operate the relay module that powers the compressor to prevent over-pressuring the system.

I don’t know why your approach is not allowed. Perhaps someone with further insight could shed some light.

~

Taking the cRIO out of the loop removes the ability to turn off the compressor when the robot is disabled.

<R78> is clear and unambiguous.

I’m not suggesting to take the cRIO out of the loop, but why is it forbidden to have cRIO->Spike->Pressure Switch (its NC, so this works)->Compressor.

In 2003 this is how we wired it till we got to competition and told to change.

I don’t understand why this configuration has always been disallowed… Its functionally identical, and there is no possibility for code to screw up.

The Nason pressure switch is rated for only 5 amps, nowhere near the current required by the compressor.

That sounds like a good reason. The only downside might be that the prevention of over-pressurization, which is the clearly stated intent of the Rule, is made less robust by including so many more components in the loop.

Of course, one might argue that the pressure-relief valve mitigates this concern. Unless, of course, the “factory pre-calibrated” pressure relief valve is in fact not properly calibrated as-received (as some teams have discovered).

With Alan’s clarification of the likely intent of the rule, it certainly seems like a good rule, all things considered.

<R78> is clear and unambiguous.

The rule is completely clear and unambiguous as to what is required.

~

That makes sense. Interesting that it worked for us though… guess it would dramatically shorten the lifespan of the switch / leave you open to risks of the switch welding itself or something.

I’ve seen things like that happen before. On my race car I have a switch on the radiator fans. The switch is rated for 10A (the biggest switch I could find without going online to a specialty supplier), and the fans pull 20-40A. Switch works, but on 2 instances has ceased to function. I thought about replacing it with an old automotive relay or something, but never got around to it. We hadn’t realized what happened at first until I thought of the current draw of the motors, and the rating on the switch.

It’s a SAFTY issue.

When the field control system shuts down the competition, it will shut down everything including the compressor
When the robot is disabled, all OUTPUTS are disabled including the compressor.

Don’t want a compressor kicking on and pressurizing a line and possible kicking unexpectedly>

Omar

Omar, with the system I described, FMS will still be able to shut it down, it just takes the cRIO out of the Overpressure-ShutDown condition.

Alan’s answer about the 5A rating on the NASON switch was the part I didn’t know about, and now it all makes sense to me.