# Reference voltage changes when connected to inverting input of op amp comparator

The capacitor C2 keeps the value of a slow varying signal for some time. The capacitor discharges through the two resistors R3 and R4 with a time constant of $$\\tau = RC = 10\mu F \times 1M\Omega = 10s\$$. The voltage across resistor R4 should be half of the voltage across the capacitor. This works as expected when the op amp (NE5534N) isn't connected to the circuit.

When V_R4 is used as reference to the inverting input of the op amp the voltage changes to about 80% of the voltage across the capacitor C2. I have not been able to find a solution to this. Am I missing something here? • what's the current that flows into a non-ideal opamp like the NE5534? – Marcus Müller May 9 '19 at 17:49
• Why do you need a diode if the input voltage lies between 0 to 5V? Actually a PI controller is a better solution if you want to achieve an offset cancellation. – Marko Buršič May 9 '19 at 18:26
• The diode is to force the capacitor to discharge through the resistors – opamp May 10 '19 at 7:14