Power: 5v mega to 5 v sabertooth
Mega's Tx2 pin connects to the S1 of Sabertooth
Mega's RX2 pin connects to the S2 of Sabertooth
Mega's GND pin connects to the 0V of Sabertooth
I intend to use position and speed control of 2 motors, I am not sure if it is possible with sabertooth, Is there possible to upload program to arduino and by pressing any switch the arduino send the progams to run the motor according to the program, Like autonomous. Please enlighten me and correct me if I am wrong.
Q2 do i need this breadboard, i had no idea the purpose for this,
Hi thx for responding, this the datasheet it does not show how the connection with mega but it has other option like to rc reciever . However, i need the robot to be program autonomously so looking if you can interprate it. Really appreciate
from the datasheet there are two mods to connect your arduino to the Sabertooth
first Simplified Serial Mode in witch case you need to connect the TX line form one of your hardware serial to the S1 input
or Packetized Serial Mode which its connected the same way to the arduino
for setting the baudrate
for the simplified serial mode - you need to toggle switch 4 and 5 (check the datasheet page 13 for values)
for the packetized serial mode - the baud rate will be set automatically when sending 170 decimal (10101010 binary) to the sabertooth after power up , valid baud rates will be 2400, 9600, 19200 and 38400 (take from the datasheet)
you need to toggle switch 4, 5,6 to set the sabertooh address as described on page 16
now if i understood this correct the following code should get your started with the simplified serial mode
Thx , you mean i should wire tx1 from arduino mega to s1 and this will send signal from arduino to sabertooth motor 1. For the motor output i was clear. Is there any wire should i plug in like 5v arduino to 5v sabertooth. I guess it is to power up. So if i need to drive 2 motor i ll need tx 1 and 2 to s1 and s2 respectively .
By the way. Do you think i would be able to vary the voltage on each motor in program to do position control of robot. Really thx for your insight. I ll keep updating my progress
nop only TX need to go in S1 for both serial communication mods and as described in the datasheet for simplified serial mode sending values between 1-127 will control motor 1 sending values between 128-255 will control motor 2
Because Sabertooth controls two motors with one 8 byte character, when operating in Simplified
Serial mode, each motor has 7 bits of resolution. Sending a character between 1 and 127 will
control motor 1. 1 is full reverse, 64 is stop and 127 is full forward. Sending a character between
128 and 255 will control motor 2. 128 is full reverse, 192 is stop and 255 is full forward.
Character 0 (hex 0x00) is a special case. Sending this character will shut down both motors.
this is taken from the datasheet
S2 has different purposes - in simplified mode with multiple sabertooth modules connected to only one TX line this S2 will select which board your communicating with (datasheet page 14)
in packetized mode when S2 its pulled low the sabertooth module will shutdown (last page of the datasheet)
i suggest you read the datasheet/documentation first and try to understand it (if you still have question will try to answer it but answers will be limited since i dont own a sabertooth module) - then decide which serial mode you want to use and play with your module