Sabertooth Ch2 not working

I have a LynxMotion AWD with 4 motors plugged in to Sabertooth 2x12 R/C. Connected RC channels of Sabertooth to a Pololu A* and I am sending PWM signals to the 2 channels, scaling up and down between 1ms and 3ms pulses. If in mixed mode, motors on both sides of the robot will move, change speed and change direction in response to various PWM signals. But when in non-mixed mode, only the left side moves. I have experimented with many connections and many signals across the 2 channels, so I know the PWM signal is being transmitted to Ch2. I think that Ch. 2 is not working on the Sabertooth, but I’m not sure how to diagnose the problem from here. There is almost no documentation on the Sabertooth. Any advice?

Hi lars1050,

I am unsure of what you are trying to do here.
The Sabertooth 2x12 R/C need to be connected to a R/C receiver and controlled that way. You cannot send PWM signals to it.

Correct connections and wiring can be found HERE.
Also further docs can be found on the Dimension Engineering website HERE.

If you could provide some good quality pictures it would help troubleshooting here.

All the best,

2 Likes

I purchased the kit that uses the Botboarduino for autonomous control – no RC (https://www.robotshop.com/en/lynxmotion-a4wd1-autonomous-rover-kit-botboarduino.html). It seems like the Sabertooth 2x12 (non-RC version) would be a better match, because then I could use serial communication, but that is not what you shipped to me. Instead of using the Botboarduino, I decided to use the Pololu Board that I am very familiar with (which can be programmed with the Arduino IDE). If you look at your provided code for the botboardino to control the motors via the Sabertooth, you will see that it is using control signals for servo motors – which are PWM signals whose pulses range between 1000us (full reverse) to 2000us (full forward). I can get the motors moving with these signals across the one channel, but not the other.

1 Like

Again - A picture is worth 1000 words.

If you are using a microcontroller, you can send PWM signals. It’s just important to understand the difference between PWM (analogWrite) and PWM (writeMicroseconds).

The Sabertooth R/C is made to be controlled by a R/C transmitter and it has some “failsafe” in it as well as an Auto-Calibration feature.
On a R/C setup you would have both joysticks centered at power-up which mean a 1500uS pulse.

My suggestions would be to put in your code:

  1. Set the Sabertooth in normal mode not auto calibration (HERE)
  2. In the setup start by sending the two center signals at 1500uS
  3. Initiate a forward movement (slow) then left to write movement

I’m not a programmer but I just wrote that and tested it on a Sabertooth 2x12 and it work. Very crude… but it works.

  #include <Servo.h>
  Servo sabertoothCH1;
  Servo sabertoothCH2;

void setup() {
  sabertoothCH1.attach(9);    //Forward & Backward 
  sabertoothCH2.attach(10);   //Left & Right

  // Initial Centering of the signals
  sabertoothCH1.writeMicroseconds(1500);  
  sabertoothCH2.writeMicroseconds(1500);
  delay(2000);

  // Moving forward both sides
  sabertoothCH1.writeMicroseconds(1700);
  delay(2000);

  // Moving one side
  sabertoothCH2.writeMicroseconds(1700);
  delay(2000);

  // Moving the other side
  sabertoothCH2.writeMicroseconds(1300);
  delay(2000);

  // Stoping
  sabertoothCH1.writeMicroseconds(1500);
  sabertoothCH2.writeMicroseconds(1500);
}

void loop() {

}
1 Like

#include <avr/io.h>

void setup() {
  // Clear control registers for PWM on Timer 1
  TCCR1A = 0;
  TCCR1B = 0;
  
  // set to waveform generation mode 14 (1110), Fast PWM with ICR1 top
  TCCR1A |= (1<<WGM11);
  TCCR1B |= (1<<WGM13) | (1<<WGM12);
  
  // set COM bits to clear on match (10) for both A and B channel
  TCCR1A |= (1<<COM1A1) | (1<<COM1B1);
  
  // clock select as 8 prescaler (010)
  TCCR1B |= (1<<CS11);

  // Set top and match
  // 16000000/(8*50000) = 40 Hz
  ICR1 = 50000;
  
  // At 40Hz, .025 seconds per period = 25ms per period
  // 2000/50000 = 4% duty cycle. .04*25 = 1ms = 1000us (full reverese)
  // 3000/50000 = 6% duty cylce. .06*25 = 1.5ms = 1500ms (stop)
  // 4000/50000 = 8% duty cycle. .08*25 = 2ms = 2000um (full fwd)
  OCR1A = 3000;
  OCR1B = 3000;

  // Set pins OCR1A (PB5) and OCR1B (PB6) as Data Direction output
  DDRB |= (1<<5) | (1<<6);
  
  delay(3000);
}

void loop() {
    int i;
  // Entering loop with 1.5ms pulse at 40Hz
  // gradually increase pulse width up to 2ms
  for (i=0; i<100; i++) {
    delay(10);
    OCR1A += 10;
    OCR1B += 10;
  }
  // pulse width starting at 2ms
  // gradually decrease pulse down to 1ms
  for (i=0; i<200; i++) {
    delay(10);
    OCR1A -= 10;
    OCR1B -= 10;
  }
  // pulse width starting at 1ms
  // gradually increase pulse width up to 1.5ms
  for (i=0; i<100; i++) {
    delay(10);
    OCR1A += 10;
    OCR1B += 10;
  }
}

If the Sabertooth R/C is meant to be controlled with an RC, then why do you sell it as part of the package for autonomous control using the Botboarduino? Why do you not sell it with the Sabertooth 2x12 (not RC) version?

Most people want the RC version since it’s easier to hook up.

Regarding your setup, i notice that you have LEDs in parallel to the R/C signal.
You should remove that as it has the potential to destroy the output pins of the controller (pololu) and also drain the signal.

I’m not a programmer, so i cannot troubleshoot your code but the one i posted work as i tested it on my setup here.

Your dip switches are not set for Mixed mode in the picture. (dip switch info)

Here are mine:

Note that the period of RC signal is 20ms.

1 Like

I had put in LEDs to confirm PWM signals were being sent (and being lazy about not adding resistors). I did not realize that could damage the board. I will remove them. Thank you!

I have tried it in mixed and non-mixed mode. When in mixed mode, the wheels turn in tandem with matched speed and direction – no variation to indicate a turn command has been received (I assume variable speed is the expected behavior if a turn command is given). When in non-mixed mode, only one side will turn (Ch1/Forward).

Is your code for an Arduino or for the Botboarduino? Here is the manual for Botboard: https://www.robotshop.com/media/files/pdf2/botboarduinomanual.pdf. I think that the pins 2-13 on the board correspond to the 2-13 pins on the processor (but not sure), and I see that the Atmega pins 9 and 10 can generate PWMs, which would match your code. However, the only documentation/code that I could find that uses the Sabertooth with the Botboard was a user showing a connection to pins 3 and 4 (at least in code, although the picture shows 2 and 3 I think) (BotBoarduino and Sabertooth). Which is even more confusing, because if the board pins do correspond to the processor, those pins do not generate PWM signals.

Can you post a picture of your setup so that I can see how you are connecting the Sabertooth and Botboarduino?

I have looked everywhere for documentation for connecting the Sabertooth to the Botboard, and for sample code. There is Lynxmotion code on Github (https://github.com/Lynxmotion/BotBoarduino/tree/master/Examples), but nothing relevant to the setup that you present for the kit I purchased. The Sabertooth documentation assumes an RC connection – not a microprocessor, so that is not helpful. Am I missing a site that has documentation?

I am obviously frustrated with not being able to get this setup after days of effort. I appreciate your help with this.

1 Like

The BotBoarduino is only an Arduino compatible board based on the ATmel 328 chip.
You will program it using Arduino IDE selecting Arduino Duemilanove as the board.

Pins are up to you really, but you need pins that are PWM capable and i used 9 / 10 in the sketch

For reference here is the official Arduino Duemilanove pinout:

Very simple setup, connecting the two cables to the BotBoarduino pins 9 / 10.

1 Like