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.
We did a similar controller this year as well. Although, we only controlled one axis. We made a scale model of our robot’s arm geometry. We found that because the rotational axis moved greater than 270 deg. normal potentiometers would not cover the entire range of travel. So, we replaced the standard potentiometers with continuous rotation pots.
Here is the “secret sauce” we used for scaling.
The robot controller supplies +5vdc to an analog input device. The Cypress board only provides +3.6vdc.
So we simple multiplied the sampled voltage from the Cypress by (5/3.6)=1.389.
Here is the logic:
At one end of travel, both pots will give you 0vdc. At the other end, one will give you 5vdc and the other 3.6vdc. Both travel the exact same distance, so scaling is linear, just multiply the lower value by the scaling factor and now they are identical throughout the range of travel.
In this picture, you can see some magnets embedded into the wooden panel. There are small pieces of metal on the scale model. The magnets are our version of the presets, having 6 magnet locations of the rack and one for transport mode. There is a physical barrier (small block of wood) that denotes the ground for tube pickup. There are youtube links in that picture thread.
Autonomous mode is on when the arm is “tucked away” under the robot, making all of the pots at their most extreme values.
We had an excellent freshman operating the arm. Best part of it? He understands every bit of programming behind it.