Speaking of "did you ever get the idea" ...

Started by Transmogrifox, September 30, 2005, 04:12:40 AM

Previous topic - Next topic

Transmogrifox

How many of you have twiddled with the pulse-width modulation scheme for a tremolo?

I discovered last night that it works very well when using two switches from the CD4066: one series, one shunt and clocked out of phase with eachother.  Actually, very similar to the thing modulator (am I thinking of the right ring mod circuit?) except clocked with a 60 kHz signal that is pwm.  It was a rather smooth and nice sounding trem, using a simple phase shift LFO sine circuit.

Well, as I was messing with it, I thought, "what if I just whip up a simple higher audio frequency oscillator here and try using it as a ring modulator?"

Lo and behold, it's beautiful.  The carrier is relatively silent if you can match the input and output DC potential to a precise degree of accuracy.

This is one of those ideas that could make a great audio frequency multiplier circuit if one would put the time and energy into refining it.   My next experiment with this circuit is to make a pair of them and drive them out of phase with the inputs out of phase as well so that the then add the two paths together in the end so the bleed-through carrier is more likely to cancel, and I can achieve a good 100% depth where the two outputs are equal and cancel.  It may make an interesting tremolo when there is a phase reversal at every half cycle of the carrier frequency.

I will provide schematics as I experiment for those of you who are experimentalists who like ring modulators.

I played with it for 2 hours making bells, gongs, and DTMF telephone sounds from my guitar.  Reminds me of some sounds I have heard on more recent Joe Satriani albums...The carrier bleed through wasn't out of control until I turned on the high gain channel in my amp.  I know much of it was in the ground, since it got really loud when plugging in the cable and touching the tip to ground.
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.

Hal

um......i didnt really get that....but sounds cool!!!!

octafish

I'm always willing to try out another ring mod :icon_biggrin:
Looking forward to the schems 'cause I'm not real familiar with these chips.
Shoot straight you bastards. Don't make a mess of it. -Last words of Breaker Morant

petemoore

   Interesting post Transmografox, cool concept, and that it's working for you is really cool...
  I need to brush up on my vocabulary and comprehension before typing more Kudos...I don't want to stick my foot in my mought !!!
   8)
Convention creates following, following creates convention.

GFR

I never tried tremolo but I and a friend tried a similar thing for a pwm limiter (back in 1987). There was a series and a shunt switch, modulated by the input envelope. The PWM attenuator was in the feedback loop of an opamp. It was very quiet and gave good limiting, very distortion free (even playing slap bass) IF the power supply was very good.

The most difficult thing is getting comparators that are fast enough (the lm339 I used is not).



Thanks to ImageShack for Free Image Hosting

I know MXR made a PWM limiter, but I've never seen the schematic.

