I want to use a old RC aircraft servo in one of my pic applications...Can someone direct me to a page on the net. (I get a error when searching the archives)
1. The servo (FUTABA S100) has three wires (red, black and white). Can someone help me with the connections (eg. black - gnd; red - +5V; and white +5V signal from pic???)
2. As I understand the servo move one increment in one direction when a 100ms pulse is applied and in the opposite direction if a 200ms pulse is applied?
3. Is there some feedback from the servo that you can determine the position of the rotor (if not how does the servo know the center position every time I switch it on in the aircraft?
A 1.5ms bitstream (with a 20ms between pulses) will take the servo to the
center. 1 to 1.5ms will move the servo in one direction (for example 1.25ms
wil move appr. half way to the one direction) and 1.5 to 2 will move it in
the other direction...
There are several projects using RC servos, including one I did as a
tester/exerciser that is available in the PICList projects archives or
from my web page. It's fairly easy stuff.
> I think I got my answer now!!
>
>
> A 1.5ms bitstream (with a 20ms between pulses) will take the servo to the
> center. 1 to 1.5ms will move the servo in one direction (for example 1.25ms
> wil move appr. half way to the one direction) and 1.5 to 2 will move it in
> the other direction...
>
> Please correct me if i'm wrong...
>
> Kindest regards
>
> Francois
>
>
Francois, those servos are fairly standard though some allow more travel.
Andy Kunz is our resident expert here but it just happens that I finished a
2-channel servo controller last night and I'm looking for a couple of
`guinea pigs' (err, Beta testers ;-). One an expert like Andy and one a
novice like you (and me in this case).
Typically, servos require a 50Hz PRF where the pulse varies from 1 to 2ms
with 1.5ms being center. Again, some servos will allow more or less travel,
hence a different pulse width range. The majority seem to allow 90 degree
rotation with the above PW but I have one that does 180 degrees from 0.5ms
to 2ms...
The connector is standard though the color of the control line may be
white, yellow, or some other color. Black is always ground and red is always
+5V. Looking at the connector with the Black wire on top:
o GND (Black)
o +5V (Red)
o CTL (White, Yellow, etc)
Back to my project, I was hacking a Radio Shack R/C car to make it a
robot. It's based on a 16F876 and is interrupt-intensive. The car does not
use proportional servos so I used PWM and an H-Bridge to control the rear
drive. I glued a couple of rare-earth magnets to the motor shaft and used a
Hall-Effect sensor to provide a tachometer for PID control. I want to use an
R/C servo for steering so I came up with this servo controller. I wanted
something simple and small with minimum parts so I used a 12C671 since it's
an 8-Pin device and, unlike the 12C5xx parts, supports interrupts with TMR0.
You send control signals via RS-232. I decided to use a simple resistor
and clamp diodes (optional, you can use internal diodes) rather than another
MAX232, etc. I wanted to control both servos with one Control Byte so I
limited the range to; 0 - 127. The MSB controls which servo gets updated. To
make it expandable, I added an Enable input. When disabled, the controller
ignores the serial port and maintains the servo's current position. The PRF
is around 55Hz. You can easily hack it for three servo channels by
eliminating the Enable input and going to a two-Byte protocol where the
first Byte is the servo channel and the second is the position. All the
servo work is done in the TMR0 ISR. You can also adapt this to any 12C6x or
16xx device by changing the port pin equates. The only requirement is that
TMR0 is free and capable of generating an interrupt. The following is the
basic interface:
Hardware Interface:
GP0 <- Enable. 0 = Enabled, 1 = Ignore Serial Port
Note: Servos Remain at their Last Position when Not Enabled
GP1 -> Servo #0 Control
GP2 -> Servo #1 Control
GP3 <- RS-232 Input via a 22K Resistor and Clamp Diodes
WARNING! Code Inverts the RS-232 Data for use with the Resistor!
Software Interface:
The span is 0 to 127. The MSB selects Servo #0 or Servo #1 as follows:
Since this is based on code from someone else (I don't have the name),
I'm putting it in the public domain for anyone interested. I use TechTool's
CVASM (Formally Parallax with several enhancements) with it's Intel-style
8051 syntax. If you want to hack the code, you can get the assembler for
free from TechTools (See the link below). The code is trivial. I can also
provide the object file in both CVASM format or as Hex for Microchip
programmers. I'll put this on my web site in the next few days. If you want
to get CVASM and the manuals, go to:
At 01:51 PM 10/19/00 +0200, Francois Robbertze wrote: {Quote hidden}
>I think I got my answer now!!
>
>
>A 1.5ms bitstream (with a 20ms between pulses) will take the servo to the
>center. 1 to 1.5ms will move the servo in one direction (for example 1.25ms
>wil move appr. half way to the one direction) and 1.5 to 2 will move it in
>the other direction...
>
>Please correct me if i'm wrong...
>
>Kindest regards
>
>Francois
>
>I want to use a old RC aircraft servo in one of my pic applications...Can someone direct me to a page on the net. (I get a error when searching the archives)
>1. The servo (FUTABA S100) has three wires (red, black and white). Can someone help me with the connections (eg. black - gnd; red - +5V; and white +5V signal from pic???)
Yep, remember the +5v needs LOTs of current sometimes - around 100-200ma depending of the force of the servo.
>2. As I understand the servo move one increment in one direction when a 100ms pulse is applied and in the opposite direction if a 200ms pulse is applied?
More or less. 1.52ms neutral, you can go above and below.
>3. Is there some feedback from the servo that you can determine the position of the rotor (if not how does the servo know the center position every time I switch it on in the aircraft?
Servos has only internal feedback. It does not know it's center position. It goes to the center position with a pulse every 1.52ms. If you rise or lower this value, it goes to that direction. The servo automatically "centers" when you turn the aircraft on, because the transmitter is sending the "center" pulse to the servos. Get a osciloscope and look at the signal, moving the sticks of the transmitter. You'll find lots of interesting things.
>A 1.5ms bitstream (with a 20ms between pulses) will take the servo to the
>center. 1 to 1.5ms will move the servo in one direction (for example 1.25ms
>wil move appr. half way to the one direction) and 1.5 to 2 will move it in
>the other direction...
You are RIGHT! Got the great prize, an atomic tribufulator!!!
> >Yep, remember the +5v needs LOTs of current sometimes -
> around 100-200ma
> depending of the force of the servo.
>
> Try 1000mA, even for a standard (S148) servo.
>
And be careful because the smaller servos sometimes take even more current.
While we're on this subject, I'm trying to build an encoder and decoder to
emulate the training cord signals on an RC transmitter (8 channels 1-2ms
with 4ms synch pulse). The encoder takes 4 analog input / 4 switches, signal
goes down 2 wires to the decoder which drives 4 servos + switches. I could
do it with the old Signetics chips (5044 ?) or 4017s but PICs seem like more
fun and it's about time I learned how to use them. Has anyone done this
before or do I have to make it all up myself ?
>>I want to use a old RC aircraft servo in one of my pic applications...Can someone direct me to a page on the net. (I get a error when searching the archives)
> http://www.goldmine-elec.com/FreeInfo.htm
ooooooooops! Wrong site!!! Damm Internet Explorer!!! Copy and paste does not work!!!
Wow! All three archives gave you an error? Amazing... what bad luck you have
with searching for your own answer rather than just asking us. I just
searched for servo at the FAQ site at found two pages:
At 12:52 PM 10/21/2000 -0700, James Newton wrote:
>Wow! All three archives gave you an error? Amazing... what bad luck you have
>with searching for your own answer rather than just asking us. I just
>searched for servo at the FAQ site at found two pages:
>
>http://www.piclist.com/../io/servo
>for general information on servos and
>www.piclist.com/../microchip/a2d-step-rw
>for PIC source.
Hi James,
Neither of those two links work for me either. I get blank pages with the
title bar "FrameFind". If I read source for the pages, there's stuff there,
but nothing that shows up in my browser window.