2e. Pnuematic Solenoid - Amarygdala/FRC-5911 GitHub Wiki

Exercise proper precautions when handling pneumatic parts!

Overview

The solenoid is essentially a magnetically-controlled switch, that directs airflow. In our case, we use it to extend and retract a piston. Some solenoids can control two pistons while some can only control one.

The advantage of a double solenoid is that it can both push and pull.

What you need

  • Solenoid wired up to PCM
  • Solenoid connected to air reservoir with tubing
  • Piston connected to solenoid with tubing

Code


private final DoubleSolenoid doubleSolenoid = new DoubleSolenoid(0, 1); //the constructor creates a new solenoid object, 
// with methods you can call
// the parameters are channels on the PCM 

doubleSolenoid.set(DoubleSolenoid.Value.kForward); //pushes piston out

doubleSolenoid.set(DoubleSolenoid.Value.kReverse); //pulls piston back

side note pneumatic system

  1. Before attempting to store compressed air in the reservoir, check the air reservoir for major dents/cracks.
  2. Make sure the air reservoir is not pressurized unless the pneumatic system is in use.

The air reservoir will evolve into an air grenade & plastic shrapnel if not treated nicely and respectfully Also, wear safety glasses when shit goes down, or else you might lose an eye.

Did you successfully hook up the compressor, air reservoir, solenoid, air regulators, and pressure valves, but pressure just doesn't build up in the reservoir?

  • check all the tubing/listen for leaks
  • if it seems like air is escaping from the regulator, give the regulator knob a firm twist to the right.

Resources