Normal behavior Anderton Compressor

Started by Ksander, June 06, 2023, 02:51:48 PM

Previous topic - Next topic

Ksander

Dear all,

I have built a compressor based on the schematic from the Craig Anderton book 'Electronics Projects for Musicians'. It might be working, but I'm not entirely sure because there doesn't seem to be much compression going on.

Other than the original:
(1) Instead of two batteries, I used a CMOS 555 as a voltage inverter to get +/-9V, as done here: https://www.diystompboxes.com/smfforum/index.php?topic=124739.0. I then use one op-amp of a TL074 to create a virtual ground. When fed into the Anderton circuit, I measure something between +/-7V and +/-7.5V between the diodes;
(2) For IC1A and IC1B, I used two of the other op-amps in the TL074; for IC2, I used a uA741;
(3) The 220kOhm input resistor has been substituted with a 150kOhm resistor and the 47kOhm resistors to the inputs of the op amp in IC2 are substituted with 33kOhm resistors because this is what I had;
(4) I built a vactrol with an LDR and a flat-headed yellow LED, glued together and wrapped in heat-shrink. In the dark, it measures 1MOhm, and with the LED lit it measures 2kOhm. I chose a yellow LED because it seemed to light up the best in the circuit, when compared with red and green LEDs

When in use, I can get a pretty huge boost using the output pot. The sound is also surprisingly clean and noise-free, so I believe that the voltage inverter solution works well.
When I vary the the compression pot, there is a noticeable drop in the overall level of the output when it is at its maximum, but I'm not sure I can really hear a compression effect. Given the range of the LDR, I'd expect the gain of the first op-amp stage to vary between approximately 3.33 (1MOhm||1MOhm -> 500kOhm/150kOhm) and 0.013 (1MOhm||2kOhm -> 2kOhm/150kOhm). It may very well be that I misunderstand something, and I don't know what the range of gains should translate to in terms of sound. So, what do you think: is it working as it should?

For reference:


Rob Strand

#1
You might first want to check that with no signal the outputs of all the opamps are at 0V. 

You can put a second LED and resistor on the output of IC2 to get an idea if the detector is
doing something.

The way you check this stuff is with a sine oscillator.
Set the compression pot to half way.
- input a 1kHz sine wave
- sweep the input level over a few points
  (needs to be carefully chosen, and depends on the but 10mV, 30mV, 100mV, 300mV, 1V would be a good start)
- measure the output level
- Extra marks:
     Measure the current through the opto LED.
- plot the gain
  Check that it has the shape of a compressor.

Extra marks:
If you have characterized your opto,
- take the measured LED current
- work predict the opto resistance from you characterization
- do the gain calculation with the opto resistance
- compare the gain with what you measured.

Something that can happen is you might have characterized your DIY opto over a certain range of
currents but the circuit limits the LED current to something much lower than that range.  As a result
the range of resistances is much narrower and you don't get full gain reduction.  In this case
you need to increase the LED current.  For this circuit that would be reducing R1 (1k5).
If you have 9V, the opamp might only swing 7V, you have 1.7V drop across the LED, so
the maximum LED current is: (7 - 1.7)/1.5k = 3.5mA, which is pretty low.

If you look up the datasheet for the original opto you can see what opto resistance to expect
for a current of 3.5mA.   Then you could choose the resistor R1 so your DIY opto
has the same opto resistance.

Looks like about 500 ohm at 3.5mA
https://pdf.datasheetcatalog.com/datasheets2/81/81939_1.pdf




The 500ohm is already lower than your 2k ohm.   If your 2k ohm is at 20mA then your DIY opto is going to be about 10k at 3.5mA.  Way too high.   However, if you 2k is at low current you might be able to change R1.

What can you do?
- Experiment with different LEDs: larger, brighter, different color, to get a lower resistance out of your DIY opto.
- Use a lower resistance LDR;  ideally without reducing the Dark resistance.
- Scale-up the resistances around IC1A.   Unfortunately there's not a lot of room for doing this unless
  you want it to be noisy.   If we limit R9 to 470k then,  R9 = 470k and, R8 = 2.2M would work like the original
  with a DIY opto of double the resistance of the original opto.

Another point is the maximum attenuation isn't what you hear.  It's probably better to match attenuation (and LDR resistance) at some point over the threshold.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Mark Hammer

Human vision is most sensitive to wavelengths around yellow, so don't confuse how bright the LED looks to you vs how bright it looks to the LDR (which will normally have an area of peak spectral sensitivity).  That doesn't mean you've done anything "wrong", just that the appearance of no audible compression could be because strumming a guitar does not produce enough LED glow to make the LDR change a lot.

Since you're not using an LM301, with compensation cap, it's quite possible the 33k to the non-inverting pin of the LED driver is not required.  A 1M feedback resistor in that stage, with a 33k input resistor, should provide more than enough potential gain to light up the LED.  It's worth noting that Jack Orman's Whisper Compressor is very close to the Anderton circuit, but uses a TL061, rather than an LM301.  Instead of a compensating cap between pins 1 and 8 of the 301, Jack sticks a small value cap in the feedback loop of that op-amp, to reduce any ripple in the envelope.  But given the greater gain of the input stage, when using a 150k input resistor, as well as the LED driver stage, by using a 33k input resistor, there's a good chance you're pushing the LED hard enough to drop the stage 1 gain waaaaaayyyyyy down.    You probably want to drop the gain of the LED driver a bit.  If you have a 680k or even 470k resistor, use that for the feedback resistor, in place of the 1M shown.  That will allow the full rotation of the compression pot to be more useful.

