Smoothing Capacitor ??

Started by zpyder, January 26, 2007, 03:56:34 PM

Previous topic - Next topic

zpyder

From this article: http://www.geofex.com/Article_Folders/LFOs/psuedorandom.htm.  R.G. references a "smoothing capacitor" in the 8th paragraph which apparently rounds the corners of the LFO output's square-like wave.  Could someone (possibly R.G.) elaborate on what value of capacitor would accomplish this and possibly provide an equation?  Also, where does one place the capacitor?  It seems to be from output to ground, but that schematic ("Psuedo-Random LFO for Effects Modulation") is not quite clear to me...

thanks!
zpyder
www.mattrabe.com/ultraterrestrial Ultraterrestrial - Just doing our little part to make new rock go where it should have gone in the late-90's, instead of the bullshit you hear on the radio today.

Mark Hammer

It's generally at the point where either a) multiple control voltages are summed or b) the control voltage is applied.

For instance, in this example, discussed a few days ago, we see a "smoothing capacitor".
http://analogguru.an.funpic.de/pictures/EH_SmallStone_75_c.gif
It is the 50uf cap just beside the little box that says "To all Pins #5".  In conjunction with the 10k resistor it forms a lowpass filter that essentially slows down the charge-up time of the cap when the voltage fluctuations start to get faster than a certain speed.  The place where you want this to show up most is in the "turnaround time" as the triangle waveform peaks and starts moving back the other way.  The cap and series resistor wil soften that, but since it acts like a lowpass filter the smothing is applied to the faster frequencies and not the slower ones.  So, an LFO at 2hz might not show any impact but once you get to 3hz and faster it starts to reveal itself by rounding off the peaks.

While an obvious example in action, that isn't perhaps the best example since the SS uses a hypertriangular waveform which is already rounded on one side.  The Anderton tremolo ( http://www.generalguitargadgets.com/diagrams/catrmsc.gif ) uses a 4049 as an LFO, and feeds the LED of an optoisolator via a 2k2 current limiting resistor.  Although the response time of the LDR itself tends to "soften" the peaks at faster speeds (at which point it can't change fast enough to reflect the LFO fully), we could soften them even more if we wanted by sticking an electrolytic cap to ground from the junction of the 2k2 resistor and the LED.

Of course, your most important question was "What value, and how do I know?"  Okay, let's take the example of the SS.  An RC combo of 10k and 50uf provides a high-end rolloff starting around .32hz.  So, when the LFO kicks out a waveform of one cycle per 3sec, it passes largely unaffected, as the speed increases above that, it starts to be affected more and more.  The Ross phaser LFO is virtually identical to the original Small Stone shown here.  I stuck a 10uf cap on mine, producing a "taming" or smoothing of the LFO around 1.6hz, or just below the point where it starts to get "bubbly" sounding.

For the Anderton unit, we'll work backwards a bit, and say that we want to start rounding off stuff at about 1hz.  With a 2k2 resistor and 1uf cap, we get a rolloff at around 72hz, so obviously we will need something much larger than 1uf to do the trick.  If we use a 100uf cap along with the 2k2 resistor, we get "smoothing" around .72hz.  If we opt for a 47uf cap it gets bumped up to 1.54hz which is not too bad.

Trick is to a) figure out what the interface between the thing that is being controlled by the modulation source/s and the modulation source itself might be, and b) figure out what the relevant series resistance is so that an appropriate cap value can be calculated based on where you want the smoothing to happen.

If it is a more complex modular synth arrangement, then you can simply build what is called a "lag generator" or "slew limiter".  Schematics for these abound in the synth DIY world. I think you can also find one in issue 3 of DEVICE at my site.


zpyder

Quote from: Mark Hammer on January 26, 2007, 04:44:07 PM
For instance, in this example, discussed a few days ago, we see a "smoothing capacitor".

couldn't get this link to work...

zpyder
www.mattrabe.com/ultraterrestrial Ultraterrestrial - Just doing our little part to make new rock go where it should have gone in the late-90's, instead of the bullshit you hear on the radio today.

zpyder

Got that link to work, the problem was on my end...

Thanks a bunch Mark, your explanation really allowed me to grasp what's going on.  I did some calculations and found that for my circuit a 220uF cap will smooth out well below .1Hz, which is what I want.  So I plugged a 220uF in there and viola!, smooth ramping.  My circuit actually uses two LED's, oppositely biased, on the same LFO control line, to get both positive and negative oscillation.  Thanks to Mark's explanation of the theory, I was able to deduce that I needed to place another 220uF cap at the junction of the reverse-biased LED and the LFO output, going to +9v.  That also works great.  So thanks!

On to my remaining problem:

Both of my LED's ramp up and down smoothly, but there is a gap between timing in one direction only.  My guess is something like the two half-cycles of the LFO wave are not equal in length.  The length of the "off" cycle seems to be longer than the "on" cycle, and the result is that when LED2 (reverse-biased) ramps down, it gets to 0v before LED1 (forward-biased) begins to ramp up.  Result: there would be a moment of silence between pans in one direction if this were used for a stereo panner.  There is what looks like ample overlap going the other way.

Here's the schematic:

The LFO is entirely on the left-hand side.  The stuff on right is the bare-bones of the stereo panner I intend to drive with the LFO.  IC1 B is used as buffer only - don't even know if this is necessary.
BTW, I originally thought that using two 220uF caps per LED, in opposing bias, would help smooth in both directions.  I found this to be not true and I removed these extra caps from my protoboard.  There are doubled-up caps in the video below.

