Precision rectifier in JFET auto gain control loop

Thread Starter

hrs

Joined Jun 13, 2014
394
Hi,

I'm working on a Wienbridge oscillator with JFET automatic gain control. The general idea of the oscillator is attached. It shows 2 sets of timing caps where I'll probably end up using 3 sets. With something like 2k - 50k and .47 nF, 10 nF, 250 nF the range would be from 12 Hz to 169 kHz, if I can make that work. It needs to be powered from a single supply, likely 12V.

The JFET in the AGC loop gets bumped once every period correcting the gain. If you insert a rectifier in the loop the JFET gets bumped twice. From the FFT it looks like this significantly reduces the harmonics. It also looks like it marginally improves the flatness of the output amplitude over the frequency range. For these reasons I consider adding the extra complexity of a rectifier.

Now I'm trying to figure out a precision rectifier that is fast enough. See precision_rectifier.png for what I came up with. Powering a comparator from the reference voltage may not win me any prizes and I need to tweak R19 to give both lobes of the rectified sine approximately the same amplitude. Also there's a lot of junk on the tops. I tried to make the comparator drive a MOSFET that shorts the non-inverting input of U8 to Vref instead of directly connecting the open collector, but nothing good came of that. Can a MOSFET help here somehow?

What rectifier configuration would you suggest here?
 

Attachments

AlbertHall

Joined Jun 4, 2014
12,343
You are exceeding the common mode range of the LM393. The inputs should not go lower than -0.3V from the negative supply which in this case is Vref, 6V.
 

Thread Starter

hrs

Joined Jun 13, 2014
394
Thanks Albert, I didn't realise that.
I managed to get a more conventional design to invert the rectified output and it works but it won't go very fast. I guess this will not work without faster opamps.
 

Attachments

crutschow

Joined Mar 14, 2008
34,280
I would think that doubling the time-constant for the FET input filter would have the same effect as using a full-wave rectifier.
 

Thread Starter

hrs

Joined Jun 13, 2014
394
I would think that doubling the time-constant for the FET input filter would have the same effect as using a full-wave rectifier.
Hmm, indeed I see it makes a few (1 or 2) dB difference if I double the cap. But it's still in the 40 dB range between the peak of the fundamental and the peak of the next harmonic whereas the circuit with the rectifier gives ~50 dB. Since I cannot measure distortion anyway I think I'll drop the rectifier.
In the post #1 General Idea schematic, the Wein stage feedback connections are incorrect.
I see what you mean, thanks.
 

Thread Starter

hrs

Joined Jun 13, 2014
394
Before abandoning the rectifier idea I was trying to see if some bjts could make a fast enough rectifier ... somehow.
I can't figure out the result of this circuit. Why is out2 rectified? Shown is an LTSpice simulation. The falstad simulator gave a comparable result.
 

Attachments

crutschow

Joined Mar 14, 2008
34,280
So what's wrong with the "bjt rectifier"?
The way it works is the positive half of the sinewave is inverted by the transistor but, since the transistor is biased at 6V with equal value collector and emitter resistors, the negative half is coupled directly through the now forward-biased collector-base junction, thus giving a full-wave rectification.

What are you trying to do with "sort of works"?
 

Thread Starter

hrs

Joined Jun 13, 2014
394
The way it works is the positive half of the sinewave is inverted by the transistor but, since the transistor is biased at 6V with equal value collector and emitter resistors, the negative half is coupled directly through the now forward-biased collector-base junction,
thus giving a full-wave rectification.
Ah, I see it now, thanks!
So what's wrong with the "bjt rectifier"?
I noticed that it isn't so well behaved over a large frequency range, say 10 Hz to 100 kHz. At higher frequencies it starts to look like junk. Also, when I inserted it into the AGC loop it worked more like a half wave rectifier. Probably due to loading and maybe fixable with a buffer. Maybe I should accept that getting such a range out if a Wienbridge is not easy and set my sights lower, like 20 Hz to 40 kHz. [edit] or accept more distortion[/edit]
What are you trying to do with "sort of works"?
Also getting full wave rectification. It's what I was working towards when stumbling across "bjt rectifier". For the sake of the experiment I added a buffer per attachment to it and it works ok at high frequency but at low frequencies the rectified output amplitude is greatly reduced. And I don't like the part count.
As far as I can see in 'sort of works.png' neither Q1 nor Q2 has anywhere for collector current to flow.
I see what you're saying. Except through the base. The simulation says the base current peaks at ~220 uA vs ~270 uA in the collector. So this wouldn't work in reality?
 

Attachments

AlbertHall

Joined Jun 4, 2014
12,343
Below is the current in C5 in 'sort of works2.asc'. As this is unidirectional I would expect the voltage across C5 to rise continually but it apparently doesn't.
Can anyone explain why?

1620937811576.png
 
Top