Shop OBEX P1 Docs P2 Docs Learn Events
PSC servo position parameter — Parallax Forums

PSC servo position parameter

ULPTMSULPTMS Posts: 2
edited 2006-05-08 23:24 in Robotics
1) for the PSC to control servo position the range (250-1250) corresponds to 0 to 180 degrees of servo rotation or 0.5ms to 2.5ms pulse width. Actually where is this parameter range 250-1250 come from? why it is not 0-1000, or other value? Does it indicate anything?
2)·What is the chip at the middle of the PSC? Is it some kind of pulse width generator? Can I find block diagram of that chip?
Thanks for helping


Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-02 18:51
    Typically, the Servo control pulse width is 1.0 to 2.0 mSec, repeated every 20 mSec to 50 mSec. 1.5 mSec is typically considered the "center" position.

    Now, different hardware uses a different 'tick' size, in order to generate those pulses. For instance, the BS2 uses a 2 uSec unit for it's PULSOUT command. So PULSOUT ServoPin, 750 results in a 1.5 mSec pulse.

    I assume the 'chip in the middle' is some flavor of PIC or SX chip.· It's programmed to communicate with your BS2, and maintain multiple positioning signals on up to 16 servo connections.· So it's not a simple "comparator", it's a microprocessor.

    Also, the 'tick' size for the PSC IS '2 uSec' -- so a value of 500 to 1000 will get you the 1.0 to 2.0 mSec outputs.· True, the documentation does say you can use 250 -- but I wouldn't.· Perhaps that was for another time, when the 'tick' size was 4 uSec.·

    Post Edited (allanlane5) : 5/2/2006 6:59:05 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-05-02 19:20
    allanlane5,

    The range of 250-1250 are determined directly from the resolution or 'tick' size.

    If your servo can accept a pulse from 500uS to 2500uS and your resolution is 2uS, then 500uS/2uS = 250 ticks , and 2500uS/2uS = 1250 ticks.

    Keep in mind that not all servos are created equal, and some can barely except a pulse width range of 1000uS to 2000uS (or ... 500 to 1000 ticks)


    'Ticks' = [noparse][[/noparse] Desired Pulse width (uS) ] / [noparse][[/noparse] Pulse resolution (uS) ]

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

    IC Layout Engineer
    Parallax, Inc.
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-02 19:32
    Oh, sure Beau, you are correct. It's just -- in the PSC documentation, it mentions changing the 'tick' size from 4 uSec to 2 uSec. So I thought that might be the reason for using that "250" in there -- 250 * 4 uSec == 1 mSec.

    And the Parallax servo's use the 1 mSec to 2 mSec pulse range. So feeding them a pulse of 500 uSec might not be a good thing. In fact, could it damage the gearing? I don't know.

    Bottom line -- read the Servo vendor documentation for what pulse width your particular Servo's require. Then convert those into 'tick' values using the 2 uSec per 'tick' of the PSC documentation. In engineering the rule is Trust, but Verify!

    P.S.· Oh dear.· I just tried to find the spec for the Futaba 3003, or Futaba 148 (I believe the '148 is the one Parallax sells).· The Futaba site doesn't specify, that I could see.· There was a site that said they go from 320 uSec to 3 mSec for full left to full right -- so the 0.5 mSec to 2.5 mSec should work just fine.

    Sorry about that, all.

    Post Edited (allanlane5) : 5/2/2006 7:45:15 PM GMT
  • ULPTMSULPTMS Posts: 2
    edited 2006-05-03 05:11
    Thanks for answering my questions smile.gif
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-03 06:36
    So the PSC has a direct relation between position value and pulsewidth:
    500 means 1.0 ms and 1000 means 2.0 ms
    For the javelin I wrote a class that converts between angles and position values.
    As I understood the PSC manual the servo 180 degree range was covered
    by the 250-1250 position value range.

    Am I to understand that for Parallax servos the 180 degree range is
    covered by the 500-1000 position value range?
    (Using angles makes the main program independant of position values
    which are servo dependant)

    regards peter
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-03 08:41
    Additional question regarding continues servos connected to the PSC.
    For CR servos the values correspond to direction and speed?
    So 500 corresponds to full rotation speed anti-clockwise
    and 1000 corresponds to full rotation speed clockwise
    and 750 corresponds to stop?
    From 750 down to 500 increase RPM acw, from 750 to 1000 increase RPM cw?
    Is this increase lineair with value?
    What is the full speed RPM value?

    regards peter
    ·
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2006-05-03 14:03
    Peter,

    I would assume that not all servos are created equal, and that you can not assume that between
    mechanical positioning and component tolerance that 0-180 Deg on one servo is going to equal
    0-180 Deg on another servo. I understand the need to normalize the data into Deg, but it seems
    to me that there might also be some loss through the conversion between the servo pulse width
    and a Deg angle. I personally like to try to do things as a percentage (0-100%) when trying to
    make a code module portable to other applications.


    For CR (continuous rotation) servos, there is a narrow window (again varies from servo to servo)
    away from center position that the 'speed' can be controlled.

    Note: The larger differences between servo's will be from manufacturer to manufacturer or the
    difference in the servo model numbers from the same manufacturer.

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

    IC Layout Engineer
    Parallax, Inc.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-03 14:23
    Beau,
    the conversion is actually done using a Pmin and Pmax value,
    corresponding to 0 and 180 degrees. One needs to measure
    the Pmin (full left position) and Pmax value (full right position) for each servo.

    On CR servos: does this mean there is no real speed control, just direction control?
    (pulse < 1.5 mSec·then dir = acw, pulse > 1.5mSec then dir = cw)

    regards peter
  • Ryan ClarkeRyan Clarke Posts: 738
    edited 2006-05-03 14:25
    Peter,

    There is 'speed control'- but keep a few things in mind: the deltas off of the 1.5 (750) and speed are not a linear relationship. That combined with tolerance differences in components used in the servos, and you need to be careful when trying to match the sides in a wheeled robot, for example.

    Ryan

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Ryan Clarke
    Parallax Tech Support

    RClarke@Parallax.com
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2006-05-03 14:37
    Thanks.
    regards peter
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-03 20:19
    Correct, there is little speed control. Since an unmodified servo is intended to move to, and hold, a position, having a lot of control over how it gets to that position is not a concern. In fact, you probably want the servo to 'zoom' to a position as fast as possible -- so if the position is "not close", use the max speed the servo can attain.

    Now, there is a modification you can make to the electronics inside the servo, which will broaden the speed curve. But it's really non-trivial (involves soldering a new resistor and capacitor in the right places).
  • fleurdelis158fleurdelis158 Posts: 5
    edited 2006-05-08 16:36
    Greetings.

    I'm new to this programming stuff of Basic Stamp. I need some help in programming two servos to make my robot move forward (or backward). I'm using BS2p24 microcontroller and Board of Education Rev C. I also use the Parallax Servo Controller (#28023). I've tried to program it but all i can do is making the servo rotating in the same direction. I know that in order to make the robot move forward (or backward), one servo must rotate clockwise and the other must rotate counterclockwise, but i really don't know how. What position should i put in my program?(GWS servos are used).
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-05-08 23:24
    'fleur', please start your own topic for this. Thanks.
Sign In or Register to comment.