This tutorial will explain how to use RobotPower's 'Scorpion XL' motor controller with your next robot project. Although, the 'Scorpion XL' is flexible and easy to use with just about any small-to-medium robot platform, we've chosen to use the Lynxmotion 'Terminator' because it features four 12vdc motors and just looks cool! For the brains of the robot, we're also using the Arduino Duemilanove board, with the Atmega 328 at its core. Ironically, the 'Scorpion XL' also uses an Atmel chip as its workhorse - the Atmega 168 to be precise.
Attaching the Scorpion XL is the simple task. We suggest using 3M's adhesive velcro strips, as they are easily attachable, removable, and surprisingly strong! Most importantly, the 3M velcro strips avoid you having to drill holes into your platform.
I also highly suggest labeling, as I did, the Gnd and Vcc leads of each of your DC(or servo) motors.
Several minor steps need to be taken in order to prep the Scorpion XL for use. Find the jumper on the Scorpion XL PCB labeled BEC. Next use a pair of wire-cutters to snip this jumper off. You will not need the BEC jumper.
Robot Power ships its motor controllers with all the jumpers attached to one pin only (due to shipping vibrations, the jumpers may have been knocked loose). You will need to attach two jumpers(in the same positions shown as 'J1' and 'J2') to the pins labeled 'M' and 'T'. If you've never seen a jumper before, they are the small black, plastic squares that can plug into two pins at a time.
Here is a picture of the what your 'Scorpion XL' should look like: Do not worry about connecting any of the wires to the 'Scorpion' just yet; this picture is merely a reference.
Note: If you decide to use a battery larger than 16 Volts DC, you will need to locate the jumper labeled HV on the 'Scorpion' and cut this jumper off.
To power the Scorpion XL, you will need a battery(preferably rechargeable) between 12-16 Volts (DC). For our robot, we've soldered together two 7.2vdc NiMH rechargeable batteries in series along with a SPST witch and a rechargeable terminal for a 9 Volt AC adapter.
Again, I used 3M adhesive velcro strips to secure the battery to the robot platform. After your battery is secured, screw the battery leads into the respective positive and negative terminals of the 'Scorpion XL'. Polarity matters; Don't dare reverse your battery leads!
Lastly, screw the DC(or servo) motor leads into the respective positive and negative terminals of the LMOT and RMOT terminals on the 'Scorpion XL':
Your 'Scorpion XL' now has power to wait and listen for instructions, but needs to be able to hear these instructions too. Next, the R/C cables on the 'Scorpion XL' need to connected to the Arduino Duemilanove. But, first thing's first; The R/C cable labeled 'COMM' on the 'Scorpion XL' will not be needed. I fastened this R/C cable off to the side of my robot platform using a piece of clear packaging tape. The remaining R/C cables are labeled 'Right' and 'Left' - one for each side of the robot. Each R/C cable is comprised of three separate wires:
As you can see from above, you will need to feed +5 Volts from the Arduino to each of the Red wires, as well as Gnd from the Arduino to each of the Black wires.
Next, you will need to connect the Yellow or White wire from each remaining R/C cable to a separate digital output on the Arduino. I chose to connect the Left R/C logic wire to Digital Input_2 and the Right R/C logic wire to Digital Input_3 on the Arduino.
Here's my Arduino connected to the 'Scorpion XL'. I suggest mounting a breadboard (again with velcro strips) for rapid and easy prototyping.
Here is a code snippet from our Ardunio sketch, which will move the robot forward at speed 70:
#include <Servo.h> //R/C leads act like servos
Servo myservo_left; //attached to digital pin 3 Servo myservo_right; //attached to digital pin 2
int count=0;
void setup() { //initialize digital output pins
myservo_left.attach(3);
myservo_right.attach(2);
}
//tell Scorpion to
void loop() //pulse motors continuously
{
myservo_left.write(70); //turn motor forward at speed 70
myservo_right.write(70); //turn motor forward at speed 70
delay(20); //wait 20 milliSecs
}
From thorough testing, we determined the valid ranges for R/C signals to the Scorpion:
If your 'Scorpion XL' is functioning properly, you should have the 'Status' LED onboard the 'Scorpion' light up in a solid fashion. If it blinks, particularly fast blinking, this means that the R/C signals you are sending to the 'Scorpion XL' are invalid or out of range. Check your code first, then your wiring.
Congratulations! You're all finished. Now experiment with Arduino Sketches 'til you have you robot working as you want it.