Sabertooth 2x25 And Ez-b V4 Simply Serial Connection

 
#1

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.

User-inserted image

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.

User-inserted image

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]

User-inserted image

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.

Code:

#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...

Code:

#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)



Code:

#Reverse
# Motor 1, 1 is full speed reverse.
SendSerial(D0,38400,1)

# Motor 2, 128 is full speed reverse.
SendSerial(D0,38400,128)



Code:

# Differential Turn Right
SendSerial(D0,38400,255)
SendSerial(D0,38400,1)



Code:

# Differential Turn Left
SendSerial(D0,38400,127)
SendSerial(D0,38400,128)



Code:

# 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.

#2

1, the ground to the ezb from the 5v side or communication side is sufficient. There is no need to connect the negative on the batteries.

[Edit] you will have to have a common ground between 2 batteries if using one battery for the motors and a different battery for the ezb. [/edit]

2. the S2 is normally used for sending data out of the sabertooth. You can chain multiple sabertooth controllers together by taking S2 to S1 on the next one. It is also possible to get data back from the kangaroo if you used that in the scenario but it looks like this isnt what you are doing. It also depends on what mode you are using as to how these connections work. Simplified Serial is the easiest.
Simplified serial uses one command to determine which wheel to move and how fast. A single byte is used to do this. 0-255...

0-127 is for one wheel with 64 being stop. 128 to 255 is the other wheel with (191?) being stop.

#3

1) Yes, they must have a common ground or the signal will not work.

2) Just one digital port can drive both motors. I believe if you were to try R/C mode (or any of the other non-serial modes) you would need two connections, one for each channel.

Alan

#4

The communications side of the sabertooth would have the ground to the v4, along with the send signal from the v4 to the receive signal (s1) to allow simplified serial to work. The ground wire would serve as your reference.

#5

Thanks for the input guys.

I figured there would have to be a common ground like other motor controllers do with separate power supplies. I did see you (Alan) mention about using a common ground in one of the threads I looked at, but just wanted to make sure.

That's good to know about the S2 terminal as well, and nice to get clarification of that. I guess the rest of what I wrote was correct.

Thanks again. Smile

#6

I assume you have also read about the power sink? The Sabertooth will try to send power back to the battery if you move the wheels (regenerative braking), so if you turn it off by disconnecting it from the battery, there is nowhere for that power to go and it can damage the sabertooth.

Dave C had some good information about having a switch and a diode so when you flip the switch no power goes from the battery to the sabertooth, but power can still flow back to it in case you are pushing your robot around.

Alan

#7

@Alan.

No, I didn't see that. I was aware about the power regeneration thing, but didn't know about what you mentioned. To be honest, for what I'm using it for, if I need to move the robot with no power, I just lift it rather than pushing it around (although I do have another robot, K9, which I do push around if needed, and may upgrade his motor controller to a Sabertooth one day, so this info is very helpful).

Thanks Alan.

#8

I think it was Dave S that had info on this.

#9

@Dave, you are absolutely correct, Dave S, not Dave C.

Here is the thread with details: http://www.ez-robot.com/Community/Forum/Thread?threadId=5304

Alan

#10

Thanks for the link Alan.