Adding CV + Modulation to Gain Amp

From circuitbending to homebrew stompboxes & synths, keep the DIY spirit alive!

Moderators: Kent, luketeaford, Joe.

Post Reply
User avatar
Uncle Peter
Learning to Wiggle
Posts: 9
Joined: Thu Feb 11, 2021 1:48 pm
Contact:

Adding CV + Modulation to Gain Amp

Post by Uncle Peter » Thu Feb 11, 2021 2:09 pm

Hello,

So I'm in the process of drawing up an EQ circuit and one of the things I would like to add is CV and a pot to attenuate the CV signal. I've been doing some research on how exactly to add CV into a circuit although there doesn't, at least to me, appear to be a clear way of doing so (talking about vactrols, JFETs, etc.).

Here's my specific scenario (see circuit below). I have a simple op-amp configuration with a filtered audio signal, resistor R1, pot P1 and generic op-amp. The idea is to add a CV input jack and an attenuator pot to, in essence, change the resistance seen at P1, in order to vary the gain of the output signal. I still want to keep the pot P1. The way I'm envisioning it is that the pot P1 provides a fixed resistance value, while the CV+attenuation circuit adds a variable resistance component to this fixed value, kind of like having the two in series, if that makes any sense.

So, what exactly is the easiest way to do this?


-Uncle Peter
cv circuit.png
cv circuit.png (35 KiB) Viewed 244 times

socom93
Common Wiggler
Posts: 93
Joined: Sun Mar 24, 2019 1:19 pm
Location: France

Re: Adding CV + Modulation to Gain Amp

Post by socom93 » Thu Feb 11, 2021 2:54 pm

If i get you correctly, you want a VCA.

User avatar
Uncle Peter
Learning to Wiggle
Posts: 9
Joined: Thu Feb 11, 2021 1:48 pm
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by Uncle Peter » Thu Feb 11, 2021 6:35 pm

socom93, I guess in a way yes :D !

A VCA where the voltage that controls the amplification is CV that can be attenuated by a pot, but also has a pot for control when no CV is present.

socom93
Common Wiggler
Posts: 93
Joined: Sun Mar 24, 2019 1:19 pm
Location: France

Re: Adding CV + Modulation to Gain Amp

Post by socom93 » Fri Feb 12, 2021 12:42 am

You can take a look at MFOS VCA. He gives a lot of details on how he designed it.

User avatar
Uncle Peter
Learning to Wiggle
Posts: 9
Joined: Thu Feb 11, 2021 1:48 pm
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by Uncle Peter » Fri Feb 12, 2021 6:59 pm

That's exactly what I did, socom93, and it has convinced me that the easiest way to fix my problem is using a LM13700 OTA. This was the circuit diagram I went off of, which was very helpful:

http://musicfromouterspace.com/analogsy ... CA001.html

From what I could understand, it looks like Ray is using the LM13700 for gain control of the audio signal, via the LM13700's bias input pin 1. It's a really neat idea and after a bit of research, I've managed to put together a circuit diagram based off of Ray's that I think will work. Here is the circuit:
eq circ 1_small.png
I should point out right away that the diagram is not exact in terms of component values, I just wanted to start by putting the components in the correct places. Exact values will have to come once I do a bit more testing/calculating.

So, here's how I think it should work. CV comes in from J1 jack and can be attenuated by a pot (R10). The TL084 op-amp acts as a weighted summer between the CV and a fixed DC-source+pot combo (for manual gain variation when no CV is present). Resistors R8, R9 are present to create the current that will ultimately control the gain via input into the LM13700's pin 1. The audio signal is inputted into the J4 jack and into the non-inverting input of the LM13700. The output of the LM13700 is passed into its internal buffers, then through resistors R16 and R17, where the output voltage can be extracted.


Some things I am not entirely clear on:

1) What is the exact relationship between current being inputted into LM13700's pin 1 and gain (or output voltage)? I assume this is how to determine the values of resistors R8, R9 and R16, R17, by biggest concern at the moment.

2) The presence of the trimpot (R18) and what exactly it sets. It appears to act as a voltage divider, perhaps for attenuation?

