PWM Envelope Phaser

Started by nelson, May 27, 2009, 04:41:01 PM

Previous topic - Next topic

nelson

Hi Folks,


I've been designing a PWM envelope + LFO controlled phaser. Here's the Beta Schematic.

I just realised I don't have suitable rail to rail opamps, so I probably won't finish it for FX-X.

Anyway....

I've done some simulations of the LFO controlled PWM in spice and I get a good variation on the pulse width with the values in the schematic.

The PWM frequency is around 40Khz and the sweep of the phaser is from about 10 seconds to stupid fast.

I originally had it in mind to remove the need to match fets and have a phase 90 style circuit.
However, it has morphed into more of a polyphase style thing, purely because I had a spare opamp for the envelope.
It has both positive and negative feedback which is possible using a transistor phase splitter. This means that in the center of the feedback pots rotation there is no feedback and turning the pot CCW or CW adds either positive or negative feedback respectively.

I have half completed the Phase stages and the PWM generation circuit on the breadboard right now, unfortunately I don't have enough IC's to make it LFO controlled, so I'll be feeding voltage to the comparator with a pot wired as a voltage divider to test the sweep.

I've taken a break as it's getting late.

Does anyone have any tips, comments (good or bad) based on the schematic?

I'll update this thread when I finish loading the breadboard.




My project site
Winner of Mar 2009 FX-X

Mark Hammer

As a matter of fact, I was looking at the schematics for the switched-resistor MXR phaser and the Envelope Filter this morning on the bus, and pondering how to meld the two to make an envelope-controlled phaser.  Perhaps you want to look at that particular MXR phaser and see how they handle the LFO.  If memory serves, it isn't too terribly different from the P90 LFO.

nelson

Quote from: Mark Hammer on May 27, 2009, 04:56:17 PM
As a matter of fact, I was looking at the schematics for the switched-resistor MXR phaser and the Envelope Filter this morning on the bus, and pondering how to meld the two to make an envelope-controlled phaser.  Perhaps you want to look at that particular MXR phaser and see how they handle the LFO.  If memory serves, it isn't too terribly different from the P90 LFO.

I would gladly look at those schematics if I knew the name of the phaser in question.

The MXR envelope filter is a different beast to mine.

I couldn't fathom the method they used to create the PWM feeding the 4066 in the Envelope filter, it's also pretty touchy if I remember correctly. So I went with a more standard analog PWM generation circuit using a comparator fed by a high frequency triangle waveform. I must admit, their method is more elegant.





My project site
Winner of Mar 2009 FX-X

Mark Hammer


Mark Hammer

Incidentally, that's a cute trick you have there with the transistor phase-splitter as a means for providing inverted or in-phase feedback.  Correct me if I'm wrong but is one direction more effective that the other?

mdh

Whoa, don't mean to hijack, but has that been posted before, Mark?  I had something similar on the breadboard based on an unholy (and unworking) melding of R.G.'s ASMOP PWM phaser, the MXR EF clock, and the Small Clone LFO (I know, I know), but I couldn't get things to play nice.  My original intent was, like nelson's, to get around matching FETs, with a longer-term possibility of grafting on arbitrary digital LFOs.

nelson

Quote from: Mark Hammer on May 27, 2009, 07:35:28 PM
Incidentally, that's a cute trick you have there with the transistor phase-splitter as a means for providing inverted or in-phase feedback.  Correct me if I'm wrong but is one direction more effective that the other?


In all honesty, I have no idea. The inspiration for the idea came from a description of the control on the toneczar phaser. I thought since I was designing a phaser I'd give the idea a whirl. If Ed thought it good enough to include on a production model, perhaps I'll find the control pleasing. I've no idea how he does it.

Thanks for the schematic.

I'd be interested to hear some expert analysis on the MXR circuit. At first glance it's difficult to know what's going on.

My project site
Winner of Mar 2009 FX-X

