From our lead programmer…
This year, we have an interesting control system for our robot featuring a scale model of the robot and its arm. To operate the robot’s arm, all you have to do is move the scale model to the position you want, then flip the on/off switch to open/close the gripper.
Potentiometers determine what the position of the model is, and determine that of the robot’s arm. The control board has 3 potentiometers - one at the base of the arm (think shoulder), one where the boom connects to the stick (think elbow), and one at the wrist. These potentiometers are wired into the Cypress First Touch I/O module, which can connect to the driver station via USB. The values from this module can be read using the EnhancedIO parts of the WPI libraries for FRC. The potentiometers on the robot are in similar positions, and are wired straight to the Jaguar motor controllers we use to control the output to the window motors that move the arm.
The driver station is constantly sending the current voltage readings for the potentiometers on the control board to the robot. Meanwhile the robot is constantly reading the current voltage for its own potentiometers. After some scaling (secret sauce!) the robot determines how much its arm needs to move in order to match that of the control board, then outputs power to its arm motors based on that difference.