Comments and criticisms are much appreciated. I wouldn't be surprised if I made an obvious mistake! :mrgreen:

User avatar
bgreeves
Common Wiggler
Posts: 131
Joined: Fri May 26, 2017 2:33 pm
Location: Illinois, USA
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by bgreeves » Fri Feb 12, 2021 8:29 pm

for manual gain variation when no CV is present
If you only need manual control when there is no CV, then you can do what you're trying to do with just one potentiometer. Pretty much every 3.5mm mono jack plug has a "switching" contact which connects to the tip when there is no jack present. You could use that to "default" (what you'll see called "normalling" or "normalizing") the input CV to something like 5V, 10V, 12V, whatever you have handy. So when there's no cable plugged in, the pot can be used to manually adjust the gain from 0 to whatever your default is, and when a cable is plugged in, the pot switches to attenuating the incoming CV.

User avatar
bgreeves
Common Wiggler
Posts: 131
Joined: Fri May 26, 2017 2:33 pm
Location: Illinois, USA
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by bgreeves » Fri Feb 12, 2021 8:40 pm

Uncle Peter wrote:
Fri Feb 12, 2021 6:59 pm
So, here's how I think it should work. CV comes in from J1 jack and can be attenuated by a pot (R10). The TL084 op-amp acts as a weighted summer between the CV and a fixed DC-source+pot combo (for manual gain variation when no CV is present). Resistors R8, R9 are present to create the current that will ultimately control the gain via input into the LM13700's pin 1. The audio signal is inputted into the J4 jack and into the non-inverting input of the LM13700. The output of the LM13700 is passed into its internal buffers, then through resistors R16 and R17, where the output voltage can be extracted.
Seems you've got it figured out 8-)
Uncle Peter wrote:
Fri Feb 12, 2021 6:59 pm
Some things I am not entirely clear on:

1) What is the exact relationship between current being inputted into LM13700's pin 1 and gain (or output voltage)? I assume this is how to determine the values of resistors R8, R9 and R16, R17, by biggest concern at the moment.

2) The presence of the trimpot (R18) and what exactly it sets. It appears to act as a voltage divider, perhaps for attenuation?

Comments and criticisms are much appreciated. I wouldn't be surprised if I made an obvious mistake! :mrgreen:
Regarding (2), yes, it's there to help you fine-tune the attenuation of the input signal. The LM13700 is only linear (read: non-distorting) for signals in roughly the 100mV range, so you have to do some pretty hefty attenuation to get the input signal (in modular, usually 10VPP, but up to 20VPP) to not distort when going through the OTA.

You might ask "well why not just use a fixed resistor value to get a known attenuation level", and I think the reason its tunable via the trimmer is because some LM13700s are better/worse than others in this regard. Or maybe because there is no common resistor value that combines with 100K to get the exact perfect attenuation level you want. Probably a mix of both reasons.

Regarding (1), this is where it gets tricky and you lose my expertise. The one thing I do know is that the gain is directly proportional to the input current. The exact formula has a bunch of physics nerd constants in it if I recall correctly. I might have to go all RTFM on you and direct you to the datasheet (in fact I'm gonna go have a peek, cuz now you've got me curious).

User avatar
guest
Super Deluxe Wiggler
Posts: 5611
Joined: Mon Aug 19, 2013 11:49 am

Re: Adding CV + Modulation to Gain Amp

Post by guest » Fri Feb 12, 2021 8:53 pm

your schematic above is missing the resistor on the OTA output. but, id also reccomend a few simple changes to get better performance. first, dont use the onboard darlington buffer, and instead use the other half of your opamp for a transimpedance amp. second, the offset trim circuit on the MFOS VCA is not good. instead, replace it with 1k resistors to ground at each input, with a 1M going to a trimmer between the rails for the offset. finally, your CV will close off the VCA as it gets higher in the current configuration. if you dont want this, there are a few ways around this. one is to switch to a non-inverting amplifier configuration, another is to use a transistor in the feedback loop, and a third is to skip the opamp altogether and just use a transistor with its base connected to ground, and a resistor between the emitter and the CV input.
openmusiclabs.com