earthtonesaudio

Excellent contribution, Nelson!

You asked for comments, so...
-I don't see where you'd need rail-rail op-amps.  It looks like it would work with what you have listed in the schematic.
-I second the praise of the transistor phase splitter.  Such a useful little widget.  You could alternatively do it with an op-amp, which would allow you to DC couple things and save you perhaps one component, but then that's assuming you have an op-amp to spare.
-I like the way you've mixed the envelope with the LFO.  The thing I'm working on for this FX-X was going to have something like that, but I never came up with such a simple solution as your switch+resistors.
-A question: that's the same envelope generator you used in the Wolf Bagger, right?  Is it full-wave (I have a couple beers in me right now otherwise I'd suss it out myself)?  How would you rate its performance in general?
-I don't understand why you've put the parallel inverters in the VB/VR feedback loop.  What's up with that?
-In my opinion, this is a more elegant way of handling the PWM than what's in the MXR envelope filter.  The op-amp route may be less glamorous, but it's more reliable.

And a comment on the MXR phaser... I don't understand much of anything going on in the lower half of that schematic.   :icon_redface:

StephenGiles

Great stuff, there was some discussion on Ampage back around 2001 about the MXR PWM phaser which I might still have (somewhere!!).
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

nelson

Quote from: earthtonesaudio on May 27, 2009, 09:05:44 PM
Excellent contribution, Nelson!

You asked for comments, so...
-I don't see where you'd need rail-rail op-amps.  It looks like it would work with what you have listed in the schematic.
-I second the praise of the transistor phase splitter.  Such a useful little widget.  You could alternatively do it with an op-amp, which would allow you to DC couple things and save you perhaps one component, but then that's assuming you have an op-amp to spare.
-I like the way you've mixed the envelope with the LFO.  The thing I'm working on for this FX-X was going to have something like that, but I never came up with such a simple solution as your switch+resistors.
-A question: that's the same envelope generator you used in the Wolf Bagger, right?  Is it full-wave (I have a couple beers in me right now otherwise I'd suss it out myself)?  How would you rate its performance in general?
-I don't understand why you've put the parallel inverters in the VB/VR feedback loop.  What's up with that?
-In my opinion, this is a more elegant way of handling the PWM than what's in the MXR envelope filter.  The op-amp route may be less glamorous, but it's more reliable.

And a comment on the MXR phaser... I don't understand much of anything going on in the lower half of that schematic.   :icon_redface:


Thanks!

I'd like the comparator output to be rail to rail. It will work with the opamps I have outlined in the schematic, however, I currently have no TL06x.

You're right, it was either use the spare opamp for that, or add a transistor, I went for the transistor, it really only saves two components and allows for the envelope.

The envelope follower is pretty standard half wave rectification (it's in most text books as precision half wave rectifier) - it would require another opamp and a couple of resistors for full wave rectification.
I like the performance of this envelope follower, it's simple, uses silicon diodes and the ripple is pretty easily compensated for - of course that's always a sacrifice. It's the same envelope follower used in the wolf bagger, it's also used in the meatball in a similar configuration. However, it is just a standard precision half wave rectifier circuit, nothing immensely special.


The parallel inverters in the feedback loop are simply a way to decouple the audio ground and clocking circuitry ground. My thinking being if people use higher current consumption IC's (or I do) in the clocking/LFO parts of the circuit it will avoid any ticks, the buffers can provide far more current than an opamp alone. It's just a precaution, I would have used seperate resistor voltage dividers if I didn't have the buffers to spare anyway. I'll probably add 0.1รบ ceramic decoupling caps at the V+ pins of the clocking circuit IC's just to be safe too, I hate @#$%ing about with needless noise from design shortcuts.


Thanks for the compliments about the design, you do some great work yourself so it's much appreciated!

Hopefully I'll get the breadboarding finished today.






My project site
Winner of Mar 2009 FX-X

snap

to what outputvoltage will the IC2D-E-F inverters flip once they feel half of the supplyvoltage (VB) at their ins?

nelson

Quote from: snap on May 28, 2009, 09:48:02 AM
to what outputvoltage will the IC2D-E-F inverters flip once they feel half of the supplyvoltage (VB) at their ins?


Hehe,

Now that I think about it, the buffer isn't going to behave how I expect.

I'm treating a 4050 (which it should be) as a BUF634, it just won't work.

That's a headslapping moment.

   
My project site
Winner of Mar 2009 FX-X

StephenGiles

Quote from: StephenGiles on May 28, 2009, 02:53:52 AM
Great stuff, there was some discussion on Ampage back around 2001 about the MXR PWM phaser which I might still have (somewhere!!).

Ampage is down so I'll look in the obvious places this evening, unfortunately I only have hard copy.
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

StephenGiles

I found the following in the Ampage archives

<<Ok the PWM portion works like the description on my previous post.  (cannot find this)

I must note some things: 

1) It doesn't go to 0% duty cicle (that's because the one shot cap takes a finite time to charge and then reset U5). The minimum of the usable range is around 7%. 

