Hi Folks,
I've been designing a PWM envelope + LFO controlled phaser. Here's the Beta Schematic (http://electroconducive.googlepages.com/PWMEnvPhaserV1-3.pdf).
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.
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.
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.
'Tis this one:
(http://i414.photobucket.com/albums/pp228/Mark_Hammer/MXRPWMPhaser.jpg)
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?
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.
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.
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:
Great stuff, there was some discussion on Ampage back around 2001 about the MXR PWM phaser which I might still have (somewhere!!).
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.
to what outputvoltage will the IC2D-E-F inverters flip once they feel half of the supplyvoltage (VB) at their ins?
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.
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 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.>>
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
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 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.
Has that been of any help, I keep on reading it but I still don't understand quite what he was on about :-\
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.
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.
Quote from: nelson on May 31, 2009, 02:04:00 PM
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 pleasure, especially as I also found some other papers I had been searching for, not electronics related though, and was able to actually put stuff in files!! I'll have a think about your explanation now.
Nothing like searching for something in particular to give you impetus to organise.
:)
Quote from: nelson on May 27, 2009, 07:57:11 PM
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.
Feedback is a very tricky beast when it comes to filters. Negative feedback is usually used to add stability, decrease gain and increase bandwidth in a system (output to input feedback). Positive feedback is used to increase gain (hysteresis anyone?) and help induce oscillation. On a filter however, general negative feedback actually
decreases stability and induces ringing and eventual oscillation. Positive feedback increases stability and prevents oscillations from occurring . This stuff was kicking my ass at work all week.. (was working on a new 4 pole low-pass filter with voltage controlled cutoff and resonance, works great now! ;))
As far as applying this stuff to a phaser, the feedback is a bit more tricky than usual because of the weird nature of an all-pass filter (I'm looking at the MXR schematic here). First notice that the feedback is connected to both the positive and negative inputs (and that both inputs are connected together), this is indicative of an all-pass filter. The purpose of the all-pass filter is to just add phasing to your signal; this phasing is a function of frequency. So, knowing this, it can be seen that the feedback also has a frequency-dependent term in there which makes predicting the output that much harder. There is a possibility for both positive and negative feedback, the amounts of each determined by frequency and the all-pass filter component values. I haven't played around with phasers enough to give a detailed analysis of everything, but I'd guess that increasing the amount of negative feedback makes the phasing more intense by creating more notches and vice versa for positive feedback. Just a guess :).
Hi,
Nice-looking circuit. I've also been working on a PWM phaser, so here are some things that I've found useful.
You might want to try adding some pre-emphasis on the input opamp, and corresponding de-emphasis on the output mixer- see the MXR phaser (C1, R1, R2 and C8, C9, R22). I've found that this really helps to reduce background noise. It should be easy to implement around you ic6a and b.
I've had pretty good results using the MXR envelope follower PWM circuit for phasers. I'm not able to post the schematic at the moment but it is easy to find online. It's a simple circuit based on a 4069 chip. It's basically a 40kHz oscillator feeding a single inverter PWM modulator- very basic but it works well. It already has the envelope detector circuitry, but you could also add an LFO and attach it to the PWM modulator using a 47K resistor (pin 9 of A1). I usually add a couple of inverter stages between the PWM and the 4066 gates to the MXR circuit, in order to square up the signal a bit (I don't think it makes much difference though). The original circuit is powered from around 5V or so, but it works fine at 9V or even 15V (sucks a lot more current, though, if you want to power it from batteries).
The main difficulty I have had with PWM phasers is in getting the sweep into a "sweet" spot in the audio range. For the 47N caps you're using, you probably want the resistances to sweep between about 2k and 80k or so. If your PWM can get close to 0% and 100% duty cycles, one way of ensuring this is to limit the range of the cmos switches by altering the values of the 47R and 1Meg resistors accordingly. You could also try adding some DC bias to the input of your PWM modulator (pin 10 of IC3) via a trimmer between the rails and a resistor similar in value to R35 and R41. This would help to control the centre and range of of the sweep.
I hope some of this is helpful.
Andy
I'm always interested to see PWM-based projects going on.
I put in a second opinion that the comparator + ramp PWM modulator is about the most elegant. MXR's is what I would term "more interesting", but not particularly elegant.
Do note that you won't get your 100% duty cycle range out of the current scheme, either....at least not without a noticeable "switch" from pulsed to on. This is due to the low speed of IC's you're using. The rise and fall times are going to limit your range. You may consider a discrete transistor design for the comparator so you can get faster switching speeds with standard "toolbox" components.
An op amp is compensated for stability under high-feedback conditions (ie, unity gain). a comparator doesn't need to be stable under feedback, so you can allow for higher slew rate without going unstable.
Additionally, I wouldn't consider an LM319 or other Rat-shack comparator to be uncommon. These will give you adequate speeds and a smoother transition at the extremes.
Thanks Transmogrifox, that's some good insight into PWM builds in general! Perhaps there should be a PWM section to this forum, between the digital and analog sections... :)
http://www.geocities.com/transmogrifox/PWM-MODEL.PDF
I put this together on my bread board last night. Removing the 4.7k resistor it oscillates at around 84kHz and 3 ish volt amplitude.
This doesn't quite do the whole PWM thing, but it gives you a ramp oscillator with a small number of parts that don't take up much board real estate.
Anyone want to take on a discrete comparator that would be functional enough for this purpose? I have some ideas I may try tonight.
Nice one 'fox. I had to look at that one for a while, but it's basically a discrete hysteresis oscillator with a CCS on the capacitor, correct? I like this approach. Making it all discrete makes it a little more feasible to figure out what parts are doing what, and (perhaps more importantly) allows one to use common/salvaged parts, plus gives you more control over duty cycle, timing, etc. than you'd normally get with a one-chip solution.
Quote from: earthtonesaudio on June 09, 2009, 08:38:43 PM
allows one to use common/salvaged parts, plus gives you more control over duty cycle, timing, etc. than you'd normally get with a one-chip solution.
That's kinda what I had in mind. I think about any general purpose switching MOSFET and pnp transistors would do the trick.
You aren't the only one who had to scratch his head over this...I also had to ponder and play for a while to get to this configuration. My first try was a negative feedback amplifier that just biased up to a stable voltage. It took a little bit to figure out how to implement the hysteresis. I think this could conceivably work without any resistors in the MOSFET Drain where the voltage divider is shown. The oscillation amplitude would probably be about at the MOSFET turn-on voltage (around 2 Volts). I tried this by part-for-part replacement of the MOSFET's with npn BJT's and it wouldn't oscillate. I think it could be done with all BJT's with a little fiddling. That would release the DIY'er from having to find MOSFETs....thus making it a little more salvaged-parts friendly.
That CSS (constant current source for the noobs) could easily be replaced with a resistor, reducing this down to a 3-transistor unit. Of course, the ramp would no longer be linear, but maybe good enough for some applications. Especially if you're using this as an audio frequency VCO for a ring modulator or something.
For more fun, here's where I got my inspiration to try making a discrete ramp oscillator:
http://www.vk2zay.net/article/196
The circuits presented in that blog are good 2-tranny implementations. The design I have presented seems to be more suitable to higher frequency applications...and that's why I didn't simply build the unit A Yates analyzed. By the time he gets to the CCS model with a good linear ramp, he's got diodes and other parts in a configuration that didn't look like it lends itself well to high frequency oscillators. My circuit went free-wheeling at 1.5MHz when I took out the capacitor. It could go faster if better switching trannies were used for the pnp BJT. 2N5087 is not made for high-freq stuff.
Hopefully I'm not detracting from the thread. If this can evolve into a very simple but effective PWM modulator that is DIY + common parts + salvaged parts friendly, then I think it would add benefit to the community.
OK, I couldn't stop. Here is a discrete component Pulse Width Modulator. It uses 8 transistors, 8 resistors, 1 capacitor and 2 LED's. That sounds like a lot, but honestly it's pretty simple...especially compared to the number of components in the phase shifters.
http://www.geocities.com/transmogrifox/PWM.jpg
(http://www.geocities.com/transmogrifox/PWM.jpg)
The "Vpwm" is the output to the CD4016 analog switch chip for the phaser. The "Control Input" is where you feed the LFO or envelope detector. Be careful to put a 1k (ish) resistor in series with this input or other current limiting means. When the transistor goes into saturation, the MOSFET will burn up because the transistor then looks like a forward biased diode.
At a frequency of about 40kHz, I got to about 4% duty cycle on one polarity, and 97% on the other. This means about 93% of the range has a linear response. On the scope, the transistion from the 4% or 97% is where the square pulse gets reduced to a triangular spike, which decreases rapidly to zero as you approach 100% or 0%. This range is sensitive...but the "switch" transistion is only for 3% of the range, so what the hey. It's pretty danged good.
Note, this particular circuit was tested with a 16V power supply (poorly regulated 12V adapter). It could conceivably work on supplies as low as 5V. This requires some resistor value changes to make it work correctly. Switching speeds and duty cycle should be quite a bit better on a 5V - 9V supply (ie, good with CD4016). With the 16V supply, it oscillated at about 40kHz. Power supply will make a huge difference in the frequency.
This needs some minor tweaking to be exactly right for the PWM Phaser, but the arrangement of transistors and resistors has you set (assuming it interest you (anybody) to use it).
Take care
TFX
Wow, that's a lot of work.
Did you do that in spice?
I'd be interested in the spice file to mess around with it.
I'm embarassed to say my design is only still half breadboarded, I have the PWM generator going nicely, I haven't yet finished the audio path. I've ran out of breadboard space and will have to rethink how I lay it all out on there.
Thanks for the discrete PWM generator, I might find a use for it yet.
Quote from: nelson on June 10, 2009, 07:37:19 AM
Wow, that's a lot of work.
It was a lot of fun. I'm trying to design a Class D amplifier with parts salvaged from a UPS, so this type of circuit fits right into my ongoing experimentation.
I use QUCS http://qucs.sourceforge.net/download.html and Debian GNU/Linux is my OS.
There is a Win32 installer for QUCS on the download page linked above. If you're up for trying a new type of simulator, then I can certainly send the project file. I don't know if there's an export function for SPICE netlists. QUCS doesn't use SPICE for its simulation engine for various reasons they discuss on their web page.
I never actually ran a simulation on the circuit. I used QUCS as a quick schematic drawing program, then printed the page as a PDF (then imported into the GIMP to crop out the blank space on the page and add some notation and exported as a .jpg). All the project file needs for a successful simulation is a control voltage source and a properly configured transient simulation.
As a result, this was actually tested on a breadboard and measured with a scope. That means it actually works in real life. I even burned up a MOSFET because I didn't use a 1k resistor the first time.
Send me a PM with your email address if you want the project file (and that goes for anyone reading this).
Very nice! :)
In the december 1983 issue of ELEKTOR (http://www.elektor.com/), there was a nice
16-stages PWM-phaser project
on pages 12-66 to 12-71 with PCBc available (# 83120-1 & 83120-2).
Of course there was an option to increase the # of stages...
After I designed (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod5.jpg) a PCB myself (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod6.jpg), I wasn`t too happy
with the sound (not "deep" enough...),
so I thought of an extension (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod3.jpg) to add a "feedback"-mix-path (regeneration),
which I submitted to the magazine (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod1.jpg) as an improvement-"mod" in early `86,
but the mag wasn`t too interested (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod2.jpg) in publishing it...
My tips for envelope-modulating the pulsewidth or controlling it with threshold-triggered sawtooth-waves also remained unheard...
Of course, my mods included a Dual-clock for "Bi"-phasing...
Now I need to search for the cassette with one of the gig-recordings where my band used it... :icon_rolleyes:
What I did find, is the overlay:
(http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod4.jpg)
(5mm grid)
Interesting also: this thread (http://www.diystompboxes.com/smfforum/index.php?topic=76880.0), and the other one... (http://www.diystompboxes.com/smfforum/index.php?topic=77045.0)
Taking a closer look into my archives, the final regen-/mix stage might have been
this one, (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod10.jpg)
or that one... (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod11.jpg)
(too lazy to trace the schemo from this concept (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod7.jpg),
that layout (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod8.jpg),
or from the original hand-drawn transfer-sheet... (http://i661.photobucket.com/albums/uu335/puretube/PWM-phasemod9.jpg))
(those were the times when I saved on resistive ink rather than on Ferric Chloride...,
and only used ready-cut 15cm x 15cm phenolic (mojo!) coppercladboards by the dozens
from a shut-down factory-dumpster...)
[EDIT:] I don`t post those (copyright-protected!) links on a certain other forum,
because the administrator or one of the moderators there edit my posts in a most perfidious way
by replacing my pix with illegally published copyright-infringing (stolen) photos,
or altering my links (which prove their criminal behaviour,) to other URLs...
They do so without the readers being able to recognize that the contents have been intrigantly changed.
Quote from: earthtonesaudio on June 09, 2009, 11:23:08 AM
Thanks Transmogrifox, that's some good insight into PWM builds in general! Perhaps there should be a PWM section to this forum, between the digital and analog sections... :)
We should keep this thread bumped. I have an old switched capacitor filter book from National Semiconductor and the nice thing about switched filter designs is the repeatability and consistency without selecting parts. A switched phasor of the type discussed here was one of the first things I designed for myself before I knew anyone had done it before. I thought I had made a breakthrough...
I agree with earthtonesaudio that there is a realm of analog processing with some digital elements in it and maybe a PWM forum or mixed-signal (analog and digital) forum would be interesting. It is easy to design a sinusoidal digital oscillator that can be used as an LFO and applied to a phasor or any other item that would need it such as a flanger or tremolo.
Dear community,
is there a chance to reupload the schematics?
PWM envelope circuits are always neat and I'm sure some people would be interested in the positive/negative feedback control as well.
Thanks in advance!
Is this what you're looking for?
(https://i.postimg.cc/G4CTs32p/MXR-PWM-Phaser.jpg) (https://postimg.cc/G4CTs32p)
Here is another one:
(https://i.postimg.cc/NF24xpjj/PWMEnv-Phaser-V1-3-1.png)
Awesome!
Thank you very much Mark and amptramp! :)
The Paul Nelson Phaser was the one that interested me most.
Quote from: amptramp on December 22, 2024, 09:01:28 AMHere is another one:
(https://i.postimg.cc/NF24xpjj/PWMEnv-Phaser-V1-3-1.png)
Aha, one of my drawings in excel!!
Quote from: StephenGiles on December 22, 2024, 11:55:17 AMQuote from: amptramp on December 22, 2024, 09:01:28 AMHere is another one:
Aha, one of my drawings in excel!!
You can do drawings in Microsoft Excel or is this some other software?
Quote from: amptramp on December 23, 2024, 08:03:01 AMQuote from: StephenGiles on December 22, 2024, 11:55:17 AMQuote from: amptramp on December 22, 2024, 09:01:28 AMHere is another one:
Aha, one of my drawings in excel!!
You can do drawings in Microsoft Excel or is this some other software?
Yes, you have to make you own component shapes. I don't do them now because of Arthritis pain in my thumb!
Not sure if it has been posted, but here is one that might be interesting for you:
https://circuitsalad.com/2014/11/19/pwm-phaser-re-design-almost-complete/
regards, Jack
One difficulty with all PWM schemes as related to human auditory effects is that PWM has a limited and linear scale. Human frequency and loudness sensing is logarithmic, so a very wide range of frequencies and loudness is mapped onto a limited range of perception. PWM as normally practiced is fundamentally linear - 0 to 100% duty cycle is usually done with a division into 2 to the 10th to 2 to the 12th duty cycles. This is too many steps on the low end and not enough on the high end to preserve the appearance of seam-less-ness in some cases.
> This is too many steps on the low end and not enough on the high end to preserve the appearance of seam-less-ness in some cases.
OR-- ratios like 0.01% can be gotten with precise extremely fast switching. To hit -60dB in a 20+kHz system is like 50 Megacycle time resolution.
Quote from: R.G. on December 23, 2024, 07:46:23 PMOne difficulty with all PWM schemes as related to human auditory effects is that PWM has a limited and linear scale. Human frequency and loudness sensing is logarithmic, so a very wide range of frequencies and loudness is mapped onto a limited range of perception. PWM as normally practiced is fundamentally linear - 0 to 100% duty cycle is usually done with a division into 2 to the 10th to 2 to the 12th duty cycles. This is too many steps on the low end and not enough on the high end to preserve the appearance of seam-less-ness in some cases.
Would 16 bit pwm resolution be able to solve it though? :icon_lol:
Quote from: diffeq on December 25, 2024, 05:38:10 AMWould 16 bit pwm resolution be able to solve it though? :icon_lol:
As Paul notes, with extremely fast and precise switching yeah, you can handle the end cases. 16 bits is probably enough, as witness CDs' resolution. There are still people who complain that CD resolution is not good enough.Then there's speed. CD equivalent at 44kHz is a good place to start. The rise and fall times have to be "fast" compared to the basic 44kHz and 16 bit resolution, so the edges of the PWM on and off times need to make the pulse edges trivial compared to a 1/2^16 of 44kHz. This gets you to - if my mental math is not fooling me - into the tens of nS rise and fall rate.
It's all do-able, especially with something like today's uC chips and DSPs. It gets tricky if you're trying to hack something together with a few CMOS gates. So would 16 bit pwm resolution do it? It's a step in the right direction, but not necessarily a slm dunk. :icon_lol:
Why on earth would they worry that CD resolution in a gig volume battle with drums, other guitars and even keyboards, is not enough - Now it's an entirely different kettle of fish if you are trying to impress your girlfriend!!!
Having dickered with envelope control of speed on a basic FET-based Phase 90, I will say that the time constants are tricky to nail down, and may well be the finickiest part of such potential circuits. The rise and fall times of the envelope shaping modulation rate, may not necessarily be those optimal for direct envelope-control of phase-shift, or envelope control of resonance or offset, or any other parameter. The "musicality" of the change, prompted by the intensity of one's picking, seems to depend very much on what sort of sonic change one is aiming for. One doesn't want it too sensitive and abrupt, but one also doesn't want it too sluggish.
I am not sure you need the entire audio spectrum.
After all, most analog delay / chorus / echo pedals have a limited frequency range and the album "No Jacket Required" certainly didn't suffer from only having content up to 5000 Hz and nothing above that. You are looking at a restriction that doesn't really exist for a guitar - even if the rest of the music is full range, the guitar content does not need high frequency content.
Quote from: StephenGiles on December 25, 2024, 12:42:09 PMWhy on earth would they worry that CD resolution in a gig volume battle with drums, other guitars and even keyboards, is not enough - Now it's an entirely different kettle of fish if you are trying to impress your girlfriend!!!
I was just using that as a handy comparison metric for "how much is enough". No, CD resolution is not needed in the sound at a gig.
Quote from: R.G. on December 23, 2024, 07:46:23 PMPWM as normally practiced is fundamentally linear - 0 to 100% duty cycle is usually done with a division into 2 to the 10th to 2 to the 12th duty cycles.
RG is completely correct about this in my experience. 10-bit PWM is common, and 12-bit PWM would be pretty good going. That's 1024 steps or 4096 steps.
QuoteThis is too many steps on the low end and not enough on the high end to preserve the appearance of seam-less-ness in some cases.
Yes, this is the critical question. *How exactly* are those steps mapped to whatever parameter we're controlling?
If it was entirely linear, and we're looking at something that humans hear in a logarithmic way, like pitch, then we've maybe got problems. Let's "back of the envelope" that:
Say we have 1024 steps. The first 512 steps cover one octave. The next 256 steps cover the next octave, and then the next 128 steps after that cover the next octave, etc etc. How many octaves do we get before this is unacceptable?
512 steps per octave is 512/12 = 42.66 steps per semitone, about 2.3 cents, less than the 6 cents generally regarded as perceptible. The next octave knocks that to 256/12 = 21.33 steps per semitone, 4.68 cents, still good. Next octave, we're going to hit 9 cents, which is certainly potentially perceptible. That's not to say it always will be - if things are moving about about and the frequency is particularly high or particularly low, you *still* won't notice, unless you're the first violin in the something-or-other philharmonic orchestra ;). But it's not looking good - at 10-bit, we've got maybe two-and-a-bit octaves at best. Clearly, for 12-bit, you can extend that: four and a bit octaves of pitch sweep without steps being audible would be actually pretty good, given that the whole range of human hearing is only ten octaves or so. 16-bit would therefore definitely cover everything you might need.
However, this is assuming the worst case. If the response is entirely linear, we finish up wasting a lot of our resolution in the lower octaves, and then don't have much left further up. If we were able to get a more "V/Oct" style response from whatever our PWM is controlling, the situation would be much better. We already know 512 steps per octave is fine, so if 4096 steps (12 bit PWM) were spread equally, we could cover eight octaves with better than 2.5cent resolution. That's basically twice as good as the than the four-and-some octaves we get the other way, and it's more consistent into the bargain.
How would we do this? Well, it turns out that putting a resistor in parallel with the 4066 CMOS switch is pretty effective. If we have a resistor setting the minimum resistance, and a resistor in parallel and the resistance of the switch itself, we have the following situation:
(https://i.postimg.cc/3yw5BxxG/image.png) (https://postimg.cc/3yw5BxxG)
Now, I did a graph with this situation, using Rmin=2K, Rmax=22K, Rswitch=50R, and with a capacitor value of 4n7 (typical is often 10n, with a 10K resistor, so I've kept things in the same ballpark). Here's the result:
(https://i.postimg.cc/xkBxzfJn/image.png) (https://postimg.cc/xkBxzfJn)
The red line is a "theoretical" 1V/oct response. The green line is what we actually get. It covers a roughly 1:10 range from 1400Hz to 16KHz (2K to 22K, following the resistor values used). This is probably a bit high, and could do with getting pushed down a bit, but the point is that the added resistors tweak the response from something linear into something much more like the curve we need, and that can help our PWM resolution *a lot*. Ok, it's not perfect, but when were effects *ever* perfect?!? All that happens is the ones that sound good become classics, and then everyone spends the next several decades trying to copy those imperfections to get the same sound! So I'm saying this is probably close enough for rock'n'roll, and that if you're working on something like this, certainly look at adding the parallel resistor and see what it can do for you. Do the sums (not personally - that's why we have computers), plot the graphs.
HTH,
Tom
Quote from: ElectricDruid on December 27, 2024, 05:31:49 PMsomething that humans hear in a logarithmic way, like pitch, then we've maybe got problems.
Prior Art: When Moog-like synths lived or fell flat on their LOG converters, PAiA built a whole synth system on LINear converters (instead of 1V/0ct, 1V/1kHz). Then used a very early microprocessor to make it music scale. JonBoy said it tracked beautifully, mostly. As kits it was vastly cheaper than any loggy plan, didn't bite the pot budget. It might be a natural on PWM? I ferget all the technical details but the company is around.
Quote from: ElectricDruid on December 27, 2024, 05:31:49 PMQuote from: R.G. on December 23, 2024, 07:46:23 PMPWM as normally practiced is fundamentally linear - 0 to 100% duty cycle is usually done with a division into 2 to the 10th to 2 to the 12th duty cycles.
RG is completely correct about this in my experience. 10-bit PWM is common, and 12-bit PWM would be pretty good going. That's 1024 steps or 4096 steps.
QuoteThis is too many steps on the low end and not enough on the high end to preserve the appearance of seam-less-ness in some cases.
Yes, this is the critical question. *How exactly* are those steps mapped to whatever parameter we're controlling?
If it was entirely linear, and we're looking at something that humans hear in a logarithmic way, like pitch, then we've maybe got problems. Let's "back of the envelope" that:
Say we have 1024 steps. The first 512 steps cover one octave. The next 256 steps cover the next octave, and then the next 128 steps after that cover the next octave, etc etc. How many octaves do we get before this is unacceptable?
512 steps per octave is 512/12 = 42.66 steps per semitone, about 2.3 cents, less than the 6 cents generally regarded as perceptible. The next octave knocks that to 256/12 = 21.33 steps per semitone, 4.68 cents, still good. Next octave, we're going to hit 9 cents, which is certainly potentially perceptible. That's not to say it always will be - if things are moving about about and the frequency is particularly high or particularly low, you *still* won't notice, unless you're the first violin in the something-or-other philharmonic orchestra ;). But it's not looking good - at 10-bit, we've got maybe two-and-a-bit octaves at best. Clearly, for 12-bit, you can extend that: four and a bit octaves of pitch sweep without steps being audible would be actually pretty good, given that the whole range of human hearing is only ten octaves or so. 16-bit would therefore definitely cover everything you might need.
However, this is assuming the worst case. If the response is entirely linear, we finish up wasting a lot of our resolution in the lower octaves, and then don't have much left further up. If we were able to get a more "V/Oct" style response from whatever our PWM is controlling, the situation would be much better. We already know 512 steps per octave is fine, so if 4096 steps (12 bit PWM) were spread equally, we could cover eight octaves with better than 2.5cent resolution. That's basically twice as good as the than the four-and-some octaves we get the other way, and it's more consistent into the bargain.
How would we do this? Well, it turns out that putting a resistor in parallel with the 4066 CMOS switch is pretty effective. If we have a resistor setting the minimum resistance, and a resistor in parallel and the resistance of the switch itself, we have the following situation:
(https://i.postimg.cc/3yw5BxxG/image.png) (https://postimg.cc/3yw5BxxG)
Now, I did a graph with this situation, using Rmin=2K, Rmax=22K, Rswitch=50R, and with a capacitor value of 4n7 (typical is often 10n, with a 10K resistor, so I've kept things in the same ballpark). Here's the result:
(https://i.postimg.cc/xkBxzfJn/image.png) (https://postimg.cc/xkBxzfJn)
The red line is a "theoretical" 1V/oct response. The green line is what we actually get. It covers a roughly 1:10 range from 1400Hz to 16KHz (2K to 22K, following the resistor values used). This is probably a bit high, and could do with getting pushed down a bit, but the point is that the added resistors tweak the response from something linear into something much more like the curve we need, and that can help our PWM resolution *a lot*. Ok, it's not perfect, but when were effects *ever* perfect?!? All that happens is the ones that sound good become classics, and then everyone spends the next several decades trying to copy those imperfections to get the same sound! So I'm saying this is probably close enough for rock'n'roll, and that if you're working on something like this, certainly look at adding the parallel resistor and see what it can do for you. Do the sums (not personally - that's why we have computers), plot the graphs.
HTH,
Tom
The Paul Nelson design in the schematic at the top of the page (#40) shows 1 Megohm in parallel and what looks like 47E ohms in series. This may be a reasonable starting point, whatever 47E means.
Quote from: amptramp on December 27, 2024, 11:32:15 PMThe Paul Nelson design in the schematic at the top of the page (#40) shows 1 Megohm in parallel and what looks like 47E ohms in series. This may be a reasonable starting point, whatever 47E means.
Assuming another 50R or so as the switch on resisance, that's about 100R total. 100R to 1M is a 10,000:1 range, extremely wide. That would be from 2Hz to 20KHz! We don't need quite so much! I'm quite sure no FET phaser covers anything like such a range.
My experience with PWM in other situations has been that it's best to stay away from the most extreme settings, so (say) only use 5% to 95% pulse widths, instead of going all the way. It's possible this is the idea in Paul's schematic, and the LFO modulates the pulse width over some middle part of the entire range.
Although perhaps my example with only 10:1 is too narrow, I think there might be some useful middle ground to be found here!