Pneumatics Programming Help

Hello,

My team is using pneumatics for the first time this year and I am running into problems with the code. I am trying to create a program that can fire and retract a single piston using a double solenoid. We are also hoping to use an on-board compressor.

Here is the current program: https://github.com/Duncan5746/5746-Pneumatics

I am not sure what is wrong with it as everything looked okay to me - The compressor would not start

I know all the software on the computer is up to date, all the hardware has the right images and firmware updates, and I know that it is wired correctly, so it has to be a code issue.

Any help would be appreciated!

Thanks!

PMed

Could you post the solution here so it helps others in the future?

1 Like

Yeah Sorry - I forgot to add c.start(); to the program to start to the on-board compressor and I also had made my variable a Solenoid instead of a DoubleSolenoid by mistake - Also, we only wired one end of the double solenoid into the PCM when we should have done both.

So there was a few different problems that combined into it not working as intended. But it is working as intended now thanks to @Julian_C’s help !

1 Like

For both 2019 and 2020, if you have any pneumatic system, an on-board compressor is mandatory. For 2020:

R78. If pneumatic COMPONENTS are used, the following items are required as part of the pneumatic circuit and must be used in accordance with this section, as illustrated in Figure 9-14.

Figure 9-14 clearly shows a compressor, and there is no alternative illustration with an off-board compressor as there was for several years ending in 2018.

1 Like

You shouldn’t need to manually start the compressor. Just instantiating the solenoid is enough.

Just to explain more though, instantiating the solenoid triggers the firmware on the PCM. With the pressure switch wired in, the PCM will automatically turn off the compressor when 120psi is reached and turn it back on around a 100psi. This is a safety feature and is required for competing.
The compressor commands are only used if you want specific control over the compressor but usually is rarely required. Maybe if you figure out how much air you need for a match and prefill, then you can use c.stop to prevent the compressor from turning on during a match to save battery.

that is what I thought, but that didn’t work for me when I tried to run it.

read my reply to myself and lmk if youre missing anything more

Could this mean our pressure switch was broken if the compressor didn’t turn on automatically when the solenoid was instantiated?

where was the switch in your system? Like where was it located

I know the pressure switch was in the pressure input on the PCM, I am not positive where it was located as I do not have access to the system to look right now but i am pretty sure it was branching off a t connector piece from the compressor

Hmm definitely check and post back here. That has to be working if you want to pass inspection and use pneumatics.

Which compressor are you using?

It was the one we got in our rookie KOP in 2015 (we have never used it before)

It’s sliver right?

And when you get a chance, please post pictures of your PCM and pneumatics set up

yes

it looks a lot like this

1 Like

Ok - will do

Actually you know, issue could be with CAN id, assuming your solenoid instantiation is DoubleSolenoid name = new DoubleSolenoid(port 1, port 2), make sure the Id for the pcm is 0 And nothing else has the same id