Flangelicious Clock-Audio decoupling

Started by lars-musik, May 23, 2016, 05:01:28 AM

Previous topic - Next topic

lars-musik

I just built the Flangelicious by Tom Wiltshire and I *think* it is really a great project. Unfortunately my layouting skills are too focused on small enclosures. I went about and tried to keep audio and clock circuits separated but in the end it didn't work out.  I get some great sounding but somewhat unwanted electro-arpeggios (I am back to hand-made, computer-free sixty-ish music)

I guess it's the clock spilling heavily into my audio path. Could you point me to a solution that does not include a completely new layout? Somewhere to put some small capacitor or the like to achieve some decoupling? That would be really great!

Here's the link to the project:
http://electricdruid.net/flangelicious-a-super-dooper-flanger/

And here are my files

Schematic:



Layout (already populated, so you have an idea why I want to rescue this project):



Thanks!

anotherjim

What I see is the audio bits - TL072's etc, are upstream of the digital in the power arrangement. So that part is hit by all the hf current kicks from the digital stuff downstream. If you could make a dedicated +9v/0v power filter  - say 100R/47uF+100nF it might help. That is, +9V and 0V fork to an audio decoupling block and a digital one before the 5v regulator.

Some ground connections look incomplete. I suppose there are links fitted not shown?

I think you probably already know better, but there isn't a switch mode supply supplying the 9v or anything else digital in the audio path is there?

mfunky

+1!

Try the the standard 9V power filtering e.g. from the RAT (http://www.electrosmash.com/proco-rat).

lars-musik

Thanks! I didn't realize that there was only filtering for the voltage regulator. Kind of tunnel-vision.

Quote from: anotherjim on May 23, 2016, 11:51:37 AM

Some ground connections look incomplete. I suppose there are links fitted not shown?


I didn't show the top layer (as you can guess, it's a double sided PCB. Pain in the neck to etch and to think of all the pads you have to solder from both sides - I was highly astonished when it flanges the first time I powered it up. Never happend before.)

For the sake of completeness:


Quote from: anotherjim on May 23, 2016, 11:51:37 AM

I think you probably already know better, but there isn't a switch mode supply supplying the 9v or anything else digital in the audio path is there?


No, it's a "real" PSU.

Thanks for spotting the missing filtering!

ElectricDruid

Hi Lars,

If you're having trouble getting PR2 set up with a multimeter...don't use one!

To be honest, many circuits don't even *bother* with a trim in this position. They simply use the centre position and ignore the small benefit that can be achieved by fine-tuning. You could easily do the same thing - just leave in the centre and don't worry about it.

If this doesn't work, or doesn't give a good result, then there must still be something else wrong with the circuit. I've checked your schematic, and it looks ok to me. I can't *see* anything wrong (but of course I can miss things easily like anyone).

I'd check the values of R22 and R23, since if one of those was wrong, there would be a lot of clock noise.

Ideally, the two traces from pins 2 and 3 of the 12F1501 need to be as short as possible and as simple as possible on their way to the BBD, since they are the clock signals. High frequency noise radiated from those lines could find its way into other signals if it can. Aside from that, other people have mentioned the power supply issues. I'd only add that your board has no ground plane of any kind. On these kind of mixed signal boards, it's a good idea to have separate analog and digital ground planes, linked only at the power supply input.

The final thing I'd say is that I've tried my prototype circuits with several different BBDs - both "vintage" and more recent MN3207s, MN3209s of a couple of different batches and a V3207, and I've found noticeable differences in noise levels between them. Not *huge* differences, but definitely noticeable, to the point at which you'd say "oh, that's a better chip than that one". So if you have other BBDs to try, try one. It won't fix everything, but it can help.

Hope this helps,
Tom


lars-musik

Thanks a LOT for your assistance (by the way, just delete my latest reply on your website - it might not help people that I have trouble with my own flawed layout when you sell a perfectly good one).

I added the suggested filtering to the power supply but without success. I guess you are right about the missing ground plane. Nothing I can do about it now.

How do you measure "distance" for clock signals? Is it the length of the trace (in my case 42 mm and 21 mm), the number of components passed or the physical distance of the two ICs? I guess all of it together.

Maybe I should try some shielded cable and connect the pads directly?

I need to bring some recording equipment  down to my soldering den and present the funky arpeggios the flanger does to you. If you could implement the TAPFLO code it would make a cool synth,




DrAlx

