Hi there,
I am new to this forum, so i hope i am asking this in the right location.
I am currently working with a A4WD1 robot, using a BasicX-24 microcontroller, a BasicX Servo8-T Servocontroller, and a Sabertooth 2x5 motor controller (which i have never ued before
).
The plan is to use differential drive and command the S1 and S2 on the Sabertooth using two of the ouputs on the Servocontroller. The servocontroller is being used instead of just going straight from the microcontroller in order to free up the microcontroller to get GPS data to direct the rover to its destination.
This leads me to my question: How do i go from PWM (1-255) out of the servo controller to the 0-5V required by the sabertooth? I have the resistor (10k) and capacitor (0.1uF) in order to make the R/C filter shown in the instructions, which i can do⦠I guess i just dont understand 100% the instruction manual seems a little vague to me. Does it matter what pulse range i use? I can set the servo controller to use the standard range of 1ms-2ms or i can also set it to extended 0.48ms-2.52ms⦠I guess part of my confusion lies in the fact that the instruction manual recommends a PWM frequency greater than 1000Hz, doesnāt that imply that the pulse width needs to be less than 1ms? that will put my rover in reverseā¦
So sorry to ramble, i just wanted to make sure i covered as many details as possible. Any and all clarification and help would be greatly appreciated
You are having a major misunderstanding of what the Sabertooth is expecting for the PWM inputs. Servo pulses are not PWM. They are a 1mS to 2mS positive going pulses that repeat every 20mS (50hz). A PWM control scheme on the other hand is a wave that repeats at some frequency, say 5khz where the wave can go from 0% to 100% on. What you need to do is connect the Sabertooth to the servo controllers outputs and set it for servo pulse control. 
Wow, i had a feeling i was grossly misunderstanding something, thanks for the clarification. Now the only thing i donāt know how to set the Sabertooth for servo pulse control, please tell me i bought a motorcontroller that will workā¦
The only modes i see in the manual (dimensionengineering DOT com/datasheets/Sabertooth2x5.pdf) are
Analog Mode
R/C mode
Simplified Serial
packetized serial
Also, in the manner that you described, there is no RC filter, just straight from the servo controller outputs to the sabertooths S1 and S2, correct?
Thank you so much for being so helpful⦠I have a over $500 invested in this rover right now and i really dont want to have to replace any components.
Life just got really good 8)
Thank you ever so much! 
So i definitely jumped the gun on this post⦠what an embarassment⦠
In the manual:
Mode 2: R/C Input
R/C input mode takes two standard R/C channels and uses those to set the speed and direction of the motor. There is an optional timeout setting. If timeout is disabled, the motor driver will continue to drive at the commanded speed until another command is given. This makes the Sabertooth easy to interface to a Basic Stamp or other lowspeed microcontrollers.
So do i even need the servocontroller? It seems somewhat redundant. Once i send the speed/direction signal, the sabertooth will hold that until the next command (which will allow the BasicX-24 freedom to move onto another process), right?
One advantage of using a servo controller in between the microcontroller and the motor controller is you can set the speed down, (Iām assuming there is a speed function in the servo controller) you get automatic acceleration and deceleration. Beyond that there isnāt much advantage.
uh-oh
have i had another grand canyon sized misunderstanding?
In R/C mode, without the servocontroller, can i not control the speed?
This is the pseudocode given in the manual:
Output_High(Pin connected to S1)
Delay(1000us to 2000us)
Output_Low(Pin connected to S1)
I thought that a 1000us signal would correspond to full backwards and a 2000us signal would correspond to full forward, and anything in between would scale the speed. And likewise for left and right turning. Am I completely wrong?
Everytime i think i understand, i realize i havenāt a clue. Thank you so much for your time and patience with me.
You have the basics down, but you are missing the big picture. Ok, here we go.
Assuming 1500uS = stop, you can program for the pulses like thisā¦
start:
high pin1
pause 1000uS
low pin1
high pin2
pause 1000uS
low pin2
pause 20mS
goto start
This will create the two pulses for the motor controller to rotate two channels at pretty much full speed. Now when the program is started the motors will very quickly spin at max speed. Not very friendly for the gears. To slow this transition from stopped to full speed it would be cool to ramp up the speed values. Like this.
start:
leftvalue = 1500
rightvalue = 1500
leftvalue = leftvalue-10
rightvalue = rightvalue -10
gosub makepulses
if leftvalue > 1000 then goto start
makepulses:
high pin1
pause leftvalue
low pin1
high pin2
pause rightvalue
low pin2
pause 20mS
return
This code would generate two pulses that start at 1500uS and gradually change to 1000uS. The time it takes to get to full speed is the āsoft startā or acceleration. Now if your servo controller has a speed variable you can set a channel to 1500uS and then tell it to change to 1000uS at a specific speed.
Making code to generate pulses is a pain, and making code to control the motors with acceleration and deceleration is a big pain especially for a beginner. The servo controller can make it much easier.
phew⦠i am not as far gone as i thought⦠i got worried there⦠I get what you are saying now.
In the Sabertooth2x5 manual it mentions exponential response:
Switch 5: Exponential response
If switch 5 is in the UP position, the response is linear. If switch 5 is in the DOWN position, the response to input signals will be exponential. This softens control around the zero speed point, which is useful for control of vehicles with fast top speeds or fast max turning rates.
Would enabling this option give a similar effect?
No. When you get it going you can experiment with this option. But itās not likely to be useful because you are controlling it autonomously, not RC.
ive got all the preceding code in working order, so the vehicle will now know where it needs to go, I am going to play with this option in a few hours and see how it goes⦠if not i will do exactly what you said⦠your advice has been amazing!