LFO idea and schematic

Started by mth5044, June 29, 2013, 08:08:23 PM

Previous topic - Next topic

mth5044

I've been thinking about how to implement an LFO onto four separate LEDs which will eventually pair with 4 LDRs. Each LED would have the ability to be turned off and on without drastically changing the brightness, rate or other parameters of the other LEDs. Upon looking at other LFO ideas on this forum, puretube (I think? and many others) have posted putting two LEDs on the end of an LFO, one with it's anode to 9V and cathode to the LFO output, then another LED with anode to LFO output and cathode to ground. In this way, the LEDs would alternate brightness instead of the same pattern. I adapted the idea in the schematic below:



Some things I'm concerned about - the LFO not being able to power all LED's at one time. Not enough current, possibly. I'm also thinking that adding more LED's is going to load the LFO as the number of LED's increase, dimming the brightness. Is there a better way to implement this simple idea?

I'm guessing this is going to be another example of simple ideas not usually simply carried out.

artifus

cool. consider inverse led's also. and using npn's or fet's instead of ldr.

armdnrdy

Quote from: mth5044 on June 29, 2013, 08:08:23 PM
Some things I'm concerned about - the LFO not being able to power all LED's at one time. Not enough current, possibly. I'm also thinking that adding more LED's is going to load the LFO as the number of LED's increase, dimming the brightness. Is there a better way to implement this simple idea?

Use a transistor as a switch for each LED. Instant LED driver. The LFO voltage hits the base of the LED, the LED is powered by it's own voltage.

Google transistor as a switch. Also at Geofex under 4053 switching......which might come in handy for what your doing as well.
I just designed a new fuzz circuit! It almost sounds a little different than the last fifty fuzz circuits I designed! ;)

R.G.

Why don't you use current mirrors?

Five NPNs make a one-in, four-out current mirror, and four PNPs on the top side make four independent current switches. You can linearize the NPNs with a 22 ohm or so resistor if you want to make them track well, but usually you get away with any five from the same batch being close enough.
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.

Kesh

#4
if you don't want to change your circuit then use a higher current output op amp than the LM4558, and maybe low current tolerant LEDs and bigger resistors. quite a few LEDs don't lose as much brightness from a drop in current as you'd expect.

if you do optocoupling, Silonex optocouplers use lower LED current then VTL5C ones

mth5044

So forgetting the LED switching for a second and focusing more on the current mirrors and PNP supply switching:


(note the LFO has changed a bit)

Is this a combination of things you all were talking about? Current mirrors are something I've never looked at before, but after reading through a web page it seemed it was pretty simple as two transistors and a supply voltage. I have worked with transistor switching and I didn't know they could be a 'variable switch' with the LFO - I guess I was stuck in the 'hi or low' mentality. Would the 22 ohm resistor RG was talking about go between the base of Q1 and the other 4 transistor bases?

Why were PNP switches suggested for switching? I used NPN's (2N3094 IIRC) to switch LED's in a similar fashion - is there more benefit to using PNP's in this situation or in general? Also, I picked BC550 based on other schematics I saw online, is this appropriate?

Kesh - thanks for the info on the variation of opto's. I was planning on rolling my own since 4 vactrols add up pretty quickly.

Going to artifus's comment about using transistors instead of LED/LDRs - would I still need the current mirror set up, or would it simply be sending out the LFO to a 220ohm resistor then simply split to the bases of 4 BC560's? That seems like it may be easier than all this LED work. Would there be any way to inverse the LFO to the transistor bases if this were done (as in the original idea)?

armdnrdy

Are you wanting to control the vactrols LEDs to operate in unison or independently in some manner?

If they are to operate in unison, take a look at the Mutron Bi-phase schematic for ideas.
I just designed a new fuzz circuit! It almost sounds a little different than the last fifty fuzz circuits I designed! ;)

mth5044