If you've never used one, an audio probe can be invaluable as a troubleshooting tool.  This is just a normal guitar cord, plugged into the amp.  But instead of a phone plug on the "incoming" end, there is an alligator clip for attaching to a usable ground in the circuit, and a cap with a nice stiff long lead, connected to the "hot" conductor.  A .1-.22uf "greenie" is about right.  The free end of the cap can be used to probe the audio signal where its presence, absence, or level can be informative about the status of the circuit.  The cap prevents any DC from going to the amplifier, so you only hear audio signal, and not hum.

The way this circuit operates, compression WILL reduce the output level, by dropping the combined parallel resistance of the LDR and 1M feedback resistor low.  That's why the output stage with the 100k feedback pot has a gain of a little over 12x - to compensate for how the first stage's gain drops so much.

Ksander

Wow, thank you both so much for the elaborate responses. I'll have to go over all those details, which may take some time!

Rob Strand

#4
I checked out what would happen if the opto was way off and it's surprisingly robust.   As expected the amount of gain reduction does poop out if the minimum opto resistance (with the LED currents in the circuit) is too high.  It's definitely worth characterizing you DIY opto with a few points ILED vs Resistance; perhaps even at ILED = 100uA.   It can be helpful correlating gain with measured voltages and currents when debugging.

For debugging/checking, the overall gain of the unit depends where you set the gain pot.  If you set the gain to full and input about 100mV rms to 1V rms the output should limit to around 0.5V rms to 0.65V rms; perhaps a tad lower with the 33k's instead of 47k's.   (Craig Anderton quotes peak to peak which translates to about 0.6V to 0.8V rms.)

QuoteWhen in use, I can get a pretty huge boost using the output pot.

QuoteYou probably want to drop the gain of the LED driver a bit.  If you have a 680k or even 470k resistor, use that for the feedback resistor, in place of the 1M shown.  That will allow the full rotation of the compression pot to be more useful.

As far as the usability goes.   The unit does have a little too much gain.

Something that can make usability worse is the compression and gain pots should log taper pots.  I'm sure some people use linear taper pots and it makes usability poorer.    Even with a 100k log gain pot the unit still has a little too much gain.

With a log taper compression pot the side chain gain, set with the 1M and 47k resistors, should be OK.   The threshold produced isn't too far off other compressors, although many compressors have even lower thresholds (which means *increasing* the 1MEG)   I was thinking if you expect extreme compression maybe that would make the unit sound like you expect.

Beyond that, the attack and release time constants tend to be all over the place with optos.   It's possible the time constants on your LDR are making it sound different to what you expect.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.

Ksander

Yesterday evening, I tried a few of the (smaller) things on the list of suggestions:

- The indicator LED was already present. I should probably have mentioned that! It responds quite nicely to an input signal, and also in proportion to the compression pot: no light is visible at its lowest setting, whereas the LED lights up for nearly as long as the sound is audible at the highest setting;
- Shorted the 33K resistor to the non-inverting input of IC2. This had no notable effect on the working of the circuit;
- Looked up the optimal wavelength for the LDR in the datasheet (5528). This is 540nm, which would be green light. I therefore replaced the vactrol with a green one (also homemade). Previously it was inserted in these press-fit thingies; now I soldered it in place to make sure that there is no issue of loose contacts. Replacing the vactrol also did not have a notable effect on the sound. As an aside, I had previously already made two of each, for red, yellow and green LEDs, to try them out. From subjectively eyeballing their behavior in the circuit, red LEDs seemed to respond the least; yellow and green responded about the same;
- I replaced the resistors around IC1A with the suggested values of 470kOhm and 2.2MOhm. There might indeed be a bit more noise, but otherwise there is no apparent difference in the sound.

From the fact that the circuit responds to the settings of the pots, it seems that at least the LED driver and IC1B are doing their jobs. As a next step, I'll make an audio-probe and listen in to the output of IC1A. At this point, the gain reduction in response to the LED should be obvious? I also plan to make some recordings and compare the waveforms on my PC. This may reveal differences (between bypass and 'effect engaged') that are there, but which I just do not perceive...

Characterization of the vactrol LED/LDR for extra marks would be nice, but I'll try the less labor-intensive things first  ;)

Ksander

#6
It appears it is working. Here are two recordings (just strumming an E chord on a strat); one without the effect, and one with. Both samples are normalized to compensate for the difference in signal level. It is odd I don't hear it. Maybe what I expect is a sort of 'quack', which I do get from my Orange Squeezer...



Rob Strand

#7
Looks like it's doing something like a compressor.

It could very well be the time constants for your opto making it sound like it is.   You can't really change the time constants without modding the circuit a fair bit.
Send:     . .- .-. - .... / - --- / --. --- .-. -
According to the water analogy of electricity, transistor leakage is caused by holes.