Re: Hardware question: Interfacing a servo PPM to a 3.3v micro...
- From: Tim Wescott <tim@xxxxxxxxxxxxxxxx>
- Date: Mon, 17 Mar 2008 08:33:51 -0700
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/05 www.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 Services
http://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 at http://www.wescottdesign.com/actfes/actfes.html
.
- Follow-Ups:
- References:
- Prev by Date: Re: Couple of nfilter Questions
- Next by Date: Re: uC selection
- 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
|
Loading