PWM and square wave question.

Started by mills, October 09, 2009, 12:17:08 AM

Previous topic - Next topic

mills

So, I'm planning out a pedalboard to make some synthy bass sounds.  Not note tracking or anything fun like that on this go around.  Going to be a fuzz and a frostwave resonator and a mess of CV controllers.

For the fuzz, I REALLY like tim escobedo's simple square wave shaper, but was interested in his PWM.  I've breadboarded it before, but its one of those cursed circuits that worked briefly then wouldn't start again.  It seemed to make some cool textures/variations on a square wave fuzz while I had it going.

So, I was wondering about the theory of combining the two before I fiddle with my breadboard.  Could I just tack the squarewave shaper's pots/diodes/output buffer onto the output of the PWM to get a combination of pulse width changes, and sloped edges on the wave? Any thoughts about putting the two together or just comments in general?

My memory is a bit fuzzy, but does the schmitt trigger in the PWM gate the signal as well?  Is there anything I can do to either circuit to get a smoother finish to the note as it gates off?

Pretty much What I want is a gated square wave that I can use as a base tone to modify, but would like to be able to squeeze some other textures out of it other than just filtering...  any other suggestions are so, any other suggestions are welcome.

mills

Allright,  lets try this from another angle maybe?  I could just be wasting space on the internet and thinking outloud, but... 

I think that the first half of the opamp in the simple square wave shaper is set up like a comparator... and the PWM uses a schmitt trigger.  So, as they both have a similar output and a fair bit in common, there's no benefit to using both stages in a hybrid of the two circuits?  I might as well just go with the schmitt trigger and slew limit the output for some wave shaping?  Just ignore the comparator entirely (I think I read that schmitt triggers are essentially comparators with some positive feedback, so...)

And, the 386 feeding the schmitt trigger in the PWM... is there anything special about using that rather than a standard opamp?  Is all its doing amplifying the crap out of the signal to get more solid transitions past the thresholds to change the output state of the schmitt trigger more smoothly?  If thats the case, would an opamp work about as well?  I would've thought that the supply voltage would limit that amount of amplification to about the same amount regardless... 

And, finally, is there anything I can do to make the sputtery gating less sputtery?  Not necessarily schematics, I'm willing to read about anything if theres a technique or circuit snippet that might be worth looking into.

Do any of those questions even make sense, or are they worth answering?  I have zero knowledge that isn't from searching this forum and google... so it could be that none of what I think I know is accurate. 

Right now, I'm thinking
Input amplifier (386, transistor, or opamp)>schmitt trigger section of PWM> slew limiter of the squarewave shaper> output buffer/amplifier of simple square wave shaper.

