I would like to point out that you can produce servo signals on ANY of the I/O pins on the Arduino with the standard Servo library. You can control up to 12 servos per hardware timer (the regular old Arduino using ATmega168 or ATmega328 has 1 timer that can control 12 servos, the Arduino Mega, sporting the ATmega1280 has 4 that can control up to 48 servos). You are not limited to the PWM capable pins. I’ve even used the analog ports as digital outputs to control the servo-based claw on my VEX robot.
Now there are a couple of differences in performance between the Arduino servo control system and the VEX one. In VEX, you send a range of values between 0 and 255 (or -127 to 127 in RobotC), with 127 as center (0 for RobotC). However in the Arduino library, there are two possible ways to control a servo interface/motor. The first, and probably most user-friendly is based off of actual servos (not the continuous-rotation servos like the VEX motors). You send the servo/motor a value between 0 and 180, based off of degrees, with 90 as center. This reduces resolution a bit, but generally works just fine, since adding one or two points on the 0-255 scale doesn’t make a noticeable difference anyway. When using a servo, this comes with a nice little surprise. Whereas with VEX and most other servo controllers, you get 120 degrees of travel, with the Arduino controlling it, you actually get a full 180 degrees! I think it adds a bit in both directions, but I’m not sure. I have no idea if this amounts to an increase in speed of VEX motors, but I would assume not.
The second way to control a servo in Arduino is to feed the servo function the raw pulse duration in microseconds. For your average servo, it’s looking for a value between 1 and 2 milliseconds, or 1000 and 2000 uS (microseconds). However, with the increased range of travel for the Arduino servo driver, valid values are actually from 544 to 2400 uS. Again, I don’t know how the extended range impacts the VEX motors.
If you want to control VEX motors with minimal modification of code written for the VEX, I would use the byte values (0-255) from the code and the map() function in Arduino to transform the byte range directly to the microsecond range from 1000 to 2000 uS, since the 0-180 range is mapped to microseconds anyway. The fastest way to write microsecond values to servo outputs is to use the Servo.writeMicroseconds() function, although Servo.write() will also work, it just takes a couple more steps to check to see if the value is in the degrees range or the microseconds range.
As for circuitry, I’ve used one 7.2v power supply, and it worked fine. Plug the 7.2v into a breadboard or PCB or perfboard, run ground to the ground on the Arduino, and the +7.2v power line to Vin on the Arduino (NOT +3.3v or +5v, those come off of regulators on the Arduino board). Then just run ground to the black line of the VEX motor, power to the orange line, and a signal line from a digital output on the Arduino to the white wire on the motor. But yes, if you do want to use two separate power supplies for whatever reason, connect the grounds. As long as you don’t have any power lines going between the two systems, there won’t be a problem.
If you need any more help, you can e-mail me here: [email protected]
Good luck, and I hope you can use some of this information.