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.
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.
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 !
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.
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.
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
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