envelope follower help?

Started by daverdave, July 15, 2010, 12:36:57 PM

Previous topic - Next topic

daverdave

hey all, I'm trying to design an envelope follower that will drive an led. I've used a standard half wave precision rectifier going into a non-inverting / inverting amplifier in order to switch between up and down sweeps. The circuit doesn't seem to function properly, I have a feeling it has something to do with the inverting amp part. I've only rigged up the amp to a single power source (9V) so the power supplies are between 9V and ground, and the unused input is going to ground also. I thought this should work as the input is only half a cycle, am I right in thinking this?

Ice-9

From how you describe this, it sounds like you power is not correct as an op amp will require a bias supply weather you only want half the signal or the full +/- signal. The power requirements are the same.

It would help if you submitted a schematic of circuit you are trying to get to work for others to spot any problem areas.
www.stanleyfx.co.uk

Sanity: doing the same thing over and over again and expecting the same result. Mick Taylor

Please at least have 1 forum post before sending me a PM demanding something.

daverdave

I tried biasing the unused input at 4.5V but it still doesn't work. I'll try and draw up a schematic to post.

daverdave



Here's the schem anyhow. It's not working right though, doesn't seem to react to the guitar signal.

slacker

I think the first opamp is connected wrong on the schematic. Pins 2 and 3 should be flipped so the input is to pin 2, it also needs a 1M resistor in series between the cap and the input , pin 3 should then be biased to half the supply not ground.

Have a look at the examples here for more info http://sound.westhost.com/appnotes/an001.htm although they are drawn for a bipolar supply so you would use half the supply instead of ground.

daverdave

Ah that was a mistake on the schem, the actual circuit has the input going to the inverting input of the rectifier, here's the correct one:


daverdave

Quote from: slacker on July 15, 2010, 03:03:53 PM
I think the first opamp is connected wrong on the schematic. Pins 2 and 3 should be flipped so the input is to pin 2, it also needs a 1M resistor in series between the cap and the input , pin 3 should then be biased to half the supply not ground.

Have a look at the examples here for more info http://sound.westhost.com/appnotes/an001.htm although they are drawn for a bipolar supply so you would use half the supply instead of ground.

I can understand the 1M resistor, would that be to keep unity gain for the recifier? But I can't understand the need for the reference as only the positive cycle of the wave is used, I looked at a few schems for help like the meatball. The envelope in that just uses +9V and ground, no ref voltage. I might give it a go and see what happens, thanks for the help.

Gurner

that pin 3 def need to go to half your supply (4.5V) not gnd.

Also you still need a series resistor between  pin2 and the right hand leg of the 1uf cap, a non inverting amp should look like thus...

http://www.radio-electronics.com/info/circuits/opamp_inverting/op-amp_basic_inv.gif  ...your cct is missing R1 - ignore the fact they've the +ve pin a gnd - yours is a single supply so needs to be at half supply.



PRR



As Ian says... It looks like +in and -in on the first '741 are swapped? (Not negative feedback.) {EDIT -later corrected.}

I would expect an input resistor, to work against the 1Meg to define gain. The pot gives an uncertain gain, until full-up, where it attempts to be "infinite" gain (which is not a good thing). {EDIT - as Gurner says.}

> the power supplies are between 9V and ground

If the inputs of a '741 are within a few volts of the supply rail, it won't work right.

The plan shows input near ground. If - power pin is also ground, the '741 input is not working correctly.

Jacking the inputs to half-supply is not elegant. Now your rectifier output is floating up at half-supply, "always on".

The LM324 inputs will stay working at the negative supply rail. That's often a good choice for single-supply DC processing.

There's more issues downstream. The inverting amp's 10K input swamps the 100K decay pot. Or would, is a '741 input were effective near the - supply rail. And since the rectifier swings positive of ground, the opamp output should swing negative of ground- with the single supply, it can't. And what does a negative swing do for the LED? If it were a bipolar lamp like an incandescent, it still goes "more". (The LED will of course stay dark.) What you want is to bias the lamp "on" and subtract the signal to get "less".

What does the 1K pot to the Darlington's base do? (Nothing.)

Why a Darlington? The '741 can deliver about all the current any normal LED needs.
  • SUPPORTER

slacker