2) I doesn't go to 100% duty cicle. The maximum of the usable range is around 90%. If you reach the one shot duration that would give 100% duty cicle, the one shot cap is not discharged, but will discharge just at the beginning of the next cicle. The effect is weird: suddenly the frequency halves with a duty cycle of 50%. If you increase the cap charging time even more you get 1/3 the frequency with 0.67% duty cicle, and so on. 

Problably the LFO section looks so complex because it tries to keep the duty cicle constrained to the usable limits, automatically. Note that the LFO has some feedback from the PWM output (fitered by the 47k/0.047u combo). 

I prototyped the whole LFO+PWM and I couldn't get it to work. I can design a LFO+PWM that's much simpler than that, but I would like to know how the original works (LFO range of frequencies, LFO waveform, modulation depth - min and max duty cycle) as a guide if I decide to do it my way.

OK, I got the LFO to work. The problem was that the opamps were not OK for this task (I used CA3140's). 

On the schematics, when it says "U5 is CD4013BE RCA only", just ignore it. But where it says "U1-U4 are TL062" please read "U4 is TL62 only". The opamp makes a big difference - working against not working   

You need an opamp that has just the right output swing. The CA3140 output would saturate at 6.5V with a 9V supply. I substituted U4b for a LM308N and the thing started to work as expected. 

The LFO frequency (looking at R47/C20) goes from 0.25 Hz to 4Hz. At the lowest frequency the waveform is triangular, at the fastest speed it's sine-like (with a smaller amplitude). Looking at U5 in 1, the duty cicle goes from 50% down to 10% or 20% (depends on the LFO frequency). That means the effective resistances on the phase shifter stages range from ~12k to ~62k. I'm going to buy some TL062's to confirm this data. 

U4a is a comparator with hysteresis. R35+C14, R40+C16 integrate the square wave output of U4a. U4b drives the PWM, and there are two feedback paths - one is negative feedback from R47+C20 back to U4b (perhaps to keep the linearity and range of the PWM under control) and one is positive feedback from R47+C20 back to U4a (to close the loop and make the LFO oscillate).


Pin 3, pin 12, C21 and R50 are all connected together. R51 and Q2(emitter) are connected to +V.>>


"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

StephenGiles

Quote from: StephenGiles on May 30, 2009, 06:30:53 AM
I found the following in the Ampage archives

<<Ok the PWM portion works like the description on my previous post.  (cannot find this)

I must note some things: 

1) It doesn't go to 0% duty cicle (that's because the one shot cap takes a finite time to charge and then reset U5). The minimum of the usable range is around 7%. 

