EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: belzrebuth on July 09, 2023, 09:56:16 pm

Title: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 09, 2023, 09:56:16 pm
Hi all,
I'd like to have a voltage (I don't mind if it's negative or positive) controlling a FET paralleled to a potentiometer wired as a rheostat which controls the discharge of a capacitor.
This is part of a timing circuit.
The rest of the circuit works great so no random issues will arise. I also tested with an actual 1M potentiometer and it works as I would like it to.
The potentiometer I'm using is 1Mohm and I need to have its ranging from a few ohm up to higher than 500k or something it doesn't have to be 1M.
So essentially the FET should be able to extend from its Rds on value ( a few ohms at worst)  to close to open circuit with some kind of voltage at its gate.
Is this even possible?
I have 2n7000s, J112s and 2sk30s at hand..
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 09, 2023, 11:19:18 pm
So I opened up multisim in order to avoid real world frustration and tried with a 2N700.
No matter what I do I can't get it off the on-off behavior. What I want is a kind of triangle (ideally) or even some kind a trapezoid response to my input voltage.
I can also scale it down to whatever's needed, meaning If I have a kind of linear response in the mV range I can scale my input control voltage to that if need be.
Polarity is also not a issue.
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: TimFox on July 09, 2023, 11:36:41 pm
When a JFET has relatively low VDS, the curves for ID vs VDS on both sides of the origin, for discrete values of VGS, do not lie on top of each other and each has a roughly constant slope through (0,0) that varies with VGS.  This behavior has been exploited for audio gain controls, but is limited to low voltage across the two-terminal "resistor".
See   https://www.circuitstoday.com/fet-as-a-vvr-voltage-variable-resistor (https://www.circuitstoday.com/fet-as-a-vvr-voltage-variable-resistor)  for such use at voltage -100 mV < VDS < +100 mV.
When the VDS is larger, the behavior is closer to a constant-current device, with ID roughly constant for each value of VGS, not a resistance.
(A vacuum pentode has somewhat similar curves, but they join into a single curve up from the origin at low plate voltage, and are not useful as a variable resistance.)
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 09, 2023, 11:51:41 pm
I replaced the 2n700 with a 2n5454 (multisim does not have a 2n5457/8 or something similar) and it seems to work almost too good. It's a shame that I don't have this jfet at hand to try to breadboard this circuit to see if it actually works that well.
Bad thing is that the end pcb will be SMD so I need to find something that easily available and these old jfets are not..

EDIT: I found that j310/j309 are available at sot-23 package so I tried J310 in a slightly modified circuit and it seems to work.
Am I missing something here or it will indeed work as it seems?

edit : I now realised that what I've thought as a linear response on my voltage divider circuit  is just my input control voltage on the output :-DD Back to square one I guess!
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: Weston on July 10, 2023, 01:09:32 am
When a MOSFET is in the Triode/Linear/Ohmic region it acts as a voltage controlled resistor, but is only for a narrow operating range.

In the saturated region a MOSFET acts as a constant current source. Can you change your circuit so it uses an adjustable current source instead of voltage controlled resistor? Thats how a lot of analog timing circuits work and it is simpler from a circuits perspective. Its also often more desirable as a current source for charging / discharging a capacitor provides a linear ramp instead of an exponential.

You could also use a feedback loop to implement a voltage controlled current source where the input voltage is the voltage across the current source. This would emulate a voltage controlled resistor and be a lot more accurate than trying to bias a MOSFET/JFET, but it would require additional circuitry.
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: T3sl4co1l on July 10, 2023, 01:34:20 am
I don't know what you're trying to accomplish with the series diode.  It seems like you're trying to charge up the gate capacitance and force it on; but you're doing it at too low of a frequency for that.

You need a much different circuit to see resistive characteristics.  These are just common-emitter/source amplifier/switch circuits.  You're seeing switching behavior because it's what you wired it for. :P

For timing purposes, there is a MUCH easier way: take advantage of the constant-current output characteristic.  Direct that current into a capacitor, and then I = C dV/dt.  Use a pair of comparators to detect when the voltage crosses a rising or falling threshold, and use that to invert the current.

The simplest form of this, uses a differential amplifier / comparator with positive feedback (hysteresis), and the comparator output shunts one of two constant-current sources.  So there's I pulling up by default, but 2I pulling down thus -I seen by the capacitor, when the comparator is inactive, or +I seen when active.  With the current and voltage polarities wired correctly, the capacitor voltage forever oscillates between thresholds -- an astable multivibrator.

Tim
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: ArdWar on July 10, 2023, 01:36:08 am
...discharge of a capacitor.
This is part of a timing circuit.
Variable constant current source is the usual linear way to implement variable timing.
Varying comparator reference voltage is the slightly dirtier way to implement variable timing. Usually when you don't need high dynamic range or simply not want to implement constant current source.
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 10, 2023, 02:06:13 am
The circuit I'm playing with is attached below.It's not a timing circuit per se.
It accepts a gate or a trigger pulse and generates a decaying signal.
I have substituted the first potentiometer with a 1k series resistor so the attack of the produced signal is zero.
Trun switch is closed so these diodes can be ignored as well.
What I want to achieve is to control the discharge of the capacitor with a "voltage controlled resistor" in parallel with the D(R) pot.
I first thougt about making a current drain (bjt transistor controlled by said voltage) to GND in parallel with the capacitor but then I decided I could go fancy with a parallel resistance but it may be more difficult than I anticipated.
My goal is to have a voltage control decay, any ideas would be more than welcome!


Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: T3sl4co1l on July 10, 2023, 04:05:40 am
Ah, they're already doing that then.  The main difference is the resistor gives a smoother exponential transition than the straight edges of a current source.

The easiest way to adapt it is use a diode bridge and current source and sink.  The double-ring symbols are where the CCS go.  Any CCS circuit will do, but you'll probably find a current mirror (BJT with emitter resistance and a resistor+diode biasing the base) most effective.

Tim
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: jwet on July 10, 2023, 06:31:42 am
There is a somewhat obscure and old opto isolator type that has a LED driving a Cadmium Sulfide photocell.  They have pretty much the characteristic you want.  Though they only go down to about 100 ohms minimum.  They were originally made by Vactec,  a division of EG&G.  They're now made by others.  Here is a link to a representative one on Digikey.  Advanced Photonics NSL-32SR3.  JFET's could come close to this kind of operation but are highly non linear as resistors and don't have this much dynamic range.

Link to DK Part:
https://www.digikey.com/en/products/detail/advanced-photonix/NSL-32SR3/5039793?utm_adgroup=&utm_source=google&utm_medium=cpc&utm_campaign=PMax%20Product_Low%20ROAS%20Categories&utm_term=&utm_content=&gclid=Cj0KCQjwtamlBhD3ARIsAARoaEwI6Tc3P3lVmciBFiktzelhpvke5w3G7Vog6wOcstuC6mGoclSeBEEaAghvEALw_wcB (https://www.digikey.com/en/products/detail/advanced-photonix/NSL-32SR3/5039793?utm_adgroup=&utm_source=google&utm_medium=cpc&utm_campaign=PMax%20Product_Low%20ROAS%20Categories&utm_term=&utm_content=&gclid=Cj0KCQjwtamlBhD3ARIsAARoaEwI6Tc3P3lVmciBFiktzelhpvke5w3G7Vog6wOcstuC6mGoclSeBEEaAghvEALw_wcB)
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 10, 2023, 08:55:58 am
Thanks for that I will try to implement this later and come back for validation.
I want to leave the original potentiometer in place though for some kind of manual control along with the voltage control.
Where should that be ?
I guess to the right of the diodes just before  the opamp (+) in?
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: T3sl4co1l on July 10, 2023, 11:41:40 am
If you leave them in, they'll set a maximum ramp rate, and skew the current vs. rate transfer function.  If you must, you can put a SPST switch in series with each, and set the currents to zero while using the built-ins.

Tim
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 10, 2023, 12:13:49 pm
As I understand it I need a current source in order to charge the cap and then a current sink to discharge it right?
Can you help a bit with this?
I really don't know how to start.
Will I need an opamp before the bases of the BJT? I don't know how to do both with one voltage :-//
The pot will act as an "offset" between these two states, right?
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: MathWizard on July 12, 2023, 09:33:03 am
Well with BJT's as a current source or sink for the cap, figure out how much charge you want to store in the cap of whatever size, and for whatever voltage, and charge time, current, etc. And then set up some BJT's, to deliver some constant current. Somehow that has to mate with the above circuits.

What is the overall circuit, what's this FET and cap charging/discharging for ??
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 12, 2023, 09:50:05 am
This is an envelope circuit; it produces a signal of specific shape (logarithmic in this case) for controlling a VCA simulating a "natural" decay of say a drum sound if you hit it abruptly which then eventually decays to silence.The decay time is controlled by the potentiometer.
These circuits are very popular in electronic music synthesizers and that's where this is going if I manage to control its decay time with a control voltage.
I found out that by using an NPN transistor Q1 in the schematic and placing a positive voltage there I can make the decay signal longer, I don't know why that is and I can't reproduce it in Multisim but it works on the breadboard :-//
I'd like to know why that happens, I just thought that if I make this node closer to ground maybe the opamp would try to compensate by forcing more current essentially charging the cap through the resistance of the pot.I know I'm not right since it does not work on the simulation.
I need to make the decay time shorter as well.
If I have a bipolar control signal I can use the positive voltage to make it longer and invert the negative to control another bjt acting as a sink somehow in parallel with the capacitor to drain it.
I'd surely appreciate some help on how to achieve this.
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: MathWizard on July 12, 2023, 10:07:57 am
Well there's too many op-amps and diodes for me to really see what's going on in that circuit, but the cap can be charged/discharged by that op-amp to the left of the pot, so if you want to alter the charge time, play with the cap size and the resistors that are hooked directly to the cap. If that's what you mean, but maybe you already know that.

What is the input signal? A digital high like a button push or clock, or some analog voltage level ?
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 12, 2023, 10:19:39 am
Yes I know that, I just want voltage control over the discharge and charge.
Input is a short trigger or a gate. A gate will keep the output signal high as long as the gate is high so the decay knob will determine the "release" of that signal.
With a trigger as input signal and the attack pot set to short circuit (less resistance to the cap) the circuit will produce a signal with a sharp attack and a variable decay.
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 12, 2023, 10:32:15 am
I just saw on the scope that it is the attack that I am making longer by increasing the voltage on the base of Q1 not the decay so back to where I was at :palm:
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 12, 2023, 02:02:31 pm
Allright  I'm 50% there I think.
I can reduce the decay with the Q1 in the right place.
Ignore Q2, the cap goes to GND as it did before.
Now I somehow need to control the discharge by not allowing the cap to discharge
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: eugene on July 12, 2023, 02:14:22 pm
You're probably on the right track, but if you decide to go back to using a FET, I have used the LSK389D successfully in the linear region as a voltage controlled resistance. They're not cheap, but they have a really broad linear region.
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: T3sl4co1l on July 12, 2023, 03:42:30 pm
Allright  I'm 50% there I think.
I can reduce the decay with the Q1 in the right place.
Ignore Q2, the cap goes to GND as it did before.
Now I somehow need to control the discharge by not allowing the cap to discharge

Not sure what you're trying to do there... the voltages are all wrong, generally speaking.  Maybe it works for part of the waveform.  Or you missed that it's just the pull-up resistor doing all the work, and the transistor does nothing.  Dunno.

Did you ever look up "current source circuits"?  They look like this...

Voltages (or currents) at A and B, and resistor values, are left as an exercise for the reader, of course.

Tim
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 12, 2023, 06:33:43 pm
Ι'll try your suggestion T3sl4co1l and post back..!
Title: Re: JFET/Mosfet as Voltage Controlled Resistor
Post by: belzrebuth on July 13, 2023, 07:21:18 pm
Playing with the values of both transistors I can't make the attack part of the waveform instant as it was before.
With the same values (emitter resistors 1k, diode resistors 10k and base resistors 47k I get a triangle, equal rise and fall.
What I want to control is only the "fall" part of the signal the "rise" should be zero at all times.
Also, I don't know where to place the decay potentiometer now that I have this diode bridge..I should be able to manually control the decay time..