Newsgroups: comp.robotics
Path: brunix!sgiblab!sdd.hp.com!spool.mu.edu!umn.edu!csus.edu!netcom.com!jfox
From: jfox@netcom.com (Jeff Fox)
Subject: Re: RC servo control dilemma 
Message-ID: <jfoxCE3qHx.Cx0@netcom.com>
Summary: PWM on servo	
Sender: jfox@netcom.com (Jeff Fox)
Organization: Netcom Online Communications Services (408-241-9760 login: guest)
References: <1993Sep28.221037.6975@ncsu.edu>
Date: Wed, 29 Sep 1993 06:10:44 GMT
Lines: 56

In article <1993Sep28.221037.6975@ncsu.edu> rmlegran@eos.ncsu.edu (RICHARD MARK LEGRAND) writes:
>like to control an RC servo (the one's by Futaba and the like) via a
>parallel digital signal (4 bits will do).  
>
>All I know at this point is that the RC servos require a pulse width 
>modulated signal with a variable duty cycle.  I'm pretty sure that 
>such a signal can be generated using a 555 pulse generating circuit, 
>but I'm unsure how to control the duty cycle (and hence control the 
>servo) with a digital input.  
>
>With or without the 555, if anyone knows how to do this with low 
>hardware overhead, please let me know.
>
>Thank you,
>
>Richard LeGrand
>North Carolina State University
>Center for Robotics and Intelligent Machines 
>

I just posted something last week in comp.lang.forth on how to control
a motor with pwm.  I mentioned that I have used PWM to control model
airplane servos.  It is really easy to do.  I have done it with 1 bit
output from an RCA 1802 (really slow) processor.

Servos want to see a 50hz signal.  I found that by modulating the width
of the pulse between say 5% and 20% of the 20 millisecond period would
cause the servo to move through about 270 degrees of rotation.  No or 
little power is drawn when the position of the servo is proportional
to the pulse width.  Power is used when the servo moves to a new position.

The old 1802 was so slow that the smallest steps in pulse width resulted
in about 1 degree rotation.  And a sudden change from 5% to 20% on of
the 50hz signal would swing the servo rail to rail.

Check out the signals that the servo gets when it is connected to the
RC controller with a scope and what you need to do is obvious.

                    20 MS                        20 MS
    <---------------------------------><---------------------------------><-

  + !-----! 20%                       !-! 5%                              !-
    !     !                           ! !                                 !
----! -   !---------------------------! !---------------------------------!

    <----->4 MS                       <-> 1 MS

    full clockwise rotation           full counterclockwise rotation

I will leave it up to you (or someone else in this group)  to tell you
how to get a 555 to produce these particular pulses. This is all from
memory, so if someone else has done this recently you may get more
precise details.

Jeff Fox
very little code will
