Shop OBEX P1 Docs P2 Docs Learn Events
servo rotation with basic stamp — Parallax Forums

servo rotation with basic stamp

mikesammikesam Posts: 1
edited 2009-07-06 11:49 in BASIC Stamp
I am a first time user of the Basic Stamp and have been working with the BOE kit..I'm up to the section on servos and have a application that calls for having the servo go from 9 o'clock (AM)·to 3 o'clock (PM)·. I have not found a command that tells the servo to go to 9 o'clock..There only appear to be 3 positions that are allowed: 10 o'clock, noon and 2 o'clock..
How do I get the servo to start at 9 am and then wind up at 3pm?

Thanks
Mike

Comments

  • FranklinFranklin Posts: 4,747
    edited 2009-07-04 17:41
    Servos are not precision devices and as such may have different capabilities. Put a horn on the servo and GENTLY move it as far as it will go in both directions and record these points. This will be the maximum distance the servo will be able to move. then start sending pulses to the servo until it reaches these limits. These are the maximum and minimum rates to send the servo without damaging it. Usually 750 is center with a bs2 and 500 to 1000 are close to the maximums but you need to experiment to find the values for your servo. Good luck and happy stamping.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • SandgroperSandgroper Posts: 62
    edited 2009-07-05 02:53
    The three positions that you refer to are merely full left, dead centre and full right.· You can have any position in between.

    In terms of timing, a pulse width of approximately 1 millisecond will turn the servo fully left, 1.5 milliseconds will centre it, and·2 milliseconds will turn it fully right.· If each command is 2 microseconds, then this equates to a value of 500, 750 and 1500 respectively as previously mentioned.·

    To get your servo to turn from full left to full right, first apply a 1 ms pulse for approximately 200 ms.· This causes the servo to turn fully left and allows enough time for it to complete the movement.· Then, apply a·2 ms pulse for a period of 400 ms.· This will turn the servo fully right.

    It's possible that your servo doesn't have a full 180 degree range of motion.· It might be limited to say, 120 degrees or so.· If it is, you won't be able to achieve the "9:00" or "3:00" position·no matter what you do, and forcing it to go beyond its limits may damage it (and anything else that might be attached to it).· It might be safer·start with pulse widths of 1.2 ms for fully left, to 1.8 ms for fully right. This limits the range of the servo, but the trade off is that you get finer resolution.·

    Once you've got the hang of controlling the range and resolution, you can then adjust the timing until the servo just reaches its limit of travel.
  • PrettybirdPrettybird Posts: 269
    edited 2009-07-05 23:19
    ·· Parallax has instructionns for setting up the pan for the ping ultrasonic in adobe format. You can find it under ping complete lesson. It·tells how to set it up. I am learning too.
  • SandgroperSandgroper Posts: 62
    edited 2009-07-06 11:49
    Oops!· Sorry, that should have read "1000", not "1500"!· My humblest apologies!
Sign In or Register to comment.