2) I doesn't go to 100% duty cicle. The maximum of the usable range is around 90%. If you reach the one shot duration that would give 100% duty cicle, the one shot cap is not discharged, but will discharge just at the beginning of the next cicle. The effect is weird: suddenly the frequency halves with a duty cycle of 50%. If you increase the cap charging time even more you get 1/3 the frequency with 0.67% duty cicle, and so on. 

Problably the LFO section looks so complex because it tries to keep the duty cicle constrained to the usable limits, automatically. Note that the LFO has some feedback from the PWM output (fitered by the 47k/0.047u combo). 

I prototyped the whole LFO+PWM and I couldn't get it to work. I can design a LFO+PWM that's much simpler than that, but I would like to know how the original works (LFO range of frequencies, LFO waveform, modulation depth - min and max duty cycle) as a guide if I decide to do it my way.

OK, I got the LFO to work. The problem was that the opamps were not OK for this task (I used CA3140's). 

On the schematics, when it says "U5 is CD4013BE RCA only", just ignore it. But where it says "U1-U4 are TL062" please read "U4 is TL62 only". The opamp makes a big difference - working against not working  

You need an opamp that has just the right output swing. The CA3140 output would saturate at 6.5V with a 9V supply. I substituted U4b for a LM308N and the thing started to work as expected. 

The LFO frequency (looking at R47/C20) goes from 0.25 Hz to 4Hz. At the lowest frequency the waveform is triangular, at the fastest speed it's sine-like (with a smaller amplitude). Looking at U5 in 1, the duty cicle goes from 50% down to 10% or 20% (depends on the LFO frequency). That means the effective resistances on the phase shifter stages range from ~12k to ~62k. I'm going to buy some TL062's to confirm this data. 

U4a is a comparator with hysteresis. R35+C14, R40+C16 integrate the square wave output of U4a. U4b drives the PWM, and there are two feedback paths - one is negative feedback from R47+C20 back to U4b (perhaps to keep the linearity and range of the PWM under control) and one is positive feedback from R47+C20 back to U4a (to close the loop and make the LFO oscillate).


Pin 3, pin 12, C21 and R50 are all connected together. R51 and Q2(emitter) are connected to +V.>>




I'll keep looking for the missing description of the pwm section
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

free electron

Take a look at the pwm controller chips used in switching power supplies (like UC384X). With some tweaks around the error amp you'll get a pretty versatile PWM generator in compact DIP8 package.

StephenGiles

I have found the missing link, so this as far as I can see is the complete set of posts from GFR, whoever he was, regarding his MXR PWM Phaser findings:

2000/11/27

I've breadboarded the circuit around U5.
It seems there's an error as it does not oscillate at all. Connecting the emitter of Q2 and R51 to V+ makes it oscillates at 96KHz, with a very narrow duty cicle. This must be the high frequency oscillator.
The modulation problably happens on the other 1/2 of U5 (that's connected to Ql).
With pin 4 of U5 connected to +V through a 2.2k resistor (to emulate Ql on) there's an inverted version of the high freq. oscillator.
With pin 4 not connected to +V to emulate Ql off the frequency at pin 1 is very low (~26Hz).
I've tested a few chips like a RCA 4013BE, a RCA 4013AE, a Signetics 4013, a Motorola 4013 and a National 4013, it works the same with any of them.
I'm going to build the rest of the circuit as time permits.

2000/11/28

Look what I've found:
http://www.imagineeringezine.com/PDF-FILES/oneshots.pdf
Back to guessing about the MXR schematic, I think U5b/Q2 is a high frequency oscillator that has a very narrow duty cycle. It acts as a trigger for U5a that is a one shot vibrator as on the above reference. U4 is a LFO that changes how fast Ql charges C19, so changing the duration of the U5a one-shot. The result is pulse width modulation.
If so then for sure (R51 + Q2 emitter) have to be connected to +V.


2000/11/29

Ok the PWM portion works like the description on my previous post. 

I must note some things: 

1) It doesn't go to 0% duty cicle (that's because the one shot cap takes a finite time to charge and then reset U5). The minimum of the usable range is around 7%. 

