Looking for skid steering algorithm
Hi all,
I have searched all the forums here and have come up empty handed.
I need a skid steering algorithm to implement the BS2 code to·control two independent motor controllers ([url=mailto:HB@%s]HB25s[/url]) as one would use a single Sabertooth 2X10 motor controller with the built-in skid steering function.
Regards,
TCIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
I have searched all the forums here and have come up empty handed.
I need a skid steering algorithm to implement the BS2 code to·control two independent motor controllers ([url=mailto:HB@%s]HB25s[/url]) as one would use a single Sabertooth 2X10 motor controller with the built-in skid steering function.
Regards,
TCIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
Comments
http://www.parallax.com/dl/docs/prod/datast/ApplyEncoder.pdf
Its a document that may help you derive your own. You will need the wheel encoder kit or an equivalent.
SJW
In other words, I think you want to be able to use a speed value and turn value and have those mixed to the two motors, rather than using two individual motor speeds?
Is that right? If so, there are a couple of approaches. The simplest is like this (from Dave A. at Parallax, I think):
The above is for mixing from an RC with X and Y joysticks, but the theory is the same. The above uses 750 as "neutral" but you can map to whatever foward/neutral/reverse values you want and it's the same (my own controller uses 0 for reverse, 128 for stopped, 255 for forward.
That said, the above wastes some resolution from the turn, and you do not get consistent speeds as you change turn (work through some half speed, half turn or full turns with changing speeds and you'll see what I mean). I use an algorithm (on the Stamp anyway), that proportionally mixes in the turn value with the "overall" speed so that the speed of the platform as a whole remains relatively consistent when the turn is changed (i.e. the turn value changes the turn direction and turn RADIUS of the platform and the nominal speed remains the same throughout). I can post that code later if you want -- it's on another machine and I'm not there right now.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Post Edited (Zoot) : 10/8/2007 5:23:35 PM GMT
The example that you have shown is exactly what I have been looking for. I would also appreciate being able to see the additional code that you have mentioned when you get the chance.
Thank you very much.
Regards,
TCIII
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
- my motor controller: 0 = full reverse, 128 = stopped, 255 = full forward
- user (i.e. platform) "speed": 0 = full speed reverse, 128 = stopped, 255 = full speed forward
- user "turn": 0 = spin CW, 128 = straight, 255 = spin CCW
- the mixing algorithm SUBTRACTS/ADDS speed to the motor on the INSIDE of the turn, the OUTSIDE of the turn maintains the overall speed. Another way to put it -- if you have a turn of 160 (128+32) at speed X, the outside motor (in this case the right motor) will move forward at speed X and the inside motor (in this case the left motor) will move at neutral+(speedX*50%). Why? It was easy. Plus, my particular platform moves really fast, and I have it operating at no more than 80% full speed anyway. This gave me a way of knowing that my *fastest* speed on the platform at any given moment would be on the outside. A purer alogrithm would add speed to the outside wheel and subtract from the inside resulting in the "master" speed at the CENTER of the platform, between the wheels. But without encoders I'm not sure that level is nuance is worth while. Just my two cents.
- my particular main program that uses this algorithm allows switching between "mixing" and individual motor control. Being able to do the latter can be helpful for following, certain PID, or sensory alignment routines, where accounting for turn vs. speed gets a little cumbersome and kinda silly.
- I split forwards/backwards up so I could mess with "which way do you turn when turning and going backwards?" My implementation is reversed from many mixers, because it fit my obstacle avoidance code better, so you could think about switching that part around. Try it and see.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Post Edited (Zoot) : 10/8/2007 8:57:03 PM GMT