Shop OBEX P1 Docs P2 Docs Learn Events
Controlling Servos from PC — Parallax Forums

Controlling Servos from PC

ArchiverArchiver Posts: 46,084
edited 2002-07-15 02:12 in General Discussion
Anyone have some good resources on the subject line? I know the scott
edwards board does it but I am interested in learning how to do it, not
just utilizing someone elses. Thanks.

- Matt

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-07-13 21:51
    Just goto www.parallaxinc.com and download their robotics manual, it tells
    you all about how to do it.

    Original Message
    From: Matt Johnson [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Ci68Nk5l2I8w8UGBJqXobpBXbe9iz3PogFKOd6yKE5pe2VttxFYcxufT5JxnCR1HaVNlywP5yz0]matt@m...[/url
    Sent: Saturday, July 13, 2002 12:54 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Controlling Servos from PC



    Anyone have some good resources on the subject line? I know the scott
    edwards board does it but I am interested in learning how to do it, not
    just utilizing someone elses. Thanks.

    - Matt


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-13 23:23
    Let me clarify. I want to do it using C# and .NET and a PC. Not using the
    basic stamp.

    - Matt

    On Sat, 13 Jul 2002, Matt Johnson wrote:

    >
    > Anyone have some good resources on the subject line? I know the scott
    > edwards board does it but I am interested in learning how to do it, not
    > just utilizing someone elses. Thanks.
    >
    > - Matt
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and Body
    of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-14 00:21
    Then this is probably not the right resource to find your answer....

    The timing requirements for servo control are precise. You might find an
    offboard microcontroller is, in fact, the best solution. It can take
    commands from the PC and go from there (this is the SEETRON mini SSC).

    I can't imagine any PC OS that would allow you to create 1.0 - 2.0
    millisecond pulses every 20 milliseconds without interfering somewhere ...
    especially running the hugely complex C# and .NET stuff.

    But then, I like microcontrollers....

    -- Jon Williams


    In a message dated 7/13/02 5:37:01 PM Central Daylight Time, matt@m...
    writes:


    > Let me clarify. I want to do it using C# and .NET and a PC. Not using the
    > basic stamp.
    >
    > - Matt
    >
    > On Sat, 13 Jul 2002, Matt Johnson wrote:
    >
    > >
    > > Anyone have some good resources on the subject line? I know the scott
    > > edwards board does it but I am interested in learning how to do it, not
    > > just utilizing someone elses. Thanks.
    > >
    > > - Matt
    >




    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-14 03:00
    Sorry to have offended you, good luck in your endevours.

    Original Message
    From: Matt Johnson [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Fwb_8NIClmh6dwio3bMo6uci4rTAtxmFrNzkShkf1fg-ci-hhnJBwhMuq-kNkEUjka7Q]matt@m...[/url
    Sent: Saturday, July 13, 2002 5:23 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Controlling Servos from PC



    Let me clarify. I want to do it using C# and .NET and a PC. Not using the
    basic stamp.

    - Matt

    On Sat, 13 Jul 2002, Matt Johnson wrote:

    >
    > Anyone have some good resources on the subject line? I know the scott
    > edwards board does it but I am interested in learning how to do it, not
    > just utilizing someone elses. Thanks.
    >
    > - Matt
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-15 00:37
    I don't think this will work on a Windows based machine without an external
    timer/processor, simply because of how the CPU gets time-sliced with background
    tasks. That said, years ago I did just what you are asking on an (8088) DOS
    only machine using QuickBasic4.5 to control a handful of servos through the
    printer port. If I remember correctly there was a trick in order to obtain
    correct timing cycles. Essentially I would create a LARGE string variable that
    corresponded to each servo (20K+ string length) and set all of the characters
    within each string to "0". This in effect is my 1mS to 2mS window for the
    servo.
    By setting a single character in the string to something other than "0" and
    doing
    a search for it became my servo position precision timing.

    example code flow:
    'Determine position of servo you want and set corresponding
    servo String
    'position to something other than "0"....for example "X"

    'Set the Printer port pin HIGH 'Start servo SYNC pulse

    Z=INSTR(Servo1$,"X") 'We don't care what Z is because we already
    'know we are simply using a
    built-in string
    'search function to create a
    precision delay.

    'Set the Printer port pin LOW 'End servo SYNC pulse

    'Here, the "OFF-TIME" is not as critical as the "ON-TIME" for the
    servo's so
    'a long FOR/NEXT delay will work here or you can "stagger" the
    servo control and
    'proceed to the next servo before you repeat the cycle and start
    all over again.

    >Then this is probably not the right resource to find your answer....
    >
    >The timing requirements for servo control are precise. You might find an
    >offboard microcontroller is, in fact, the best solution. It can take
    >commands from the PC and go from there (this is the SEETRON mini SSC).
    >
    >I can't imagine any PC OS that would allow you to create 1.0 - 2.0
    >millisecond pulses every 20 milliseconds without interfering somewhere ...
    >especially running the hugely complex C# and .NET stuff.
    >
    >But then, I like microcontrollers....
    >
    >-- Jon Williams
    >
    >
    >In a message dated 7/13/02 5:37:01 PM Central Daylight Time, matt@m...
    >writes:
    >
    >
    > > Let me clarify. I want to do it using C# and .NET and a PC. Not using the
    > > basic stamp.
    > >
    > > - Matt
    > >
    > > On Sat, 13 Jul 2002, Matt Johnson wrote:
    > >
    > > >
    > > > Anyone have some good resources on the subject line? I know the scott
    > > > edwards board does it but I am interested in learning how to do it, not
    > > > just utilizing someone elses. Thanks.
    > > >
    > > > - Matt
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2002-07-15 02:12
    We explore this connecting pin2 (bit 0 of the decimal 888 port) of the DB-25
    parallel port of the PC (with a resistance) to the servo input. A QBASIC
    program generate a pulse of between 1 and 2 ms and repeat it at
    aproximattely at 50 HZ. All the timing was calibrated with freqin and pulsin
    instructions in a Basic Stamp connected to the output from the PC.

    repeat:
    out 888,1
    delay1
    out 888,0
    delay2
    goto repeat

    All the experiments of the Basic Stamp manual can be made easily with an
    old PC

    Carlos Contreras
    presidente Club Cientifico de Pe
Sign In or Register to comment.