Aduino noise in VCA controlled parallel looper

Started by JK Sleepling, November 16, 2023, 03:13:41 PM

Previous topic - Next topic

JK Sleepling

I'm designing a pedal mixer. Much like the EHX Switchblade Pro, but purely MIDI controlled and with crossfading features, plus some more routing options.

Basically an Arduino Nano receives MIDI information, then controlles three MCP4922 DACs which sends CV (0 - 3.3V) to two AS2164 VCAs. Every input/channel is buffered and after the VCAs they are amplified to a max of 15 dB. That gives every route a span from -85 dB to +15 dB as the VCAs can attenuate 100 dB. Buffers and amps are done with simple TL071/72/74 op amp circuits.

Anyways.. It works! Awesomely. I'm quite new to electronics (been scratching my head for a couple of years now), but happy to come this far.

My next headache is the digital noise from the arduino when it is calculating the next step of attenuation for the DACs. My breadboard looks like a wild jungle, but the analog noise is actually pretty low. It's only whenever I switch sounds, meaning in the duration of a crossfade the Arduino has to run a lot of code that are continuesly send to the DACs. This I can hear as a ticking high pitched sound.

On my breadboard I have isolated the digital parts to a breadboard of its own, running 5 and 3.3 volt.
The analog/audio circuit have its own (two) boards running +-9V. Theres only one ground wire between the two circuits. I use coupling caps 100nF on the Vin of the Arduino and the DACS.

Anyone ever experienced - or even better - solved an issue like this?

Thanks

ElectricDruid

Yeah, I've hit similar problems using those the same chips (those cheap and handy MCP DACs feeding cheap and handy quad VCAs!). Mixing up analogue and digital is always fiddly, but it's worth it since the payoffs are the best of both worlds!

You should really have some good filtering on the CVs to the VCAs. Since you said the DACs are sending 0-3.3V, I'm guessing you'Ve set up the DACs VRef with a 3.3V supply, right? That's handy in that saves you having to reduce the level of the CV output, but that doesn't give you as much scope for adding filtering.

The CV inputs of the AS2164 have a 5K impedance, iirc. If you have a series resistor from the DAC to the VCA, it forms a voltage divider and drops some voltage. If you add a cap to ground at the DAC end, it still forms a voltage divder, but now the series resistor and the cap make a RC lowpass filter too. If you either do some sums or juggle the values a bit, you can get this to simultaneously drop the extra voltage you planned for earlier on *and* filter the CV (that's why your "handy" exact 3.3V output isn't so handy after all - no voltage to lose).
The filter cutoff can be *low*. After all, you probably don't *want* instant switching when a channel changes level, so a soft fade-in/out over 50/100msec would be fine (adjust to taste, but you get the idea - slow is good).

Alternatively, you could try some active filtering. What are you doing about the bipolar supply for the VCAs? Have you got them on a 9V/4.5V/Ground supply like we would for most pedals? If so, how did you get the CVs into the right range from 4.5V upwards?

Would it be possible to use the DACs to provide only the final levels, and let the filtering provide the slow crossfade from one level to another? Like that, the arduino wouldn't need to do some much work (hence generating less noise) and the DAC would only switch once, and then the level would drift gradually to the new value. Or do you need variable slopes/times?

One other thing that would help a little bit with noise is using the VCAs themselves to provide the gain you need. The 2164 can also accept -ve CVs down to -0.66V. This gives gain of up to +20dB. That would avoid amplifying afterwards, which is going to boost any noise you've got. It would involve changing the range and offset of your CVs though, so it's far from straightforward. Just a thought.

HTH.

Kevin Mitchell

#2
Clock noise is a common occurrence when breadboarding digital & analog near each other.

I have a few tricks for addressing noisy circuits. But we really should know what the power distribution circuit looks like before throwing ideas around.

Are you feeding the Nano and analog circuit the same 9v supply, and the 4922 5v from the Nano and also the Nano's 3.3V for the DAC's reference voltage?

Have you considered using an inductor to isolate the analog 9v supply from the Nano's 9v input? - assuming the above.
  • SUPPORTER