User avatar
bgreeves
Common Wiggler
Posts: 131
Joined: Fri May 26, 2017 2:33 pm
Location: Illinois, USA
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by bgreeves » Fri Feb 12, 2021 9:01 pm

The formula for transconductance is:

Iout (amps) = (Vin+ - Vin-) (volts) * gm (transconductance)

Screen Shot 2021-02-12 at 5.48.25 PM.png

If I'm reading this right, I think at room temperature, 1 uA of control current gets you 20x amplification, and 10 uA gets you 200x. Plugging that into my Desmos 3000, I get:

gm = 2 * 10^7 * Iabc

More than likely you're gonna wanna just take this as a rough estimate and experiment with it on a breadboard.

Also be aware that the LM13700 is known to have some issues with feedthrough (like the signal will still come through a little bit even with 0CV). I also think they're pretty easy to fry if you accidentally send a little too much juice into Iabc.

There are alternatives, like ready-made quad-VCA in a chip like the SSI2164 or AS3360. You can also make a VCA out of a pair of transistors. Lots of options!

User avatar
Uncle Peter
Learning to Wiggle
Posts: 9
Joined: Thu Feb 11, 2021 1:48 pm
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by Uncle Peter » Sun Feb 14, 2021 11:55 am

Thank you for your responses Ben and guest, you have both given me a lot to think about.

Ben, that's a great point about using the audio jack to switch between CV and manual variation. That would also eliminate the op-amp that was acting as a weighted summer between the two or make it available for use as a transimpedence amp, as guest mentioned. Thank you for the graph as well, definitely useful numbers to go off of.

I think I'm confident enough now in the circuit that I can order the components and begin breadboarding. One idea I did have was to change the R9 and R17 (or equally R8 and R16) resistors to trimpots, just for finer tuning of the input bias and signal output. Also to Ben's point about the LM13700 being easily fryable, I am thinking of adding a BJT before the bias input of the LM13700, as guest suggested, to act as a current controlled switch and ideally tune it so that the BJT switches off before the LM13700 becomes fried or turns off.

I should also mention that the signal input will be filtered audio, via a passive RC bandpass filter. I had originally decided on active filtering via a simple op-amp configuration, but I don't see this as necessary now since the LM13700 is providing the gain variation.

The entire module idea is that there will be several of these circuits, each tuned to filter out a range of audio frequencies, then amplify/attenuate these frequencies via CV or manual variation, with the ability to extract these specific filtered sounds from each circuit as outputs. A final weighted summer will also recombine all these outputs to a single output, similar to a standard EQ module.

User avatar
bgreeves
Common Wiggler
Posts: 131
Joined: Fri May 26, 2017 2:33 pm
Location: Illinois, USA
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by bgreeves » Sun Feb 14, 2021 1:03 pm

Sounds neat. If you want further inspiration, I'm sure you can find a couple existing circuits by searching "voltage controlled EQ"

User avatar
neil.johnson
Super Deluxe Wiggler
Posts: 1630
Joined: Thu Apr 08, 2010 3:51 pm
Location: Cambridge, UK
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by neil.johnson » Sun Feb 14, 2021 2:54 pm

Uncle Peter wrote:
Thu Feb 11, 2021 2:09 pm
The idea is to add a CV input jack and an attenuator pot to, in essence, change the resistance seen at P1, in order to vary the gain of the output signal. I still want to keep the pot P1. The way I'm envisioning it is that the pot P1 provides a fixed resistance value, while the CV+attenuation circuit adds a variable resistance component to this fixed value, kind of like having the two in series, if that makes any sense.
You want a VCA. P1 then provides one of two control voltages to the VCA. The other comes from your CV jack, via attenuator.

If you're controlling audio then you might want the VCA to have a log/audio response, such as the 2164 type. The LM13700 types are linear control, from which a linear CV would produce a linear response, much like using a linear pot as a volume control (all the action is in the first quadrant).

Good luck with your project!

Neil
Random ramblings :: http://www.njohnson.co.uk
SSI parts and more :: https://www.cesyg.co.uk

User avatar
Uncle Peter
Learning to Wiggle
Posts: 9
Joined: Thu Feb 11, 2021 1:48 pm
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by Uncle Peter » Sun Feb 14, 2021 3:33 pm

