Shop OBEX P1 Docs P2 Docs Learn Events
Servo Output — Parallax Forums

Servo Output

computer guycomputer guy Posts: 1,113
edited 2007-03-02 05:27 in BASIC Stamp
I have a motor controller that requires 2 servo inputs in order to control 2 motors.

I need to know how to get the BS2 to output this:
Computer Guy said...


Input Signal:

Input method..........40-70Hz PPM 1.5mS Mark Center [noparse][[/noparse]RC standard]
Input Voltage..........2.2v - 18v Max
Input resistance..........50kohm
Input current..........Fixed at 5mA/Channel


Please note 'input' is into the motor controller. From the BS2
Thank you smile.gif

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2007-03-01 21:05
    You hook up 2 I/O pins, and a ground, to the servo controller.

    That magic seeming "40 to 70 Hz, 1.5 mSec Mark Center", really means:
    40 Hz == every 25 milliseconds
    70 Hz == every 14 milliseconds

    1.5 mSec Mark Center == "1 mSec is full left, 2 mSec is full right, 1.5 mSec is stop"

    So, you must send this thing, using PULSOUT, a 1 mSec to 2 mSec signal, repeating that signal every 20 mSec. Just like a "normal" modified servo control signal.

    Which looks like:

    MAIN:
    PULSOUT LeftSig, 500 ' On a BS2, there's 2 uSec per 'tick', so 500 'ticks' is 1 mSec
    PULSOUT RightSig, 1000 ' 1000 'ticks' is 2 mSec. If you have the motors back-to-back, one spins left while the other spins right to go forward
    PAUSE 20
    GOTO MAIN
  • computer guycomputer guy Posts: 1,113
    edited 2007-03-02 05:27
    Thank you smile.gif

    My motors are left and right motors so they are different to each other.

    so i would use

    MAIN:
    PULSOUT LeftSig, 500
    PULSOUT RightSig, 500
    PAUSE 20
    GOTO MAIN

    to go full speed forward/backward and

    MAIN:
    PULSOUT LeftSig, 1000
    PULSOUT RightSig, 1000
    PAUSE 20
    GOTO MAIN

    to go full speed in the opposite direction.

    Once again thank you smile.gif
Sign In or Register to comment.