Whine in output in time with trem - so close to done :(

Started by harmless, January 14, 2012, 08:41:36 PM

Previous topic - Next topic

harmless

I'm trying to finish boxing up my tremolo with an arduino LFO (based on the PIC tremolo here http://www.diystompboxes.com/smfforum/index.php?topic=77471.0 ).  I've got everything wired except the bypass led and the indicator LED.  I decided to try it out since my box has turned into a nest of wires.

Good news is it works.  Bad news is that there's a whine in the output that matches the LFO.  If you look at the schematic, you'll see that the indicator LED does the same thing as the LED in the LED/LDR pair (I'm using a VTL5C9).  I hear a whine in the output that is exactly in time with this indicator (ie, if I'm on sine wave I get a nice sine wave whine, if I'm in square, it's square).

I think that means it's pretty clearly related to the current draw from the LED right?  I used to have both the microcontroller and the LFO side circuit grounded on the output jack.  I moved them each to a direct line from the power jack, but that didn't help.  The microcontroller gets its own line to 9v and I use its internal voltage regulator to supply the 5V that I run my pots and tap switch off of.

Any suggestions?


Here's my vero layout so you can see what's going on there. 

R.G.

Welcome to the soft, ugly underbelly of the analog-digital chimera. It can be quite difficult to eradicate digital bleed through from connected analog circuitry.

It is possible that since it mimics the LED, it may be coming from the PWM drive on the LED, assuming that it is PWM'd. Since you're using an LED, one good place to start is to make sure that the LED shares no common power supply wires or ground wires with the digital stuff, and that the power/ground and LED are filtered to a fair-thee-well.

There is one other worrisome thing you said: "my box has turned into a nest of wires."
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.

harmless

Quote from: R.G. on January 14, 2012, 09:34:01 PM
Welcome to the soft, ugly underbelly of the analog-digital chimera. It can be quite difficult to eradicate digital bleed through from connected analog circuitry.

It is possible that since it mimics the LED, it may be coming from the PWM drive on the LED, assuming that it is PWM'd. Since you're using an LED, one good place to start is to make sure that the LED shares no common power supply wires or ground wires with the digital stuff, and that the power/ground and LED are filtered to a fair-thee-well.

There is one other worrisome thing you said: "my box has turned into a nest of wires."

The LED/LDR is powered off of 5v which comes directly from the arduino's voltage regulator.  If I have to rethink that, then I'm pretty much at total rebuild stage.  I could use Vref that I'm creating for the opamp instead I guess.  The LED is driven by a PWM output.

The nest of wires bit is mostly related to the 4 pots, expression pedal jack, input/output, bypass, and tap switches more than anything else.  I've kept the wires as short as possible, but this is only my second build so what starts out neat doesn't seem to end up that way.

Thanks for the advice.  I think the right approach is to start again with the breadboard.  Luckily I used sockets for the vactrol which is the only semi expensive thing in the build.

R.G.

QuoteThe LED/LDR is powered off of 5v which comes directly from the arduino's voltage regulator.
Does the Arduino have a separate power supply or does it make its 5V from the same power as powers the analog part of the circuit?

Can it be powered separately? There is no need for the LED to be connected to the analog power supply, except convenience, is there?

Do the Arduino and the analog circuit share a ground wire? Could they NOT share a ground wire?
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.

harmless

Quote from: R.G. on January 14, 2012, 10:18:55 PM
QuoteThe LED/LDR is powered off of 5v which comes directly from the arduino's voltage regulator.
Does the Arduino have a separate power supply or does it make its 5V from the same power as powers the analog part of the circuit?

Can it be powered separately? There is no need for the LED to be connected to the analog power supply, except convenience, is there?

Do the Arduino and the analog circuit share a ground wire? Could they NOT share a ground wire?


The arduino and the signal path are both powered from the same 9v input jack.
I guess I could add another input jack and keep the 2 paths completely separate.

Per my vero I have 2 ground wires...one for the LFO side and one for the signal side.  The LFO (arduino side) is grounded to the 9v jack and the signal side is grounded to the output jack....which I have just traced and realized is only connected to the input jack and not the 9v ground.  I'm using the beavis audio schematic to reality article but I don't ever use batteries so I just have mono jacks on both sides and I neglected to connect the input ring -> switch wire to the input sleeve instead.

It's late and my iron is put away but I'll try that tomorrow and hopefully that will get it.

R.G.

Try running the Arduino from a 9V battery separate from the audio circuits, with exactly 1.000 ground wires between the two circuits.
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.

harmless

Good news...I think I've fixed it.  Being a software guy at heart I first tried a software fix.  Your first comment mentioned that it might be the PWM drive so I did some investigate and it turns out that the default frequency for PWM on arduino is about 500Hz.  I don't have perfect pitch but the whine certainly sounded close to an A so I suspected that was it.

I set some registers on the arduino that bumped the PWM frequency up to its max, which is about 32kHz and the whine is gone.

If I leave the strings uncovered and listen really really carefully I can maybe detect a bit of pulse, but it's very quiet.  For future designs I could probably put a low pass filter on the PWM to block that 32kHz thing completely.

I'm going to go ahead and hook up the remaining LEDs and box this all up.  Feeling much better about things today than I did yesterday.  Thanks for your help :)

R.G.

Cool. That works too - make the interference be in a range that you can't hear. Just because you can get heterodynes that convert ultrasonics down into audible, filtering the PWM would be a good idea as well.
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.