Re: Hardware question: Interfacing a servo PPM to a 3.3v micro...
- From: frenchy <deja@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 17 Mar 2008 11:20:15 -0700 (PDT)
On Mar 17, 11:33 am, Tim Wescott <t...@xxxxxxxxxxxxxxxx> wrote:
frenchy wrote:
Hello,
I am bringing an RC servo signal into the input capture module of the
PIC24FJ64GA002. The RC receiver outputs a voltage pulse that has an
amplitude which approximately tracks the battery level of the
receiver. Therefore the servo pulse-high voltage can be up to 8volts
and can sag down to 4 volts or so. Which of these options is the best
design practice?...
1) Put a 10k in series and hook the servo pulse up directly to the
input capture pin. Any injected current will be very small (<0.5mA).
2) A resistor divider seems like a bad idea because as the battery
voltage sags, the input to the input capture will not be in a reliable
range because it will sag to.
3) Use an NPN transistor with the emitter tied to GND. The 4-7v
pulses will go to the base through a ???ohm resistor and the collecter
will go through a ???ohm resistor to the +3.3v rail. The collector is
now input into the input capture. This will invert the signal, but it
will also force it to be nicely in the 0 to 3.3v digital range.
Being that this is my first PIC24F project AND my first dealings with
Radio Controlled hobby applications, I am dealing with the system as
it is. My friend's system that I am working with uses the motor
batteries through the motor controllers (Traxxas XL-1) to "backfeed"
power to the receiver (Futaba FP-R7H). The receiver therefore does
not have its own independent power, it runs off the motor batteries
(PowerMax 2400mAH Peak Racing Pack) and varies from approx 7v to 4v as
they discharge. Should I actually prefer to run the receiver off from
its own power and use the resistor divider scheme? I was thinking
that the inverting transistor scheme (#3 above) would be more
versatile because it provides a digital signal that is always between
3.3v and GND, no matter which battery and no matter how discharged.
Thanks for any input.
respectfully,
frenchy
Most RC motor controllers that I'm aware of have a voltage regulator so
that when the receiver voltage doesn't go over 5V or so.
The transistor input idea is a good one, and may work well for you.
Normal practice is to use three resistors:
3.3V
+
|
.-.
| |
| | R3
'-'
|
o---------o out
|
___ |/
in o---|___|--o---|
R1 | |>
.-. |
R2 | | |
| | |
'-' |
| |
| |
=== ===
GND GND
(created by AACircuit v1.28.6 beta 04/19/05www.tech-chat.de)
The resistor from base to ground will speed up the transistor turn-off,
making your time measurement a bit more accurate. As a first cut I'd
use a 4.7 kohm for R1, 2.2 kohm for R2, and 1 kohm for R3. If you can,
try your circuit out over temperature before you trust it on really hot
or cold days.
You may also want to consider a comparator with a bit of hysteresis.
Use a comparator that'll let you quickly drive to the processor's 3.3V
rail, and compare the incoming servo pulse against the radio system's +
rail.
--
Tim Wescott
Wescott Design Serviceshttp://www.wescottdesign.com
Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details athttp://www.wescottdesign.com/actfes/actfes.html
Tim Wescott,
Thank you very much for your very helpful response!!! For such a
simple circuit as this I was having a hell of a time finding any on-
line references or discussions of using such a circuit as a level
shifter. Do you know where I would look to read detailed discussions
about design considerations of this simple common emitter NPN
circuit? I know that I can do simple circuit analysis on it using
Vbe=0.7v when turned on, etc...but I would love to read about details
such as why you would select the biasing resistors to set optimal
currents, etc. For instance, my first trial (without the base
resistor to GND) I used 3.3k in the collector and 1.5k in the base.
It worked, but are those foolish choices? What made you choose the
values you did?
I appreciate your suggestions...now I want to understand why, so that
I don't have to ask next time. I have a 700 page McGraw-Hill circuit
encyclopedia here and I couldn't find a discussion on this
circuit....also I have a twenty-billion paged internet and I couldn't
find a discussion either. I was probably calling it the wrong thing
but I did try for quite some time until I resorted to coming here.
Thanks again for your helpfulness.
respectfully,
frenchy
.
- Follow-Ups:
- Re: Hardware question: Interfacing a servo PPM to a 3.3v micro...
- From: Tim Wescott
- Re: Hardware question: Interfacing a servo PPM to a 3.3v micro...
- References:
- Hardware question: Interfacing a servo PPM to a 3.3v micro...
- From: frenchy
- Re: Hardware question: Interfacing a servo PPM to a 3.3v micro...
- From: Tim Wescott
- Hardware question: Interfacing a servo PPM to a 3.3v micro...
- Prev by Date: Re: Couple of nfilter Questions
- Next by Date: Re: Controlling relays over internet
- Previous by thread: Re: Hardware question: Interfacing a servo PPM to a 3.3v micro...
- Next by thread: Re: Hardware question: Interfacing a servo PPM to a 3.3v micro...
- Index(es):
Relevant Pages
|