I am trying to design a precision rectifier, to detect AC current through a current transformer. With a 22 Ω burden resistor and a test bulb, the CT I have gives me a pretty ugly 20 mV sinusoid with a 5% duty factor, which I have modeled as pulses in the simulation below:
I am trying to use a first non-inverting amplifier stage, followed by a precision half-wave rectifier. Each circuit taken separately in a simulator works fine, but as soon as I combine the two everything breaks down.
This is a snapshot of the amplifier simulation (5 V voltage source on the right, LM324 op-amps):
This is a snapshot of the half-rectifier simulation:
And the complete circuit that doesn't work at all:
For starters the negative rail goes up to 0.8 V and the positive one to 5.8 V :( What am I missing?