I’m having issues just running basic commands from the BotBoarduino to the Sabertooth Sabertooth Dual 12A 6V-24V R/C Regenerative Motor Driver. I’m using a standard Alkaline 9 volt battery to power the BotBoard and I’m running a 12.0 Volt Ni-MH 2800mAh Battery Pack to run the Sabertooth.
If I attached 2 motors to the Sabertooth and only program one motor to turn, both will turn in opposite directions. If I program both to turn, only one will turn depending on the speed, but if the second one does turn, it will run in the opposite direction.
When I attached two continuous servos to the BotBoard, they run without issues in the appropriate directions.
I bought the Sabertooth motor driver about 10 years ago, can it possibly have issues? The board was never wet or stored in any damp places and I only removed it from the sealed container this week.
#include <Servo.h>
Servo myservoleft;
Servo myservoright;
void setup()
{
myservoleft.attach(3);
myservoright.attach(4);
}
void loop()
{
myservoleft.write(100);
//myservoright.write(85); //commented out
}
This is how to wire the BotBoard to the Sabertooth and set the switches on the Sabertooth.
Tutorial for PS2 Control (BotBoarduino)
1 Like
I even tried running the code from the manufacturer of the Sabertooth Motor Driver and it still only spins one wheel fast and the second one either spins slow in the opposite direction or it doesn’t spin at all. Obviously I changed my output pins to 3 and 4 to match my settings.
// Sweep Sample
// Copyright (c) 2012 Dimension Engineering LLC
// See license.txt for license details.
#include <Servo.h>
Servo ST1, ST2; // We'll name the Sabertooth servo channel objects ST1 and ST2.
// For how to configure the Sabertooth, see the DIP Switch Wizard for
// http://www.dimensionengineering.com/datasheets/SabertoothDIPWizard/start.htm
// Be sure to select RC Microcontroller Mode for use with this sample.
//
// Connections to make:
// Arduino Pin 3 -> Sabertooth S1
// Arduino Pin 4 -> Sabertooth S2
// Arduino GND -> Sabertooth 0V
// Arduino VIN -> Sabertooth 5V (OPTIONAL, if you want the Sabertooth to power the Arduino)
//
// Sabertooth accepts servo pulses from 1000 us to 2000 us.
// We need to specify the pulse widths in attach(). 0 degrees will be full reverse, 180 degrees will be
// full forward. Sending a servo command of 90 will stop the motor. Whether the servo pulses control
// the motors individually or control throttle and turning depends on your mixed mode setting.
// Notice these attach() calls. The second and third arguments are important.
// With a single argument, the range is 44 to 141 degrees, with 92 being stopped.
// With all three arguments, we can use 0 to 180 degrees, with 90 being stopped.
void setup()
{
ST1.attach(3, 1000, 2000);
ST2.attach(4, 1000, 2000);
}
void loop()
{
int power;
// Ramp both servo channels from 0 to 180 (full reverse to full forward),
// waiting 20 ms (1/50th of a second) per value.
for (power = 0; power <= 180; power ++)
{
ST1.write(power);
ST2.write(power);
delay(200);
}
// Now go back the way we came.
for (power = 0; power >= 180; power --)
{
ST1.write(power);
ST2.write(power);
delay(50);
}
}
Has anyone on the forum actually using a Lynxmotion Rover had success with running a BotBoardArduino or Uno with either the Dimension Engineering Sabertooth 2x10RC and/or the 2x12RC?
I’m not talking about this might work, or this should work, I know someone that said that they had it working… someone that has experience spinning motors with this set up?
1 Like
@RoboCS am I under-powering the Sabertooth by only using one 12V battery? I’m currently only trying to get 2 motors to spin correctly (Default motors that came with the rover)… I contacted Dimension Engineering and they said that I can RMA the unit for them to test it since everything appears to be configured as per instructions.
@bmoscato In the first image, it appears that there’s a red wire from the Sabertooth still connected to the BotBoarduino on Tx of pin 4? Note that the Sabertooth is providing 5V power, which is not at all meant for the Tx pin (or MCU) of the BotBoarduino and both of the red power pins from the Sabertooth need to be removed. You also have VS=VL, and the jumper for pins 3 and 4 is set to VS, therefore you likely have some major power conflicts. going on, to the point where it is possible something has burned or fried. Normally you would have removed the VS=VL jumper on the BotBoarduino and removed both red 5V cables on the Sabertooth.
@cbenson thanks for the reply. Nope, I actually cut the red wires and taped them back, so there is no 5V passing to the Sabertooth.
Ok. As such, with VL = VS jumper in place, there should not be 9V on the Tx line, but since the red wires from the Sabertooth are cut, it goes nowhere. Note that 9V batteries drain very quickly. For testing, try USB power for the logic voltage (change the jumper from EXT to USB).
Q1) Can you provide a link to the motor you are using?
Q2) Note that you have mixed mode ON (might be easier to troubleshoot with independent control. This might explain the behavior. If one of the motors spins in the wrong direction, simply switch the two wires.
Q3) Check the 12V battery’s voltage.
I will make the changes to the BotBoard when I get home later and see, that said, the BotBoard runs fine when I’m just spinning 2 servos on pins 3 and 4. I know that the servos are running the 5V pin, where the motor driver has those pins bypassed.
A1) I have the stock motors that ship with the Lynxmotion A4WD1 Autonomous Rover Kit.
A2) One motor will spin (slower and opposite direction) when I’m only trying to move one. This is a hit or miss occurrence.
A3) I’ll check this as well when I get home.
I also purchased a new Sabertooth dual 12A motor driver for R/C and new battery last night.
Ah - Lynxmotion A4WD1 standard setup then. Regarding direction, just flip the wires from the motor going in the wrong direction. The question is really why are both motors moving when only one motor is receiving a signal. It sounds like Dimension Engineering seems to think the unit is defective, and we can’t see anything wrong with your setup. You’ll get back to us with the battery’s voltage.
Will do, I’m assuming that it’s good because it’s brand new… but you never know.
Good morning,
I tested the voltage last night after charging the battery, but didn’t get a chance to post… 12.9V is what I got.
Bryan
@bmoscato Battery seems fine. If Dimension Engineering has indicated they suspect it’s defective, and we cannot spot anything wrong with your setup or the code, then we can only agree with them at this time. No clue what may have happened though.
3 Likes
Agreed, I’ll probably RMA it to them later this week. Hopefully I’ll have the new board that I purchased from RobotShop before the weekend so I can get this project up and running.
I received the new Sabertooth 2X12 R/C board today and all appears good. I swapped the boards and put the new one in “Independent Control” mode. Current switch positions:
1 = off
2 = off
3 = on
4 = on
5 = off
6 = off
This configuration works with both the BotBoarduino and the Uno. BotBoard is configured for pins 3 and 4 where the Uno is using pins 9 and 10.
Thanks to all those that gave advice to help sort this out.
1 Like