Boe Bot Ramping Issues
I just got my Boe Bot kit a few days ago and everything has been going very smoothly until now. My servos are mismatched, but I was able to find an acceptable correction to slow down the right servo enough that the Boe Bot can go straight. My issue comes in the next project when I am starting to play with the ramping. I am having a hard time figuring out how to ramp the Boe Bot. During the ramping up phase, it skews to the left. During the constant motion phase it drives straight because it was simple to put in my correction value here, but during the ramp down phase it once again skews to the left. How can I make some permanent adjustments to keep the Boe Bot straight during the ramping phases?
Comments
Are encoders pretty useful for keeping mismatched servos turning at the same speed?
Extremely useful for that. You can also use them for fairly reliable estimates of your current location. Parallax sells a set for the Boe-bot, as well as third parties, and people home brew them too. They do add some complexity and take up two I/O pins, so I'd say try the 25%, 50%, 75%, and 100% technique for now since you are still learning. But keep the notion of using encoders in the back of your mind for the future as you get more confident.
Here's my Robot using encoders for dead reckoning:
Here's a link to the Parallax product:
http://www.parallax.com/Store/Robots/RoboticAccessories/tabid/145/ProductID/80/List/0/Default.aspx?SortField=ProductName,ProductName
One last question... when you do the 25% 50% 75% 100% method for ramping, you no longer use the type of ramping shown in the activity book? ie. not the pulsout, 12, 750 + PulseCount ?
The code I used for my demo above is based upon the apply encoders document written by Phil Pilgrim. He uses a calibration program to maintain an even more granular table of pulse widths to servo velocity. I use that code all the time.
PWM = pulse width modulation. This is varying the width of the high portion of the control signal relative to the overall wave form. That is what you are doing when you issue a pulsout command followed by a pause.
The problem isn't ramping per se, the problem is ramping two servos so that their velocities are matched at each step. As you ramp by changing the pulse width one servo's output is inevitably greater than the other. That's why the robot goes to one side or the other. At full speed you already tweaked the control signals so the servos output equal power. You've also adjusted them so 750 is their rest position. So if you change each pulse width by one when you are at full power you won't reach this difference in the full power output.
Did I make sense? BTW This problem is bigger than the Boe-bot and engineers face this problem all the time when designing things like printers.
Also, Martin, when you do the ramping with the 25% 50% 75% 100% method, do you leave a specific pause in between the commands to ramp? I only ask because I assume doing this without a pause would practically negate my attempt at ramping. Thanks for all the help!
The value for pulsout can be between 650 to 850 with 750 as the center. For normal servos if you keep making the pulses wider or narrower than that the servos will keep moving farther and farther from neutral until they hit their mechanical limits and possibly damage the gears. With continuous rotation servos there are no mechanical limits so I am not sure what will happen.
Each pulse is like always, a pulsout with a pause. But because of inertia you can't do one at 25% power, one at 50%, one at 75%, then go to full power. You need to do several at each intermediate pulse value. How much depends upon the inertia of the robot in question. A stock Boe-bot is pretty light, but if you add the gripper and maybe a camera it gets much heavier. So you'll need to experiment a bit.
Does this make sense?