Neil, that is a very good point. I will need to look into this as well. From the MFOS VCA circuit I am referencing, there is a section for log response. To my understanding, it looks like a pair of BJTs are taking attenuated CV and outputting what I assume is log current, with respect to linear CV.

I wonder if I would need log potentiometers as well.
Last edited by Uncle Peter on Sun Feb 14, 2021 3:35 pm, edited 2 times in total.

User avatar
Uncle Peter
Learning to Wiggle
Posts: 9
Joined: Thu Feb 11, 2021 1:48 pm
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by Uncle Peter » Sun Feb 14, 2021 3:34 pm

As I go through some of the current calculations, one thing has become unclear. How exactly do resistors R8 and R9 create the current that flows into the bias input of the LM13700 and how can I calculate this current value? (this value will ultimately decide what values R8 and R9 should be).

My calculations are telling me that the current value at the node between the two resistors should be zero, since there is no "load" that draws the current into the bias input, but of course this can't be right. It seem I may be overlooking something here!

User avatar
guest
Super Deluxe Wiggler
Posts: 5611
Joined: Mon Aug 19, 2013 11:49 am

Re: Adding CV + Modulation to Gain Amp

Post by guest » Sun Feb 14, 2021 4:47 pm

the bias input to the LM13700 is the equivalent of 2 diodes in series connected to -12V. so you find the difference between the opamp output and -10.8V (12V - 2x0.6V) and divide by the resistance to get the current. in this case, since there are 2 resistors, the calculation is a bit more complicated as you have to figure out how much current is going through the other resistor. but, this is just 1.2V/R, and then you subtract that from the amount coming from the opamp.
openmusiclabs.com

User avatar
Uncle Peter
Learning to Wiggle
Posts: 9
Joined: Thu Feb 11, 2021 1:48 pm
Contact:

Re: Adding CV + Modulation to Gain Amp

Post by Uncle Peter » Tue Feb 23, 2021 1:04 pm

So my LM13700 came in a few days ago and I've been breadboarding some circuits since, some successful some not. I've had the best success with the following VCA circuit from Electric Druid:

https://electricdruid.net/wp-content/up ... scaled.jpg

Conceptually it appears similar to the original circuit I posted, except a PNP BJT is used to aid in current regulation. I tweaked the values a bit to get more relevant results, here is my version in Falstad:

https://tinyurl.com/y9vqsey7

Now for some numbers from my test with this circuit. Lets call the voltage output from the gain pot (i.e. across the 300K resistor) Vin. The decibel value is with reference to the original inputted audio also.

Vin=+2.96V, Iabc=486μA, 0dB
Vin=+4.18V, Iabc=661μA, +3dB
Vin=+5.92V, Iabc=920μA, +6dB

Not bad results. There appears to be a sqrt(2) scaling factor here, in order to double dB levels. Extrapolating these results suggests that if I wanted a +12dB increase in gain, a Vin=8.37V and Iabc=1300μA would be required, still under the 2mA limit. This circuit still needs some tweaking though, as I would like a +12dB increase to correspond to a Vin=+5V, as per CV standards. Most likely I'll need to change the 300k resistors to different values.

What I particularly like about this circuit is that the 6K8 resistor on the collector side of the PNP BJT acts as a voltage/amplification limiter, depending on its value. So suppose I wanted a max amplification of +12dB, I would simply pick a resistor value that results in an Iabc of ~1300μA across it (or whatever the actual value is for +12dB). This way, even when the gain pot is turned high and a CV is present, the amplification cannot go higher than +12dB.

User avatar
guest
Super Deluxe Wiggler
Posts: 5611
Joined: Mon Aug 19, 2013 11:49 am

Re: Adding CV + Modulation to Gain Amp

Post by guest » Tue Feb 23, 2021 2:15 pm

glad to hear you got something up and running. you might consider varying R4 to get the amplitude you want. the 13700 runs best at 250uA or so as a max value. so if you have 5V in create 250uA, with the 6.8k setting a current limit of 500uA, you can then tweak R4 for the gain you want.
openmusiclabs.com

Post Reply

Return to “Music Tech DIY”