Shop OBEX P1 Docs P2 Docs Learn Events
driving 16 servos — Parallax Forums

driving 16 servos

Lee MarshallLee Marshall Posts: 106
edited 2008-11-03 18:33 in Propeller 1
hi, I want to control 16 servos, and PWM control 8 LEDs whilst receiving commands from a 19.2KBaud serial line
I thought: "This is a job for the parallax propeller"

I want to use the counters in 2 cogs to do the servo control, but i am concerned about the latency caused by polling the counters(to complete the servo pulses), which would probably be about 100-200ns.
latency in servo pulses seems to me like a bad thing.(i still think the prop 2 could benefit from some kind of interrupt system).

is a 200ns possible variation from one pulse to the next really going to make the servo shake around? or is it too small to noticably affect the servo?

im using analog servos and ill be controlling them with a resolution of 16usec.

Post Edited (Lee Marshall) : 10/19/2008 10:39:33 AM GMT

Comments

  • grasshoppergrasshopper Posts: 438
    edited 2008-10-19 10:45
    Interrupts, pft! Propeller has defined that its needless. As far as counters in the cogs, why use them? why not just program a method?
  • simonlsimonl Posts: 866
    edited 2008-10-19 11:09
    You're right - that does sound like a perfect use for a Propeller. I'd suggest you use Beau Schwabe's Servo32 object from the object exchange wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheers,
    Simon

    www.norfolkhelicopterclub.com

    You'll always have as many take-offs as landings, the trick is to be sure you can take-off again wink.gif
    BTW: I type as I'm thinking, so please don't take any offence at my writing style smile.gif
  • Lee MarshallLee Marshall Posts: 106
    edited 2008-10-19 11:40
    Interrupts, pft! Propeller has defined that its needless. As far as counters in the cogs, why use them? why not just program a method?
    


    ah, i still have my head in a PICMicro.
    i forgot that when you are running parallel, you can waste time for a certain task and not have to design everything else around it.

    on beau's servo controller:
    now THAT is damn tight.

    methinks im gonna use that.

    the prop really has turned uC programming upside-down for me, shame it doesn't have more ram...

    the alternative for this task was like 5 PIC16f628s..

    now, the only problem is that ive gotta build this thing in time for halloween.(it's a computer controlled LED lighting cluster) smilewinkgrin.gif
  • Lee MarshallLee Marshall Posts: 106
    edited 2008-10-19 12:18
    ah, one more thing, why do i need a 4k7 resistor between the prop and each servo?

    thanks for the help, guys.

    EDIT: there is something else - is it possible to hand-solder the QFP44 prop relatively easily(in comparison to other smts)? it's just that the DIP40 is big, and needs holes in the PCB and doesn't look as cool.

    Post Edited (Lee Marshall) : 10/19/2008 12:28:10 PM GMT
  • StefanL38StefanL38 Posts: 2,292
    edited 2008-10-19 15:08
    Hello Lee,

    to speed up help from the forum there are three rules:

    1.) give a DETAILED descrition of what you want to do
    taking 10 minutes more to make it detailed will pay back
    in 10 hours less time finding the solution

    2.) Ask CONCRETE questions

    if somebody has to ask back you will loose minimum some hours

    3.) Attach your COMPLETE code using the archive-function of Proptool
    and the attachement.manager of this forum site

    manual for this is here
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-10-19 21:38
    Lee Marshall,

    "...why do i need a 4k7 resistor between the prop and each servo?" - The resistor is to help·attenuate any inductive issues that may occur within the servos or long distance wire runs greater than 6 inches, something I have noticed in my experiments.· With a resistor physically close to the controller, and a capacitor across power·physically close to the servo itself, I have achieved·steady servo control·over 20 feet away.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • heathclfheathclf Posts: 43
    edited 2008-11-03 16:48
    What's the rule of thumb for cap size?
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-11-03 18:33
    heathclf,

    For low power applications I use roughly 50uF per foot... so at 20 feet I used a 1000uF cap as close to the servo power as possible.
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
Sign In or Register to comment.