BoeBat Tracking to the Left or Right
We have a problem with our BoeBot - when we attempt to go in a straight line over a distance, it tracks to the left or the right. The servos were centered appropriately, and we using the correct PULSOUT offset to make the wheels spin at the same speed. We thought it was the rubberband treads, but we still had the same problem when we removed them. Any ideas of what we should look at?
Comments
1.· Alignment of the servos - The folds of the metal BOEBot body that create the verticle surfaces that you mount the servos on may be slightly off from true perfect 90 degrees and may not be perfectly parallel.
2.· Servo speed - due to slight differences in the manufacturing process, the motors and/or electronics may have slight differences that cause very slight speed differences that will pull the BOEbot left or right.
I actually use a "callibration" variable in my programs even thought my servos were both "centered".· By adding or subtracting a small amount, I was able to get my BOE to go straight for up to 15 or 20 feet!
The code looks like this
Adjustment····· var···· Nib
Adjustment· = 2
pulsout output_pin, 850+Adjustment
One servo going a little faster than the other is the most common culprit for a slight lilt in the Boe-Bot's forward travel.· If the servos aren't actually going the same speed, the goal is to slow down the faster one so that the slower one can keep up. Here is a program for continuous forward motion with both servos turning full speed:
Let's say your Boe-Bot is veering to the right. If we slow the left wheel down some, it should straighten out the Boe-Bot's path. Even though the Boe-Bot I tested for this post was only veering slightly to the right, the program that straightened out its path has a seemingly large adjustment to the left servo's pulse width.
Why such a big change? There's a graph of servo speed vs. pulse width on page 115 that hints at why. The pulse values you are sending the servos are somewhat outside of the speed control range to make sure that both really are going full speed. Once you get down to 820 or so, there starts to be some more noticeable changes in speed. Beyond 800, the speed control is pretty linear.
If it turns out that the right wheel is the one you want to slow down, keep in mind that the rule for slowing down a servo is to give it pulse widths closer to 750. So, instead of 650, try 680 as a first guess, then adjust the value upward to slow the servo down, or downward to speed the servo up.·
Once you're pretty sure of your numbers, you can declare some constants for your program. That way, if the servos performance changes over time, you can adjust values at the beginning of the program that will in turn adjust the arguments in every PULSOUT command. Here is an example:
In terms of tuning, you may also want to declare CcwRight and CwLeft constants for tuning backward travel. You can also add PIN declarations, like ServoLeft PIN 13 and ServoRight PIN 12. Then you can replace all instances of 13 in the program with ServoLeft, and all instances of 12 in the program with ServoRight.· If you ever need to plug your servos into different servo ports, this will also make it possible to adjust single values at the beginning of your program that in turn update all the program's PULSOUT commands.
Post Edited (Andy Lindsay (Parallax)) : 4/14/2005 1:50:36 AM GMT
and it only happens at the same place, (several locations of same place), with two different Robots
(Both the BOE-BOT, and a TAB Build Your Own Sumo-Bot), but not elsewhere..
case in point.. At home, both will track a perfect straight line. (give or take a few degrees.)
However, at work, (for those who don't know, I work at a schoolbus garage, and I occationally
bring the bots to amuse & inspire the Kindergarten kids, on the bus.)
both seem to track to the right.. I looked at the frame of the BOE, and one side seemed a little
out of square, but once I bent it into place, it still tracked right.. Okay, Re-calibrate the servos..
still tracking right. Yes, I even tried adjusting the pulsout rate.. Guess what?
Now, It even happens with the TAB Robotics 'Build Your own Sumo-Bot'.. Now, I know there's
that chance that DC motors won't always spin at the same rate, but, at home, no problems.
At work, it drifts right in a nearly perfect arc.. But, Here's where it gets even weirder!
I took them outside, out onto the parking lot. (without the busses charging around. Personally, the BOTs
seem to drive better than some of my co-drivers. ) the right turn arc, is tighter!
inside, it would move off about 5-6 inches from straight after 3 feet.. Outside, it would turn almost a good
1-foot drift!
Sounds like a case for the X-Files, but it's a definate case of fact being stranger than fiction!
Stephen (gelfling6)
there are a few things you could try...
add some weight to the bot.
use a compass module to check for bearing deviation.
put a pot dial on top to use as input for an adjustment variable (as demonstrated above). When you notice the variable steering for the different surfaces, you could just dial in the corrected variable.
just a thought.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
**************
daniel woolston
Teksystems Inc.
www.danwoolston.com
**************