I'm aiming for the LED's to be independent in terms of being on or off as well as the phase of the LFO sweep into each LED (normal or inverse), but then in unison in the fact that they have the same rate and depth if they are on. I will try to decipher the bi-phase schematic. Thanks!

Would putting a simple switchable inverting unity gain opamp between the base of the PNP switch and of the NPN current mirror transistor flip the phase of the LFO? I'm a bit confused as the current will bypass the opamp - ultimately I'm a bit confused as to what the LFO looks like once it reaches the LED. Would an inverting opamp do anything at all? 

armdnrdy

I'm not real sure what you are going to use this for. How are you planning to control the LEDs independently and to accomplish what effect?

Having the whole picture in mind might help in getting the correct information.
I just designed a new fuzz circuit! It almost sounds a little different than the last fifty fuzz circuits I designed! ;)

mth5044

At this point it's was just a circuit block I was considering. Having four (or more by adding more current mirror transistors) LED's controlled by a single LFO shining on LDR's across pots or in a circuit. LED's could be switched on or off to control modulation and the phase of the LFO could be inverted for each LED. I have a pt2399 circuit it could be cool with, but someone else could use it as a building block in other circuits.

amptramp

#10
Check your schematic again.  You are not getting current mirror operation.  If VA is 5 volts and the transistor emitters are at 9 volts, you have a transistor exterminator with a low-impedance 4 volt supply from base to emitter.  One usable implementation would be to put the 4k7 collector resistors in series with the emitter of each PNP transistor instead of the collector.

R.G.

#11
Here's what I had in mind.



The input takes in a current, Iin, which may be driven by a voltage through a resistor to give Iin = (Vin-Vbe)/Rin. This isn't shown.

The four NPNs follow the input current. It's not perfect in this version of a current mirror, but probably good enough.

The PNPs switch LEDs on and off. They must be pulled to ground to turn an LED on, left open or pulled up to +9V to turn it off.
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.

mth5044

Thanks for the schematic. I'm guess we need some kind of limiting resistor for the LED's somewhere between + and - . So each A, B, C and D would have a SPST connecting for ground to allow power to the LED which would be modulating based on the LFO.

I guess a question (or more of a clarification) is that the current isn't actually modulating at all, it's only the voltage? Therefor a unity gain inverting opamp would work to invert the voltage as the current would typically circulate around the opamp. Working on a schematic now!

Thanks everyone.

Also, thanks for time traveling back in time for the post, RG. 21013 must be an awesome year. Unless you can tap into your future circuit library. I guess the PNP switching never goes out of fashion.

R.G.

Quote from: mth5044 on June 30, 2013, 07:44:22 PM
Thanks for the schematic. I'm guess we need some kind of limiting resistor for the LED's somewhere between + and - .
Actually, no, you don't. The action of a current mirror is that the NPNs all work at making their collector currents the same (within some tolerance) and so the resistors are redundant. You can make them be more the same across all five NPNs by putting small (10-22R) resistors in the emitters, but the LEDs are driven from collector currents, and the currents all follow the input current.

QuoteSo each A, B, C and D would have a SPST connecting for ground to allow power to the LED which would be modulating based on the LFO.
The PNPs act just like SPST switches, or relays. If you are selecting the LEDs with hard switches, it's OK just to use the switches where the PNPs are. But if you are selecting the PNPs from other circuitry, it's easy to drive the PNPs from electronics.

QuoteI guess a question (or more of a clarification) is that the current isn't actually modulating at all, it's only the voltage?
No, it's really a current that's being controlled. Literally, the four "slave" NPNs try to make their collector currents be the same as the current into the input. If you can control the *current* into the "Iin" terminal, the slaves will follow Iin.

Difficulty understanding current mirrors is another of those blind spots we nearly all get from being "voltage-centric" and thinking that the voltage comes first, and the current is a result of that. This is a current-controlled current circuit, primarily.