#9
The meatball uses an LM1458 for it's envelope follower, that's a "single supply" opamp and on a single supply the input can go down to ground and it will work. If you use a normal opamp like a TL072 or whatever then it can only handle inputs down to about 1 volt above ground so you can't connect it's inputs to ground, you have to reference them to half the supply or some lower voltage that it's happy with.

EDIT: Paul beat me to it but it might be useful info anyway.

Following on from what Paul said, if you look at the Nurse Quacky schematic that uses a resistor and an LED to set the positive input to just above where the opamp will still work, and then uses a LED in series with the output to remove the DC offset, so the output sits roughly at 0 volts with no input. That will avoid the rectifier being "always on".

http://www.home-wrecker.com/nurse-quacky.html

daverdave

Thanks for the help guys.

I've added a 10k resistor after the 10uF input cap. I'm actually not using LM741s, I'm using a TL072 dual opamp, would that work better near the supply?

As I know opamps require dual supplies generally, I wasn't sure due to the fact that the rectified signal is only half a cycle. In my head the non-inverting input is kept at 0V, which keeps the inverting input at the same, 0V. Since only the top cycle needs amplifying I though that might be the case with the second opamp, which is set to be either a non-inverting or an inverting.

Would adding a smaller resistor, say a 1K, in series before the 100K pot stop it swamping the second opamp?

daverdave

Ah thanks slacker, that answers the meatball question. So if I biased the non inverting inputs at around 1V or something then it should function. Would the diode on the output of the rectifier not remove the DC biase anyhow? I know diodes have a smaller voltage drop than leds.

Gurner

Just a small clarification

Quote from: slacker on July 15, 2010, 04:41:38 PM
The meatball uses an LM1458 for it's envelope follower, that's a "single supply" opamp and on a single supply the input can go down to ground and it will work.

You need a 'rail to rail' opamp for that ....& not all single supply opamps are rail to rail.


slacker

I never knew that I thought rail to rail and single supply meant the same thing. What differentiates them then?

PRR

#14
Is a dual-supply not possible?

Single-supply precision rectifiers are tough. You usually need more parts. However along the way you may find that a full-wave is little more trouble than a half-wave. Full-wave has less ripple and acts consistently on asymmetrical waveforms.

One popular "trick" is to invert the negative wave, and leak the positive wave around the now-dead opamp. Beware: the output impedance is very high on the "cheated" half-wave, you need to consider this.

Rod Elliot is always worth a read:
http://sound.westhost.com/appnotes/an001.htm  {EDIT: Mick beat me}

This one is very neat:
http://www.discovercircuits.com/DJ-Circuits/fullrect.htm

I don't think the opamp types are critical (however LM324 may be a better bet than '741). I do not believe it needs "stable +5V reference" for your uses; everything has the same reference so it all cancels. The 0.1% resistors are overkill, bread it with 2% parts and get it to a point you can listen, then decide if the low-level errors matter.

The AC filter is Average, not Peak. You want another precision diode and a decay resistor to the half-reference potential.

The output stage can be swopped from sweep-up to sweep-down by moving the bottom "5.00V" point to ground.

This seems a very neat FW single-supply:
http://www.electronics-circuits.net/single-supply-precision-rectifier-vt258.html

The poster boasts how thrifty it is. Using a less-thrifty but faster amp such as LM324 it will sure cover the guitar range (and no Rset).

The gain is well-defined unity. In most audio uses, 2% resistors would be fine.

It is naturally a peak rectifier with a tolerable decay resistor.

At 5V or 7V, D2 is not really needed.

The AD820 sheet shows a unique idea which depends on some unusual property of the AD820 inputs.
http://www.analog.com/static/imported-files/data_sheets/AD820.pdf
  • SUPPORTER

PRR

> LM1458 .., that's a "single supply" opamp

The 1458 does not claim to be single-supply, and the input won't work at the negative rail. It is rated for inputs to be at least 3V off the rails. The schematic suggests it won't choke until 2V off the negative rail.

Link to this "meatball"?

> I thought rail to rail and single supply meant the same thing. What differentiates them then?

ALL opamps can work "single supply". They don't need to know where Ground is. You keep the signal well within the supply rails. The basic opamps won't swing (input or output) close to a supply rail.

