I gather that the OP wants a "transition" at the peak.
"It's beginning to sound a lot like..." homework :-) ...Jim Thompson
I gather that the OP wants a "transition" at the peak.
"It's beginning to sound a lot like..." homework :-) ...Jim Thompson
Maybe it's related to previous query? That's why I like to get an idea of where and why these things wanted. Difficult to offer specific help when an adjacent whatsit might be capable of doing half the job, or something.
Grant.
Disable the down input to the counter so it can only count "up". The A/D will follow the signal up, and then stay there; at the peak. If the counter only has a clock and direction, connect the counters "direction" to the count enable and the direction input to "up".
Possibly. That's why I broached the all-pass 90° shift as another method. ...Jim Thompson
--- Clever devil! :-)
I don't know why, but a tracking ADC didn't even come to mind until you mentioned it.
Old-timer's disease setting in maybe. :-(
Anyways, what I was thinking about was more like a counter chain gated by a dflop clocked by a zero-crossing detector to get the period of the AC signal, then taking that quantity, shifting it one bit toward the LSB and counting it down to zero, using the same clock that drove the up-counter to get a half-period which would correspond to the location of the peak when the counter got to zero.
Needs a little more thought to make sure both halves of the AC signal would be used to generate a continuous output in quadrature with the input, but I'm waiting for the OP to come back with his accuracy requirements before I put much more time into it.
Nice thing about this circuit (if it's done right) is that, like a tracking ADC, it'll track the input and make edges which will follow the variations in its period.
On the other hand, If he wants to use an ADC and he wants be able to place the edges with an accuracy of one degree at the peaks he'll need a 14 bit ADC, since if:
E (sin 90°) = 1V
then E (sin 89°) = 0.99985V
and
DV = 0.00015V,
which is 1.5 parts in 10000.
The best you can do with a 13 bit ADC is 1 part in 8192, so that won't work, but 14 bits is 1 part in 16384, so that will.
For 1° resolution he'll need to sample 360 times in one cycle which comes out to 36Ms/s, which is certainly doable:
Hi,
The accuracy requirements are as follows
Thanks
John
What's wrong with an RC?
Actually, and RC doesn't approach the required 90 degree lead or lag unless the time constant is huge, and then the signal is approaching zero. If your signal frequency is fairly steady, an R-L-C can do a lot better.
Try this:
in-------R------L---+------------comparator+ | | C | +------------comparator- | | gnd
Pick the R-C to give, say, 70 degrees of lag at 100 KHz. Pick the L to add phase lag until the comparator switches just at the signal peaks, compensating for comparator delay while you're at it. R can be partly trimpot for fine tuning. This will preserve a healthy fraction of the original signal amplitude.
I've also done this as
in-------C----------+------------comparator+ | | R | L | small | offset---comparator- | | gnd
as a fast constant-fraction discriminator, with an ecl comparator, instead of the usual delay-line thing.
John
Then what's wrong with my suggestion... you don't like capacitors and want to spend more money ?:-) ...Jim Thompson
-- | James E.Thompson, CTO | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona 85048 Skype: Contacts Only | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at
Spice is like a sports car... Performance only as good as the person behind the wheel.
You're not sampling fast enough.
john1987 is invited to do the math.
A differentiator finds peaks just fine as previously demonstrated, and a 90° all-pass is also trivial, without an inductor, also as previously demonstrated. ...Jim Thompson
That sounds like a job for a window comparator. All these peak detector gizmos are assuming you don't know the actual amplitude.
Cheers
Phil Hobbs
(1) Differentiator + Comparator: NO (2) All-pass + Comparator: NO (3) Tracking ADC/Counter: NO
How does a window detector find "peak"? It can find zero-crossings just ducky, but not "peak"... unless you "know actual amplitude" :-) ...Jim Thompson
(Could you please include context in your replies? This is USENET.)
Why are you dead set against the RC circuit?
Detecting peaks requires memory of past history of the wave, which means (in an analog circuit) than you need a capacitor or an inductor. So, sure you can get rid of the cap -- if you don't mind having an inductor in there.
People keep asking you questions like "is your frequency stable", trying to find ways to make you happy, and you keep responding with "I don't even want to put up with a capacitor in my circuit".
What are you really trying to do, and what are your real constraints? What's the matter with a cruddy capacitor?
If it's really a sine wave you could square it up and lock to it with a
4046 or other PLL.Why the objection to the cap? Nothing that you can replace the RC network with is going to be smaller, but there are lots of options that are far bigger.
Trying to find actual end-use intent is one of the bigger problems everywhere. Vagueness drives me nuts.
Reminds me, in the early '60's, an Admiral comes to Moto and we get in a closed meeting, only those with secret clearance allowed.
This SOB rambles and rambles and rambles... for several hours.
I'm taking notes.
All of a sudden I say, "You're trying to do... TOP SECRET" :-)
After he got over his white faced shock. I showed a simple PLL solution. ...Jim Thompson
Very good solution! An analog phase detector would give you the 90° phase shift, thus the "transitions on peaks" the OP wants.
More capacitors than the differentiator, or all-pass, though :-)
...Jim Thompson
Nope. Just do random time sampling using a simple microcontroller. As long as the S&H can handle 100kHz it's fine. Keep in mind that today's microcontrollers are 32 bit, run at >50MHz and have hardware multipliers and dividers.
Clever indeed. Are you working for Elektor these days? :-)
Have something to add? Share your thoughts — no account required.
Ask the community — no account required