If all you have is a voltage you're using to modulate this, then you can fake a controlled current into Iin by using a resistor to convert the input voltage to a current. If you have an LFO output of 0-5V, then nothing happens as the voltage rises from 0 to 0.4 or 0.45V, then there is enough voltage to turn on the Vbe of the first NPN. If you have a resistor between your modulating voltage and the NPN base, then the current into the master NPN becomes I = (LFOvoltage-Vbe)/R, which is nearly linear. If you happen to have an LFO voltage that runs from 0.4V to, say, 5.4V, then the current into the master NPN can be substantially linear with the incoming voltage. But it is the *current* that matters.

Here's another wrinkle that I've used, but never seen very often. As Craig Anderton used to say, the human ear prefers things that vary exponentially. It was the basis of the hypertriangle LFO from PAIA in one or the other of their kits. The current in a semiconductor junction is an exponential function of the voltage across it. So if you could make your modulating *voltage*  be 0V to perhaps 0.7V, and feed that into the current input in voltage mode, letting the input NPN's base-emitter junction take only the current corresponding to the incoming voltage, then the current in all of the NPNs would be an exponential waveform, and would sound KEWL. But this is tricky to do well.

QuoteAlso, thanks for time traveling back in time for the post, RG. 21013 must be an awesome year. Unless you can tap into your future circuit library. I guess the PNP switching never goes out of fashion.
... ooops...  :icon_redface:
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.

mth5044

QuoteActually, no, you don't. The action of a current mirror is that the NPNs all work at making their collector currents the same (within some tolerance) and so the resistors are redundant. You can make them be more the same across all five NPNs by putting small (10-22R) resistors in the emitters, but the LEDs are driven from collector currents, and the currents all follow the input current.
Makes sense!

QuoteThe PNPs act just like SPST switches, or relays. If you are selecting the LEDs with hard switches, it's OK just to use the switches where the PNPs are. But if you are selecting the PNPs from other circuitry, it's easy to drive the PNPs from electronics.
Also makes sense! I gave electronic switching a few thoughts and I have used it elsewhere, but I think I like the idea of those little black sliding toggles for now.

QuoteNo, it's really a current that's being controlled. Literally, the four "slave" NPNs try to make their collector currents be the same as the current into the input. If you can control the *current* into the "Iin" terminal, the slaves will follow Iin.

Difficulty understanding current mirrors is another of those blind spots we nearly all get from being "voltage-centric" and thinking that the voltage comes first, and the current is a result of that. This is a current-controlled current circuit, primarily.

If all you have is a voltage you're using to modulate this, then you can fake a controlled current into Iin by using a resistor to convert the input voltage to a current. If you have an LFO output of 0-5V, then nothing happens as the voltage rises from 0 to 0.4 or 0.45V, then there is enough voltage to turn on the Vbe of the first NPN. If you have a resistor between your modulating voltage and the NPN base, then the current into the master NPN becomes I = (LFOvoltage-Vbe)/R, which is nearly linear. If you happen to have an LFO voltage that runs from 0.4V to, say, 5.4V, then the current into the master NPN can be substantially linear with the incoming voltage. But it is the *current* that matters.

Before I dive off the deep end into hypertriangle wave forms (I have a few of those electric druid LFO chips which I believe have that waveform? Perhaps something to try out later), I'm going to try to understand the basics of what you posted  :icon_lol:

Now that I'm thinking about it, I had just supposed the output of the LFO in question was 0 - 4.5V. Thinking about it more, I'm only basing that off of the divider at the negative input of the first opamp. Can anyone recommend a free software simulator were I could look at what is coming out of this (and future other) circuits?

If I want to convert the LFO voltage to amps with the assumptions that 1) the peak output of the LFO is 4.5V and 2) that I want to modulate between 0mA and 20mA to take an LED from off to full bright it would just be R = V/I = 225 ohm or a 220 ohm resistor. I'm confused as to what the (-Vbe) bit of the master NPN equation you have posted.

