PWM Envelope Phaser

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

Previous topic - Next topic

StephenGiles

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.
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

nelson

Nothing like searching for something in particular to give you impetus to organise.

:)
My project site
Winner of Mar 2009 FX-X

Cliff Schecht

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 :).

kiwiandy

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


Transmogrifox

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. 
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

earthtonesaudio

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... :)

Transmogrifox

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.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

earthtonesaudio

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.

Transmogrifox

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.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

Transmogrifox

#29
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

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
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

nelson

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.


My project site
Winner of Mar 2009 FX-X

Transmogrifox

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).

trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

earthtonesaudio


puretube

#33
In the december 1983 issue of ELEKTOR, 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 a PCB  myself, I wasn`t too happy
with the sound (not "deep" enough...),
so I thought of an extension to add a "feedback"-mix-path (regeneration),
which I submitted to the magazine as an improvement-"mod" in early `86,
but the mag wasn`t too interested 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:



(5mm grid)


Interesting also: this thread, and the other one...


puretube

#34
Taking a closer look into my archives, the final regen-/mix stage might have been
this one,
or that one...
(too lazy to trace the schemo from this concept,
that layout,
or from the original hand-drawn transfer-sheet...)

(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.

amptramp

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.