Author Topic: Creating controlled resistance to ground  (Read 16703 times)

0 Members and 1 Guest are viewing this topic.

Offline IDEngineerTopic starter

  • Super Contributor
  • ***
  • Posts: 1981
  • Country: us
Creating controlled resistance to ground
« on: December 15, 2020, 07:12:11 pm »
There's a style of fluid sensor (often used in fuel tanks, etc.) that involves a linear array of reed switches and a magnet on a float. As the float moves with the fluid level, different reed switches are closed. The output of this entirely passive system is a resistance to ground, typically a few hundred ohms at "empty" to a few tens of ohms at "full". Current capacity is obviously quite low given the reed switches so this is purely a low-level signal environment.

We just got a call from a customer who wants us to replicate this output so they can keep using their existing upstream inputs without modification. They want a single wire referenced to ground that presents a resistance to ground that varies from this few hundred ohms to a few tens of ohms. It needs to be ~linear and contiguous (i.e. not "stepped" like a series of reed switches). It may be connected to any (reasonable) voltage as part of a divider.

This is similar to a DC electronic load except that there's no guarantee of applied voltage nor current. "Measuring" it is an interesting challenge.

The easy answer is an open drain NFET operating in its linear range. But since we don't know the attached voltage, it's difficult to close the loop around it. It's supposed to be "just a resistance" so we can't apply our own voltage across it.

Seems like I've also run across a D/A converter that had a separate reference input, allowing you to treat it like a digitally controlled resistance, but it's unlikely its range would magically match what we need here.

EDIT: Absolute worst case we could "build" a low-res D/A using multiple NFET's and associated resistors (so we can control the dynamic range of the resistance) but that just feels inelegant.

I'm guessing this problem has been solved before, and if so there's no point in reinventing the wheel. Any RTFM out there? Thanks!
« Last Edit: December 15, 2020, 07:14:24 pm by IDEngineer »
 

Offline dmendesf

  • Frequent Contributor
  • **
  • Posts: 431
  • Country: br
Re: Creating controlled resistance to ground
« Reply #1 on: December 15, 2020, 07:20:32 pm »
I think the most similar thing is 4-20mA transducers. The 4mA start is used to guarantee a minimum power for the circuit. Can you get power from somewhere else? If so you can use a LDR + led or a linear optocoupler like IL300 to make a variable resistor down to nothing.
 

Offline IDEngineerTopic starter

  • Super Contributor
  • ***
  • Posts: 1981
  • Country: us
Re: Creating controlled resistance to ground
« Reply #2 on: December 15, 2020, 07:42:57 pm »
Power is entirely separate from the controlled resistance to ground. We have local circuitry which has its own power source and local regulator. Normally this circuit transmits its data via CAN but in this case the customer insists on continuing to use a pure resistance to ground because that's what the upstream piece of equipment demands and they don't want to change it.
 

Offline IDEngineerTopic starter

  • Super Contributor
  • ***
  • Posts: 1981
  • Country: us
Re: Creating controlled resistance to ground
« Reply #3 on: December 15, 2020, 07:48:24 pm »
IL300 to make a variable resistor down to nothing.
Good idea, but the IL300's output element is a photodiode which is a current output device. Thus we'd still need a translation output stage to yield a pure resistance to ground capable of tolerating (say) 12 or 24 VDC applied to the voltage divider that the pure resistance is made part of.
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 9439
  • Country: us
Re: Creating controlled resistance to ground
« Reply #4 on: December 15, 2020, 07:53:37 pm »
Power is entirely separate from the controlled resistance to ground. We have local circuitry which has its own power source and local regulator. Normally this circuit transmits its data via CAN but in this case the customer insists on continuing to use a pure resistance to ground because that's what the upstream piece of equipment demands and they don't want to change it.

The customer's upstream equipment doesn't demand a pure resistance, they just think it does.  It has some test current or signal that it applies and then measures the result and it just needs to see the appropriate results in response to its test signal.  If you aren't allowed to know what those test signals and conditions are (they could be a test current while reading the voltage, the other way around or something else I haven't thought of) then your job seems difficult to me.  Perhaps a motorized rheostat with a feedback potentiometer?   :-DD
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline IDEngineerTopic starter

  • Super Contributor
  • ***
  • Posts: 1981
  • Country: us
