I’m trying to use a Sabertooth 2x12 RC with an Arduino Uno but I’m inexperienced and having trouble.
I was trying it with the switches as
123456
011111
with the code attached. For whatever reason one motor only goes in one direction once it’s pulse gets above about 150(after the setup()) and then does nothing once below that number. The other motor does nothing until , after setup(), it gets to about 200 for the pulse value and after that it spins at full blast until power is removed regardless of the future values. I used Serial.println() to print the value to my computer and used an LED in parallel with both signals to confirm the duty cycles were changing.
The arduino is being powered by my USB port and the Sabertooth is being powered by a 6V power supply. On both PWM plugs the brown wire is connected to the GND pin of the arduino, the red wire connected to the 5V pin on the arduino, and the orange wires are connected to pins 3 and 5 on the arduino.
I’d be happy to take any constructive diagnostic advice and post results upon request. chair_thing.pde (761 Bytes)
From the data sheets, your sabertooth controller should be controlled like it is a servo. Below is some simple arduino servo test code you can try.
[code]// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually DOES NOT WORK.
String readString; #include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
Serial.begin(9600);
myservo.writeMicroseconds(1500); //set initial servo position if desired
myservo.attach(7); //the pin for the servo control
Serial.println(“servo-test-22-dual-input”); // so I can keep track of what is loaded
}
void loop() {
while (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the string readString
delay(2); //slow looping to allow buffer to fill with next character
}
if (readString.length() >0) {
Serial.println(readString); //so you can see the captured string
int n = readString.toInt(); //convert readString into a number
// auto select appropriate value, copied from someone elses code.
if(n >= 500)
{
Serial.print("writing Microseconds: ");
Serial.println(n);
myservo.writeMicroseconds(n);
}
else
{
Serial.print("writing Angle: ");
Serial.println(n);
myservo.write(n);
}
readString=""; //empty for next input
if this is the data sheet can you tell me what to look for in regards to how it’s controlled?
I looked at it and the links at the bottom of the page much earlier but didn’t get that it’s controlled like a servo. Is it controlled like a servo because it’s an R/C device?
I think the manufacturer assumes it is only connected to an rc receiver, so little details.
From the lynxmotion sales page:
Sabertooth 2X12 R/C Regenerative Dual Channel Motor Controller
Control = Standard R/C pulses 1.0mS - 1.5mS - 2.0ms
Channels = 2 (dual motor controller)
Voltage = 6.0vdc - 24.0vdc
Continuous Current = 12amps/18vdc, 8amps/24vdc
Peak Current = 15amps/18vdc, 15amps/24vdc with fan
Features = Synchronous regenerative drive, Ultrasonic switching frequency, Thermal and overcurrent protection, Lithium protection mode