Hi, I would like to build a rover without a steering servo but rather with 2 motors (left+right) for the steering, just like a tracked vehicle.

Is there an ArduRover firmware that supports that kind of setup.

If not, can someone tell me where in the ArduRover code I have to make the necessary changes.




Views: 4620

Replies to This Discussion


I just tested a 6WD skid steering rover with my APM1.4/Oilpan. The manual mode works fine. I have not tested the autonomous mode yet. I am using the APM throttle and steering PWM signals to control a Dimension Engineering Sabetooth dual motor controller. I have the controller operating in the R/C mode so the throttle input controls forward/backward motion and the steering controls the right/left skid steering. If you are using separate motor controllers for each motor then that complicates the steering process. You might want to investigate the APM elevon output mode to accomplish what you wish to do.



Sounds good. Thanks.

I'm using the Arduino Motor shield to control both motors. I hope that it brings the same functionality as the sabertooth. I will try it as soon as I have put everything together.



I'm using a second Arduino with 40 amp  4QD Motor Controllers. The signals can be read in using the PulseIn() function, adjusted as required and then outputed as PWM using AnalogueWrite().

It should be possible to alter the ArduRover code but its quite difficult to figure out where to put the code. Having a second Arduino also opens up the possibilities for adding further features without affecting the ArduRover code.



Seems that the sabertooth does the steering into differential steering translation.

Do you know an algorithm/source code that does that translation (for forward and backward movement).



This may help. Its the code I use to convert to PWM for the motor controllers.

// Remote control ......
#define CH1Max 1830
#define CH1Min 1040
#define CH2Max 1810
#define CH2Min 1055
unsigned long CH1val = 0, CH2val = 0;
int CH1adj_val = 0, CH2adj_val = 0, startup = 0, counter = 2;
int lSpeed = 0, rSpeed = 0;
byte IsAuto = 0, IsAutoDone = 0;
int lSensorValue = 0, rSensorValue = 0, SensorResult = 0;

void RemoteControl() {
// Get receiver pulses
CH1val = pulseIn(CH1, HIGH, 20000); // read RC channel 1
CH2val = pulseIn(CH2, HIGH, 20000); // read RC channel 2

// Allow pulses at startup to settle system
if (startup < 10) { // may reconsider this stategy
startup ++ ;
} else if (CH1val == 0 || CH2val == 0) { // ignore occasional bad pulses
if (counter >= 3) { // allow 2 bad signals then shutdown
counter = 0 ;
lSpeed = 0 ;
rSpeed = 0 ;
digitalWrite(lREV, LOW) ;
digitalWrite(rREV, LOW) ;
counter ++ ;
} else {
counter = 0 ;
// Map Ch1 pulse range - 255 to 255 - sets voltage at approx 3v - vary to change max voltage
CH1adj_val = map(CH1val, CH1Min, CH1Max, -255, 255); // Spectrum 5 RC values are between 1040-1830 RANGE MAY NEED ADJUSTMENT
// Map Ch2 pulse to -255, 255 (consider different range)
CH2adj_val = map(CH2val, CH2Min, CH2Max, -255, 255);

if(CH1adj_val >= -10){ // Forward
digitalWrite(lREV, LOW) ;
digitalWrite(rREV, LOW) ;
} else { // Reverse
digitalWrite(lREV, HIGH) ;
digitalWrite(rREV, HIGH) ;
lSpeed = abs(CH1adj_val) ;
rSpeed = abs(CH1adj_val) ;

// Check direction and adjust motor speed if required (turning left or right)
if (CH2adj_val < -10) { lSpeed = abs(CH1adj_val) + CH2adj_val ; }
if (CH2adj_val > 10) { rSpeed = abs(CH1adj_val) - CH2adj_val ; }

// stabalize speed if near centre
if (lSpeed <= 5) {lSpeed = 0 ; } // adjust as required
if (rSpeed <= 5) {rSpeed = 0 ; } // adjust as required

// Constrain Motor speeds
lSpeed = constrain(lSpeed,0,255) ;
rSpeed = constrain(rSpeed,0,255) ;

// Write PWM to Motor Controllers
analogWrite(lMOTOR,lSpeed) ;
analogWrite(rMOTOR,rSpeed) ;


Instead of a Sabertooth, I'm using a RoboClaw.  It is a dual motor driver board, and can convert from steering and throttle to left/right "tank" drive. 

But thanks for posting your code!



A few of us are attempting to do the same thing with boats that have 2 screws.  I've gone into the C++ code in several files, found references to elevators and changed them to copies of the throttle code.  But I'm not a programmer and can't find all the changes that need to be made.  And when I try to compile the changed code, I just get a load of errors.

If you are successful, please let me know.  I've about given up and am looking at driving the boat with just one screw.

Good luck!




The shortest route to accomplish what you want to do is for you is to use a motor controller, like the Sabertooth or the RoboClaw to control the two motors. Otherwise, there is a program for the Parallax BS2 that will take steering and throttle PWM and convert it to a left and right PWM outputs for motor ESCs for a form of skid steering. I am sure that there is an equivalent Arduino program available.

Just a thought

Hi Doug,

I'm a software engineer but its hard to dig into the code if you dont know how it is structured.

May be Jean-Louis Naudin who has ported ardupilot to ardurover could help.




Yeah, it would be nice if code to do the transpose was built in.  A simple #define or even a parameter could invoke it.

basic algorithm for converting throttle/steering to L & R motor commands:

Lmotor = throttle + steering

Rmotor = throttle - steering

scale as needed.  If steering is reverse, swap the two signs of steering.

You might look on LynxMotion for "rover" code (in Basic):



Google: "joystick to differential drive"



Another avenue is to use an off the shelf - or finding a code snippet - for a "v-tail mixer"

This is, in essence, what these motor controllers are doing.

Here is something I found:


© 2017   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service