2) I doesn't go to 100% duty cicle. The maximum of the usable range is around 90%. If you reach the one shot duration that would give 100% duty cicle, the one shot cap is not discharged, but will discharge just at the beginning of the next cicle. The effect is weird: suddenly the frequency halves with a duty cycle of 50%. If you increase the cap charging time even more you get 1/3 the frequency with 0.67% duty cicle, and so on. 

Problably the LFO section looks so complex because it tries to keep the duty cicle constrained to the usable limits, automatically. Note that the LFO has some feedback from the PWM output (fitered by the 47k/0.047u combo). 

I prototyped the whole LFO+PWM and I couldn't get it to work. I can design a LFO+PWM that's much simpler than that, but I would like to know how the original works (LFO range of frequencies, LFO waveform, modulation depth - min and max duty cycle) as a guide if I decide to do it my way.

2000/11/30

OK, I got the LFO to work. The problem was that the opamps were not OK for this task (I used CA3140's). 

On the schematics, when it says "U5 is CD4013BE RCA only", just ignore it. But where it says "U1-U4 are TL062" please read "U4 is TL62 only". The opamp makes a big difference - working against not working   

You need an opamp that has just the right output swing. The CA3140 output would saturate at 6.5V with a 9V supply. I substituted U4b for a LM308N and the thing started to work as expected. 

The LFO frequency (looking at R47/C20) goes from 0.25 Hz to 4Hz. At the lowest frequency the waveform is triangular, at the fastest speed it's sine-like (with a smaller amplitude). Looking at U5 in 1, the duty cicle goes from 50% down to 10% or 20% (depends on the LFO frequency). That means the effective resistances on the phase shifter stages range from ~12k to ~62k. I'm going to buy some TL062's to confirm this data. 

U4a is a comparator with hysteresis. R35+C14, R40+C16 integrate the square wave output of U4a. U4b drives the PWM, and there are two feedback paths - one is negative feedback from R47+C20 back to U4b (perhaps to keep the linearity and range of the PWM under control) and one is positive feedback from R47+C20 back to U4a (to close the loop and make the LFO oscillate).


Pin 3, pin 12, C21 and R50 are all connected together. R51 and Q2(emitter) are connected to +V.

"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

StephenGiles

Has that been of any help, I keep on reading it but I still don't understand quite what he was on about :-\
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

nelson

Quote from: StephenGiles on May 31, 2009, 03:48:58 AM
Has that been of any help, I keep on reading it but I still don't understand quite what he was on about :-\


It's certainly helped me understand what's going on in the MXR schematic.

It's working in a similar way to mine, apart from utilising the 4013 as an oscillator and one shot.

simply:

One section of the 4013 creates a square wave clock with 96Khz frequency. The other flip flop is used as the voltage controlled pulse width modulator, through its implementation as a one shot, in turn triggered by the clock with the one shot length and therefore pulse width controlled by the LFO.

The Pulse width range isn't as high as with the comparator method in mine. This would result in less range of variable resistance in the all pass filters and therefore less depth of sweep possible. but as the depth isn't variable, I guess this is how they wanted it.

Thanks for dredging that up Stephen!

Illuminating stuff.

My project site
Winner of Mar 2009 FX-X

nelson

Quote from: free electron on May 30, 2009, 08:08:06 AM
Take a look at the pwm controller chips used in switching power supplies (like UC384X). With some tweaks around the error amp you'll get a pretty versatile PWM generator in compact DIP8 package.


I'll be doing this as a project on my site eventually, so the more parts that are in the average DIYer's parts stash the better.

I did have a look at a few dedicated PWM IC's datasheets, the supporting circuitry needed for linear voltage controlled PWM was about as much as I have now, in terms of board real estate.

My project site
Winner of Mar 2009 FX-X