Speaking from experience, I think any clock noise leaking into the audio due to long clock lines, layout, or lack of ground plane will be insignificant compared to the fact that those clock lines are actually operating directly on the audio signal within the BBD itself.
There's an easy way to show that.  Take the BBD chip out of the circuit and audio probe the BBD input. 
If you don't hear clock noise there then that shows that the noise isn't affecting the circuit pre-BBD.
Better still, take the BBD out of the circuit and just run a wire directly from the BBD input socket to the two BBD outputs sockets, and audio probe the audio path again. If you've got a scope, even better.  Clock noise should be barely visible and certainly not audible.

Note that when the BBD is in the circuit it does in fact cause weak clock noise to appear at the BBD input (because that's where the sampling process is taking place).  You don't need to worry about that though.  It's just the way BBDs work.  You do need to be aware of this "wobbling of the input line" if you have a circuit with multiple BBDs clocked at different rates but that's another story.



lars-musik

Thanks. I'll try that. If I don't get any clock noise with a briged BBD in and out, that would mean I'll get used to the noise, right?  I'll report back when I had the time to try it.

ElectricDruid

#8
Quote from: DrAlx on May 26, 2016, 06:01:36 AM
Speaking from experience, I think any clock noise leaking into the audio due to long clock lines, layout, or lack of ground plane will be insignificant compared to the fact that those clock lines are actually operating directly on the audio signal within the BBD itself.
There's an easy way to show that.  Take the BBD chip out of the circuit and audio probe the BBD input. 
If you don't hear clock noise there then that shows that the noise isn't affecting the circuit pre-BBD.
Better still, take the BBD out of the circuit and just run a wire directly from the BBD input socket to the two BBD outputs sockets, and audio probe the audio path again. If you've got a scope, even better.  Clock noise should be barely visible and certainly not audible.

Note that when the BBD is in the circuit it does in fact cause weak clock noise to appear at the BBD input (because that's where the sampling process is taking place).  You don't need to worry about that though.  It's just the way BBDs work.  You do need to be aware of this "wobbling of the input line" if you have a circuit with multiple BBDs clocked at different rates but that's another story.

+1 agree with DrAlx. The *most* significant source of clock noise is definitely the BBD itself. After all, the audio signal is being sliced and diced at the clock frequency, shifted along about a thousand stages, and then reassembled. Is it any wonder that this process is "somewhat imperfect"?! That said, anything you *can* do to limit noise has to be a good idea - so I'm still in favour of proper ground planes or star-grounding, short clock lines, magical healing crystals attached to the board, goat sacrifices on the full moon - whatever it takes to get it quieter.

But I'm getting a bit far from the point - what's going on in *your* circuit? Have you discovered anything else that might give us more clues?

Another possibility might be if one of the two resistors that set the Vgg bias supply was wrong. That would throw the BBD out and give a lot of clock noise.

Tom

lars-musik

Hi Tom,

I ventured on the Flanger tonight again. I checked R22 and R23 (luckily SMD, so both are readable the supposed 104) and the Vgg bias resistors (r20 is 332 and R21 is 473, oth correct, too).

I bridged the BBD as suggested by Alex and there's no clock noise left - culprit found.  I had two other MN3207 that I tried - different but not really worth the effort.

Maybe I am just over-sensitive - or lame at the biasing potentiometers. I did a very quick and dirty recoding (pauses are due to fiddling with the knobs) of how it sounds at the moment. Maybe your ears spot something I miss (or just tell me it is good as it is).

Depth is at max, stating with some clean strums, then sine wave (wait - here's something strange again: I can't seem to dial in all the 7 waveforms. Maybe I should change the pot.) followed by sine wave with the up/down switch open. Then the following waveforms first with the up/down switch closed, then open.

MP3:
https://www.dropbox.com/s/xtlz3eywfe5p887/Flanger.mp3?dl=0

I saw that you updated the whole project! That's great. Thanks for your work. I tried to install the 4 knob code on my PIC but the #*'*#@ fake PICKit3 (Olimex) didn't recognize the chip. Damn.

That's it for tonight.

Thanks for your patience, Lars

DrAlx

#10
It sounds like you have the feedback (intensity) set very high. That will always make noise sound worse, not to mention the sounds will not sound too musical especially with fast sweep.
The only suggestion I can think of to lower the noise is run the BBD at 9v supply rather than 5v. Signal to noise according to MN3207 datasheet will be 3dB better. I am guessing Tom's chip needs 5v supply and puts out 5v clock signals. I am guessing those can be left alone, even if BBD runs at higher supply voltage. Maybe Tom could comment..

One other thing is that some of the sounds appear to be clipped. I have heard similar with a badly biased BBD. The bias resistors are R17 and R18. I have usually seen those implemented with a trimmer instead. Changing supply voltage would probably need the R17/R18 ratio to change.

anotherjim

I had a quick listen to the mp3.

Not familiar with that LFO/Clk or PIC, but is it possible it's running too slow? For example, If I don't set the clock select fuses properly in an Atmel mcu, it will run 1/8th of the internal clock speed.

Sounds like normal BBD noise, but poor SNR? Maybe input to bbd isn't quite right. Could be the signal isn't making it thru from input properly, or bias from R17/R18 isn't ideal. You could try replacing a R18 with a pot (47k?) temporarily and see if you can improve signal thru the BBD - maybe find a better fixed resistor value for R18. Input bias level can vary between BBD's, so fixing the voltage is at best "should work with most chips".
Does that LFO have zero modulation with depth zero? If it can, keep it like that while testing.

Also sounds like a lot of regen (intensity) AND the LFO sweep is taking the BBD clock low enough for the sampling rate to get into aliasing territory. With high regen, that may well be the cause of the tinkling harmonics effect (which I happen to like BTW).

If you want pristine BBD sound, I think you have to throw everything at it -  companding, pre-emphasis/de-emphasis, deep anti-alias filters...

...but a flanger should be a very fast clocking BBD which helps you get away with simple supporting circuits, which is why I wonder about that PIC clock.



samhay

>but the #*'*#@ fake PICKit3 (Olimex) didn't recognize the chip.

I have had nothing by good times with my Olimex PICKit3 clone. Which software are you using and is the compiler up-to-date?
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

lars-musik

Quote from: samhay on June 01, 2016, 07:53:10 AM
Which software are you using and is the compiler up-to-date?

Hi Sam, I am using the latest MPLAB IPE (V 3.30). I used the same setup for programming the initial code, albeit as the very first action before populating the board further. Just soldered the smd pic and the connections to the programming header.

I am really clueless about the workings of microcontrollers... wanted to change that fact but am not smart enough... BUT looking at schematic, is it possible that now that I connected all these pots to the pins that share the ICSP (standing for IN CIRCUIT serial programming, right?) header make a successful transfer impossible?


samhay

Sorry - should have thought that it was in-circuit.
Try setting the pots that are connect to the pic to noon and the switch to MCLR pin to not-grounded before flashing the chip - if you ground any of the MCLR or ICSP pins, you get a 'chip not recognised' error (I know from repeated experience).
I'm a refugee of the great dropbox purge of '17.
Project details (schematics, layouts, etc) are slowly being added here: http://samdump.wordpress.com

lars-musik

Quote from: samhay on June 01, 2016, 03:07:31 PM
Try setting the pots that are connect to the pic to noon and the switch to MCLR pin to not-grounded before flashing the chip - if you ground any of the MCLR or ICSP pins, you get a 'chip not recognised' error (I know from repeated experience).

Thanks, Sam! That did the trick (I won't think about the hour I spent on that topic yesterday).
Unfortunately the "4-Knob" HEX file Tom uploaded on his website is identical to the "Multiflange" one.

I'll keep fiddling with the other issues I have and keep all of you posted.

ElectricDruid

Ok, links corrected! Try the new 4KNOBFLANGE and MULTIFLANGE files now.

I also had a listen at your sound file; there's definitely some distortion on the input signal from somewhere. The soft-clipper on the input mixer will do that if you drive it really hard. But "hard" here means about 1 or 1.2Vp-p, which is a pretty full-tilt guitar signal - are you using some kind of boost? Could the bias be wrong at that stage? Aside from that, as everyone else says, you've got the feedback set almost at resonance, which makes any flanger noisy. I found the resonance is louder at lower frequencies, because the LP filtering naturally backs it off at the high end. You might want to adjust the resonance trimmer to limit the maximum resonance a bit.

I don't really agree about the fixed BBD bias. I've seen no evidence that tweaking the input bias makes a significant difference. The biggest effect of the trim is on clock noise, so most units either put a trim on the input or the output of the BBD - none have both. This one does it on the output. Either way, the clipping isn't coming from there - the input mixer doesn't allow a signal that would drive the BBD to overdrive, so the bias is a moot point.

I do agree about the comments about companders and such like - if you want a "quiet" flanger (is there such a thing?!) you really do need to chuck everything you have at it - companding, heavy filtering, careful limiting of clock frequencies etc etc. This circuit doesn't do any of that. You *can* push it "too far" if you want. I knew that when I designed it, and it was a deliberate choice. I was aiming for "simple" and "powerful" over "ultimate hi-fi" (which was never going to happen!).

Aside from the input distortion, your pedal sounds about right. The newer files might include one or two further tweaks - I kept finding minor improvements I could make to limit background noise and smooth things out. That said, the PIC is pretty stretched, and I'm not claiming that it's perfect. I did the best I can with the available resources. If you want hi-fi flanging...ummm, don't use BBDs?! ;) But if you want the wildest noise you can get, you might be in the right place!

Enjoy!
Tom

lars-musik

Quote from: ElectricDruid on June 01, 2016, 07:42:22 PM
But "hard" here means about 1 or 1.2Vp-p, which is a pretty full-tilt guitar signal - are you using some kind of boost?
In the recording setup I guess it's the cheap and well-worn Behringer USB interface that does the clipping. It is recorded directly from a ROG Conder Cab Sim + MXR Headphone Amp (maybe set too loud) into the computer. BUT my effect chain starts with a KLON to boost the signal, so maybe I'll have to be careful about the signal strength (although I never had problems with other pedals).

Quote from: ElectricDruid on June 01, 2016, 07:42:22 PM
Could the bias be wrong at that stage?

I don't know (hope not). That would be the 10K from emitter to ground (R3, right)? I'll have to check when I get home.

Quote from: ElectricDruid on June 01, 2016, 07:42:22 PM
You might want to adjust the resonance trimmer to limit the maximum resonance a bit.
I will (already stated a heavy-handedness in that regard on my part)

Quote from: ElectricDruid on June 01, 2016, 07:42:22 PM
I was aiming for "simple" and "powerful" over "ultimate hi-fi"

Rightly so! I was looking for a simple swoosher and not subtlety. Sorry if my questions implied that.
Quote from: ElectricDruid on June 01, 2016, 07:42:22 PM
Aside from the input distortion, your pedal sounds about right.

That is good news indeed!

Quote from: ElectricDruid on June 01, 2016, 07:42:22 PM
The newer files might include one or two further tweaks - I kept finding minor improvements I could make to limit background noise and smooth things out.
I already tracked down these changes:
   Old    New
C2   330nF   100nf
C12   470nF   1uF
C15   470nF   1uF
C10   1u   470nF

the differences between Butterworth/Sallen-Key/ Multiple Feedback Bandpass filters now and then are beyond me....  Do they perform MUCH better or would they be minor improvements?

Finally: Thanks again for inventing, improving, supporting and most of all sharing the project!

ElectricDruid

Quote from: lars-musik on June 02, 2016, 04:27:21 AM
Quote from: ElectricDruid on June 01, 2016, 07:42:22 PM
The newer files might include one or two further tweaks - I kept finding minor improvements I could make to limit background noise and smooth things out.
I already tracked down these changes:
   Old    New
C2   330nF   100nf
C12   470nF   1uF
C15   470nF   1uF
C10   1u   470nF

the differences between Butterworth/Sallen-Key/ Multiple Feedback Bandpass filters now and then are beyond me....  Do they perform MUCH better or would they be minor improvements?

Fairly minor. Both the old and the new filters use a butterworth response. My first PCB prototype used the Sallen-Key filters and sounded fine. The MFB filter is supposed to provide more attentuation in the stop band at high frequencies - so the improvement is at ultrasonic frequencies. That might block more clock noise (and is therefore better, so I changed it when I was re-doing the PCB anyway), but it won't be an obvious *audible* improvement. I also reduced the cutoff a little bit, which helps with the clock feed-through at extreme sweeps, but it was only a tweak.

The other changes (1uf->470nF) were because I didn't want electrolytics in the audio path if I could avoid it. 1uF is an expensive value to use if it's a non-polarised film cap. Reducing it a bit to 470nF makes it cheaper and easier to find, and doesn't hurt the bass to any degree that matters (so you raised the HPF cutoff from 5Hz to 10Hz, say. Big deal).

Quote
Finally: Thanks again for inventing, improving, supporting and most of all sharing the project!

You're welcome. I hope you get it tweaked to your liking!

Tom