Shop OBEX P1 Docs P2 Docs Learn Events
Need help ramping servo speed on boe-bot bs2 — Parallax Forums

Need help ramping servo speed on boe-bot bs2

William HolmesWilliam Holmes Posts: 4
edited 2008-10-09 20:15 in Robotics
Hello everyone, This is my first robotics project so please be patient [noparse]:)[/noparse]

So far things are going well, I have the boe-bot built and most of the basic tuning done e.g. Straight, Right/Left 45,90,180.

The problem I have run into is with ramping the speed of the servos for gentle start/stops. Getting my bot to go straight took a bit of tweaking with the servo speed.
I ended up with numbers around 850 / 683 (the 683 is different depending on maneuver) so when I go to ramp them up i'm not sure how to go about it as the 750 +/- 100 in the loop will not work because the max speeds are not the same.

On a side not is that must difference between servos "normal" ?

Any help or suggestions would be greatly appreciated.

Thanks
~Bill

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-09 14:10
    Differences between servos are normal. Read the Wikipedia article on servos (en.wikipedia.org/wiki/Servomechanism). It discusses standard radio control servos. The BoeBot uses continuous motion servos which are described in some of the links from the Wikipedia page. These are modified and the servo position feedback mechanism is disabled which results in the loss of accuracy in terms of motor speed.

    There's not much you can do other than what you're doing (tweek the PULSOUT numbers). You can write your routines so the step size for the PULSOUT values is different on the left than the right while ramping.

    Post Edited (Mike Green) : 10/9/2008 2:15:58 PM GMT
  • William HolmesWilliam Holmes Posts: 4
    edited 2008-10-09 14:18
    Hi Mike, Thanks for the reply.

    I have achieved acceptable (to me) accuracy in regards to going straight / turning to a specific angle. The part I am struggling with is I have no ramping of the speed because of the difference in the max servo speeds.

    I guess a different approach to the question would be, is ramping absolutely necessary for servo longevity or will I outgrow this platform before the 0 - Max / Max - 0 start stops kill the servos?

    Thanks again.

    I am having a blast teaching my little bot new tricks [noparse]:)[/noparse]
    ~Bill
  • Mike GreenMike Green Posts: 23,101
    edited 2008-10-09 14:32
    The servos will probably outlast your use of the BoeBot.

    One option would be to normally run things at slower speeds and reserving maximum speed for the straightaway dash, slowing down if there's to be some maneuvering. Rather than having a smooth ramping of speed, you just have a stepwise shift from moderate to fast and back again.
  • SRLMSRLM Posts: 5,045
    edited 2008-10-09 15:40
    For my project (dare I reference you to Swiftsure BS2e Robot?) I came up with a fairly simple implementation of the ramping. Basically, I had two values for a servo position: servo real, and servo ideal. The program would modify the ideal at the drop of the pin, whenever it felt that it needed to change dirrection and go in a different path. However, to move, a method was called that compared the servo ideal (what was set) to the servo real (the current position of the servos). Then, the method would step the servo real in the dirrection of servo ideal, and PULSOUT servo real.

    This method produced a very smooth motion on my BOE BOT, and it was completely adjustable in terms of ramping speed. Just change one of the variables a little bit higher, and it takes a little longer. It worked even with differing speeds in the servo mechinisms. One other thing that's useful it LOOKUP tables to correspond those different servo rates.
  • William HolmesWilliam Holmes Posts: 4
    edited 2008-10-09 16:47
    Good stuff guys, Thanks [noparse]:)[/noparse]

    I was considering the stepped method, but I was looking for a more programmatic solution so I could avoid the trial and error. SRLM I am following your solution in concept. Do you happen to have a code snippet lying around so I could see the implementation. I will be looking into a hybrid approach short term using a look up with stepped values until I can get my mind fully around your real/ideal solution as I think that is where I ultimately want to be.

    Thanks again
    ~Bill
  • SRLMSRLM Posts: 5,045
    edited 2008-10-09 19:54
    The link I provided above has the complete code for my project. Look in the Roving.bse program slot, and look for the _Move method. This method is the central movement authority of the robot. Note that the code is almost exacltly the same for a BS2 (as opposed to my BS2e).
  • William HolmesWilliam Holmes Posts: 4
    edited 2008-10-09 20:15
    That's great thank you both for the help. I will post up progress in a few days [noparse]:)[/noparse]

    ~Bill
Sign In or Register to comment.