ElectricDruid

Kevin makes a very good point - where's that DAC Vref oming from? That'd better be as clean as a whistle, or you're just feeding noise direct into the CV output. MCP4922 is a multiplying DAC, more or less.


JK Sleepling

#4
Cool! ElectricDruid - that name seemed familiar, and yes think I actually purchased the VCAs from you 8) ;D 

Well thanks guys. That was a lot to try out.

I didn't know you could squeeze 20 dB gain out of the VCAs by sending -0.66V. Then I should have a total vref 4 V and make a virtual ground at 0.66. Seems a bit cumbersome. I like using Op Amp gain, but using VCAs gain it will get my attenuation max back down to -100 dB. I might try it.

Regarding my power supply and the voltage send to vref heres my power schematic. This has been a long journey by itself.




I've created my own 3.3 V output as the one from my Arduino clone somehow stopped working. The 3.3V output is connected directly to the DACs vref.
 
So I use the +9V for both Arduino and the analog bipolar circuits. Could this be a problem?
I know nothing about using inductors (yet). Will that still be a good idea here?

And to answer the question about crossfade control - I do need variable slope/times. Fade duration is a control feature by it self. So I need full controll of all the VCA fades.

Eb7+9

Quote from: JK Sleepling on November 16, 2023, 03:13:41 PMTheres only one ground wire between the two circuits.


Sure you're not daisy chaining the two gnd lines ?? If so you'll get ground bump in the likely configuration - something filtering won't fix

You should star digital and analog grounds to a common/main psu gnd point first ... farad padding second

Consider also that your VCA's actually might have low PSRR and therefore might need more than mere localized decoupling to run clean

—-

JD Sleep eh ?!

JK Sleepling

Quote from: Eb7+9 on November 17, 2023, 05:17:50 AMJD Sleep eh ?!

Just googled JD Sleep.. nope not me  ;D

Quote from: Eb7+9 on November 17, 2023, 05:17:50 AMYou should star digital and analog grounds to a common/main psu gnd point first ... farad padding second

Ok - I'm a bit unsure of the meaning of "star" ground
I have one wire from the digital breadboard hooked up to the PSU ground like this. Does that count as a star?

 

ElectricDruid

Quote from: JK Sleepling on November 17, 2023, 07:26:27 AMOk - I'm a bit unsure of the meaning of "star" ground
I have one wire from the digital breadboard hooked up to the PSU ground like this. Does that count as a star?

 

Looks like you've got the idea to me!  8)

Eb7+9

#8
well, glad to meet a new JD ...  8)

Quote from: JK Sleepling on November 17, 2023, 07:26:27 AMunsure of the meaning of "star" ground


let's separate the two, there's the grounding part and then there's the staring part
each function differently here

recall, ground plays two general purposes in audio electronics ...
one is safety (when it applies), the other is shielding

also, ground itself is none responsible for producing the main branch currents that make a circuit work ...
 
generally, currents might circulate in and out of ground if a ground line (or chassis) is ever used as a conduction channel ...
but in principle there should never be any net flow of current in or out of a true earthing connection

that's unless from a lightning strike, which is perfectly natural ... ;)



in my schematic here the active analog and digital circuit blocks are replaced by equivalent current source loads
if there's no negative supply in your implementation just ignore it in the schematic

in a mixed-signal situation it's more about how exactly branch currents return to their main source of stored charge
forming a natural summing point (star center) in the process ...
a standard scenario in mixed signal designs

QuoteGROUND-BOUNCE: as a principle, if two or more return lines coming from dynamic circuits pass thru
a shared impedance on their way to ground (ie., same line or wire) the two circuits may interact with each other ...
ie., inducing noise issues, etc.

since wiring is minutely resistive the only real option towards minimizing their coupling effects is to de-couple all dynamic return lines,
that is, all the way to the points of origin which is at the base of the main filter caps in a linear psu

note that typically the actual signal&circuit ground connection might be done a little further away from the actual star center,
which is fine since this line typically carries no appreciable current as mentioned ...

the same goes with the gnd ref pins on the regulators, since they carry non-dynamic DC reference currents each
those could be daisy chained together back to the star center using a separate single line