This may matter to the circuit. Here you expect the input to work near the supply. '741 won't. TL072 won't: the input common-mode range on +/-15V supply is rated +15V and -12V, you can't take an input within 3V of the negative rail. (Aside from it not amplifying as expected, the '07x series will violently high-out if either input gets to a volt up from the negative rail.)

You are also expecting a '741 or '072 output to swing to the negative rail. The '741 might get close to a volt. The '072 will get closer, some tenths of a volt. Note that this is similar to the dead-band of a simple (non-opamp) rectifier, so you've added complication and gained nothing.

So there is a use for an opamp that will work with inputs "at" negative rail and output will swing "very-very close" to negative rail. This is often sold as "Single Supply".

There is also a market for an opamp which will work with ins and outs close to negative rail -or- positive rail. You find "rail to rail" on these blurbs. Read the fine print: it may be only the input, only the output, or "close" may not be close enough for your needs. 
  • SUPPORTER

Gurner

Quote from: slacker on July 15, 2010, 05:06:59 PM
I never knew that I thought rail to rail and single supply meant the same thing. What differentiates them then?


What differentiaes them? Dunno! & when you think about it, single supply vs dual supply is a bit of a misnomer from an opamp perspective ...it'll always have two 'power' pins  ...whether the -ve power pin is ground or a true negative voltage ...so long as you've your biasing right ...who cares?!

But there's an awful lot of single supply opamps that aren't rail to rail. (ie use Digikey's search to confirm!)

slacker

#17
Quote from: PRR on July 15, 2010, 05:43:08 PM
> LM1458 .., that's a "single supply" opamp

The 1458 does not claim to be single-supply, and the input won't work at the negative rail. It is rated for inputs to be at least 3V off the rails. The schematic suggests it won't choke until 2V off the negative rail.

Yeah you're right, I got confused. I'd mistakenly thought the Dr Q pedal used an LM1458, which is why I thought it was single supply, but I was wrong it was the modified Nurse Quacky version I linked to above which used it.

Quote
Link to this "meatball"?

http://notinteractive.com/stuff/guitar/fx/mc-meat.pdf

Quote
So there is a use for an opamp that will work with inputs "at" negative rail and output will swing "very-very close" to negative rail. This is often sold as "Single Supply".

There is also a market for an opamp which will work with ins and outs close to negative rail -or- positive rail. You find "rail to rail" on these blurbs. Read the fine print: it may be only the input, only the output, or "close" may not be close enough for your needs.  

Cheers that makes sense.

daverdave

This is the link to the mcmeat project:

http://notinteractive.com/stuff/guitar/fx/mc-meat.pdf

I tried biasing the non inverting inputs at 4.5V, and then through the 10K / LED voltage divider as in the nurse quacky schem. Neither made the circuit work. As I said, I added a 10k resistor in series after the input cap. Not sure what's going wrong to be honest, I've traced over the layout and can't see any dodgy connections or obvious faults.

daverdave

Quote from: PRR on July 15, 2010, 04:29:07 PM


As Ian says... It looks like +in and -in on the first '741 are swapped? (Not negative feedback.) {EDIT -later corrected.}

I would expect an input resistor, to work against the 1Meg to define gain. The pot gives an uncertain gain, until full-up, where it attempts to be "infinite" gain (which is not a good thing). {EDIT - as Gurner says.}

> the power supplies are between 9V and ground

If the inputs of a '741 are within a few volts of the supply rail, it won't work right.

The plan shows input near ground. If - power pin is also ground, the '741 input is not working correctly.

Jacking the inputs to half-supply is not elegant. Now your rectifier output is floating up at half-supply, "always on".

The LM324 inputs will stay working at the negative supply rail. That's often a good choice for single-supply DC processing.

There's more issues downstream. The inverting amp's 10K input swamps the 100K decay pot. Or would, is a '741 input were effective near the - supply rail. And since the rectifier swings positive of ground, the opamp output should swing negative of ground- with the single supply, it can't. And what does a negative swing do for the LED? If it were a bipolar lamp like an incandescent, it still goes "more". (The LED will of course stay dark.) What you want is to bias the lamp "on" and subtract the signal to get "less".

What does the 1K pot to the Darlington's base do? (Nothing.)

Why a Darlington? The '741 can deliver about all the current any normal LED needs.

I added the darlington pair to drive the leds, the envelope will drive 8 optocouplers for a phase shifter. The 1K pot provides some attenuation to the ammount of current to the led as far as I can see.