Hardware APIs

This section discusses the control of motors and pneumatics through motor controllers, solenoids and pneumatics, and their interface with Java and C++ WPILib.

Motor Controllers

A motor controller is responsible on your robot for making motors move. For brushed DC motors such as CIMs or 775s, the motor controller regulates the voltage that the motor receives, much like a light bulb. For brushless motor controllers such as the Spark MAX, the controller regulates the power delivered to each “phase” of the motor.

Note

Another name for a motor controller is a speed controller.

Hint

One can make a quick, non-competition-legal motor controller by removing the motor from a cordless BRUSHED drill and attaching PowerPoles or equivalents to the motor’s leads. Make sure that the voltage supplied by the drill will not damage the motor, but note that the 775 is fine at up to 24 volts.

Warning

Connecting a BRUSHLESS motor controller straight to power, such as to a conventional brushed motor controller, will destroy the motor!

Pneumatics

Pneumatics are a quick and easy way to make something that’s in one state or another using compressed air. For information on operating pneumatics, see Operating pneumatic cylinders.

Relays

A relay controls power to a motor or custom electronics in an On/Off fashion.