Re: Creating controlled resistance to ground
« Reply #5 on: December 15, 2020, 08:36:03 pm »
The customer's upstream equipment doesn't demand a pure resistance, they just think it does.  It has some test current or signal that it applies and then measures the result and it just needs to see the appropriate results in response to its test signal.  If you aren't allowed to know what those test signals and conditions are (they could be a test current while reading the voltage, the other way around or something else I haven't thought of) then your job seems difficult to me.  Perhaps a motorized rheostat with a feedback potentiometer?   :-DD
Again, I agree - but the problem is the conditions may change depending upon the environment. Both 12VDC and 24VDC are commonplace. If the applied voltage changes, then presumptions we might make could be invalid. Yes, we could then sample the input voltage... but does that catch all of the possibilities?

A resistor to ground is pretty darned simple, and thus flexible. That old reed-switch-plus-resistors approach does have the elegance of simplicity going for it. My hope is to come up with some scheme by which we can use nice 40-60V NFET(s) in open drain configuration, but we need a way to close the loop around it/them. Otherwise replicating the reed switch scheme using SOT23-3 NFET's may actually be a straightforward approach, inelegant though it may be.
 

Offline dmendesf

  • Frequent Contributor
  • **
  • Posts: 431
  • Country: br
Re: Creating controlled resistance to ground
« Reply #6 on: December 15, 2020, 08:49:58 pm »
The LDR+led wasn't a joke or some arduinesque contraption, it's a product. Look for VTL5C7, there are others (at least some are sold as Vactrols).
 

Offline dmendesf

  • Frequent Contributor
  • **
  • Posts: 431
  • Country: br
Re: Creating controlled resistance to ground
« Reply #7 on: December 15, 2020, 08:54:19 pm »
Can you put a series resistor (say, 1 ohm) with the FET source to measure the current and close the loop?
 

Offline KaneTW

  • Frequent Contributor
  • **
  • Posts: 814
  • Country: de
Re: Creating controlled resistance to ground
« Reply #8 on: December 15, 2020, 08:59:24 pm »
Digital pots do exactly what you want.
 

Offline IDEngineerTopic starter

  • Super Contributor
  • ***
  • Posts: 1981
  • Country: us
Re: Creating controlled resistance to ground
« Reply #9 on: December 15, 2020, 09:03:08 pm »
Digital pots do exactly what you want.
Yep, and that's the easy way out. I'm just wondering about alternatives. One would be a R-2R ladder with NFET's pulling the legs to ground. I haven't checked the price of digital pot IC's but an R-2R FET solution would be really inexpensive.
 

Offline IDEngineerTopic starter

  • Super Contributor
  • ***
  • Posts: 1981
  • Country: us
Re: Creating controlled resistance to ground
« Reply #10 on: December 15, 2020, 09:05:30 pm »
Perhaps a motorized rheostat with a feedback potentiometer?   :-DD
You laugh, but the linear faders of high end analog audio mixing consoles are (were?) done exactly like that. My first reaction upon encountering them was "YUCK!" but then I thought about keeping the analog signal path entirely separate from the gain control and my opinion improved a bit.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 14130
Re: Creating controlled resistance to ground
« Reply #11 on: December 15, 2020, 09:15:53 pm »
Shouldn't be *too* tricky to do.
Take a 'classic' OPAMP + MOSFET adjustable current sink, and derive its control voltage from a multiplying DAC fed with a reference proportional to the MOSFET drain voltage.
 
The following users thanked this post: mikerj

Offline coppercone2

  • Super Contributor
  • ***
  • Posts: 13719
  • Country: us
  • √Y√... 📎
Re: Creating controlled resistance to ground
« Reply #12 on: December 15, 2020, 10:01:29 pm »
I think you need to fuse it then because your sensor could electrify something in a controlled but dangerous way

I assume pipe = earth. Don't put any earth resistance unless you figure out exactly what the safety aspect is.
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 5369
  • Country: nl
