REV PH not turning on compressor

We are trying to use the Rev Pneumatic Hub and can’t seem to get it to enable our compressor. We know the compressor works because we followed the manual instructions found here. We are using java and our code looks like below. I’ve tried the Compressor class and the PnuematicHub class and niether enable the compressor. We are trying to use the Analog pressure sensor which is accurately reading pressure when we manually turn on the compressor.

public class Robot extends TimedRobot {
    public PneumaticHub ph = new PneumaticHub();
    // Compressor compressor = ph.makeCompressor();
    Compressor compressor = new Compressor(1, PneumaticsModuleType.REVPH);
    public static CTREConfigs ctreConfigs;
    private RobotContainer robotContainer;
    private Command autoChooser;

    // private Ultrasonic ultrasonic = new Ultrasonic();
     * This function is run when the robot is first started up and should be used for any
     * initialization code.
    public void robotInit() {
        ctreConfigs = new CTREConfigs();
        // Instantiate our RobotContainer. This will perform all our button bindings,
        // and put our
        // autonomous chooser on the dashboard.
        robotContainer = new RobotContainer();
        ph.enableCompressorAnalog(0, 120);
        // compressor.enableAnalog(0, 120);

I could be wrong, but I think that the compressor only works once a solenoid has been instantiated and in teleop or auto. I think this is a change this year. However, we have not gotten ours to run yet this year either so this is mostly conjecture.

I created a solenoid but that didn’t seem to help either. Getting a bunch of too since I’m trying to print the Compressor status in Robot Periodic, System.out.println(ph.getCompressor());.

HAL: CAN Receive has Timed Out
Error at frc.robot.Robot.robotPeriodic( HAL: CAN Receive has Timed Out
edu.wpi.first.hal.REVPHJNI.getCompressor(Native Method)

I think your problem is the parameters for enableCompressorAnalog. It takes a minPressure and a maxPressure argument. The PH will keep the pressure in between these two, so if you have the min set to 0, it won’t turn on the compressor until the tanks are empty. Try setting the min pressure to something like 100 psi.


What color is the status LED on the PH?

I tried that and changed it to ph.enableCompressorAnalog(100, 120); and still nothing.

1 Like

The General Status LED is solid green and the Compressor light is off and when I enable, no change.

I got it working. Had to move the Analog sensor from Port 1 to Port 0. Just replicated what this person did, Rev Analog Pressure Sensor Reading - #5 by Sky_Captain. I can’t find anything in the docs/API about how to determine what port to use or to set a different port.

1 Like

See R812.


We always had the sensor on the High Side, I was only referencing that post regarding their mention of using Port 0 on the Rev PH.

B. REV Robotics P/N REV-11-1107
The analog output of the sensor must be connected directly to analog input 0 of the PH
(with firmware version 22.0.2 or newer) controlling the compressor

:man_facepalming: I guess I need to download a newer copy of the Manual because mine doesn’t have that.