Buffering a capacitor with an op amp causing output to ramp up to V+...?

Thread Starter

nedhayward

Joined Aug 12, 2020
8
Hi,
I've been trying to breadboard the Keyboard Controller circuit described on this page

http://musicfromouterspace.com/inde...MAINTAB=SYNTHDIY&SONGID=NONE&VPW=1252&VPH=500

Almost all of it has been working fine, however part of it, the sample and hold section, keeps giving me troubles! It is supposed to take in a certain DC voltage (depending on what keys is pressed) and hold that voltage on a capacitor even when the key is released. This voltage is then buffered with an op amp. When I build this section however, a key is pressed and the output of the buffer initially assumes the correct voltage but then quickly ramps up to V+. I've also found that disconnecting the sample cap and buffer from the rest of the circuit still shows this behaviour, so if you just connect the capacitor from the non inverting to ground, and tie the output to the inverting, the output ramps up as well. This has really been confusing me because I can't think how the capacitor can be charging if all it's connected to is the non inverting input of the op amp. Initially i was trying this with TL074 and TL084 op amps however I've just tried it with the suggested LF444 and it's still doing the same thing. Any help as to why this is happening or how to fix it would be greatly appreciated, thankyou!
Ned
 

AlbertHall

Joined Jun 4, 2014
12,344
Leakage across the PCB is one possibility. Clean everywhere the sample capacitor is connected, including the switch matrix, with iso-propyl alcohol (IPA).
 

OBW0549

Joined Mar 2, 2015
3,566
I've also found that disconnecting the sample cap and buffer from the rest of the circuit still shows this behaviour, so if you just connect the capacitor from the non inverting to ground, and tie the output to the inverting, the output ramps up as well. This has really been confusing me because I can't think how the capacitor can be charging if all it's connected to is the non inverting input of the op amp.
Nothing mysterious going on here.

Real world op amps don't have perfect inputs with infinite resistance/zero conductivity. The inputs of ALL op amps either source or sink some amount of current, called the input bias current. And if you have a capacitor connected to an op amp input, the input bias current will slowly (or not so slowly, if the capacitor is small and/or the input current is large) either charge up the capacitor or discharge it, depending on the direction of the current.

It's good to understand the differences between real-world components and "ideal" components; doing so will avoid a lot of confusion. Read the manufacturer's data sheet for the component to find out what its limitations are.
 

Thread Starter

nedhayward

Joined Aug 12, 2020
8
Leakage across the PCB is one possibility. Clean everywhere the sample capacitor is connected, including the switch matrix, with iso-propyl alcohol (IPA).
Thanks for the reply! I've only built it on breadboard so far, a bit hesitant to make a pcb until I know it's working! Do you think this could be causing the leakage? I've tried on a few different breadboards, including some brand new ones but it's all doing the same thing!
Thanks for the help!
 

Thread Starter

nedhayward

Joined Aug 12, 2020
8
Nothing mysterious going on here.

Real world op amps don't have perfect inputs with infinite resistance/zero conductivity. The inputs of ALL op amps either source or sink some amount of current, called the input bias current. And if you have a capacitor connected to an op amp input, the input bias current will slowly (or not so slowly, if the capacitor is small and/or the input current is large) either charge up the capacitor or discharge it, depending on the direction of the current.

It's good to understand the differences between real-world components and "ideal" components; doing so will avoid a lot of confusion. Read the manufacturer's data sheet for the component to find out what its limitations are.
Yes, I was thinking that must be the only explanation, thanks for helping to clarify though! I still find it a bit confusing though because the website where I posted the link to the circuit diagram sells PCBs of this circuit, with the same component types, so I'm sure it should work! The LF444 datasheet does specify it has low input bias current (50pA max), so maybe the problem is just because I've built it on a breadboard?
 

Audioguru again

Joined Oct 21, 2019
6,672
Capacitors have a spec called "dielectric absorption" that causes the voltage to return to a capacitor that was discharged. Electrolytic capacitors have this problem severely but film capacitors do not. Ceramic capacitors develop a voltage when they are vibrated, even with sounds.
 

Thread Starter

nedhayward

Joined Aug 12, 2020
8
Capacitors have a spec called "dielectric absorption" that causes the voltage to return to a capacitor that was discharged. Electrolytic capacitors have this problem severely but film capacitors do not. Ceramic capacitors develop a voltage when they are vibrated, even with sounds.
I didn't know that, thanks for the info! I initially had this problem with normal ceramic disk capacitors, but I bought some polystyrene caps to use instead and still had the same problem! I'd assume then that the capacitor isn't the problem?
 