My mind is still blown about inverting amps like a voltage  :icon_redface:

R.G.

Quote from: mth5044 on July 01, 2013, 03:56:06 PM
If I want to convert the LFO voltage to amps with the assumptions that 1) the peak output of the LFO is 4.5V and 2) that I want to modulate between 0mA and 20mA to take an LED from off to full bright it would just be R = V/I = 225 ohm or a 220 ohm resistor. I'm confused as to what the (-Vbe) bit of the master NPN equation you have posted.
The "-Vbe" comes in because your LFO voltage may be going between 0V and +4.5 V,  but no current at all is going to flow into the input of the current mirror until the voltage gets high enough to turn on the Vbe diode. So the lowest Vbe of the LFO voltage is lost to you for making current (which is what matters to the current mirror) flow into the input. Effectively, the Vbe is subtracted from the total amount of voltage you can put into the input, so the current through a resistor from an LFO **voltage** source is the LFO voltage, Vin, minus Vbe.
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.

mth5044

Doh, just hit me that the first transistor may be acting like a diode, thus the Vbe (base and emitter, the part that snuck by me). That explains what you were talking about before with the the 0.45V or so turning on the first transistor. I seem to have found that it typically is 0.7V for 2N3904's, so, if we want the current to be 20ma, we got R = (4.5 - 0.7)/0.02 = 190 ohms or the common 180 ohms will get ~21ma.

So, the output of the depth pot goes to a 180 resistor into the first npn and the rest is history?

mth5044

Something like this?



and if that checks out, could I add an inverting device like this to have separate inversion control over all four LEDs?


*just saw a mistake in that the output of the op-amp doesn't reach up to the switch terminal, but pretend that it does.

R.G.

Quote from: mth5044 on July 01, 2013, 08:57:30 PM
Doh, just hit me that the first transistor may be acting like a diode, thus the Vbe (base and emitter, the part that snuck by me).
Yes.
Quote
That explains what you were talking about before with the the 0.45V or so turning on the first transistor. I seem to have found that it typically is 0.7V for 2N3904's, so, if we want the current to be 20ma, we got R = (4.5 - 0.7)/0.02 = 190 ohms or the common 180 ohms will get ~21ma.

So, the output of the depth pot goes to a 180 resistor into the first npn and the rest is history?
MMMMMaybe.

In your schematic, you have a depth pot of 1M in series with a 180 ohm resistor. The effective range of the depth pot is remarkably compressed into the 0-ohms end.

You have to drive the 180 ohm resistor with an impedance that's significantly lower than the 180 ohm resistor itself. I'd use that 1M depth pot as a volume divider and drive the + input of another opamp, the output of which would drive the 180R.  It's a PITA, but it is a remarkably good place to insert an offset to raise the actual LFO above and below some DC level to make up for that Vbe off set on the current mirror.

The other thing you could do is to put a two-PNP current mirror up at 9V, and then SUCK current from that one's input. This lets you convert to a current immediately without the voltage offset being an issue.

LFOs need a lot of tinkering to get the DC, AC, and ranges right.
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.

mth5044

#19
Makes sense. I'm familiar with using an op-amp stage as a buffer, and even as an amplifier, but to use it to offset a voltage is a bit unknown. So I figured I'd mess around with an op-amp calculator and see what happened and came up with this:



Feeding the noninverting side with 5.2V, when 0V is coming in from the LFO to the inverting side, we get 5.2V out. When we feed 4.5V into the inverting side we get 0.7V out, the turn on voltage for Vbe. That was a bit of a shot in the dark, but it seem to make sense? Not too big of a deal, what's two TL074's and five transistors anyway  :icon_lol:

How about the inverting buffers on the current mirror side, would they do their job?

As far as using a two PNP current mirror, I think I'll stick with the op-amps if they work. The current mirrors are still a little obtuse to me.