9

I'm designing an envelope generator for a sort of mini synthesizer I'm currently working on. I want the envelope signal to evolve (rise or decay, depending on the SPDT switch) only when the switch (SW1) is closed. The first part of the circuit (RV1, C1, R1 and D1) handles the rising envelope signal. The first op-amp ensures that the capacitor discharges only when the switch is open (through D1 and R1) and buffers the signal. That signal is then inverted to generate the decay envelope signal. The problem is that, when the switch is open, the output of the first op-amp, which should be very close to ground (typically 5mV according to LM324 datasheet), is at about 600mV. It surely can't be an impedance problem, the output impedance of the buffer is very low and the input impedance of the inverting amp is 10k. However, if I swap R2 and R3 for 100k resistors, the offset is minimized (I get about 60mV instead of 600mV). Why does this happen? Does it have to do with the inverting amplifier being biased at 2.5V?

Edit: LM324 power supply voltages are 0V and 9V (9V single supply).

Envelope generator schematic

Javier Soto
  • 127
  • 6
  • When you measure 600mV at the output, what do you measure at the input? – brhans Oct 19 '22 at 23:29
  • And the power supply voltages to the are what, 0V and 5V? – Justme Oct 19 '22 at 23:59
  • 2
    You'll probably have better luck with a true rail-to-rail opamp that can operate at 5V. – td127 Oct 20 '22 at 00:49
  • It is possible that the 2.5 V bias on U2B will cause its output to be 5V and this will cause a 250 uA current into the output of U1A. This might be enough to cause a 600 mV offset on its output. – PStechPaul Oct 20 '22 at 01:36
  • @brhans At the input of the buffer (U1A) I measure almost exactly 0V (1-2mV). – Javier Soto Oct 20 '22 at 21:18
  • @Justme The op-amp power supply voltages are 0V and 9V (so I can have clean envelopes from 0V to 5V), sorry I didn't mention that. I edit my post to add this information. – Javier Soto Oct 20 '22 at 21:39

2 Answers2

8

When the LM324 output is sinking current, it can only sink a few tens of uA before the (nominal) fixed 50uA current sink to ground is overwhelmed and the output voltage increases to about one diode drop above the negative rail minimum.

Note that the data sheet specifies Vol with a 10k ohm resistor to ground (the negative rail), which is not your situation since current through R2 + R3 must be sunk. 5V/200k is 25uA. 5V/20k is 250uA.

From the TI data sheet:

enter image description here

Spehro Pefhany
  • 376,485
  • 21
  • 320
  • 842
3

The lower (pnp) output transistor of the buffer (U1A) is dropping about 0.6 V across its base-emitter junction when you use 10k resistors. When using 100k resistors there is much less current being sunk through that buffer's pnp output drive transistor and so its base-emitter voltage drop is much less than 600 mV.

  • 1
    The LM324 has a maximum VOL of 20 mV into 10k, so I don't think that's the problem. More likely is the mismatch of impedance on the + and - inputs, such that the bias current creates a differential voltage on the inputs. This should be more pronounced for the 1 Meg input resistor on U1A, but the maximum bias current is 200 nA which would cause 200 mV offset. It is good practice to use equal resistances to address this issue. But it does not fully explain the observed behavior. – PStechPaul Oct 20 '22 at 01:17