Sabertooth 2X25 And Ez-B V4 Simply Serial Connection
I have received my very first Sabertooth 2x25 motor controller today, and looking to hook it up over the weekend. I've spent the afternoon looking through the forum finding all of the necessary information, as well as the Sabertooth Serial tutorial to find out what I need for a successful connection. I've combined all of the essential information and laid it out below like a basic tutorial for others to follow should anyone need it. But I'd be grateful for some help as I do have a couple of questions at the end of the this post, and would like conformation that I have the tutorial part correct.
This is for a two drive wheeled robot with differential (tank style) steering.
Connecting the Sabertooth to the EZ-Bv4. NOTE: This example will use EZ-B v4 Port "DO", but any EZ-B digital port will work.
The "S1" terminal on the sabertooth, connects to the D0 Signal (white) pin on the EZ-B.
The "0V" terminal is "Ground" on the sabertooth, and connects to the D0 ground (black) pin on the EZ-B.
Connecting Motors.
One DC motor connects to M1A and M1B terminals on he sabertooth.
Second DC motor connects to M2A and M2B terminals on he sabertooth.
Connecting Motor Battery. NOTE: Wiring has to be correct, as the sabertooth does not have reverse polarity protection.
DC motors positive (red) battery cable connects to "B+".
DC motors negative (black) battery cable connects to "B-".
[u]Dip Switch Setting for "Simplified Serial at 38400 baud rate.[u]
Switch 1 Up, Switch 2 Down, Switch 3 Up, Switch 4 Down, Switch 5 Down, Switch 6 Up.
I have also read that some members had trouble with the 38400 baud rate, and used 9600 baud rate with the fallowing dip switch settings...
Simplified Serial at 9600 Baud Rate.
Switch 1 Up, Switch 2 Down, Switch 3 Up, Switch 4 Down, Switch 5 Up, Switch 6 Up.
Connection initialisation script.
Place the following code in the EZ-B "Connection Control" script editor, or "Init" script that connects to the EZ-B connection control.
#Connection INIT command to put motors in a "Stopped" state.
#NOTE: If using 9600 baud rate, edit the following script from "38400" to "9600".
SendSerial(D0,38400,0)
Setting Up Custom Movement Panel.
The following scripts are added in to the custom movement panels script editor...
#NOTE: If using 9600 baud rate, edit the following script from "38400" to "9600".
# Forward
# Motor 1, 127 is full speed forward.
SendSerial(D0,38400,127)
# Motor 2, 255 is full speed forward.
SendSerial(D0,38400,255)
#Reverse
# Motor 1, 1 is full speed reverse.
SendSerial(D0,38400,1)
# Motor 2, 128 is full speed reverse.
SendSerial(D0,38400,128)
# Differential Turn Right
SendSerial(D0,38400,255)
SendSerial(D0,38400,1)
# Differential Turn Left
SendSerial(D0,38400,127)
SendSerial(D0,38400,128)
# Stop
SendSerial(D0,38400,0)
I believe I have the above information correct, but I do have a couple of things I am unsure of.
1.) If the EZ-B has its own battery, and the Sabertooth has its own battery, does there need to be a common ground between the Sabertooths battery ground (B-) terminal, and an EZ-B ground port or EZ-B battery ground... or is this not necessary as the Sabertooths "B-" and "0v" share a ground circuit?
2.) If using a two drive motor setup with independent "differential" steering, is the Sabertooth to EZ-B connection just "S1" to "D0 signal" and "0v" to "D0 Ground" as mentioned above... or is the "S2" terminal used (S1 = left motor, S2 = right motor, and connects to another signal port (D1 for example)? The only reason I ask this, is what I've seen in other threads, it looks like members use just the S1 terminal for two motors, but the sabertooth documentation says S1 and S2 are for separate motors.
Thanks.
Thanks for the link Alan.
The sabertooth is my baby...LOL... The best motor controller in the world....
Wouldn't build a robot without one.....
@Richard.
Really? I would never had guessed, lol. Seriously though, I said to you I would get one... eventually, so I figured it was about time to step up. It is an expensive bit of kit, but I've only seen good things said about it from yourself and pretty much everyone else who uses one, so I don't mind paying out for quality and reliability. 2x25 maybe bit of overkill for what I need it for, but better safe than sorry.
@Steve... they are rock solid... although they don't have reverse polarity protection (don't ask me how I know that... think magical blue smoke) they will simply shut down if the motors attempt to draw too much current, which is an awesome feature.... They are expensive as you mentioned, but I really like them.... I think that they are very versatile and only take up one port (or uart) on the ezb.... And as a bonus you can use a kangaroo for feedback if need be... I actually haven't used the kangaroo (even though I have 2) yet but one day, especially if David gets his LIDAR plugin complete I will be definitely using them....
Yeah, that's a great point. The one v4 port thing really is a bonus too.
Steve, I did some testing this morning and found out that a previous statement from me was wrong. You will need to have the grounds from the two batteries connected. Sorry about the misinformation earlier. Alan is correct in this.
Not to worry David. Thanks all the same.