I have a resistive sensor that I'd like to use to generate an amplified voltage in a small range. I'd also like to shift/offset that range up and down with the use of a DAC to kind of "zoom in" to pre-defined regions during operation using an op-amp.
I should also note that the sensor does not inherently have any AC component and is not expected to change quickly (similar to a thermistor reacting to temperature changes).
I came up with this circuit to test:
After some initial troubleshooting, I realized I was exceeding the upper input common-mode range of VDD–1.1V=1.9V which is why I added U1, R6, R7, R8, R9. This allowed me to measure ~0V to ~3V for "Vsensor" and "Vdac" and test "Vout" at specific ranges.
By solving the circuit, I derived the theoretical output voltage to be: \begin{align} V_{out} &= \frac{-R_2}{R_1}*V_{sensor} + \frac{R_5*(R_1+R_2)*(R_3*V_{DAC}+R_4*V_{cc})}{R_1*(R_3*R_4 + R_3*R_5 + R_4*R_5)} \end{align}
After running through several values of "Vsensor" between 1.57V and 1.85V for a constant "Vdac" of 2.9V, I noticed the error between the theoretical and actual "Vout" was poor - as bad -38%. I realize this is outside of the opamp linear spec, but an -18% error when Vout=0.15V seems too high when I expect it to be in the linear range.
The MCP607 datasheet states the maximum input common mode voltage is 1.9V (for 3V supply) and I applied ~1.69V so I don't suspect that is the issue. It also states the output voltage is linear when it is at least 100mV away from the rails.
I tried adjusting the values of R3, R4, R5 so that the parallel resistance is close to R1||R2 with the thought that the input bias currents could be leading to additional input offset errors. Although the error was not improved, the sign was opposite (now Vsensor was 30% higher than expected).
I have tried again at Vdac set to 1.5V (worst error was -17%) and again at 0.1V (worst error was +11%). It seems the error is always the worst when Vsensor is highest and converges to 0% as Vsensor decreases.
I could use some help in troubleshooting. Any ideas what could cause this? Perhaps I'm not considering other key specs in the datasheet?
Thank you!
EDIT: I removed references to "difference amplifier" and instead called it op-amp
UPDATE: I tried removing the capacitor (C3), cleaning residual flux from pcb, and even removed U1 and connected PSU directly to "Vsensor" and "Vdac". Unfortunately, the error remained high at 25%. I input my values that I listed above into a PWL to simulate in LTspice and saw the worst error was ~2% and averaged ~0.6%. My search continues.
===============================================================
UPDATE: Rather than post my own answer and close this discussion, I decided to post an update to see what further contributions/improvements could be made. Furthermore, I still have more testing to determine if this behavior will be acceptable. Once that is complete, I will post an answer and close the discussion.
TLDR; By eliminating the trimpots and the amplifiers after them, I was able to reduce the error from ~30mV down to ~10mV.
After reviewing all the responses, I took a step back and tried to think through this again. To try and simplify the test setup as much as possible, I removed U1/R3/R5 and shorted R4. Then I connected alternate PSU channels directly as "Vsensor" and Vdac". I was happy to see that the measured "Vout" was within 3mV of the expected value throughout the range.
After further review, I believe part of my issue was with the trimpots themselves since I noticed them drifting a little over time. They are multi-turn ones but residual internal tension and disturbances while taking measurements may have caused the wiper to move slightly. The following 2x gain stage would only make it worse. Since I took my measurements one at a time with ~10s of averaging, there could've been enough time for things to change enough to be problematic.
I eliminated the pots and U1, restored R3/R4/R5 back to the original values, and connected my PSU as the two inputs as follows: same as OP but without pots/U1
After testing multiple points in three ranges: results in table and chart formats The parts in green are meant to signify when "Vout" is in the linear range (at least 100mV away from the rails).
As @Jonk and @Spehro Pefhany mentioned above, the resistor tolerance also contributes errors. Moving forward, I'll look to incorporate a more stable reference voltage rather than base things off Vcc. I may also consider using 0.1% resistors.
Thank you, everyone, for your help!
As stated above, I will still test and look for further improvements and welcome any additional feedback that might arise. Once I complete my testing and am confident the issue has been resolved, I'll close the topic.