Go Down

Topic: Reducing static from volume control digipot (Read 3078 times) previous topic - next topic

Jiggy-Ninja

I have an MCP4131-103 digital potentiometer hooked up according to the attached schematic for volume control. The section of concern is labeled Volume Control and Volume Control Digipot. For those unable or unwilling to download the schematic, I have an opamp hooked up in an inverting configuration. The power supply is 5V; the + input is connected to a 2.5V virtual ground; the input resistor is 10k ohms; the 10k digipot is connected as a rheostat feedback resistor to adjust the gain of the amplifier from 0 to 1. In other words, the Wiper is connected to the output, and B is connected to the - input.

The main problem is that at low volume, there's a staticy kind of distortion of the sound being played through the digipot. This seems to go away when I turn the volume up (increase the pot setting). Here is a video demonstrating the problem: https://www.youtube.com/watch?v=8DHSe-Jqzl8

Is this distortion due to the wiper resistance being significant at low settings? A 7-bit 10k digipot has about 78 ohms per setting. At a setting of 2 or 3, the nominal 75 ohm (max 160 ohm) becomes significant.

Am I using a suboptimal amplifier configuration? Should I increase the digipot value to 100k (and the input resistor likewise)? Or could this simply be an artifact of my breadboard setup with wires crisscrossing everywhere?
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

Caltoa

#1
Mar 29, 2014, 02:34 am Last Edit: Mar 29, 2014, 02:38 am by Caltoa Reason: 1
It sounds like a badly digitized sound or a feedback ringing.
But there is so much going on in you schematic, it is hard to tell.

Something as a bad ground can be the cause, but also the volume control is strange. Instead of a the normal volume digital pot, you use it for the gain resistor over the opamp. That might work, but in this schematic the input impedance of that circuit is not certain.
There could be a feedback with the power supply. You have 470uF at the 12V, but wires and bad breadboard contacts can cause trouble.
Even with a pcb board, the ground and 12V copper traces on the board should be carefully designed.
I see only one 100nF next to the 7805, I don't know what kind of capacitor the 1uF is, but I like to see also 100nF at VI.
Your V_GND is not filtered, it might be noisy.

Can you use an amplifier with a resistor of 10k to 100k and a capacitor of 100nF to 1uF to the input and listen to the board how it sounds in different places.
Don't forget to listen to the ground in many places and be sure to listen to the V_GND and the power supply.

Jiggy-Ninja

The input in that video is from my computer's headphone jack at a fairly high volume, so there shouldn't be digitization problems for the input signal.

The schematic doesn't exactly correspond to my setup with regards to the bypass capacitors. I have a bunch of 0.1uF ceramics peppered around my power rails, and a couple of 470uF on the two 12V rails.

What do you mean that my V_GND has no filtering? I have a 47nF capacitor at the voltage divider to ground. Do you mean no cap at the output? I've heard opamps don't like driving capacitive loads.

I think that the wiper resistance being in the feedback current loop was the cause of the distortion. I've rearranged my circuit according to the attached diagram, and the static is almost all gone. In this case, the wiper is not part of the feedback loop.

The remaining static distortion seems to be caused by the input signal. For all this time I've been using my phone's or computer's headphone output as the test signal at maximum volume. When I turned my phone's output down just one notch, the static distortion was reduced as well.

Since this is a breadboard setup so far, I've been expecting some imperfections to exist, and there are a couple. One wire causes a buzzing sound when I move my finger close to it, and my speaker "chirps" lightly whenever my LCD screen updates. I'm expecting these problems to go away in the PCB version of the circuit, which has a proper Analog and Power/Digital pair of ground planes.
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

Caltoa

#3
Mar 29, 2014, 11:40 am Last Edit: Mar 29, 2014, 11:52 am by Caltoa Reason: 1
I don't see a reason that the chirps by the display update will suddenly vanish after it has been placed on a pcb. It might even be worse.
Even "professional" equipment has problems like that. Ask any audio engineer.

