Turning an offset dc sinewave into a linear output

Thread Starter

cmartinez

Joined Jan 17, 2007
8,786
After careful evaluation of the latest circuit, I noticed that the last values I used for U1's gain resistors were producing a highly asymmetrical rectified wave at the MID test point. So I adjusted again the circuit with values of SMT resistors I have with me, and also the gain resistors of U2 to bring the output signal back into range and acceptable linearity. Here's the result.

upload_2018-10-13_14-5-14.png
 

Attachments

crutschow

Joined Mar 14, 2008
38,540
I noticed that the last values I used for U1's gain resistors were producing a highly asymmetrical rectified wave at the MID test point.
Part of the reason for that is you used a value of 33kΩ for R8 instead of the 10kΩ I used (why?).
The asymmetry is due to the input impedance of the first stage being significantly different for the positive (near infinite) versus the negative portion (R3 in parallel with R2-R10) of the input waveform.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,786
Dumb question: what should I do with the unused OpAmp of the LMC6484A? Ground the inputs and leave the output floating?
 

crutschow

Joined Mar 14, 2008
38,540
I 'd tell you why ... but I don't want to make disparaging remarks about myself ... :oops: ... :D
Then I'll stay mum on the subject also. ;)

Incidentally changing D1 from a standard diode to a Schottky should have no significant effect on circuit operation.
The effective diode forward drop is reduced by the open-loop gain of the opamp.
 

crutschow

Joined Mar 14, 2008
38,540
"Grounding both inputs, or shorting them together at some other potential, also causes the output stage to saturate."
True, but I don't think that's a particular problem.

But alternately, connect the output to the (-) input and ground the (+) input.
The will put the output at ground potential without saturating and without any added parts.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,786
"Grounding both inputs, or shorting them together at some other potential, also causes the output stage to saturate."
True, but I don't think that's a particular problem.

But alternately, connect the output to the (-) input and ground the (+) input.
The will put the output at ground potential without saturating and without any added parts.
Thanks, crutschow. That small advice from you just saved me valuable PCB space ... and a few cents worth of SMT resistors. And, say ... I remember now why I'm using a 33k resistor for R8. After all the adjustments I made to all the other resistors to values I have available, I noticed that leaving R8 as 10K would shift the output scale in a way that at 50% input amplitude the output would be a few mV short of the 2.5V expected. Adjusting R8 to 33k fixed that.
 
Last edited:

crutschow

Joined Mar 14, 2008
38,540
I noticed that leaving R8 as 10K would shift the output scale in a way that at 50% input amplitude the output would be a few mV short of the 2.5V expected. Adjusting R8 to 33k fixed that.
Adjusting R1 (R2 in my schematic) would have been better since it minimizes the plus and minus asymmetry at U1's input (see below).

upload_2018-10-13_18-3-32.png
 
Last edited:

Thread Starter

cmartinez

Joined Jan 17, 2007
8,786
Update.

I've finally built the thing, but haven't tested it yet, that's something that's gonna happen in the next couple of weeks. Installing the MLX91205 was a piece of cake using low-temp soldering paste. But wrapping 3-1/2 turns of #22 ga wire around it was a bit tricky. Though I think I did a decent job in the end.

Untitled 01.png

Untitled 02.png
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,786
Well, I'm back ... I've tested the thing, and it isn't working ... I've gone through all the wiring, checked grounds, voltages, and have made sure that the parts in the circuit are exactly the ones as the parts in the sim, and still no results.

The input of the circuit is a steady 2.5V, just the way I want it to. But the output seems to be left "floating" (when it should be a flat 0V) when I apply power to it. When I either measure it with a MM, or scope it, the output seems to peak at 5V, and then after a few seconds drifts down to 0.5V, where it begins to very slowly oscillate.

What am I missing?

upload_2019-1-4_17-17-10.png
 

ebeowulf17

Joined Aug 12, 2014
3,307
X
Well, I'm back ... I've tested the thing, and it isn't working ... I've gone through all the wiring, checked grounds, voltages, and have made sure that the parts in the circuit are exactly the ones as the parts in the sim, and still no results.

The input of the circuit is a steady 2.5V, just the way I want it to. But the output seems to be left "floating" (when it should be a flat 0V) when I apply power to it. When I either measure it with a MM, or scope it, the output seems to peak at 5V, and then after a few seconds drifts down to 0.5V, where it begins to very slowly oscillate.

What am I missing?

What happens when you feed in an AC input? Do you see the expected DC output then? In other words, is the problem only when you're close to zero volts target output?

What's your power supply? Do you have decoupling caps at all ICs?

I don't have any specific ideas yet - just troubleshooting and brainstorming. Good luck!
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,786
X

What happens when you feed in an AC input? Do you see the expected DC output then? In other words, is the problem only when you're close to zero volts target output?

What's your power supply? Do you have decoupling caps at all ICs?

I don't have any specific ideas yet - just troubleshooting and brainstorming. Good luck!
Yes, there are decoupling caps sprinkled all over. But the circuit's performance should be such that it has a 0V output when it has a 0V input, and that's not the case here.
 

Thread Starter

cmartinez

Joined Jan 17, 2007
8,786
Measure the voltages at all the circuit nodes and post a schematic with the voltages.
That should allow us to troubleshoot the problem.
Here are the real measurements when IN=0V, vs the theoretical values, according to the sim:

Code:
node|  Sim  | Meas
-------------------
+V  | 5.000 | 4.999
In  | 2.500 | 2.500
01  | 0.000 | 0.001
02  | 0.020 | 0.010
Mid | 0.190 | 0.007
03  | 0.018 | 0.078
04  | 0.033 | 0.006
05  | 0.035 | 0.007
06  | 0.035 | 0.007
07  | 0.036 | 0.000
08  | 0.108 | 5.000
      Out | 0.107 | 5 to 0.360V

upload_2019-1-5_0-54-2.png

The problem manifests itself starting at node #2, but obviously the greatest discrepancy lies at node #8. And when "Out" is physically measured, it starts by peaking at 5V, and then it goes down to 0.36V after 4 or 5 seconds, as soon as either the probe of the MM or the scope is applied. Something's fishy and I just don't understand what it is.

I can confirm that I've already gone through each and every part on the PCB at least five times, and everything is connected according to plan.
 
Last edited:

crutschow

Joined Mar 14, 2008
38,540
Elementary, my dear Watson. :)
The exactly 0V at node 7 is a flag.
Think about that.
If the output on node 8 is 5V, then the voltage on node 7 should be about 1.67V.
It's exactly at 0V, which indicates that point is just sitting at ground with no connection to node 8 (or node 7 is shorted to ground).
I would check the connections for R6, R7, and R11.
Measure the voltage across R6.
Also check the resistor values across those devices and to ground with the circuit unpowered.
 
Top