Shop OBEX P1 Docs P2 Docs Learn Events
Keeping servo Timing — Parallax Forums

Keeping servo Timing

ratronicratronic Posts: 1,451
edited 2006-10-12 20:35 in BASIC Stamp
I am trying to find out out whether a servo pulse can be put out in the back ground while reading other devices (ie 1620 ,1302, updating display etc). If not, can somebody recommend a serial device that can be programmed on the fly during program execution so that the pulse width and freq stay as you want. Or is there a way to time the total time of your entire program loop so that the output pulse can be set to output pulse frequency to·make the servo happy? cool.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
D Rat

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-10-12 17:41
    ratronic,

    You can use a Parallax Servo Controller to control up to 16 Servo's in the background.

    Serial version:
    http://www.parallax.com/detail.asp?product_id=28023

    USB Version:
    http://www.parallax.com/detail.asp?product_id=28823


    Optionally the PWMPAL will also let you control your servos
    http://www.parallax.com/detail.asp?product_id=28020

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

    IC Layout Engineer
    Parallax, Inc.
  • ratronicratronic Posts: 1,451
    edited 2006-10-12 19:17
    Thanks Beau

    Is there a simple way that you know of to time a program loop that might vary in time from end to end? I thought I saw something like that somewhere ?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Rat
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-12 19:41
    The Stamps really are single threaded and there's no extra hardware on chip that's accessible for doing the timing while the interpreter is doing something else. You'd have to have some kind of external hardware to do this. It might be something as simple as a couple of resistors and a capacitor that could be charged up at the beginning of the loop, then tested at the end of the loop to see how long it takes to charge up again, then compute the time for it to discharge to where it was by the end of the loop.
  • PARPAR Posts: 285
    edited 2006-10-12 19:45
    ratronic said...
    Thanks Beau

    Is there a simple way that you know of to time a program loop that might vary in time from end to end? I thought I saw something like that somewhere ?

    Here is a place to look for ideas on how to estimate timing.

    http://emesystems.com/BS2index.htm, and specifically,

    http://emesystems.com/BS2speed.htm

    Also, don't forget to search Parallax's own Forum archives for answers, at

    http://search.parallax.com/

    PAR
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-10-12 19:46
    ratronic,

    As you ask."... Or is there a way to time the total time of your entire program loop so that the output pulse can be set to output pulse frequency to make
    the servo happy?"

    The servo "dead time" where the pulse is LOW, is pretty forgiving. Most servo's will tolerate a dead time ranging from 15mS to 25mS. If you are careful
    with your code, and you can get everything done that you need to get done within that allotted time window or even partition everything than needs to
    be done over multiple time windows, you could pull something off that would work in your application.

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

    IC Layout Engineer
    Parallax, Inc.
  • ratronicratronic Posts: 1,451
    edited 2006-10-12 20:35
    Thanks Beau , I am new to micro controllers , but thats what I thought , had to check just in case!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    D Rat
Sign In or Register to comment.