I once tried a simple ring modulator using a single opamp and a switch to swap the gain from +1 to -1, the feedthrough was too much :(

Transmogrifox

QuoteI never tried tremolo but I and a friend tried a similar thing for a pwm limiter (back in 1987). There was a series and a shunt switch, modulated by the input envelope.

GFR--You had sent me that schematic a while ago when I posted my first attempt at the PWM Trem.  That first time around was fair, I was using a much lower frequency and using the output of the LM339 as a shunt switch to ground.  It was hard to get good depth without exceeding the 339's response to smooth pulse width change, at which point you would hear a pop.

The schematic you have provided inspired me to do the series-shunt configuration.  I did the math on it, and found that I could get much better extinction, and a more linear amplitude transfer from the LFO waveform.


I'm working on the experiment tonight so hopefully I'll have a schematic soon for those of you who are curious as to how it works, more specifically.
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.

GFR

Transmogrifox,

If you look at my schematic, there's a detail that's working against me. I'm using the switching inside the feedback loop of the opamp. So since the opamp is internally compensated I can only filter the switched signal with a first order RC filter because if I use a higher order filter it will oscillate (confirmed :)).

If you're doing a tremolo, your switching is most likely NOT inside a loop, then you can switch at much lower frequency than I did and just use a steeper filter to cut the high frequency stuff.

BTW I think there's a thread somewhere on the forum about class T amplifiers you may find this interesting. If I'm not mistaken they use a modified signa-delta modulation.

Sigma-delta modulation (noise shaping opversampling blahblah...) means you compare the analog input with an analog reconstruction of the digital output. The digital output (1 bit) is the comparator's output sampled at a very high frequency. The reconstructed analog is just this one bit stream integrated by a RC filter. So the digital output says "up, up, up, down, up, down..." and that's how it represents the waveform. The frequency needs to be very high so that you can have big enough slew rate and small enough amplitude steps.

Transmogrifox

I have done some more tinkering and designing.

Here's the schematic of the PWM ring mod/ trem so far:
http://putfile.com/pic.php?pic=10/29301490054.jpg&s=x10

I have not shown an LFO, or HFO since I am still trying to iron out distortion and noise problems right now and the modulating control voltage source is a secondary concern to me at this point.

The first experiment was a series-shunt resistive deal.  It worked relatively well, but the full modulation depth was not possible and it would click/pop on the on/off extremes as tremolo, and would have increased clock feedthrough for ringmod settings.

I therefore put two together driving the inputs out of phase (similar to the schematic I have shown) but with the outputs seperately filtered and added together. This worked well for getting good extinction, and added the reverse-phase effect as well.  Unfortunately, the noise and distortion in this setting was horrendous.

I then decided to simplify it a bit with the current schematic.  I had been using a triangle wave generator based on the all-too-popular "bang-bang & integrate"  op-amp shmidt-trigger gettup, but I was finding that the drift and amplitude instability was adding too much noise for this application.  I checked out a Fluke scopemeter from work to verify this (the scope has been helping a ton with this design).

The current ramp generator is a modification of something I found on the 4QD website for PWM motor control.  They were using a resistor instead of a current mirror for a little less linear ramp.  A little math revealed that a current source would make the ramp quite linear.  After going through all the math to determing the oscillation frequency and amplitude relationships, I recalled the ramp generated used by GFR in his PWM limiter posted in this thread.  The ramp generator he used is almost identical except that he uses a resistor bias network to control the current through the pnp transistor.  For some reason I like the simple current mirror.  Now, for the LFO and audio ring oscillators, this ramp generator makes an excellent VCO with the current mirror, since the frequency changes linearly with the amount of current forced into the capacitor, which is quite linearly dependent on the voltage applied to the grounded side of the 15k resistor in the current mirror.

Anyway, the scopemeter shows that this oscillator (ramp generator) is very very stable.  The AC RMS voltage did not change down to 3 decimal places on the TrueRMS setting.  The frequency drift was on the order of 300 Hz max over a relatively long period of time (like 10 seconds) so there was not much frequency drift noise that would be audible (even so, 300 Hz is like .29% error). 

So my final problem was crossover distortion on the op amps.  I was using LM358's because I had a bunch laying around when I breadboarded this circuit.  It still reaked of fizzy distortion that I had at first though was carry-through of oscillator noise.  Further investigation of the LM358 datasheet revealed that the current sinking abilities are not wonderful, and the current sinking curve is gross, so going from 0 current to several mA leaves a horribly ugly looking crossover distortion to the signal.   Adding the 3.3k resistors to ground to bias up the class A half of the output helped on the scope, but the scopemeter does not give the type nor precision of information I would need to determine if it made the distortion acceptably inaudible. 

So here I am.  I have designed to the next stage and tested it with a scope, but have not tried it with the new ramp generator and class A bias on the op amp outputs.  I thought I would post the schematic for those of you who expressed interest in seeing this, though.
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

Oh, and for you interested in seeing the formula to express the oscillation frequency and amplitude, let me know and maybe I will have time to scan it in.  I calculated that the ramp generator would oscillate at 102.845 kHz (or .8 something) and the actual oscillator on the scope was going at around 102.4 kHz, and drifting by about +/- 150 Hz, so I know my calcs are good.  I also verified it using PSPICE.  The physical circuit followed the calculations much more closely than PSPICE did, however.  I did expect it to be slightly slower (as it was) since I did not factor in the fall time of the capacitor discharging through the diode on the reset cycle.  I put another diode in paralell with the one and the frequency changed to within 30 Hz of the predicted frequency, but then became more noisey where the amplitude was bouncing around quite a bit.   I decided I liked the stability from just one diode. 

I can also take some photos of the meter display for the educational value.  It's too late now...moving on toward midnight and I have to go to work tomorrow. 

And most importantly, I'll post soundclips if it ends up sounding cleaner this time around.  All this technical stuff doesn't mean much to most of you, but a good guitar effect sound will say it all.  A meticulously designed pedal that doesn't sound good is about as wonderful as  a meticulously sculptured piece of dung.
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.

Paul Perry (Frostwave)

Quote from: Transmogrifox on October 21, 2005, 03:50:30 AM
about as wonderful as  a meticulously sculptured piece of dung.

..not that there is anything wrong with that, of course! http://news.bbc.co.uk/2/hi/uk_news/england/4168915.stm
I've always had trouble with PWM schemes, because of poor behavior as the pulse gets 'thin', but maybe it was stray capacitance in the prototyping. If anyone can recommend a common switchmode power controller that makes a good simple PWM controler straight off, that would be appreciated! Easy to do with a PIC micro  but I don't want to go there right now. :icon_rolleyes:

Transmogrifox

Great article.   ;D  Gave me my daily chuckle.  It reminds me of the "Smurf Poles" here in Juneau, AK.  The capital building got some new external lighting and the building manager somehow decided that smurf blue poles were a great color for the capital building (though the color matches nothing nearby).  Only a couple days up and they gained the nickname "smurf poles".  The big power in the state came by and said "This ain't gonna fly", so they have taken them down for repainting.
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

I have now tried the circuit from the schematic I posted at putfile (a few posts previous to this one).  I think this is darn near it.  I am currently prototyping using LM358's, so the sound quality is fine for the low-gain, high-feedback configuration.  It sounds clean now--not so much on the distorted fizzly stuff coming through.  Adding the bias on the output of the 358's was probably the biggest kicker, then using a lower noise oscillator certainly helped.  I didn't hear ANY of the carrier frequency coming through, even with my amp on the high gain channel.  It was just static pssshhhhhhhhh noise with a couple crackle & pop sounds which may have been due to oscillator bounce, or it could easily have been noise fed it from my modulation reference, being a 1Meg pot so the input noise there is not negligible.

In addition, the perfect null point (silence, depth, what have you) is very hard to tune in.  part of the problem is the noise, part I think may be common mode input.  The 358's are not famous for having exceptional common mode rejection, so I think a higher end op amp would help some.  I think my next experiment will be to decrease the input resistance of the next stage to help the PWM switches also vary the gain on the next stage--see if I can get a little more change in amplitude for change in pulse-width.

Then I think I may play with frequency...but for now I think I'm going to start trying to come up with a good pair of VCO's, one LFO and one for audio frequencies.  Between two, I can add them together and do all kinds of fun things, even modulate the frequency of the high frequency VCO with the LFO.  This is almost starting to sound like DIY synth stuff, but this circuit's going into a stompbox when it does what I like.
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.