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 the CIM or 775, 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.

הערה

Another name for a motor controller is a speed controller.

רמז

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.

אזהרה

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

פניאומטיקה

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 Pneumatics APIs.

Relays

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