Audioguru again

Joined Oct 21, 2019
6,672
Most of the old opamps you tried have a problem called "Opamp Phase Inversion" where the output goes as high as it can if an input voltage is within maybe 4V from the opamp's negative supply voltage. Does your opamp have a +12V and a -12V supply?

Do you have messy wiring all-over-the-place on your breadboard that is picking up the 50Hz or 60Hz electricity hum all around you which is rectified into a positive voltage by the two diodes to ground?
 

Thread Starter

nedhayward

Joined Aug 12, 2020
8
Most of the old opamps you tried have a problem called "Opamp Phase Inversion" where the output goes as high as it can if an input voltage is within maybe 4V from the opamp's negative supply voltage. Does your opamp have a +12V and a -12V supply?

Do you have messy wiring all-over-the-place on your breadboard that is picking up the 50Hz or 60Hz electricity hum all around you which is rectified into a positive voltage by the two diodes to ground?
I am using a dual supply yes! I can't think of any reason why either of the inputs around this stage would go much below ground, but something to consider!

That's an interesting thought, I've just dismantled the whole circuit to try re-breadboarding (for a second time!) I'll try and do it at neatly as possible this time, hopefully that'll show some improvement...
Thanks for the help!
 

DickCappels

Joined Aug 21, 2008
10,153
I am amazed that you were able to get the insightful advice that you received without posting a schematic. Maybe one of us will spot something helpful .

What op amp are you using now and what is the value of your capacitor?

What is the rate of voltage change now and what is your target (as mentioned, zero drift is not on the menu unless you want some digital content. It is fairly easy to do this with and A-to-D converter and D-to-A converter on a microcontroller or controlled by one. How much resolution do you need?
 

OBW0549

Joined Mar 2, 2015
3,566
The LF444 datasheet does specify it has low input bias current (50pA max), so maybe the problem is just because I've built it on a breadboard?
I doubt it.

In addition to U3-C's input bias current (50 pA) you also have to consider the gate leakage, Igss, of Q3, which for a 2N5457 can be as high as 1 nA. 1 nA flowing through a 0.01 μF capacitor will cause a voltage rate of change of 0.1 volts/second.
 

Thread Starter

nedhayward

Joined Aug 12, 2020
8
I am amazed that you were able to get the insightful advice that you received without posting a schematic. Maybe one of us will spot something helpful .

What op amp are you using now and what is the value of your capacitor?

What is the rate of voltage change now and what is your target (as mentioned, zero drift is not on the menu unless you want some digital content. It is fairly easy to do this with and A-to-D converter and D-to-A converter on a microcontroller or controlled by one. How much resolution do you need?
Sorry, I'm new here, first post! I did provide a link to the schematic though! I'll attach a PDF of it to this reply.
I'm using an LF444 now, as recommended in the schematic, although I haven't noticed much of a difference between this and the TL074 or 84! The recommended sampling cap was a 10nF polystyrene, however when I use this I get a drift of about a volt every second, which obviously is way too high! I've experimented with some higher values, and have been able to get better performance with these ( around 0.03mV per second with a 470nF cap) but this is still noticeable if a long note is held. Also I'm still confused as to why the voltage is increasing, not decreasing - everything on the original website and what I've heard from others talks about voltage drop over time, not gain!
At the end of the day this is all for fun so it's not crucial to have minimum drift, however I would like it to be playable!
 

Attachments

Thread Starter

nedhayward

Joined Aug 12, 2020
8
I doubt it.

In addition to U3-C's input bias current (50 pA) you also have to consider the gate leakage, Igss, of Q3, which for a 2N5457 can be as high as 1 nA. 1 nA flowing through a 0.01 μF capacitor will cause a voltage rate of change of 0.1 volts/second.
That's a very good point! Do you know of a simple way to limit this, or would I just have to use a JFET with lower gate leakage? You would have thought that it shouldn't cause too much of a problem if it's the recommended JFET on the schematic though! If I'm using all the same components you'd like to think the problem wouldn't be there, but I suppose it could still be!
Thanks for all your help :)
 

MisterBill2

Joined Jan 23, 2018
18,167
If you can try it, add a way yo remove the drain voltage from Q3 and see if the drift stops. it might be that simple. That will show you if it is leakage causing the drift or some other unseen cause.
 
Top