some ideas that might be useful here ...

---

I see ac self-hum in vintage tube amps the same way, as a mixed signal problem ...
a simple partial-star is often sufficient in removing the last residuals of hum in an old tube amp

de/ac-tivating the chassis in the process //

especially nice on SE's

amptramp

It may be time to bring out the audio isolators:





This allows you to run completely isolated power supplies for the Arduino and the linear stages without resorting to transformers.

JK Sleepling

Quote from: Eb7+9 on November 17, 2023, 07:48:18 PMin my schematic here the active analog and digital circuit blocks are replaced by equivalent current source loads
if there's no negative supply in your implementation just ignore it in the schematic

That's a nice and simple circuit and close to what I need. But I'm a little unsure of the symbols here and what they do? And what makes each voltage out clean?




R.G.

Take some comfort from the past. Using DACs to control VCAs in a mixer has historically been difficult. It's the classical peel-an-onion problem, where you remove succeeding layers and start dropping tears. To get good, quiet results, you have to do everything right. The bits you're hearing above are correct.
The DAC reference has to be super clean, and usually filtered to a sub-audio slope.
This helps with "zipper noise"; some pro gain-changing chips switch and/or change gain only at zero crossings to sidestep zippering.
The currents in each ground wire needs to be assessed for digital ground return noise.
Every chip usually needs its local power supply decoupler cap, including a 10uF to the usual 0.01 to 0.1
Digital and analog sections need separate ground "domains" connected at one and only one point, usually the bulk DC first filter cap
Power networks, as mentioned, often need tree/star wiring to separate power supply noise, and the real pros usually do separate regulation for each section so you get separate bulk bypassing and two regulators' worth of bulk DC noise rejection between sections.
You can't do this on breadboards, but the digital section of digitally controlled analog setups really do need ground planes for the higher harmonics in the corners of digital signals' return currents. On high frequency digital signals, field effects come into play and current flow channels itself into the closest path for returning to the generating signal source that it can find. Giving it a low-inductance path back to the chip that generated it lets it try to stay local, and a ground plane lets this happen.




R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

Eb7+9

#12
Quote from: JK Sleepling on November 19, 2023, 07:27:24 AMBut I'm a little unsure of the symbols here and what they do? And what makes each voltage out clean?


those symbols represent whatever active loads are present on regulated/clean (no ripple) supply lines - those that may try to cause noise (instability) on those lines by their activity - ie., drawing dynamic currents ... generally speaking we use regulators as a means of isolating circuit sections (active blocks) from each other within an architecture but it's in these return lines that certain things can be easily overlooked - things which produce an analogous outcome to what you describe ... that's all I was saying in response to your "one ground wire"

I checked and your VCA's have data of 90db for PSRR - plenty high. And then there's class-A versus class-AB mode - have you checked that? and then, since you're on a breadboard and everything's an antenna it begs the following question: are you using overly high valued resistors in your analog signal path?

ElectricDruid

I had very similar problems using a dsPIC and some MCP4822 DACs to control an AS3372E filter/VCA chip. I had the AS3372E on one stripboard, and the digital control circuit on a separate stripboard. For testing, I also had a "manual" control board that was just a load of pots and op-amps set up to give me the required CVs. The Manual board worked fine with no noise. The digitally-controlled board was noisy.

I haven't completely fixed it. It's one of my back-burnered projects waiting to be picked up again.

This sort of analogue-synth-esque mixed signal stuff is *hard*. Or at least, there's lots of ways to screw it up! Like RG said, " To get good, quiet results, you have to do everything right".

Eb7+9

Quote from: ElectricDruid on November 19, 2023, 02:26:48 PMThis sort of analogue-synth-esque mixed signal stuff is *hard*. Or at least, there's lots of ways to screw it up!


good design work means finding a simple solution devoid of gotchas ...
there are basic rules to follow here - I've given you one of the "hard-to-see" ones

speaking of simple, personally I've never bought/used a commercial DAC in my life, as it's so simple to roll your own here using a handfull of bjt's coming straight off the digital outs


