Digital LFO for phase shifter (ASMOP)

Started by Benny, March 01, 2004, 10:09:43 PM

Previous topic - Next topic

Benny

Greetings all!  I have been reading this forum for a while and built several of the projects discussed here.  Before I post my question I would like to thank all the members here for sharing their knowledge and putting some great DIY projects within everyone's reach!  And now on to my question...

I built an Easyvibe (cool pedal!) a while ago, and it got me thinking about using a digitally generated LFO to control an analog phase shifter; sort of the best of both worlds.  I looked around and saw that others had put a lot of thought into this as well, and reading R.G. Keen's ASMOP article got me motivated to give it a try.  I've had some experience working with PICs, so the programming should be pretty straightforward... the hard part is deciding what phase shift scheme to use (LED/LDR ala Easyvibe, JFET ala MXR, OTA ala Small Stone) and what means to bring the digital control into the analog domain.  Here are some options I have been considering:

1) PWM/low-pass filter driving a LED/LDR combo
2) Use a D/A converter (TI makes some cheap 8-bit ones) to drive a LED/LDR or JFET
3) PWM controlling a CD4066 switch connected to a small (100 ohm) resistor, like in R.G.'s PWM controlled phaser schematic.  I admit I don't understand the theory here... how fast must it switch to work like a variable resistor, and not just bouncing back and forth between 100 ohms and an open circuit?  Is there something that works as a "low-pass" filter for the resistance here?
4) Digital pots, but these seem like a bad idea because of the coarse granularity ("zipper noise" when changing values) and cost/availability.

I would like to hear from anyone who has attempted this, and even if you haven't feel free to give your opinion.  Right now I'm leaning toward the Easyvibe setup, basically replacing the LFO with a PWM or D/A stage driving the LED/LDRs.  The LFO waveform could be selectable as R.G. suggests.  And what about 4 LFO's (one for each phase stage) operating independently?  I suspect that could generate some cool sounds as the stages interact and the LFO's move in/out of phase.

Well sorry to ramble, but I'd like to hear what you guys think...

Benny

niftydog

sounds like a good idea, we'd all be interested in the results of your experimenting.  A couple of things I've encountered along these lines;

PWM and LPF is going to be easy to acheive and I would probably start there.  (see link below too!)

ADs and DAs are fiddly.  I have attempted some experiments using PICAXE chips, but the overheads of the basic assembly language make them far too slow for audio frequencies.  However, they may be fast enough for an LFO for this kind of effect.  Have you looked at the PICAXE?  The AD conversion on a PICAXE is incredibly easy to implement.  (Yes, even EASIER than for a PIC!)

A vanilla PIC is my next experimental tool, but it's the old thing of finding the time to program and test...

Digital pots, as RG has mentioned, are next to useless for most things.  Briefly checking out some data sheets, I've discovered that in order to get them to handle even modest currents (ie; anything > 1mA) requires very complex additional circuitry.
niftydog
Shrimp down the pants!!!
“It also sounded something like the movement of furniture, which He
hadn't even created yet, and He was not so pleased.” God (aka Tony Levin)

mikeb

Having played with PICs and also PICAXES for this purpose, I would love to see *someone* make available a pre-programmed uC or have source available for purchase license. I just don't have the time to develop this and it doesn't make financial sense to do so either (speaking as a DIYer, I'd much prefer to pay someone tens of dollars for programmed chips or source than spend the time to do it myself).

From my way of thinking in fact it is the audio part that is unimportant. Given that you have a control voltage, it is always possible to massage it to work with any type of phaser (or other pedal), either by changing the source code or by scaling and ranging of the voltages using linear technology. A few weeks back Peter S mentioned working on something like this (check the archives) and came up with a list of features that might be implemented. It would be well worthwhile finding this thread and seeing what was discussed there.

No matter whether you use PWM or a resistor ladder thing (I think the D-A converter is unecessary for LFOs) I would LOVE to see a real, workable and play-around-able design for this! :)

Mike

Nasse

Quote... how fast must it switch to work like a variable resistor, and not just bouncing back and forth between 100 ohms and an open circuit? Is there something that works as a "low-pass" filter for the resistance here?

I believe the switched capacitor/resistor technique idea is to do the switching at freqs well above highest audio freq, maybe three or four or more times so that aliasing and side-effects and their harmonics can removed with simple lowpass filter
  • SUPPORTER

Mark Hammer