The wire that causes buzzing, can you make the circuit lower impedance at that point ? Or add a capacitor to filter out frequencies above 20kHz.

The 7805 needs 100nF ceramic capacitors very close to it, at input and output. I hope you have that.

In your drawing you still use the digital pot with gain feedback over an opamp.
That opamp circuit still is influenced by the impedance/inductance/capacitance from the input. In other words : If you connect a phone output with long wires to the circuit, the opamp behaviour is influenced by the long wires.
That is what I was trying to say. It is not possible to calculate the behaviour of the opamp, since the signal source is not certain.

Why don't you use the digital pot in a normal way ? With the signal on one side, the other side to ground, and the middle as output. With a fixed gain for the opamp.

The V_GND is the output of the opamp. You could add a RC filter.
I'm reading about 1mA output source current for the TL972. That is a low current, the resistor would be high. But the V_GND doesn't have to supply current. So perhaps 4k7 or 2k2 and 100nF (maybe an extra 22uF) to reduce noise.

bosleymusic


Even "professional" equipment has problems like that. Ask any audio engineer.

Well designed gear doesn't really exhibit the types of symptoms he's talking about.

Quote
The 7805 needs 100nF ceramic capacitors very close to it, at input and output. I hope you have that.

In a lot of applications I've seen even larger caps in use - 100nF seems small, and larger caps may help with decoupling any power supply / control noise that might be masked at higher volumes, but audible at lower. 

Quote

Why don't you use the digital pot in a normal way ? With the signal on one side, the other side to ground, and the middle as output. With a fixed gain for the opamp.

Agreed. Use the pot as a variable voltage divider.

Clean layout is essential in audio applications, and separating digital from analog ground planes is a typical solution in production board design. Your mess of wires is probably not helping anything. Also, what is the actual op amp you are using? Is it optimized for single supply operation? Did you decouple the AC signal prior to biasing it to ensure your signal is really biased at 2.5 volts?

pito

#5
Apr 02, 2014, 10:31 pm Last Edit: Apr 02, 2014, 11:03 pm by pito Reason: 1
The C32 - make it larger - ie 10uF-100uF (and leave the 47nF there).
I think your problem is decoupling generally.

Not sure 470uF at 12V is enough. Also you have none larger capacitor at 5V. You have to use a separate regulator for the 5V audio section - mixing digital and analog at the same 5V rail is not a good idea.
For audio app I would add a simple RC filter at 5V regulators inputs (first one for the atmega, the second one for the op-amp) for example 50ohm/470uF.

Quote
The TPA3122D2 is a high-performance CMOS audio amplifier that requires adequate power supply decoupling
to ensure that the output total harmonic distortion (THD) is as low as possible. Power supply decoupling also
prevents oscillations for long lead lengths between the amplifier and the speaker. The optimum decoupling is
achieved by using two capacitors of different types that target different types of noise on the power supply leads.
For higher frequency transients, spikes, or digital hash on the line, a good low equivalent-series-resistance (ESR)
ceramic capacitor, typically 0.1 uF to 1 uF placed as close as possible to the device VCC lead works best. For
filtering lower frequency noise signals, a larger aluminum electrolytic capacitor of 220 uF or greater placed near
the audio power amplifier is recommended. The 220-uF capacitor also serves as local storage capacitor for
supplying current during large signal transients on the amplifier outputs. The PVCC terminals provide the power
to the output transistors, so a 220-uF or larger capacitor should be placed on each PVCC terminal. A 10-uF
capacitor on the AVCC terminal is adequate.
..
Because the TPA3122D2 is a class-D amplifier that switches at a high frequency, the layout of the printed-circuit
board (PCB) should be optimized according to the following guidelines for the best possible performance.
· Decoupling capacitors--The high-frequency 0.1uF decoupling capacitors should be placed as close to the
PVCC (pins 1 and 10) and AVCC (pins 16 and 17) terminals as possible. The VBYP (pin 6) capacitor and
VCLAMP (pin 9) capacitor should also be placed as close to the device as possible. Large (220 uF or
greater) bulk power supply decoupling capacitors should be placed near the TPA3122D2 on the PVCCL and
PVCCR terminals.
· Grounding--The AVCC (pins 16 and 17) decoupling capacitor and VBYP (pin 6) capacitor should each be
grounded to analog ground (AGND, pins 7 and 8). The PVCCx decoupling capacitors and VCLAMP
capacitors should each be grounded to power ground (PGND, pins 11 and 20). Analog ground and power
ground should be connected at the thermal pad, which should be used as a central ground connection or star
ground for the TPA3122D2.
· Output filter--The EMI filter (L1, L2, C9, and C16) should be placed as close to the output terminals as
possible for the best EMI performance. The capacitors should be grounded to power ground.


