How to clamp an input signal to propeller?
jcfjr
Posts: 74
I have developed an automatic antenna tuner for amateur radio applications. I sample the frequency of the signal being transmitted through one of the prop pins, to preset my tuner components to the proper settings via stepper motors. At 10 watts signal strength, my frequency sample is about .8v pep, and at 100w the sample is about 1.88v pep. But, when I apply full legal power of 1500w, the freq sample goes to above 5v. I have tried resistive pads, but to reduce the 5v to 3.3v they reduce the lower power readings to something below what the propeller can read. I have also tried a zener diode to clamp the voltage, but it seems to reduce the voltage as well at the lower power readings, below the clamping voltage desired. Does anyone know how I can buffer the input to the propeller? All I need from the measurement is the frequency, but I am concerned that at the higher power, I may damage the prop. I need to limit the voltage of the frequency measurement at the higher power settings, but not the signals below 100w. Any suggestions for a buffer that can accomplish this? The frequencies I am measuring are between 3.5 - 28.5 Mhz.
Comments
Either would work with the attenuated signal then.
CompDAC mode uses an internal analogue comparator along with an internal DAC. So quite a different beast to a regular CMOS input. Result is the DAC level can specified the switching threshold for an input - Presumably between supply (VIO) and ground (GIO).
Configuration, including the DAC level, is done with the P field of WRPIN. Here's an earlier write-up of it:
EDIT: Also, the "DAC always clocked" comment is out of date now too. I had thought the main DAC was used with the comparator but the comparator has its own DAC that just switches in the eight bits from WRPIN mode register.
And the much older P field data - https://forums.parallax.com/discussion/comment/1448228/#Comment_1448228
EDIT: Or to make it easily a dynamic threshold adjustment:
EDIT2: Typo correction
do you have any sample ac coupler circuit? Sorry, my background is mechanical engineering because I couldn’t hack electrical engineering
Appropriate values I can't even guess at other than likely quite high resistances and low capcitance.
The threshold voltage of a P1 pin is around 1.42V, that's why the Rs are not equal.
At your frequencies also lower Cap values should work, 10pF or 22pF i.e. this makes it even more safe for the pin. There are protection diodes in the pins, so a 5V signal through a small Cap should not kill the pin.
Andy
Thanks for schematic. Is the 12kohm resistor connected to 3.3v?
EDIT: Actually,the lowered balance is 10/(10+12) * 3.3 = 1.5 Volts. So still got some margin above 1.42 V so good to use.
Here are results at 7Mhz today
Voltage @ + Voltage @ + Voltage @
(Input)+ (P1Pin)+ Output thru series 2k resistor
30 watts + 1.08 + .96+ .52
100 watts + 1.76+ 1.56+ .88
1500 watts+7.5+ 6.2+ 3.04
Without the resistor in series it would have been too much. Not sure why the AC coupler section did not bring down the voltage more, seems the series resistor did all the work. And applying the 3.3v to the 12K resistor only offset the voltage by about 1.4v, the pep reading was still the same. If I removed the 3.3v, pep reading was same but no offset. Question is now is if the .52 v is enough to read a frequency with. Thanks for the help guys.
Sorry I don't know how to transfer the format for my table above, did not seem to see the spaces to form the columns.
To keep the format of a table you can use the Code tags to surround the text, the "C" option in the format menu. It takes some fiddling to get things to line up.
Instead of a Bpin, couldn't I just use existing 3.3v for bias?
With the 10k and 12k resistors and the 100pF with added 2k. I'm curious how your setup samples the RF. Is it through a resistive pad of some sort, or maybe an inductive loop or directional coupler?
In a sigma-delta application, you might have a microphone connected through a capacitor to the apin input node, with direct resistive bpin feedback. The input stays close to the threshold, but the bpin pulse density closely tracks (balances) the input current, so that counting the bpin pulse density allows the Prop to track the analog level. With a low-impedance voltage source fed thru a capacitor at the input, the current is a function of the rate of change of voltage, not by its absolute value. It is easily possible for a large rapidly changing input voltage, a square wave for example, to overdrive the input. When that happens, the bpin pegs to one of the rails, in which case the Prop loses track of the analog level and sees only high or a low, balance is lost, no longer sigma delta. The scheme I was suggesting just takes that to an extreme to enhance the overdrive effect.
I shouldn't get too deep into it, unless I actually try it out to see if there is a gotcha I've missed!
Tracy,
This solution will protect the prop up to 1500watts, but I am not so sure there will be enough there to measure frequency at the 30watt level. I have ordered a new board to implement the current solution (can't breadboard it onto existing board) and won't know if it is going to read the lower power frequency until I build it out. If that doesn't work, I have found a '850Mhz, low distortion, output limiting, programmable gain, buffer amplifier' (HFA1113) chip that sounds like it should just clip the upper voltages to a set voltage. You set the upper and lower clipping voltages with two pins on the chip. Sounds like what I am looking for, but it is surface mount (yuck), so back to Hong Kong for another board, just so I could try it. So I am hoping this solution works.
I am just using a short piece of wire(about 1.5") in parallel with the center conductor of the feedline. I am also using a directional coupler to measure my forward and reverse voltage to calculate the SWR.
What is POSDET mode? Still do not understand your bpin idea, but would like to understand better how it works, as a possible alternate solution.
Something like this AD8307 from Analog Devices.
https://www.analog.com/media/en/technical-documentation/data-sheets/AD8307.pdf
US$13.50 from Digikey https://www.digikey.tw/product-detail/en/analog-devices-inc/AD8307ARZ/AD8307ARZ-ND/936617
I have not used it myself yet. Just an idea.
This shows the bias voltage adjustable with a potentiometer. If you were to adjust the potentiometer through the input switching threshold, you would see a point where the input is at a peak of sensitivity to lower levels of the input signal, right at the threshold. There will be a lot of noise that determines the lower limit of sensitivity to a real signal. You'd probably adjust it to one side or the other of the exact threshold, outside the noise band, so you get no count when there is no input.
again, the noise band determines your limit of sensitivity.
As it stands, your firmware is probably using one of the counter modes, either POSEDGE or NEGEDGE to count the rising or falling edges of your input signal.
In the scheme I mentioned above, using the mode POSDET, with feedback to the bpin, the feedback mimics the effect of adjusting the potentiometer seen the the simpler scheme. The feedback causes the bias voltage to settle right on top of the threshold, the point of highest sensitivity, noise and all. The feedback rule is simply that the bpin follows the inverse of the apin, as determined at each 12.5ns Propeller clock cycle (at 80MHz clock rate). I really should specify POSEDGE with feeback, not POSDET with feedback, because still what you want to do is to count the edges on the apin over a period of time. POSDET measures the input period, not the frequency. The period in your situation is too short to be meaningful in relation to the Prop clkfreq.
Given that the input is not a square wave, wouldn't it be prudent to add a little hysteresis to the Prop's input pin to ward off the counting of false edges? This can be done by applying an inverter to the POSDET output, along with a weak resistor to the input pin.
-Phil
Tracy,
I have attached a picture of my setup for my frequency sampling, pretty simple, but effective for measuring the feedline frequency to within a few cycles. I put my capacitor meter between the input to the prop and the center conductor of the feedline and measured 8.8pf. I think this would be the answer to your ?pf coupling question. As you see this is a single conductor to the prop, no grd. I get different answers from my scope that has confused me, and I think it may be in relation to your ? on the ground. If I put my scope on the line coming into the prop, and ground the probe to prop grd, I will get a pep voltage of .84v @ 30 watts and the tuner does not have enough to measure a freq. But if I remove the ground connection on the probe and measure (floating grd) , I get 2.56v, and the tuner measures the frequency. I really do not understand why the difference, and which voltage the prop is actually seeing. These measurements are without any resistor dividers or caps in line, from my sensor in the picture directly to prop pin. It seems as though the probe is acting as a voltage divider when grounded. This is the reason I am not so sure the current divider network will work at lower power, if it yields the answer my scope gives when grounded.
So I am trying to figure out how to setup my scope to properly measure Vx when adjusting the 1k pot. Which Schottky diodes are you using in your design, and how do I determine the capacitor value across the resistors. I am using POSEDGE to make my freq measurements.
In this design you are using a fixed bias voltage set with the pot. I am intrigued of how you would use a bpin to bias, I have some extra pins available, and not excited about putting a pot on the board. I have included my code for frequency measuring below, where would you put the bpin biasing in this code, and what would it look like?