still, I don't see why OP can't make his original design work perfect ... I'm pretty sure it's a ground bounce issue ... maybe in tandem with something else

must ask you JD, is your system properly earthed ?!

ElectricDruid

Quote from: Eb7+9 on November 19, 2023, 08:04:12 PMstill, I don't see why OP can't make his original design work perfect

+1 agree. I don't think there's anything fundementally wrong with it either. It's just a question of doing the tweaks to get it good.

R.G.

Quote from: Eb7+9 on November 19, 2023, 08:04:12 PMgood design work means finding a simple solution devoid of gotchas ...
Easy to say - hard to do.
As Albert Einstein said, "Everything should be made as simple as possible, but not simpler."
From long professional experience, finding a simple solution, especially one devoid of gotchas is not simple, and also something that needs experience and practice, not just a list of rules.
Quotespeaking of simple, personally I've never bought/used a commercial DAC in my life, as it's so simple to roll your own here using a handfull of bjt's coming straight off the digital outs
With all the respect due to you, J.C., I suspect that may be a result of never having to simultaneously meet more than a few bits of resolution, low ripple, modest or higher accuracy and linearity, a PCB size budget, an assembly cost budget, and any kind of limitation on the available I/O pins or multiple synchronized operations. I have both made my own DACs in several technologies and used commercial ones. The commercial ones are generally cheaper per unit [whatever], more accurate, and both simpler and faster to develop with, as well as coming with guaranteed performance specs you don't have to tinker for every unit.
Take a look at the Microchip Technology MCP47FVBXX series.
Mouser sells these, lots in stock at US$0.89 for the 8 bit part, with 10 and 12 bit parts available in the same eight-pin package. The family includes both single and dual (two DACs) in the same eight pin package. They are voltage output, and include an internal band gap reference if you like a constant reference, and an external reference input if you want to feed it signal.
The MCP47FVBXXs have a pin that forces the update to a new reading to happen at the microseconds when you want it to - like when a signal goes through zero volts -  to help eliminate zipper noise. They are resistor-divider types, not ladders or shared-charge types, so their step to step accuracy depends on the relative matching of monolithically matched resistors and they can guarantee no missing codes.  They consume under 200uA for the singles, under 400uA for the duals. It takes two of your controller's pins to run the I2C bus they run on and you can gang up to four of them (including the duals) on one set of two controller pins.
These are the CHEAP and dirty DACs. You can get much better, faster, more accurate, yada, yada commercial DACs. Cruder DACs are included inside even simpler, sub-US$1 controllers like the PIC series. As an aside, Microchip also offers the MCP47xx series, which have non-volatile storage - they can be made to remember their last setting over power off/on cycles. They cost US$0.90 at Mouser instead of the US$0.89 of the MCP47FVBxx series.
I personally would choose something similar over hand-designing something that was not as accurate or easily controlled. But that's just me.
Quotestill, I don't see why OP can't make his original design work perfect ... I'm pretty sure it's a ground bounce issue ... maybe in tandem with something else
That's probably because you're not there with the device on the bench and a cadre of test equipment boxes hooked to it so you could notice something he hasn't noticed yet. It's probably not a personal shortcoming of the OP.  We're just feeding him hints, of course.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

JK Sleepling

#17
Quote from: R.G. on November 20, 2023, 12:51:58 PMThat's probably because you're not there with the device on the bench and a cadre of test equipment boxes hooked to it so you could notice something he hasn't noticed yet. It's probably not a personal shortcoming of the OP.  We're just feeding him hints, of course.

Thanks R.D - and all of you! It may very well be a personal shortcomming ;D As I said in the first post - I am sort of a beginner and I'm spelling my way through all of your posts and looking over at my bench trying to figure something out. I really appreciate all of your hints.

What I hear most is proper grounding and super clean Vref for the DACs.
Still not sure if the power circuit I posted would be sufficient for feeding a clean 3.3V to the DACs, given that the grounding is made right?

Could grounding of the audio signals be an issue if not connected to directly to the star point, but placed in different spots of the analog ground?

J.K aka J.D or J.C