Shop OBEX P1 Docs P2 Docs Learn Events
Boe Bot Ramping Issues — Parallax Forums

Boe Bot Ramping Issues

msh5686msh5686 Posts: 70
edited 2012-03-29 13:32 in Robotics
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

  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-28 12:14
    When I'm not using encoders I have a table of left and right pulse widths for 25%, 50%, 75%, and 100% power. Then I go 25%, 50%, 75%, and then 100% to ramp the servos. Basically you need to work out the pulse widths for each power level.
  • msh5686msh5686 Posts: 70
    edited 2012-03-28 12:59
    Martin,

    Are encoders pretty useful for keeping mismatched servos turning at the same speed?
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-28 13:06
    msh5686 wrote: »
    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
  • msh5686msh5686 Posts: 70
    edited 2012-03-28 13:26
    Thanks for the help, Martin!

    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 ?
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-28 15:32
    Correct. That addition does not work because servos are not linear. So adding one does not produce the same amount of umph servo to servo. This is a common problem and requires feedback to fix.

    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.
  • msh5686msh5686 Posts: 70
    edited 2012-03-29 06:06
    I was looking at the servos on Parallax and it says they are easily ramped using the PWM command. I have not come across this command yet and was wondering if any had any input as to its usefulness for a permanent ramping solution. I'm working on the percentages Martin suggested, I'm just not sure how to implement it as a full-time solution. I'll keep playing with it until it makes sense, was just wondering what the deal was with using the PWM since it said it could easily do linear ramping.
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-29 06:50
    msh5686 wrote: »
    I was looking at the servos on Parallax and it says they are easily ramped using the PWM command. I have not come across this command yet and was wondering if any had any input as to its usefulness for a permanent ramping solution. I'm working on the percentages Martin suggested, I'm just not sure how to implement it as a full-time solution. I'll keep playing with it until it makes sense, was just wondering what the deal was with using the PWM since it said it could easily do linear ramping.

    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.
  • msh5686msh5686 Posts: 70
    edited 2012-03-29 13:02
    Just playing with the pulsout arguments, I tried putting a value greater than 850 for my servo that runs slower than the right one. I did this to see if I didn't necessarily have to slow the Boe-Bot down to match the servos and it seemed to work ok. Is this an issue? Will it damage the servo by going beyond what the book says to use?

    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!
  • Martin_HMartin_H Posts: 4,051
    edited 2012-03-29 13:32
    msh5686 wrote: »
    Just playing with the pulsout arguments, I tried putting a value greater than 850 for my servo that runs slower than the right one. I did this to see if I didn't necessarily have to slow the Boe-Bot down to match the servos and it seemed to work ok. Is this an issue? Will it damage the servo by going beyond what the book says to use?

    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.
    msh5686 wrote: »
    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!

    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?
Sign In or Register to comment.