Shop OBEX P1 Docs P2 Docs Learn Events
servo control question — Parallax Forums

servo control question

krokikroki Posts: 21
edited 2005-02-07 15:00 in BASIC Stamp
Hi all!

I have a servo for a nitro model, that's not modified, and has the following specs:

Signal pulse: Positive Pulse Control 1520us Neutral
.14sec 0-60 deg.

Can anyone help me to control it with a BS2sx or p24?

And I need some info how to monitor a controller reciever for it?

Thanks for the anwser!

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-02-07 14:46
    ' Numbers: Note the BS2 uses 2 uSec per 'count'.
    ' The BS2sx uses something else -- 800 uSec?
    ' This example uses BS2 numbers -- adjust the 'count' values
    ' for the BS2sx.

    '1. Holding at neutral...

    LOW ServoPin ' Set servo pin as Output, and LOW. Servo control uses positive pulse.
    MAIN:
    PULSOUT ServoPin, 760 ' 2 uS per 'count' in BS2, so 760 == 1520 uSec
    PAUSE 20 ' Pause 20 mSec -- Servo's work on a pulse, then get refreshed every 20 to 50 mSec
    GOTO MAIN

    ' 2. Typically, 1 mSec is full left, 2 mSec is full right.
    ' So, full left:
    MAIN:
    PULSOUT ServoPin, 500 ' 500 * 2uS == 1,000 uS, or 1 mSec
    PAUSE 20
    GOTO MAIN

    AND -- the Servo power ground and the BS2 ground MUST be connected.
  • MatthewMatthew Posts: 200
    edited 2005-02-07 14:49
    Kroki, where did you get those values from??
  • krokikroki Posts: 21
    edited 2005-02-07 15:00
    What values?
    The servo specs? From it's desc.
Sign In or Register to comment.