Hardware question: Interfacing a servo PPM to a 3.3v micro...
Mar 17, 2008 4 Replies
F
frenchy
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 (
Didn't find your answer? Ask the community — no account required.
J
Jan Panteltje
On a sunny day (Mon, 17 Mar 2008 06:49:21 -0700 (PDT)) it happened frenchy wrote in :
Use the transistor.
T
Tim Wescott
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:
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
F
frenchy
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
T
Tim Wescott
Oy. Mostly I pulled those values out of my hat.
The 1kohm collector resistance was selected to give a reasonably fast rise to the output voltage once the transistor turned off. This part of the rise time is mostly affected by the output capacitance times the resistance, so lowering the collector resistance speeds things up. Lowering the collector resistance also increases power consumption, so if you want to err on the side of speed then lower it, if you want to err on the side of power consumption increase it.
The 4.7kohm input-base resistance was selected to put a generous current into the base with the expected voltages and temperatures. I _think_ I'm hitting about 1/10th the collector current, but I'm not doing the math unless I'm paid! This value should give you a reasonable turn-on characteristic in spite of the Miller effect, without sucking too much current.
The 2.2kohm base-emitter resistor was selected to not steal too much base current, while still providing a means of clearing the base charge with reasonable efficiency. You'll find that the turn-off characteristics of you circuit are worse than turn-on, but it should still be OK.
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
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.