2022PythonExamples/17 - Pneumatics
2022-12-26 14:40:10 -05:00
..
README.md Adding a bunch more readme content 2022-12-26 14:40:10 -05:00
robot.py Committing some more work 2022-12-13 20:35:53 -05:00

17 - Pneumatics

P What?

Pneumatics (new-matics) is working with air to have your robot perform various functions. These actions tend to be very linear in nature (up/down, in/out, etc.). Pneumatics provide robots with a consistent motion experience for relatively simple tasks where a motor would require some form of complicated sensing to complete the same task.

Big disclaimer, all robots can be dangerous, but pneumatics tend to add an extra layer of possible danger, be wary of your pneumatics setup and always refer to the documentation if you're unsure if something is set up correctly. DO NOT charge your system before verifying your pneumatics are setup correctly.

So how do I go about using Pneumatics?

You need a pneumatics setup first, the documentation in the above disclaimer can help you with that. This is a programming training after all. The parts you'll be most concerned with are:

  • What type of cylinders are we using? (Single or Double Action)
  • What type of control module are we using? (Pnuematics Control Module (PCM) from CTRE or Pneumatics Control Hub (PCH) from REV)

The type of cylinder is important because it will inform you what class to create an object from when writing your pneumatics oriented code. You may have a mix of single and double, and that's ok, you just need to make sure that you configure the right ports with the right objects.

Speaking of ports, the PCM and PCH devices are sub-boards that help the RoboRIO manage not only your cylinders and how they're directing air, but also your compressor and the amount of stored air you have in your tanks. These devices have a number of ports that can be used to control solenoids (either single or double solenoids, again, depending on the type of cylinder). The ports are numbered, similar to how they are on the RoboRIO and PDP/PDH, you should be able to spot them pretty easily. Note that a double solenoid, like the name implies, will take up two ports, rather than just one.

The PCM/PCH as I mentioned also play a role in managing your compressor and your tank stored air. If you're using the PCM from CTRE, you're limited to Digital Only pressure sensing, meaning that, a digital switch informs the PCM whether or not to turn the compressor on. This isn't a bad thing, but it can cause the PCM to turn the compressor on more often than it really needs to, which can waste battery power. If you've got a PCH from REV though, you can use Analog sensing, and get real time pressure data that will tell you (within a tolerance) the exact amount of air you have stored for use. This way, you can use your better programming judgement to determine when the compressor should come on. For example, if your working pressure (the pressure you actually send to mechanisms) is 60, and your desired standing pressure tank pressure is no less than 75. With digital, the compressor is going to turn on basically every time the storage tank pressure hits 112 PSI or so, whereas with Analog, you could tell the PCH to not turn the compressor on until you hit the 75 or less mark you care about, saving a bunch of start/stop compressor runs that really aren't necessary.