Jiggy-Ninja

@caltoa
Quote
The wire that causes buzzing, can you make the circuit lower impedance at that point ? Or add a capacitor to filter out frequencies above 20kHz.

Not really. It's right in the middle of my tone control circuit.
Quote
In your drawing you still use the digital pot with gain feedback over an opamp.
That opamp circuit still is influenced by the impedance/inductance/capacitance from the input. In other words : If you connect a phone output with long wires to the circuit, the opamp behaviour is influenced by the long wires.
That is what I was trying to say. It is not possible to calculate the behaviour of the opamp, since the signal source is not certain.

Wouldn't the same problem exist if I use the "normal" way?
Quote
Why don't you use the digital pot in a normal way ? With the signal on one side, the other side to ground, and the middle as output. With a fixed gain for the opamp.

Mostly because I wasn't aware of the normal way. I wanted to be sure the output was biased at half-supply, and the inverting configuration was the best I could come up with on my own.

By "normal way", I assume you mean something like Example 3 in this Maxim article? http://www.maximintegrated.com/app-notes/index.mvp/id/1828
Quote
The V_GND is the output of the opamp. You could add a RC filter.
I'm reading about 1mA output source current for the TL972. That is a low current, the resistor would be high. But the V_GND doesn't have to supply current. So perhaps 4k7 or 2k2 and 100nF (maybe an extra 22uF) to reduce noise.

Is that necessary when I'm already using a low noise op amp?

@bosleymusic
Quote
Clean layout is essential in audio applications, and separating digital from analog ground planes is a typical solution in production board design. Your mess of wires is probably not helping anything. Also, what is the actual op amp you are using? Is it optimized for single supply operation? Did you decouple the AC signal prior to biasing it to ensure your signal is really biased at 2.5 volts?

I am designing a board in CADSoft Eagle for this (current revision attached) and it does have separate Analog and Power/Digital grounds. The actual op amp on my board is what's listed in the schematic, TL972 (datasheet also attached).

I have an AC input capacitor, and have verified with the biasing voltages for the amps with my multimeter.

@pito
Quote
Not sure 470uF at 12V is enough. Also you have none larger capacitor at 5V. You have to use a separate regulator for the 5V audio section - mixing digital and analog at the same 5V rail is not a good idea.
For audio app I would add a simple RC filter at 5V regulators inputs (first one for the atmega, the second one for the op-amp) for example 50ohm/470uF.

Is a second regulator really going to make that much of a difference? The only thing being powered by the regulator are the ATmega328P, 2 digitpots, an LCD screen and 2 op amps. None of those are really high loads.I have a 100nF ceramic decoupling cap near each chip.
Hackaday: https://hackaday.io/MarkRD
Advanced C++ Techniques: https://forum.arduino.cc/index.php?topic=493075.0

bosleymusic

Your op-amps appear to be rail-to-rail which is good, but dual supply - not single. My guess is that is the biggest issue running here.  If you want to run single supply, you need to run an amp designed for single supply, i.e. Vcc & Ground, not Vcc- / Vcc+.



doxasound

Did you ever resolve this? I think I may be having the same issue.

Some nasty static decaying noise in the audio signal at low volumes. Only remedy is to increase the volume, then the static noise goes away and I hear the original, clear audio signal.

Go Up