The first step in our master plan is to program the Arduino to communicate with the robot base, so we can move. To interface between the motors and the Arduino, I am using a Sabertooth 2x12 motor controller. I configured it to run with mixed steering RC inputs using the DIP switch wizard here. My DIP switches were set to 011110. To connect the Arduino to the Sabertooth, connect wires from ground, S1, and S2 on the Sabertooth to the GND, P5 and P6 pins on the Arduino. The Sabertooth will act like a pair of servos, so it makes it a snap to program. Here is a basic program to test the base with(NOTE: make sure that either the robot is on blocks or the motors are set to freewheel so it can't go anywhere.): https://github.com/kk6axq/RosBotCode/blob/master/SabertoothTest/SabertoothTest.ino
A quick note about code: all code from this project will be going into the GitHub repository where you can download the latest repository as I work on it.
Back to work. Now try running the code. The robot should move forward and left. Here are a few troubleshooting points:
If the robot is...
- moving backwards: the polarities on your motors are reversed.
- moving right: the motors are swapped in the ports.
- not moving at all: check your power, circuit breakers, and make sure that the Sabertooth is on.
My time to write is getting short, so I'm going to wrap it up here. We covered how to hook up the Sabertooth to the Arduino and how to test the motors. Till next time...