Turning an offset dc sinewave into a linear output

Discussion in 'General Electronics Chat' started by cmartinez, Oct 11, 2018 at 6:32 PM.

  1. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
    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: Oct 11, 2018 at 6:40 PM
  2. Papabravo

    Expert

    Feb 24, 2006
    11,657
    2,448
    Last edited: Oct 11, 2018 at 7:21 PM
    cmartinez likes this.
  3. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
  4. crutschow

    Expert

    Mar 14, 2008
    19,709
    5,509
    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?
     
    cmartinez likes this.
  5. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,321
    408
    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: Oct 11, 2018 at 9:04 PM
  6. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
    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.
     
  7. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
    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.
     
  8. MrChips

    Moderator

    Oct 2, 2009
    16,830
    5,165
    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.
     
    cmartinez likes this.
  9. crutschow

    Expert

    Mar 14, 2008
    19,709
    5,509
    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?
     
  10. danadak

    Well-Known Member

    Mar 10, 2018
    1,537
    320
    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.
     
  11. Danko

    Active Member

    Nov 22, 2017
    502
    197
    You can use ADL5511 chip:
    a.JPG
    b.JPG
     
    cmartinez likes this.
  12. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
    Thanks for the recommendation. There's also de AD536, which I've been using for this purpose on previous projects, but that chip and the one you've recommended are expensive components. That's one of the reasons I'm trying to find an alternative.
     
  13. ebeowulf17

    Well-Known Member

    Aug 12, 2014
    2,321
    408
    I assume the solution would be to use something more like this?
    9D760663-2E62-478D-8333-0F0DC966BF31.jpeg
     
    cmartinez likes this.
  14. crutschow

    Expert

    Mar 14, 2008
    19,709
    5,509
    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
     
    Last edited: Oct 12, 2018 at 3:38 PM
    ebeowulf17 and cmartinez like this.
  15. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
    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!
     
  16. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
    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
     
  17. crutschow

    Expert

    Mar 14, 2008
    19,709
    5,509
    R6 and R7 determine the gain of U3.

    The 5k and 1nF output load for the MLX91205 is a nominal load that it can drive.
    You don't have to intentionally add that to the circuit.
     
    cmartinez likes this.
  18. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
    Thanks for pointing that out. Now I understand how to read datasheets a bit better.
     
  19. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
    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
     
    Last edited: Oct 12, 2018 at 9:29 PM
  20. cmartinez

    Thread Starter AAC Fanatic!

    Jan 17, 2007
    5,423
    6,357
    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: ...
     
Loading...