Re: Creating controlled resistance to ground
« Reply #13 on: December 16, 2020, 03:06:26 am »
A "multiplying DAC" is one thing that comes to mind.
Then there are also I2C "digital potentiometers"
Another option is to use a DAC and append an opamp and transistor to make a variable current sink.
 

Offline IDEngineerTopic starter

  • Super Contributor
  • ***
  • Posts: 1981
  • Country: us
Re: Creating controlled resistance to ground
« Reply #14 on: December 16, 2020, 04:52:26 am »
More: I've scanned the digital pot IC market thinking that might be an easy, single-component way out. There are 1Kohm devices with 100 steps, which we could make work by only using ~25% of its dynamic range (25 steps) to get the ~240 ohm maximum value that this "standard" defines. However, these devices also have a figure of merit called "wiper resistance" which is self-explanatory... and which is well above the 33 ohm minimum value required by the "standard". So even with the device set to "zero" resistance there will still be more resistance than the minimum value. In some cases the wiper resistance is more than the MAXIMUM value of 240 ohms.

Yes, we could parallel the device with an external resistance to drop the total but then we'd get some sort of logarithmic response curve. I suppose we could then do a formula, or lookup table, to convert these nonlinear values to their linear equivalents. Jump through enough hoops and maybe it could work.

But I've also found that most of them run on 5V supplies (the minimum voltage this resistance must endure is 12VDC, and really more like 16VDC given the automotive environment even with protection circuitry). I didn't find any of low-ish max resistance (remember, our target maximum is 240R) that tolerated anywhere near 16VDC. So I've concluded that a IC-style digital pot would be more trouble than it's worth to make work in this application, and that's presuming it could work at all.

As for a "1 ohm source resistor", the max resistance is 33R at one end of the dynamic range so even 1R represents a meaningful percentage. Plus, what current (dropped voltage) do we presume? If the output feeds into a 12V system, we'll get one reading. If it goes into a 5V system, we'll get another. 24V systems are not uncommon in certain automotive environments either. Yes, a workaround here could be an A/D to measure what voltage the resistance is connected to, but it will have to be high value to avoid becoming a significant parallel path to ground (and affecting our resistance).

Given the above, the R-2R-FET approach is sounding pretty good. 1% resistors will give us sufficient accuracy. FET's with 30V+ tolerance are commonplace, and the resistors can take anything the FET's can. A 5-6 bit R-2R is only a handful of parts, all of them small and inexpensive. No feedback/closed loop is required. And ultimately, it really is what is desired (a pure resistance to ground) instead of something trying to fake it with various design compromises.

Unless some magic solution is proposed, that's the direction I think we're heading here given the constraints. I'd be happy to discard that approach if something better comes along.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21608
  • Country: us
Re: Creating controlled resistance to ground
« Reply #15 on: December 16, 2020, 06:41:22 am »
How about analog switch ICs paired with resistor networks? It's not particularly elegant, but it's highly customizable and using SMT parts it could be made fairly small. A small microcontroller could convert any number of interfaces to drive the switches.
 

Offline IDEngineerTopic starter

  • Super Contributor
  • ***
  • Posts: 1981
  • Country: us
Re: Creating controlled resistance to ground
« Reply #16 on: December 16, 2020, 07:44:27 am »
That's my general plan, except use standalone SOT23-3 packaged FET's to get lower on resistance. I haven't been particularly impressed with the on resistance of analog switch arrays and with a low end of 33 ohms small amounts matter.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3671
  • Country: gb
Re: Creating controlled resistance to ground
« Reply #17 on: December 16, 2020, 07:53:05 am »
Shouldn't be *too* tricky to do.
Take a 'classic' OPAMP + MOSFET adjustable current sink, and derive its control voltage from a multiplying DAC fed with a reference proportional to the MOSFET drain voltage.

Agreed, and might also be a good exercise in compensation to make it reliably "resistance" instead of oscillate  :)  12/24v also suggests a possible automotive type environment, so the usual supply and input protections will likely be needed.  Also will the "sensor" always be on the low side or high side, or could it be either?

