Results 1 to 8 of 8

Thread: Servo - Adjustable movement speed

  1. Servo - Adjustable movement speed

    Hi,

    Planing to make some multiple servo controller.

    What would be a good approach to implement smooth variable speed movements for a servo?

    The only solution I see is not to tell the servo immediatelly what position it should go to, but for slower movements to have a timer that will increase the servo position in small steps (step length depends on desired movement speed and uC speed).

    But theoretically that would produce non-smooth movements (yanking) i guess?


    any other ideas or is this the way its usually done?

    Last edited by nik; 11-19-2008 at 03:25 PM.

  2. #2
    Join Date
    Jul 2008
    Location
    Chicago
    Posts
    307
    Rep Power
    45

    Re: Servo - Adjustable movement speed

    I actually have been working on this for about 2 months using a Propeller from Parallax.

    I tell it the postion to move to but I compare its current postion. I take the differences between the two and divided it by 100. Then I have a looping program that adds the result to my variable as it increases I send the comand to the servo. This actually moves the servo in steps.(There is no need to go any higher resolution than 100 since the servos smallest value of movement is only .09 degrees)

    It s actually pretty smooth and looks very realistic. I also have variable speeds where there is no limit on the slow side but there is a limit on how fast before the Inverse Kinematic equation donsnt have enough time to finish computing. The math engine is on a seperate COG. The spec sheet explanies what a COG is and that can be found at Parallax.com

    I can make a small video clip of my current progress.

    Paul
    Last edited by Quantum; 11-19-2008 at 04:12 PM.

  3. Re: Servo - Adjustable movement speed

    Quantum: Thx, that helped. I was afraid that the step by step motion would produce non-smooth movements. I just didnt understand what you meant about that second var. speed thats associated with IK :|

    I can make a small video clip of my current progress.
    sure
    Last edited by nik; 11-19-2008 at 04:27 PM.

  4. #4
    Join Date
    Apr 2008
    Location
    Sacramento, CA, USA Area
    Posts
    5,341
    Rep Power
    174

    Re: Servo - Adjustable movement speed

    Welcome Aboard, Nik!

    If you have a look at Metaform3D's recent posts, you'll see his work on something not unrelated, and some linkage to suggestions for algorithm.
    I Void Warranties´┐Ż

  5. Re: Servo - Adjustable movement speed

    Hi Adrenalynn,

    thx for the welcome I read Metaform3D's topic before but I think its another problematic, related to servo electronics and its PID control.

  6. #6
    Join Date
    Apr 2008
    Location
    Sacramento, CA, USA Area
    Posts
    5,341
    Rep Power
    174

    Re: Servo - Adjustable movement speed

    I think the concepts still hold sway. You have a distance, you're estimating that distance, and you're figuring your current position. You have a desired time and you need to cover that distance in that time. You can overshoot or undershoot time, not just distance (as in PID)

    You might also poke a bit at the SSC32's firmware source-code, since it does an outstanding job of getting the algorithm correct...
    I Void Warranties´┐Ż

  7. Re: Servo - Adjustable movement speed

    Thx, I wasn't aware that LM published the source code. I'm curretly brainstorming on my solution but sure, will take a quick look at the code too

  8. #8
    Join Date
    Apr 2008
    Location
    Sunnyvale, CA
    Posts
    378
    Images
    34
    Rep Power
    53

    Re: Servo - Adjustable movement speed

    Quote Originally Posted by Adrenalynn View Post
    If you have a look at Metaform3D's recent posts, you'll see his work on something not unrelated, and some linkage to suggestions for algorithm.
    For what it's worth, I've also worked on the related problem of making servos move slow. What I did was change the pulse width at a constant rate until it matched the target pulse width (actually, with the code I was using, the target servo angle). The code is straightforward except for the complications of using fixed-point integer math.

    I did run into a lot of problems with the step size, however. I'm driving servos using the software servo control class that comes with the Arduino. Delving into their code I found that they had kind of botched some math which resulted in about half the precision that was possible. Fixing that, there was still a limit of 4 microsecond resolution to the pulses due to the scale factor on the pulse-counting register (I don't have the code in front of me so I forget the name). That's about 0.5 degree steps, not the theoretical 0.1 degree. It's basically still kind of quantized when it moves.

    I think it may be possible to change the default scale factor on the register, but I'm not sure how to do it, or if it could be done, how it would affect the rest of the Wiring libraries.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Contest Entry Roving Servo Bot
    By Pinter75 in forum Project Showcase
    Replies: 13
    Last Post: 02-02-2009, 07:08 PM
  2. Question(s) servo and motor controllers
    By csdude in forum Arbotix, Microcontrollers, Arduino
    Replies: 7
    Last Post: 06-15-2008, 08:23 PM
  3. Question(s) Phidgets and servo voltage
    By Eric in forum Arbotix, Microcontrollers, Arduino
    Replies: 5
    Last Post: 05-12-2008, 08:32 AM
  4. Kondo web page translated.
    By Droid Works in forum Humanoids, Walkers & Crawlers
    Replies: 4
    Last Post: 10-06-2007, 05:49 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •