### Author Topic: Question about mosfet as variable resistance  (Read 596 times)

#### craftyjam

##### Question about mosfet as variable resistance
« on: January 27, 2021, 09:34:38 PM »
Hello,
I have a question about the correct configuration of the mosfet in either of these situations.
Assume an lfo volage will trigger the gate, thereby turning on and off the mosfet.
I'm not quite sure how to deliver the VR to the op amp in order to power the filter.
In the LDR version, the LDR is simply placed between VR and the noninverting pin.
My understanding is that I may need a p-channel mosfet for the same configuration to work with a mosfet.
Thank you for answering simple questions for people like me!

« Last Edit: January 28, 2021, 02:04:24 PM by craftyjam »

#### R.G.

##### Re: Question about mosfet as varaible resistance
« Reply #1 on: January 27, 2021, 11:21:31 PM »
First, some background about opamps. An opamp with negative feedback tries to make the output be whatever voltage on the output that drives the inverting input to be as close to the voltage of the non-inverting input as possible. So you need some connection from the Vref to the non-invering input. In the case of a phase shift circuit, which is what I think you're doing, you need a resistor to Vref from the + input. The MOSFET can parallel this resistor, as in general it's not useful for the MOSFET to go all open-circuit on your opamp. A 100K to 1M resistor in parallel with the MOSFET will be fine.
If I were making this, I'd use your top circuit with a large value resistor from drain to source of the MOSFET.

Driving the MOSFET requires some thought. MOSFETs act like variable resistors IF AND ONLY IF the voltage across the drain and source is "small". "Small" means in practice that it's well under one silicon diode forward drop of about 0.6V without other special arrangements in the circuit. There are a number of reasons for this. But in practice, if you drive the circuit with more than about 200mV peak of signal, you start getting distortion from the MOSFET not acting like a resistor.

MOSFETs used as resistors need the source to be held to some relatively fixed voltage; in this case, Vref needs to be a fixed DC value, and well decoupled to actual ground. The gate drive voltage to the MOSFET is then the difference between Vref and the actual gate voltage. For enhancement mode MOSFETs, nothing at all happens in the channel from drain to source until the gate is enhanced by the gate threshold voltage. For small MOSFETs, this is generally 1.5 to 5V. So your LFO sweep voltage will need to rise from Vref by more than that amoung or there will be no resistance change. That's for N-channel MOSFETs. For P-channels, the source would still be held at Vref, but nothing will happen until the gate is more than the gate threshold lower than Vref. Which way you set it up depends on how your are powering your opamp: that is, what the relative voltages from power supply to Vref to ground are in your circuit.

I find it complicated to get MOSFETs to act as a good variable resistor in practical circuits. Not that it's impossible, but complicated and fussy.
R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?

#### craftyjam

##### Re: Question about mosfet as varaible resistance
« Reply #2 on: January 28, 2021, 05:23:09 AM »
I find it complicated to get MOSFETs to act as a good variable resistor in practical circuits. Not that it's impossible, but complicated and fussy.

I see. Thank you for all the helpful knowledge. I couldn't seem to find info on using a mosfet as a variable resistance online, but this has helped me greatly. After I noticed the arangement used in the frantone vibutron, I though it might be interesting to incorporate into another circuit. The vibutron features a trimmer from the gate to ground, and also is in a tremolo configuration with the source to ground. So in this instance, the rimmer is increases until the gate voltage is a small voltage above ground? I can see why it would be significantly more difficult to incorporate this in what I've drawn out. If I were to use a bipolar power supply, I could then reference the mosfet to ground in my current configuration, correct?

#### iainpunk

##### Re: Question about mosfet as varaible resistance
« Reply #3 on: January 28, 2021, 08:29:17 AM »
Quote
But in practice, if you drive the circuit with more than about 200mV peak of signal, you start getting distortion from the MOSFET not acting like a resistor.
having slight distortion in phasers is actually desired, to a point that a distortion free phaser just doesn't sound good. up to 5% THD is nearly undetectable, and 5 to 10% is more 'coloration' than actual distortion. so don't be afraid of that,
for the rest, that's a really great write-up!

cheers, Iain
half man - half snail - 6 feet to scale - Snail man's - not frail - He's been - to jail - snail man is fuccing real
『ｓｎａｉｌｐｉｌｌｅｄ』

#### antonis

##### Re: Question about mosfet as varaible resistance
« Reply #4 on: January 28, 2021, 09:39:53 AM »
As you've permanently grounded Gate & Source, VGS=0 so you need a function generator output of a couple of Volts, at least..

ICL8038 output (Vpeak-to-peak) gives about:
Sine = 0.22 * VCC
Triangle = 0.33 * VCC
Square = 0.9 * VCC
so you might need to raise the gain of 741 op-amp, depending of particular output waveform..

"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

#### craftyjam

##### Re: Question about mosfet as varaible resistance
« Reply #5 on: January 28, 2021, 02:03:30 PM »
As an aside, how would one figure out the resistance of a MOSFET in the linear region?
Is it dependent on a variable in the datasheet, or similar among all?

#### Rob Strand

##### Re: Question about mosfet as variable resistance
« Reply #6 on: January 28, 2021, 02:42:29 PM »
Quote
As an aside, how would one figure out the resistance of a MOSFET in the linear region?
Is it dependent on a variable in the datasheet, or similar among all?

IIRC it works out to be something like,

rds = rds0 / (VGS/VT - 1)

You get VT from the threshold in the datasheet, about 2V for 2N7000.  Then you work out rds0 by matching the rds0 spec at the VGS specified in the datasheet.

The main issue with MOSFETs is the rds0 is a small value resistance.   Much lower than JFETs.   That affects the scaling of the rest of the circuit.

A while back I posted a "better" method for using a MOSFET as a controlled resistor.  It wired the  MOSFETs in series, there's two ways to do it.   The scheme doubles resistance and helps increase the voltage you can put across the MOSFET.

You can add linearization schemes to the MOSFET like you do with JFETS.   The main issue with the MOSFETs is the body diode.

I posted the method on the forum once or twice including diagrams but I can't find the post.

EDIT:
Here's one, see reply #42,
https://www.diystompboxes.com/smfforum/index.php?topic=52905.0
« Last Edit: January 28, 2021, 02:48:34 PM by Rob Strand »
The internet:  answers without the need for understanding.

#### craftyjam

##### Re: Question about mosfet as variable resistance
« Reply #7 on: January 28, 2021, 03:05:36 PM »
Ah ok I see. Does the series MOSFET configuration impact the necesary gate voltage to get the MOSFET's into the ohmic region?

Also as another aside, this circuit must have a bipolar power supply if the fets are being referenced ground for the op amp bias voltages right?
Or am I missunderstanding something about differential amplifiers?

If I'm not pushing my luck already, how would one analyze the frequency response of the output of the differential amplifier with a filterted signal on one input and the unfiltered signal on the other?

« Last Edit: January 28, 2021, 03:33:14 PM by craftyjam »

#### antonis

##### Re: Question about mosfet as variable resistance
« Reply #8 on: January 28, 2021, 03:32:20 PM »
Alternative to what Rob said, the "ideal" current-voltage characteristics in "triode region" (VDS < VDS(sat))

is described by the equation: iD = Kn[2(vGS - VTN)vDS - v2DS]

where VTN = threshold voltage (N for n-channel) and Kn = conduction parameter (depended on channel Width to Length ratio, Oxide capacitance per unit area and inversion layer electrons Mobility)

But, IMHO, it's always better/safer to measure/verify your specific device channel resistance under particular circumstances..
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

#### Rob Strand

##### Re: Question about mosfet as variable resistance
« Reply #9 on: January 28, 2021, 03:54:19 PM »
Quote
Ah ok I see. Does the series MOSFET configuration impact the necesary gate voltage to get the MOSFET's into the ohmic region?
The series connection doesn't affect the required gate voltage.  However, linearization schemes can affect the gate voltage if they are DC coupled; you get the same problem with JFETs.

Quote
Also as another aside, this circuit must have a bipolar power supply if the fets are being referenced ground for the op amp bias voltages right?
Or am I missunderstanding something about differential amplifiers?
It will work with a bipolar supply however you can move the MOSFET source connection to a fixed DC voltage.  The same trick is used for JFET phasers,

http://www.lynx.net/~jc/phase45modded.gif

Quote
If I'm not pushing my luck already, how would one analyze the frequency response of the output of the differential amplifier with a filterted signal on one input and the unfiltered signal on the other?
The two stages are formed from all-pass filters,

https://en.wikipedia.org/wiki/All-pass_filter

The filter can be viewed as a block instead of analysing it from scratch.   The all-pass filter shifts the phase 90 degrees at the frequency f0 = 1/(2*pi*R*C) where R is the resistance to ground on the opamp +input and the C is the cap.

The two 90 deg phase shifts produce an overall phase shift of 180 deg.  When the filtered output is summed/mixed back with the dry signal the signal cancels and you get a notch at f0.
« Last Edit: January 28, 2021, 03:59:12 PM by Rob Strand »
The internet:  answers without the need for understanding.

#### craftyjam

##### Re: Question about mosfet as variable resistance
« Reply #10 on: January 28, 2021, 06:26:52 PM »
Now it's starting to all come together. Thank you.
Helping me to understand the similarities and differences between vibes, phasers, and flangers.

I suppose I should experiement with all the different methods of voltage controlled resistances (fet, ldr optocoupler, OTA, photofet, etc.)

#### PRR

##### Re: Question about mosfet as variable resistance
« Reply #11 on: January 28, 2021, 09:29:16 PM »
AN105 Siliconix 10-Mar-97 ---- FETs As Voltage-Controlled Resistors
https://www.vishay.com/docs/70598/70598.pdf
• SUPPORTER

#### anotherjim

##### Re: Question about mosfet as variable resistance
« Reply #12 on: January 29, 2021, 05:22:40 AM »
Since phasors usually have multiple stages, it has been done using the MOSFET's in a CD4049UB hex inverter chip. You basically don't power or connect the chip VCC pin at all, use the inverter inputs as the gates and the outputs as the drains on the N-channel halves of the complementary pairs. Sources are common to ground using the chip Vss pin. Only the 4049 can work like this because it has different input protection diodes to most other CMOS parts (an extra reverse blocking diode to Vdd).
Still tricky (as told above) because they are still MOSFETs, but since all are formed in the same die they are well matched.
A diagram...

As can be seen, if the Vcc pin has no connection, then the upper P MOSFET can't do anything and you have the N-channel acting alone.

Croeso i Diystompboxes.

#### R.G.

##### Re: Question about mosfet as variable resistance
« Reply #13 on: January 29, 2021, 11:13:06 AM »
Yep. What they said.

And that's why I said that using MOSFETs as variable resistors always winding up being complicated.

The search for a simple, effective voltage controlled resistor absorbed a lot of my circuits-hacking time back in the 1970s. Here's what I remember off hand.
Light/LDR modules: GREAT as a VVR on the LDR side, requires lots of power on the light side, even with LEDs, which were newfangled in the 70s. LDRs are OK-ish in terms of matching, kind of, but have issues with speed of response. Some of them take seconds to fully respond to a step in light change. The fastest ones also have the biggest variation in on and off resistances, so tracking is chancy. But they have zero control voltage feedthrough.
BJTs: Ordinary bipolars do have a range of operation where they act as a variable resistance, and they're easier to match than FETs. But they also have an offset voltage that is inherent in the setup, and problems with letting some of the control voltage through to the signal path. They seem to be most effective as a resistance or switch when used "backwards", with the nominal "emitter" and "collector" leads swapped. And they distort easily unless the signal level across them is kept to quite small levels.
Ordinary junction diodes: Yep, they can be used as variable resistors if you go to the trouble to carefully use small signals (25-50mV max) and run them in some kind of circuit that cancels the massively bigger offset voltages they need. The tremolo in the Thomas Organ Vox amplifiers were made with a bridge arrangement of four diodes, fed top and bottom with equal and opposite currents, and was quite nice sounding. Lot of work though.
JFETs: Work well, have less issues with control voltage feedthrough than bipolars, although not zero. They have less restriction on signal size than bipolars or diodes, and there are techniques to extend this range, as Paul notes. Their issues are with matching (like everything associated with JFETs). JFETs can vary from the Rdson value for the device, usually in the 10 to few-hundred ohm range up to effectively infinite. I've never found the resistance range to be a problem, but matching can give you nightmares.
MOSFETs:Similar issues to JFETs, but with added difficulties with the gate threshold voltage and that always present body diode.
OTAs. OTAs can be highly effective voltage controlled resistors; the classical OTA phaser is effectively a voltage controlled resistor phase shift circuit, with buffering. The physics/math says that they track well. Complicated using eight pins and additional parts for a resistor, though.
A really effective technique that side steps most of these issues is making a PWM resistor. You switch a resistor on and off at ultrasonic speeds, and the effective resistance is the PWM-math value.Tracking is GREAT across multiple units. You can also use PWM switching to convert a capacitor to effectively a resistor. Switched-resistor and switched-capacitor setups work GREAT, track well, have no feedthrough if done carefully, but need that pesky switching circuit and filtering before and after the circuit to get rid of any sampling aliasing.
It's a fun topic to explore. I'm still waiting to find a good and simple voltage variable resistor.
R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?

#### antonis

##### Re: Question about mosfet as variable resistance
« Reply #14 on: January 29, 2021, 02:08:46 PM »
I'm still waiting to find a good and simple voltage variable resistor.

A trimmer driven by a servo motor driven by a variable voltage, perhaps..??
"I'm getting older while being taught all the time" Solon the Athenian..
"I don't mind  being taught all the time but I do mind a lot getting old" Antonis the Thessalonian..

#### R.G.

##### Re: Question about mosfet as variable resistance
« Reply #15 on: January 29, 2021, 03:27:07 PM »
That's certainly voltage controlled!    The transfer function of voltage to resistance is a little complicated.

One good way to do motor to pot is to use a dual gang pot and servo the motor with feedback from one of the gangs. I believe some very early hifi/stereo stuff did this.
One I was always fond of was using an RC servo bit enough to move a pot. Some RC servos have a 270 degree rotation. You'd just have to get a pot and a servo with the same rotation range. But then, RC servos are PWM controlled for rotation, so that might qualify under PWM control.
Not exactly voltage controlled resistance, I liked the idea of using a dual shaft stepper motor with one of the shafts being where a user knob was put, and a shaft coupling (such as section of rubber hose with hose clamps) coupled the other motor shaft to a pot. Using the dual-pot trick, you can set a pot manually, read the wiper position of the second gang, and then remember the setting to come back to it with your cleverly-programmed uC.
Of course, if you go that far, digital pots are about as good. Some of them have built-in zero crossing detection for changing state, so they don't cause "zipper noise" as they slew or clicks as they change instantly.

It's a target rich environment!

R.G.

Quick IQ Test: If anyone in a governmental position suspected that YOU had top-secret information on YOUR computer, how many minutes would you remain outside a jail cell?