PDA

View Full Version : [Question(s)] Arduino with sabertooth 2x12



neurotrama
02-26-2011, 01:00 PM
Hi All,

I just recieved a sabertooth 2x12 motor controller. The problem is that I cannot get power to the motor terminals (and I am also a noob).

Hardware involved:
Adruino duemilanove
Sabertooth 2x12
14.8v 4S20C lipo battery


Connections:
Arduino Serial tx -> sabertooth s1
B- -> battery neg (black wire)
B+ -> battery pos (red wire)


I have the sabertooth set to address 131 according to the DIP wizard. When I power everything on the status1 led goes solid and the status 2 will blink 4 times then pause (as they should for a 4S battery). The TX led on the arduio will blink but when testing voltage at the motor connectors I get zero volts.

What am I doing wrong??



const int BAUDRATE = 19200;
const byte ADDRESS = 131;

void setup()
{
//Hardware Serial
Serial.begin(BAUDRATE);
delay(2000);
Serial.print(170, BYTE); //bauding character to Sabertooth
delay(200);

}

void loop()
{
int speed = 127;
int direction_m1 = 0;
int direction_m2 = 4;

Serial.print(ADDRESS, BYTE);
Serial.print(direction_m1, BYTE);
Serial.print(speed, BYTE);
Serial.print ( ((ADDRESS + direction_m1 + speed) & 0b01111111), BYTE); //checksum
delay(10000);
}

ROBOTMAN
02-27-2011, 02:22 PM
Are you powering the arduino off the same battery as the motor controller? If not you will need to connect the ground of the arduino to the ground of the motor controller. If you do not do this attempts to communicate with the motor controller will fail.

neurotrama
02-27-2011, 04:00 PM
No the Arduino will be powered off a separate battery.

When I connect the Arduino TX pin to S1 and the Arduino GND to 0V (as in the image) the error led will go solid for ~3 seconds then blink rapidly.

http://img153.imageshack.us/img153/8075/img1427kg.th.jpg (http://img153.imageshack.us/i/img1427kg.jpg/)

Thanks for your help

ROBOTMAN
02-28-2011, 05:45 PM
Hmm, try attaching the ground for the arduino

[edit] sorry pressed the submit button on accident :)

Try attaching the ground for the arduino directly to the battery's ground instead if possible. If that dose not work disconnect the arduino from the computer and power it completely off the battery.

ROBOTMAN
02-28-2011, 05:57 PM
By the way are you sure the address is 131 because the default appears to be 130 ?

neurotrama
03-01-2011, 07:55 PM
I wired up the arduino to run off the 5V from the sabertooth.
So I have:
S1 -> arduino TX
GND -> arduino gnd
5V -> arduino vin

baud rate is set at 9600 and I verified the sabertooth address on dip and in code. The results are the error led lighting up.

One thing I did notice is that if I check all of the terminals at the battery and motor side I see:
Red probe on m1a black on B-: 3.69V
Red probe on m1b black on B-: 16.69V
Red probe on m2a black on B-: 0.0V
Red probe on m2b black on B-: 3.64V
Red probe on B+ black on B-: 16.69V
Red probe on m1a black on m1b: 0.0V
Red probe on m2a black on m2b: 0.0V

This seems a bit strange to me.

Thanks for the help

ROBOTMAN
03-01-2011, 09:23 PM
This is a shot in the dark but try putting a motor on the m1 and m2 then retrying the code. Also add a delay at the very start of your program of about 2000, these motor controllers have problems sometimes if your arduino is doing things before the motor-controller is ready.

[edit]

Also you said the baudrate is set for 9600 when your previous code snippet says 19200 ?

ROBOTMAN
03-03-2011, 12:52 PM
I was reading your other thread and it is possible that your board is faulty... It could be the serial chip or the motor driver its self. If you want I would try running the motorcontroller in analog mode with a potentiometer. If that dose not work then the board is faulty.

neurotrama
03-06-2011, 04:16 PM
I went a head and contacted dimension engineering and they are taking a look into it.

Thanks for all the help