Thanks for all the suggestions, much appreciated
![Grin ;D](https://www.eevblog.com/forum/Smileys/default/xgrin.gif.pagespeed.ic.QVVz6XIT20.png)
I used so many relays because, in my mind, they introduce less parassites in the circuit than a CMOS switche, but sure, i could use CMOS switches at least for the compesation pots.
Reading the LMC622 datasheet i discovered that loading an opamp's output with a capacitor it may induce instabilities in the opamp. I didn't know that
![Banging Head |O](https://www.eevblog.com/forum/Smileys/default/bangheadonwall.gif.pagespeed.ce.8iLbFYV4Bc.gif)
probably i should have read the whole datasheet before designing the whole circuit. Shame on me.
Anyway, the datasheet itself says that to drive a very capacitive load it is necessary to put a resistor in series with the output. Initially i put a 330 Ohm resistor in series and i noticed that the peak-to-peak amplitude of the oscillation was reduced by a bit, then i tried 1Kohm and it reduced by another bit, so i tried 1MOhm and now it seems that the oscillation is entirely gone. I noticed that when is selected the MegaOhm range(i.e. the 1MOhm resistor is in the feedback path) there's another oscillation, but is the main's 50Hz. Switching to 1GOhm in the feedback path, this oscillation is a bit wider, so i presume it's just ambient noise picked up by a big resistor(even if i calculated the cutoff frequency with the 330pF @1GOgm and it should be 0.5Hz, so i shouldn't see that oscillation)
1K range:
![Poor linearity of a opamp push-pull buffered 1016618-0](https://www.eevblog.com/forum/index.php?action=dlattach;topic=245906.0;attach=1016620;image)
1M range:
![Poor linearity of a opamp push-pull buffered 1016602-1](https://www.eevblog.com/forum/index.php?action=dlattach;topic=245906.0;attach=1016604;image)
Doing that the non linearity dessappeared. YEAH!
What do think about this solution? Is it fine? Is it doable? Is it dumb?
![Poor linearity of a opamp push-pull buffered 1016606-2](https://www.eevblog.com/forum/index.php?action=dlattach;topic=245906.0;attach=1016608;image)
There is just an offset, fixable with one of the pots shown in a picture in the previous replies.
I would like to ask you another thing, it's a bit off-topic though.
![Poor linearity of a opamp push-pull buffered 1016610-3](https://www.eevblog.com/forum/index.php?action=dlattach;topic=245906.0;attach=1016612;image)
As you can see, i'm measuring a 1MOhm resistor.
In the first part of the plot there's a clean 1MOhm line while the opamp has a 1MOhm resistor in the feedback path. Once it saturates, it switches feedback resitor and it set it to a 1kOhm resistor(i.e the next range). As you can see there are 2 major problems.
The first problem is a conversion problem, i.e. converting the ADC data to a more human readable data. I do that dividing the incoming data depending on the range. For example if the opamp is in the 1MEG RANGE, it divides the converted data by 1000000, when it is in the 1K RANGE it divides by 1000 and so on. But, as you can see, the ranges are non contiguous.
Probably i should make another topic, but if you can help me about this problem i would appreciate it a lot.
The second problem, maybe the most dramatic, is the fact that when measuring a 1MOhm Resistor, the 1K RANGE is
VERY noisy.
I mean, the 1MOhm in kinda there, but a 24bit converter over 5V and with a 0.00000029V resolution, should be able to read a
(5V/1MOhm = 0,000005A -> 1kOhm*0,000005A =) 0.005V signal withouth problems i think. Considering also that the LTC2402 is a precision ADC, and considering also that 0.005V is far away from the minimum value, i would assume that this noise in not generated by the ADC.
This is a very limiting problem if my circuit cant do a full sweep with reasonalbe noise level of a 1MOhm resistor.
This problem was present even before the fix to the oscillation.
Can you help me? Probably is an opamp issue, but how can i improve this mess?