A very cheap and nasty way of creating variable resistance is switching between the lowest and highest required value resistor via PWM using a FET, to multiply the resistance by the duty cycle.  This might be viable if the upstream measurement system has a low enough bandwidth with suitable filtering.
« Last Edit: December 16, 2020, 07:56:03 am by mikerj »
 
The following users thanked this post: Ian.M

Offline IDEngineerTopic starter

  • Super Contributor
  • ***
  • Posts: 1981
  • Country: us
Re: Creating controlled resistance to ground
« Reply #18 on: December 16, 2020, 08:01:40 am »
Hadn't even considered PWM. I agree it's nasty in an elegant sort of way - or perhaps elegant in a nasty sort of way. Definitely worth checking to see if it would be compatible. Might be specific to the upstream device. Thanks!
 

Offline Non-Abelian

  • Contributor
  • Posts: 36
  • Country: us
Re: Creating controlled resistance to ground
« Reply #19 on: December 16, 2020, 08:46:47 am »
Really, the Vactrol mentioned by someone easier is the easiest solution. Vactrols also come in duals with a common center tap so that one can be used as a reference for the resistance you want to control. Look for a VTLC 3/2.
That's not right - It's not even wrong - W. Pauli
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16394
  • Country: za
Re: Creating controlled resistance to ground
« Reply #20 on: December 16, 2020, 11:09:35 am »
How about a simple R 2R ladder and some highish voltage (at least 60-80V for automotive, with logic level gate drive) MOSFET switches. That way you have the resistor required, and you just need to have a basic need to drive a n bit DAC to drive it. Resistor values are either one single value of the smallest bit size, with 2 in series for the 2R case, so you just have 3n+1 resistors to place on the board. Otherwise you need a R and a 2R value, and need 2n+1 again, but using a single value is cheaper as all off the same reel could be considered to track reasonably well, so you could get by with a 1% part on a 8 bit converter with almost no added error. 8 bits will exceed the resolution of most indicators anyway, as they are likely sub 8 bit anyway. 10 bits will, to most systems, look exactly like it is a smooth linear sweep in any case. If you need more than 10 bits, you probably need a different measuring system, or the tank is massive.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 22454
  • Country: gb
  • 0999
Re: Creating controlled resistance to ground
« Reply #21 on: December 16, 2020, 11:47:21 am »
More: I've scanned the digital pot IC market thinking that might be an easy, single-component way out. There are 1Kohm devices with 100 steps, which we could make work by only using ~25% of its dynamic range (25 steps) to get the ~240 ohm maximum value that this "standard" defines. However, these devices also have a figure of merit called "wiper resistance" which is self-explanatory... and which is well above the 33 ohm minimum value required by the "standard". So even with the device set to "zero" resistance there will still be more resistance than the minimum value. In some cases the wiper resistance is more than the MAXIMUM value of 240 ohms.

Yes, we could parallel the device with an external resistance to drop the total but then we'd get some sort of logarithmic response curve. I suppose we could then do a formula, or lookup table, to convert these nonlinear values to their linear equivalents. Jump through enough hoops and maybe it could work.

But I've also found that most of them run on 5V supplies (the minimum voltage this resistance must endure is 12VDC, and really more like 16VDC given the automotive environment even with protection circuitry). I didn't find any of low-ish max resistance (remember, our target maximum is 240R) that tolerated anywhere near 16VDC. So I've concluded that a IC-style digital pot would be more trouble than it's worth to make work in this application, and that's presuming it could work at all.

As for a "1 ohm source resistor", the max resistance is 33R at one end of the dynamic range so even 1R represents a meaningful percentage. Plus, what current (dropped voltage) do we presume? If the output feeds into a 12V system, we'll get one reading. If it goes into a 5V system, we'll get another. 24V systems are not uncommon in certain automotive environments either. Yes, a workaround here could be an A/D to measure what voltage the resistance is connected to, but it will have to be high value to avoid becoming a significant parallel path to ground (and affecting our resistance).

