Lesson: Intro to Pneumatics

Explore Pneumatics, what it is, how it is used and programmed on FRC robots.

Gain a basic understanding of Pneumatics and how it is used and programmed on FRC robots.


Pneumatics is a branch of engineering that makes use of pressurized gas to control physical systems. Pneumatics are used extensively on FRC robots using compressed air to create mechanical motion. The FRC pneumatic system is comprised of an air compressor, air storage tank(s), pressure sensor, relief valves, regulator, tubing, control valves, cylinders and the Pneumatic Control Module (PCM). The objective is to create mechanical motion using cylinders that produce push and pull motions in response to air pressure directed to them via valves controlled by your robot program.

The PCM is the key component of the pneumatic system. It controls the compressor motor and the valves that direct the air to cylinders. The compressor is controlled by a pressure switch (connected to the PCM) and a relief valve that limits pressure on the compressor/storage tank side of the pressure regulator to 120 pounds per square inch (PSI). The relief valves are manually set and open on their own when pressure goes over 120psi. The pressure switch turns on below 120psi and turns off at 120psi and is used by the PCM to turn the compressor on and off with the goal of keeping 120psi on the supply side of the pressure regulator. The purpose of the relief value is to prevent over pressure if the pressure switch fails to turn off the compressor at 120psi.

The pressure regulator separates the air supply side (compressor and storage tanks) from the working side (valves and cylinders) and sets the pressure on the working side to 60psi. These pressure settings are defined in the FRC rule book. From the working side of the regulator, air is directed to control valves. These valves are connected to the PCM and are controlled by your program. You determine when to open and close the valves. The valves direct air to cylinders where the air pressure causes the cylinder shaft to move in or out.

Cylinders, and the valves that control  them come in two types: single action and double action. Single action cylinders have a spring that retracts the shaft when air pressure is not present. When air is applied, the shaft moves out and remains out as long as pressure is applied. When pressure is removed the spring retracts the shaft. Single action cylinders have only one air input port. Single action cylinders are controlled by single action valves. Such valves have one input port (air from regulator) and one output port (connected to the cylinder) and one set of wires which connect to a valve port on the PCM. The valve opens when power is applied and has a spring that closes the valve when power is not applied. Pressure is only present at the cylinder when the valve is open. When the valve is closed, the output port connected to the cylinder is vented to the atmosphere allowing air in the cylinder to escape.

Double action cylinders have two sets of input ports and no spring. In this case you apply air to one port (and open the other port to the atmosphere) to move the cylinder shaft in one direction (in or out). You apply air to the other port to move the shaft in the opposite direction. The shaft stays in either the in or out position as controlled by a double action valve. The double action valve has two output ports, one for each of the ports on the cylinder. You can think of valve as having a sliding gate inside of it that moves one side to the other and applies air pressure to one output port or the other. When air is not applied to an output port, that port is vented to the atmosphere. Your code moves that sliding valve from one side to the other to change which output port the air pressure is applied to causing the cylinder shaft to move in or out. Pressure is always applied to one side or the other when there is pressure in the system. The key is that double action cylinders stay in or out until you change the setting of the valve. Note that double action valves have two sets of wires and take two ports on the PCM.

The valves that control the air have mechanical and electrical components. The electrical side consists of one or two solenoids. A solenoid is a magnetic actuator that translates an electrical signal into mechanical motion. You apply power to a solenoid on an air valve and valve opens (typically moves a slider that connects the valve output port to the pressure input port). The WpiLib provides a Solenoid class for your use in your programs to control air valves. For a single action valve you create a single solenoid object to control that valve. When you create the object you provide the CAN id of the PCM and the port number on that PCM that the valve is connected to. In your code to use the set(true/false) method of the Solenoid object to apply power (true) to the valve to open it.

A double action valve is more complicated. It has two solenoids, each one causes the sliding valve to move to one position or the other. So you need to create two solenoid objects in your code, one to apply air pressure to one side of the valve and one to apply pressure to the other side of the valve. You only need to apply power to one side or the other to move the valve to that side. Note that you must apply power for a period of time,  typically .05 seconds to allow time for the physical valve (slider) to move to change the setting of the valve. After moving the valve you can turn off the solenoid power (removing pressure) as the valve will stay in the new position. Double action valves take two ports on the PCM. Double action valves typically have thier sides (solenoids) marked as A and B. A wiring convention is the A side is wired to the first of the two PCM ports and should represent "opening" the valve. The B side is wired to the second PCM port and represents "closing" the valve. You would then plumb (do the air tubing) the valve to connect the A output port to the input port on the cylinder that causes the shaft to extend (open) and the B output port to the other input port on the cylinder to cause the shaft to retract (close).

In your code, when you create solenoid objects to double action control valves, you need to set the initial position of the valve at start up so that your cylinders start in the correct position (extended/retracted).

Due to the potential danger presented by the pneumatic system stored air pressure, there are strict rules in the FRC rule book governing the components of the system and their layout. You need to pay close attention to the rules when constructing your pneumatic system to make sure it complies with the rules. Your robot will be inspected at competitions and you will be required to fix any part of the system that is outside the rules. You should review the rules every year as the rules may change in subtle ways and make sure you are using approved part numbers for your pneumatic components.

Here is a detailed discussion of the pneumatic system. Here is wiring documentation. Note that there are rules in each years rule book that supplement this documentation.

Operation of the valves provides a great oppourtunity to show how you can simplify your programming by putting complex or often used code into classes. It makes sense to create classes to contain the details of operating the air valve solenoids and present a simple open/close interface to the rest of your code. Here are two sample classes that handle the single and double action air valves:


Lesson navigation: