Turning an offset dc sinewave into a linear output

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
I need to turn a 60 Hz sinewave that has an offset of 2.5V into a lineal signal depending on the sinewave's amplitude. The sinewave's maximum peak-to-peak is 4V. That is, it has an amplitude of 2V, its lowest point will be at 0.5V and its highest at 4.5V. What I want to do is convert the signal produced by an AC current transducer to a linear output.

If the sinewave has a 0V amplitude (that is, it's a fixed 2.5V signal) the circuit's output has to be 0V. If the sinewave has a 2V amplitude, the circuit's output needs to be 5V. Something like the following graphs:

upload_2018-10-11_17-31-59.png

upload_2018-10-11_17-32-9.png

Any advice as to what technique would be best to approach this problem, maintaining simplicity and minimizing the number of components?
 
Last edited:

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220

crutschow

Joined Mar 14, 2008
34,284
Why not just run the signal through a series capacitor (HPF) to remove DC offset and use a peak detector to generate a DC voltage?
You can amplify that with an op amp to give the desired output voltage.

How fast a response do you need to changes in current?
 

ebeowulf17

Joined Aug 12, 2014
3,307
Why not just run the signal through a series capacitor (HPF) to remove DC offset and use a peak detector to generate a DC voltage?
You can amplify that with an op amp to give the desired output voltage.

How fast a response do you need to changes in current?
Forget all the nonsense I originally wrote - I must've been hallucinating, because I completely misread the description the first time.

Wouldn't that leave only the DC offset and eliminate any trace of the AC amplitude? I believe the goal is to create a DC signal proportional to the AC amplitude of the input, ignoring DC offset.
 
Last edited:

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
Why not just run the signal through a series capacitor (HPF) to remove DC offset and use a peak detector to generate a DC voltage?
You can amplify that with an op amp to give the desired output voltage.

How fast a response do you need to changes in current?
That's a very attractive idea, thanks. I need the signal to reach 0V, from its highest point of 5V, in 1/4 second. That is, if the highest allowable current is instantaneously removed, a response time of 1/4 second is desirable.

As you can see, I'd like the circuit's response to be relatively sluggish.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
Here's my first attempt at a sim:

upload_2018-10-11_22-7-44.png

I've (more or less) introduced the MLX91205 output parameters into V1, so as to more accurately represent the source. The circuit seems to be working fine, except maybe for a little ripple ... which can be tolerated, and maybe got rid of after feeding the output to a x3.3 OpAmp. Only thing bothering me is that the output takes a little too long for my taste to reach 0V after the source stops.
 

Attachments

MrChips

Joined Oct 2, 2009
30,712
Your time constant is C2 x R1.
With C2 = 0.47μF and R1 = 1MΩ, time constant = 0.47 s.
Try reducing C2 or R1 or both.

Edit: Of course, reducing the time constant will increase the ripple. You cannot have it both ways. In order to have low ripple and fast response you will have to go with a much more complicated design using peak detect and cross-over detection.
 

crutschow

Joined Mar 14, 2008
34,284
Is it no problem that inputs below about 0.5V peak are not seen at the output of your circuit due to the diode forward drop?
 

danadak

Joined Mar 10, 2018
4,057
Can always do a peak detector with a UP using its onboard
A/D to detect peaks and DAC to produce result. Something
like this -

upload_2018-10-12_6-40-30.png


Note can handle cycle to cycle generation of peak, not integrating
approach by typical analog peak detector. Latency is << analog
approach. And accuracy, because of onchip Vref, very good. If
these issues matter to you.

Note I forgot to G it up to meet the 0 - 5V requirement, thats also
trivial using one of the onboard R-R OpAmps.

Regards, Dana.
 

Danko

Joined Nov 22, 2017
1,829
I need to turn a 60 Hz sinewave that has an offset of 2.5V into a lineal signal depending on the sinewave's amplitude. The sinewave's maximum peak-to-peak is 4V. That is, it has an amplitude of 2V, its lowest point will be at 0.5V and its highest at 4.5V. What I want to do is convert the signal produced by an AC current transducer to a linear output.
You can use ADL5511 chip:
a.JPG
b.JPG
 

crutschow

Joined Mar 14, 2008
34,284
Below is the LTspice simulation of a precision full-wave rectifier followed by a 2-pole Sallen-Key filter with gain.
This circuit uses a rail-rail opamp that operates from a single-supply, with the 2-pole filter providing good ripple suppression and relatively fast transient response.
The full-wave rectifier is less sensitive to any signal noise spikes as compared to a peak detector.

The output is shown for inputs of 1V and 2V peak.

upload_2018-10-12_12-38-22.png
 

Attachments

Last edited:

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
Below is the LTspice simulation of a precision full-wave rectifier followed by a 2-pole Sallen-Key filter with gain.
This circuit uses a rail-rail opamp that operates from a single-supply, with the 2-pole filter providing good ripple suppression and relatively fast transient response.
The full-wave rectifier is less sensitive to any signal noise spikes as compared to a peak detector.

The output is shown for inputs of 1V and 2V peak.

View attachment 161429
That's impressive, Crutschow ... and your design's only using one chip! ... gonna start playing with it and be right back with my results. Many thanks!
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
Here's my interaction with Crutschow's circuit. I've adjusted the caps and resistor values to what I have available at the moment, and it seems to be working fine. Also, I've specified a 5K and a 1nF output impedance and capacitance value for V2, just as the the MLX91205 output specs. I added an RC filter at the circuit's output, to smooth things a bit. And finally, I've set V2 to work as a 2.5V ±2.25V, also to imitate said chip's maximum range. Are there any critical component tolerances that I should be concerned about? Something tells me that R6 and R7 should have a tight tolerance.

upload_2018-10-12_18-52-16.png
 

Attachments

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
And considering all the previous observations, these latest values give (so far) the best results, with minimum output ripple. I also changed the 1N914 for a BAT54 diode to obtain a more symmetric rectified output from U1, and it seems to have worked.

upload_2018-10-12_20-21-53.png
 

Attachments

Last edited:

Thread Starter

cmartinez

Joined Jan 17, 2007
8,220
I would use a precision rectifier and a peak detector. Subtract the 2.5V offset and then map 0-2VDC to 0-5VDC using a gain of 2.5

https://en.wikipedia.org/wiki/Precision_rectifier
http://sound.whsites.net/appnotes/an001.htm
And in the end, @Papabravo, it seems that the solution to the problem was exactly that :) ... I just didn't visualize that it could be done with a single chip ... sometimes a problem is much bigger in your head than it is in reality ... it's when things turn out to be the other way around when big trouble happens :eek: ...
 
Top