Given the above, the R-2R-FET approach is sounding pretty good. 1% resistors will give us sufficient accuracy. FET's with 30V+ tolerance are commonplace, and the resistors can take anything the FET's can. A 5-6 bit R-2R is only a handful of parts, all of them small and inexpensive. No feedback/closed loop is required. And ultimately, it really is what is desired (a pure resistance to ground) instead of something trying to fake it with various design compromises.

Unless some magic solution is proposed, that's the direction I think we're heading here given the constraints. I'd be happy to discard that approach if something better comes along.
So use the digital potentiometer and an op-amp + MOSFET to scale down the resistance.
https://www.eevblog.com/forum/projects/ptc-resistance-output-from-0-10v-analog-input/msg2454789/#msg2454789
https://www.eevblog.com/forum/beginners/voltage-controlled-resistor-options/msg2917762/#msg2917762
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19223
  • Country: us
  • DavidH
Re: Creating controlled resistance to ground
« Reply #22 on: December 16, 2020, 11:52:40 am »
One of the common applications for operational transconductance amplifiers like the LM13700 is making grounded and floating voltage controlled resistors.  A voltage controlled resistor can also be made with an analog multiplier/divider.
 

Offline Someone

  • Super Contributor
  • ***
  • Posts: 6075
  • Country: au
    • send complaints here
Re: Creating controlled resistance to ground
« Reply #23 on: December 16, 2020, 08:32:23 pm »
A very cheap and nasty way of creating variable resistance is switching between the lowest and highest required value resistor via PWM using a FET, to multiply the resistance by the duty cycle.  This might be viable if the upstream measurement system has a low enough bandwidth with suitable filtering.
Hadn't even considered PWM. I agree it's nasty in an elegant sort of way - or perhaps elegant in a nasty sort of way. Definitely worth checking to see if it would be compatible. Might be specific to the upstream device. Thanks!
Yes, it will depend on how the upstream device creates a test current. For DC applications you can just swamp out the switching with a capacitor and likely assume the output impedance of the source is equal to or higher than the "sensor". If the source is pulsing the test, or has very low output impedance, then its no longer simple/universal.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22435
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Creating controlled resistance to ground
« Reply #24 on: December 16, 2020, 08:57:38 pm »
The electronic load method is to measure the output current and voltage, and use a set ratio of the two to set the output condition.

The classical (constant current) load only measures (and feeds back on) current.  The classical (constant voltage) load (shunt regulator) only measures voltage.

By mixing the two together, the load characteristic lies somewhere between CV and CC -- a resistance.

The challenge then is to vary these proportions electronically.  A friend has even created an audio amplifier with this, I believe using OTAs (LM13700) as variable gain amplifiers.  (Audio power amps with certain output impedance characteristics, are desirable in the hi-fi crowd: most amps are CV (low Zo), suited to modern low efficiency drivers that need heavy damping; a modest Zo suits vintage speakers, or helps emulate the sound of a tube amplifier; and high Zo (CC) works with some specialty or custom driver types.)

You could also take the power DAC approach, which is simply to output a binary number to an array of MOSFETs, sinking an array of resistors, whose values are in binary sequence.  (Or use an R-2R network, possibly?)  The main annoyance of this method is really just getting a binary sequence of values, while choosing from E96 or whatever series values.  Probably a few bits should be spanned by series/parallel combinations to keep the BOM items down (two and four resistors, in series or parallel, spans three bits (5 resistors total), or five bits (13 resistors total) -- not too shabby, but obviously it goes exponentially with span, so one or two levels seems justifiable).

Note that the bandwidth may not need to be very much, so that an MCU could sample current and voltage sequentially (at a paltry say 10kS/s or less) and stabilize their ratio in a control loop (PID or whatever).

I don't see that it's worth making assumptions on how the outside equipment works.  If it tests with a voltage, current or resistance, the amount may vary from case to case, or even over time (supply voltage, resistance drift, etc.).  The effect is to require a calibration step (to set up the default voltage and resistance the OE uses), but also to massively increase error sensitivity if the sense method is poorly matched (driving a CC sense with a CC load, or CV with CV).  Both issues are easily avoided by performing one offset calibration at factory test (or designing it to a tight enough standard that this is not necessary -- likely, this is quite easy) and using a true-resistance (double feedback) method.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->