And here's a 10-second video of the circuit oscillating. :) 3.1Mb The reverse-biased LED (LED2) is above, and the forward-biased LED1 is below.  Notice the "moment of silence" between LED2 ramp down and LED1 ramp up.:
http://www.mattrabe.com/circuits/Stereo-LFO-vid.avi

Is there any way, and what's the easiest way, to ensure that the sum of the 2 LED's voltage is always as close to supply voltage as possible?

thanks!
zpyder
www.mattrabe.com/ultraterrestrial Ultraterrestrial - Just doing our little part to make new rock go where it should have gone in the late-90's, instead of the bullshit you hear on the radio today.

R.G.

It has been my experience that getting a smooth biphase triangle wave is difficult. It is especially difficult using CMOS for the oscillators.

If you're tied to the CMOS inverters for your LFO, use a CD4013 flipflop after the LFO main oscillator and you will guaranteed get a 50% duty cycle square wave out of it, as well as having a true/inverted output to run into your capacitors for smoothing.

Better, since you're using LED/LDR as a gain modulator, the LDR timing will cover up a multitude of sins in driving the LEDs less than smoothly. An incredibly simple and flexible way to do this is with CMOS ring counter to make a triangle wave through resistor networks. The counters can't NOT do what you want them to once you get the circuit right.

Or even more simply, generate a triangle with either a one- or two-opamp integrator/Schmitt trigger, then invert it around the reference voltage of the Schmitt. You could probably get by with one dual opamp there, and no 220uF caps.

Another way to do this is to put the LEDs on the collectors of a diffamp and set the total LED current with the current source in the emitters of the diffamp. Hang one of the diffamp bases on the reference voltage, then feed the other base with a triangle wave that is resistor-divided down to about 30mV, centered on the reference. This will smoothly drive the LEDs out of phase, and since the diffamp saturates at over 25mV across the bases, it will smooth the input triangle into a low distortion sine.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

gez

#5
Quote from: R.G. on January 26, 2007, 07:54:23 PM
If you're tied to the CMOS inverters for your LFO, use a CD4013 flipflop after the LFO main oscillator and you will guaranteed get a 50% duty cycle square wave out of it,

Somewhere in the archives is a simple circuit I posted that uses the first half of a Flip flop as a clock (One 4013 to do both jobs)

Edit

Reply No 5 here:

http://www.diystompboxes.com/smfforum/index.php?topic=36559.0

Low current LEDs would have to be used to prevent loading the outputs of the flip flop.
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter

zpyder

Quote from: R.G. on January 26, 2007, 07:54:23 PM
If you're tied to the CMOS inverters for your LFO, use a CD4013 flipflop after the LFO main oscillator and you will guaranteed get a 50% duty cycle square wave out of it, as well as having a true/inverted output to run into your capacitors for smoothing.

Better, since you're using LED/LDR as a gain modulator, the LDR timing will cover up a multitude of sins in driving the LEDs less than smoothly. An incredibly simple and flexible way to do this is with CMOS ring counter to make a triangle wave through resistor networks. The counters can't NOT do what you want them to once you get the circuit right.

Are these not the same thing?  From http://www.geofex.com/Article_Folders/LFOs/psuedorandom.htm I get the impression that they are the same thing??  A ring counter made from D-type flip-flops....

zpyder
www.mattrabe.com/ultraterrestrial Ultraterrestrial - Just doing our little part to make new rock go where it should have gone in the late-90's, instead of the bullshit you hear on the radio today.

R.G.

QuoteAre these not the same thing?  From http://www.geofex.com/Article_Folders/LFOs/psuedorandom.htm I get the impression that they are the same thing??  A ring counter made from D-type flip-flops....
No, they're not the same thing.

Some capacitor basics: When you apply a step in voltage to an R-C network, the voltage on the cap cannot change instantly, but in the long run it cannot conduct DC. The voltage on the cap one nano-femto-second after the voltage changes is the same as before the change, but it changes toward the DC value with a decreasing exponential. That is, the voltage on the cap changes proportional to e^(t/RC) where t is time and RC is the product of the R and the C. At one time constant, (t = RC), the voltage has changed 0.632 of the total amount it will change. When t = 2*RC, it has changed by 0.632 of the remaining voltage and so on.

The voltage response of an RC lowpass is then a rounded-off step which approaches the new value every more slowly as time goes on. In a sense, it rounds off the edges of the stepped voltages, and so it got called a smoothing capacitor. In fact, it's acting as an imperfect low pass filter, or an imperfect integrator.

In the article I covered a lot of things. The initial pseudorandom thing shows how to connect schmitt trigger gates to get a random-ish thing, and to smooth that with caps. The ring counter things showed how to make a counter make an approximation of a triangle wave. In the ring counter examples, a smoothing cap will smooth off the little stair steps much more readily than a cap can make a single square wave into a triangle.

I bring that last up because that's what your circuit does. It feeds two square waves to two caps to get a rounded rising and falling edge. Here's what's wrong with that for an LFO. Unless the RC time constant is much larger than the longest time period of the square waves feeding it, all it does is to round over the rising and falling edges. This rounding is a constant rate, so as you change the speed of the LFO, the roundness of the edges remains the same but the time between edges changes, so the shape of the LFO changes with its speed.

For a real triangle sounding LFO, you need an LFO edge that changes slope as the LFO speed changes. A simple cap won't do that.

A counter derived triangle will give you a changing slope because the sides of the triangle really do change slope as you speed up the LFO. Here's another advantage to you on the ring counter-triangle LFO: If you invert the outputs of the counter that make the triangle and sum the inverted outputs into an identical resistor network, you get an inverted triangle that is *exactly* the inverse of the main triangle, including DC level and timing. It takes some more chips, but they are very, very simple chips.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.