View Full Version : arduino control of motor controllers
RyanShoff
18-01-2014, 20:32
I'm not sure if this has been covered, but the Arduino sample Knob http://arduino.cc/en/Tutorial/Knob works great for quick testing of mechanisms. Just place any standard FIRST motor controller in place of the servo, and you have a easy variable speed control without CRIO programming.
We hooked an Adafruit Flora to a Talon and a Cim and our prototype ball disintegrator worked great.
BradAMiller
19-01-2014, 08:18
While that is a good way for quick tests, just be aware that it is not legal in competition. And as a long term solution, not recommended. There are many safety mechanisms built into the FRC control system that, for example, turn off the motors when the robot is out of range of communications or when the robot is disabled. Using the Arduino to control the motors bypasses all of them.
We played with this in the off season. A couple of things:
Use the version of server.attach() version that specifies pulse widths that the controller you are using likes. This is for a talon:
// motor drive server connected to a TALON
driveServo.attach(3, 1000, 2000); // TALON // widths are in micro-seconds
You will need to calibrate the speed controller. I wrote a sketch that prompts the user though the calibration starting with pressing the button and uses input from the serial port to advance thought forward, reverse, and back to idle.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.