(I have 40106's in the mail, so the breadboard will be broken out soon, but any theory would be usefull!)

synthmonger

Quote from: mills on November 03, 2009, 12:36:31 AM

And, the 386 feeding the schmitt trigger in the PWM... is there anything special about using that rather than a standard opamp?  Is all its doing amplifying the crap out of the signal to get more solid transitions past the thresholds to change the output state of the schmitt trigger more smoothly?  If thats the case, would an opamp work about as well?  I would've thought that the supply voltage would limit that amount of amplification to about the same amount regardless... 


Pretty much. You need to drive the 40106 with a hot signal but nothing a couple op-amps can't do. The gateing and cleanliness of 'fuzz' comes out better with tailored op-amps vs. the 386.

earthtonesaudio

Quote from: mills on November 03, 2009, 12:36:31 AM
And, the 386 feeding the schmitt trigger in the PWM... is there anything special about using that rather than a standard opamp?  No reason I can see other than simplicity.  Is all its doing amplifying the crap out of the signal to get more solid transitions past the thresholds to change the output state of the schmitt trigger more smoothly? Yep! If thats the case, would an opamp work about as well? Right again! I would've thought that the supply voltage would limit that amount of amplification to about the same amount regardless...  The supply limits the amount of clean amplification or headroom.  But you don't care about clean, you just want to amplify the crap out of the input signal so it can drive the Schmitt trigger properly.

And, finally, is there anything I can do to make the sputtery gating less sputtery?  Not necessarily schematics, I'm willing to read about anything if theres a technique or circuit snippet that might be worth looking into.  This is what Schmitt triggers do.  You can make your own Schmitt trigger with an op-amp and that will allow you to adjust the trigger thresholds, which will dial out some of the gating (but probably not all of it).  You might also try adding a clean blend (or blend of distorted-but-not-Schmitt-triggered tone) to "fill in" the portion of the decay where the Schmitt triggers are sputtering.

Do any of those questions even make sense, or are they worth answering?  I have zero knowledge that isn't from searching this forum and google... so it could be that none of what I think I know is accurate.  You've made a lot of the important connections already, and I think you're on the right track.

Right now, I'm thinking
Input amplifier (386, transistor, or opamp)>schmitt trigger section of PWM> slew limiter of the squarewave shaper> output buffer/amplifier of simple square wave shaper.  Sounds good!  But while you're waiting for the 40106's to arrive, try another op-amp configured as a Schmitt trigger in its place.  Should be fairly similar.

(I have 40106's in the mail, so the breadboard will be broken out soon, but any theory would be usefull!)

mills

Awesome, thanks for the reply!  I've been looking at op amp and discrete schmitt triggers because it seems wrong to have all those unused sections of the 40106, but in the end I think that the chip would still end up smaller.  I'll look into adjusting the thresholds... that makes sense as a solution.

earthtonesaudio

You can adjust the absolute thresholds even if you use a 40106, by varying the supply voltage to that chip only.  It trips at 1/3 and 2/3 of the supply voltage, and will work with +3 to +15V supplies (pretty sure about this but always check the datasheet).  Just keep the thing driving it at a fixed (higher) voltage.

mills

#6
Well, for anyone thats desparately waiting for a new development...

I tried this out as I described, and for an initial breadboard its working "well".

Its almost doing what I want it to (which is actually pretty exciting), but needs some tweaking before it's built.  It ought to sound great when its done, and so far the gating seems smoother.  We'll see once its up and running though.  It either needs a stronger boost than I'm using (pretty much an mxr micro amp right now) or to try running the opamp at 12V and the schmitt at 9V...  I tried the different voltages with a 9V maximum, but couldn't make it work and don't know why.

a couple questions came up while trying this...

1)  I thought that the pulse width control ought to attenuate (might be an poor usage of the word?) the signal from the first schmitt stage, which would limit the time that the signal spends above the necessary thresholds, causing the difference in pulse width.  Now that I write it down, I think that must be wrong, so how does the pulse control do its thing?  And, if I'm not too far off base, it currently goes from "50%" duty cycle to essentially 0% (although a resistor to limit the range would be a good addition.  So, if that's how it works, would putting a few volts on there do the opposite and increase the duty cycle further?  so I could maybe go from like "75%" to like "10%"?
      (I know that I'm not actually going to get anything close to that exact a duty cycle out of it, but just conceptually...)


2)  The 0.005u cap after the first schmitt trigger stage...will it limit lows? or is that actually a sufficient value?  I put a bigger cap in on mine for now, but I was wondering if there was a reason for such a small cap value there as it seems out of place somehow in my limited understanding?


synthmonger

If you set the pot up as a voltage divider you can go from 0-100 but when the pot is around noon posistion it will switch duty cycles very quickly and not have a smooth transition. Basically it'll sound really harsh. Though if you don't plan on modulation the signal with an LFO I guess it wouldn't matter.

I found a way of using a FET and an extra gate to get a smooth 100% duty cycle. I also found a neat way of getting an octave up using more of the schmitt triggers. If I get around to it I'll post a schem.

mills

Yeah, if you get the time to post a schem I'd appreciate it.

mills

Another update...

I tweaked op-amp values to get a better input and its starting to come together.

Something isn't quite right though.

Here's a ballpark schematic to show what I'm doing.  (excuse the mess... paint is the most complicated computer program I can use)



Right now, the two caps in red aren't in the circuit... I'm just unsure about the in/out of the 40106, Vb connections, and where the decoupling caps are needed.

So, I started with no cap at "1" and a cap at "2"  I was getting a weird swell into the effect when the "slew limiting" pots are at minimum.  The highend from the squarewave is present, but the lows are gone.  But, there's a swell as the lows come in and things fill out a bit.  Neither sound is quite what I'd expect given the tone out of the squarewave shaper (I a/b'd them directly... just now).  the wierd part is that it only happens on the first note I play.  If I play a scale, first note swells in, then every other note sounds the same.  I thought it might be an envelope thing, but there's not really any other modulation except that initial fade in on the first note...  so I wondered if there's something to do with a capacitor building charge somewhere?   

So, I pulled the cap at "2" and, now the swelling stuff is gone, but when the wave shaping pots are at minimum, there's a huge loss of lows.  if you move either one about 1/2 of the way up it's travel, the lows jump in...  so turning one pot from min to max, you get highs withouth lows, the lows creep back until there's  a sudden change, and then highs coming off and lows in.

And, with botht the red caps out, If I take the output from before the final op amp,  It sounds like I wanted this build too.  Huge volume, beefy lows at almost all the settings and a fairly smooth gating action without a ton of artifacts... If I can figure out what the deal with that last stage is I'll be thrilled.  If anyone has any thoughts about what could be interacting, I'd be really appreciative.  I'm pretty sure I have the pinout right on the opamp (a 4558)

mills

And now that you're all sick of this being bumped to the top...

There's some resolution.  I tried everything I could think of, got frustrated, and tried a new opamp.  Works perfectly.  Sounds great, and I'd recomend this as an alternative to the square wave shaper... not too many more parts and seems smoother to me.

I'll post the final schematic once I get some time after it's built.

Thanks for all the help and whatnot!

isildur100

Hi there,

I'd be interested in hearing a sound sample of your effect project, if that is possible. :)

cheers


mills

Yeah, once I get the final version built I'll see if I can post a rough sample.  Might be a little bit though, I'm not sure when I'll get the time to put it together.

Wasted_Bassist

I'd be interested in seeing the final schem once you finish. I have a PWM on my breadboard right now.