Check out the digital pattern generator from John Blacet (http://www.blacet.com/cool.html    scroll to the bottom),  This thing is 25 years old at this point.

Benny

Thanks for the replies... it seems that the PWM/LPF approach is the way to go here.  The PIC16F675 looks like an ideal candidate- cheap, small (8 pin DIP), and 6 I/O's (one analog input for a speed control pot, 4 waveform select inputs, one pulse output.)  It's a little short on memory for waveform tables, but if it can hold a sine table then that's a good start.  Many interesting waveforms can be calculated on the fly anyway (triangle, sawtooth, square, etc...)

For those of you with PWM experience, what have you found to be good parameters for the output pulse waveform?  That is, what should the period of the waveform be, and what is the incremental width of the pulse (and thus the quantization of the output)?

Quote from: mikebA few weeks back Peter S mentioned working on something like this (check the archives) and came up with a list of features that might be implemented. It would be well worthwhile finding this thread and seeing what was discussed there.

No matter whether you use PWM or a resistor ladder thing (I think the D-A converter is unecessary for LFOs) I would LOVE to see a real, workable and play-around-able design for this!  

I found this thread, and it looks very interesting!  Peter's proposal looks excellent, sort of the mother of all LFO's.  If I get this working and there is a demand for something much less complex then I may choose to offer mine for non-commercial DIY'ers, though I don't want to step on anyone's toes here.

Benny

Quote from: Nasse
Quote... how fast must it switch to work like a variable resistor, and not just bouncing back and forth between 100 ohms and an open circuit? Is there something that works as a "low-pass" filter for the resistance here?

I believe the switched capacitor/resistor technique idea is to do the switching at freqs well above highest audio freq, maybe three or four or more times so that aliasing and side-effects and their harmonics can removed with simple lowpass filter

You are right- I understand how a low-pass RC filter can be used to produce an average *voltage* of the pulse waveform... just not how a PWM can be used to create an average *resistance* by switching a resistor on and off.  I'm not questioning whether it works, I just want to understand it, and in what context it can be used.

Benny

Quote from: Mark HammerCheck out the digital pattern generator from John Blacet (http://www.blacet.com/cool.html    scroll to the bottom),  This thing is 25 years old at this point.

Yes, I didn't mean to imply that this is in any way a new idea.  To be honest, my interest in this project is not the end result so much as the challenge of designing and implementing it (I'm an engineer, go figure...)  It's a good excuse to play around with PIC's and learn something along the way.  As the saying goes, getting there is half the fun!

R.G.

Benny - GREAT!!! I'm so glad that someone with some time and the necessary experience is looking at this.
Quote1) PWM/low-pass filter driving a LED/LDR combo
This is going to be the bottom-dollar way to go. I think that getting a design done that does an LFO that's speed selectable based on a pot, and adding in tap tempo (trivial in a PIC, as you realize) in an 8 pin package is the way to go. Even if that's only one or two waveforms. Sine and square should be easy. If you need more waveforms, overflow into the bigger package and memory.

The DA approach is going to be a primo way for some things I'm working on, as it will generate a consistent 0-5V arbitrary voltage, and in fact many of them for real time control of complex pedals. But for the ordinary stuff, an 8 pin package with PWM output of one or two waveforms is great.

Quotehow fast must it switch to work like a variable resistor, and not just bouncing back and forth between 100 ohms and an open circuit? Is there something that works as a "low-pass" filter for the resistance here?
It has to be Nyquist-outside the band you're interested in, which means 30kHz plus for anything we do in effects, 40kHz and up for full audio. The low pass is every cap (and inductor if there are any) in the rest of the circuit. What is happening is that all the caps are filled/emptied in little buckets of charge every time the switch closes to the 100 ohms, and static when it is not closed.

QuoteAnd what about 4 LFO's (one for each phase stage) operating independently? I suspect that could generate some cool sounds as the stages interact and the LFO's move in/out of phase.
Good idea. I might drive the stages in pairs to have control of notch position, as it takes two stages to make a notch, but random interactions would still make notches, just not particularly predictable.

QuoteThat is, what should the period of the waveform be, and what is the incremental width of the pulse (and thus the quantization of the output)?
From a practical standpoint, 128 values is probably plenty for increments. This kind of thing will be followed up with a lowpass filter anyway. As long as the period smooths well with the followup filter, you'd have a hard time hearing the difference - I think! Getting the period well up into audio where the filtering is easy is a good idea but not supercritical, I'd guess.
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.

Mark Hammer

I didn't mean to imply that the idea is old and you shouldn't bother.  Rather, I meant to indicate that the idea has been ticking people's fancy for a while, and also to pay hommage to John Blacet's vision and foresight.  When it comes to modulation, that is a bottomless well as far as I'm concerned....there is ALWAYS another way to modulate.   :)

One of these days I'm actually gonna DO something with the 16F84 I bought a few years ago!!