Author Topic: Time constant involving a resistor divider  (Read 12104 times)

0 Members and 1 Guest are viewing this topic.

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Time constant involving a resistor divider
« on: February 19, 2017, 07:26:03 pm »
Say I have a resistor divider and across the bottom resistor I place a capacitor. What is the time constant on that RC circuit? I asked somebody this once and he said that it's the parallel of the 2 resistors because I should consider the circuit with the voltage source being ideal and short it to ground. However if I do that do I consider this a parallel RC circuit? Would this take into account the fact that the resistor in parallel with the capacitor cause it to charge up more slowly and discharge more quickly. Obviously if I consider it a parallel circuit then recharging uptime becomes nil because nothing charge it or maybe infinite.

If I consider it a series RC circuit with a load and how to account for the fact that it will take longer to charge the capacitor particularly as the maximum voltage would never get applied to it and it would discharge quite quickly.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: Time constant involving a resistor divider
« Reply #1 on: February 19, 2017, 07:32:45 pm »
Yes, the R is equal to the value of both resistors in parallel and V equal to the output voltage of the potential divider.

If the potential divider is connected to a push-pull driver, then the charge and discharge time constants will be the same. If it's connected to a battery, to charge and left open circuit to discharge, then when charging the resistors are in parallel and when discharging, the upper resistor is open circuit, so only the lower resistor forms part of the RC circuit, so the capacitor will discharge more slowly than charge.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5840
  • Country: de
Re: Time constant involving a resistor divider
« Reply #2 on: February 19, 2017, 07:34:57 pm »
It's a nice problem in analysis.

Consider your voltage divider output without capacitor. You can model that as Uout = Uin * R2 / (R1 + R2) where R2 is your lower leg resistor.

This can be replaced with a voltage source with a value of Uout and a series resistor with a value of R1 || R2.

Add your capacitor and it's done.

 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #3 on: February 19, 2017, 07:35:18 pm »
So the charge and discharge is not symmetrical? Because the values of resistance change. What I'm actually aiming at here is a thermistor with a pull-up resistor and a capacitor in parallel with the thermistor to smooth out the signal. So I'm wondering what the frequency response and then becomes.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2074
Re: Time constant involving a resistor divider
« Reply #4 on: February 19, 2017, 07:36:59 pm »
I asked somebody this once and he said that it's the parallel of the 2 resistors because I should consider the circuit with the voltage source being ideal and short it to ground.
Basically, convert the two resistors and voltage source to their Thevenin equivalent. From that you should be able to answer your other questions.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Time constant involving a resistor divider
« Reply #5 on: February 19, 2017, 07:42:09 pm »
The top of the resistor divider is connected to an ideal voltage source, right?

If not, the Thevenin equivalent source resistance must be added in series with the top resistor, and then you take the parallel equivalent.

In the extreme, you might have a CCS source, in which case the top resistor is effectively open circuit, and the time constant is due to only the bottom resistor! :)

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

Offline AG6QR

  • Frequent Contributor
  • **
  • Posts: 857
  • Country: us
    • AG6QR Blog
Re: Time constant involving a resistor divider
« Reply #6 on: February 19, 2017, 07:43:09 pm »
Google the term "Thevenin equivalent" (and for further understanding, "Norton equivalent").

It depends on what your resistor divider is connected to.  If we can assume the top of the resistor divider is connected to an ideal (zero impedance) voltage source, and the bottom is connected to an ideal (zero impedance) ground, then the middle of the resistor divider is equivalent to an ideal voltage source in series with a resistor, where the value of the resistor is the parallel resistance of the two resistors in your voltage divider.  This seems to be what your friend said. 

If the top and bottom of the resistor divider are connected to points in a circuit that themselves have non-negligible resistance, then the problem becomes more complicated.  You must include those impedances as you figure out what the Thevenin equivalent circuit would be.

Quote
If I consider it a series RC circuit with a load and how to account for the fact that it will take longer to charge the capacitor particularly as the maximum voltage would never get applied to it and it would discharge quite quickly.

To put some solid numbers to it, suppose you have a 15V supply, and your voltage divider is a 10K resistor on top, and a 20K resistor on the bottom, for an output of 10V.  The equivalent resistance is 10K in parallel with 20K, or about 6.7K.  So the capacitor will behave exactly the same as if you were charging it from a 10V supply through a 6.7K resistor.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #7 on: February 19, 2017, 07:46:30 pm »


To put some solid numbers to it, suppose you have a 15V supply, and your voltage divider is a 10K resistor on top, and a 20K resistor on the bottom, for an output of 10V.  The equivalent resistance is 10K in parallel with 20K, or about 6.7K.  So the capacitor will behave exactly the same as if you were charging it from a 10V supply through a 6.7K resistor.


Okay fine but I'm also looking at the discharge time. As I said before the bottom resistor is a temperature sensor. So the vault is in the middle is going to vary. What I'm trying to ascertain is how fast will it keep up with a given capacitor in parallel. I think I'm going to get the signal generator out, the oscilloscope out and some parts.
 

Offline AG6QR

  • Frequent Contributor
  • **
  • Posts: 857
  • Country: us
    • AG6QR Blog
Re: Time constant involving a resistor divider
« Reply #8 on: February 19, 2017, 07:59:23 pm »
Okay fine but I'm also looking at the discharge time. As I said before the bottom resistor is a temperature sensor. So the vault is in the middle is going to vary. What I'm trying to ascertain is how fast will it keep up with a given capacitor in parallel. I think I'm going to get the signal generator out, the oscilloscope out and some parts.

To calculate the discharge time, put in whatever numbers are appropriate resistances for the situation when the capacitor discharges. 

But if the capacitor is charging and discharging due to temperature changes affecting a thermistor, don't forget that the thermistor itself won't change its temperature or resistance immediately.  There will be time constants involving the heat transfer to reach thermal equilibrium.  I don't know the context you're considering, but it wouldn't surprise me if the thermal response is much slower than the electrical response.  Anyway, run the numbers.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5840
  • Country: de
Re: Time constant involving a resistor divider
« Reply #9 on: February 19, 2017, 08:03:56 pm »
Quote
Okay fine but I'm also looking at the discharge time. As I said before the bottom resistor is a temperature sensor.

You're overanalyzing this.

If the bottom resistor is a temperature sensor, it's normally so slow that static analysis is enough.

Do a calculation for lowest value, highest value and middle value of the sensor resistance.

Your equivalent source voltages will be different, and so will the RC time constants for those three cases. But there is NO difference in charge/discharge time at a given temperature. It's a purely linear circuit (I hope! You've said nothing about the sensor).
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #10 on: February 19, 2017, 08:14:37 pm »
It's not the sensor response I'm looking at. What I am looking at is if this was just a resistor divider with capacitor what would the frequency response be to say for example injected noise.

So what I'm actually planning to do it in my hopes of over sampling on the ADC was to inject some of the PWM output from my controller back into the input pin via a resistor. Obviously I don't want that input to change instantly so I put a capacitor in so that to some degree the voltage will swing around about the measurement point. The hope is to gain a bit more resolution (it's purely an experiment and I don't strictly need the resolution) and ultimately there is going to be noise to filter out anyway so my sampling algorithm will filter the signal. Whether or not I get the extra resolution is another matter and beside the point there is another thread on that. What I was wondering was what value of capacitor to use so that I produce a reasonable amount of noise rejection but don't over filter for my intentionally injected noise which would come via a high value resistor. So in this case the sensor and its pull-up are at around 470 ohms each. If I were to use a 470 kilo Ohm resistor from my output to my sensor input I would want to look at the change of voltage that resistor being connected first to 5 V and then to ground causes. The effect of immediately jumping the voltage up or down by a few millivolts will be delayed by the capacitor. This would allow the voltage to be moved around its actual voltage and hopefully squeeze a bit of resolution out.

So this is why I wanted to analyse what is effectively a voltage divider with a capacitor in parallel with one resistor and what it's frequency response would be given that is not just a simple RC circuit. It is in effect a circuit in which I that you consider the resistor changing rapidly or the voltage applied changing albeit by not very much.

I have just carried out an experiment and the voltage jumped about by 5 to 10 mV with a 5 V input to the divide and using the 470 Kilo Ohm resistor to inject a 5 V square wave onto the capacitor.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #11 on: February 19, 2017, 08:19:14 pm »
But the voltage jumps quite quickly so my 470 Kilo ohm resistor is a bit on the small side. I should probably just bang a mega ohm in there and hope for the best. Like I said it's more of an experiment.
 

Offline Benta

  • Super Contributor
  • ***
  • Posts: 5840
  • Country: de
Re: Time constant involving a resistor divider
« Reply #12 on: February 19, 2017, 08:26:47 pm »
You've now gotten the same answer several times. Your friend in your original post is correct. Period.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: Time constant involving a resistor divider
« Reply #13 on: February 19, 2017, 08:30:28 pm »
Instead of putting a capacitor directly across the thermistor, why not put a separate RC filter on the output of the voltage divider? Then you can calculate the filter properties independently of the thermistor circuit. If you make the R in the RC significantly higher than the themistor resistance it will not affect the thermistor voltage response.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2074
Re: Time constant involving a resistor divider
« Reply #14 on: February 19, 2017, 08:31:15 pm »
So this is why I wanted to analyse what is effectively a voltage divider with a capacitor in parallel with one resistor and what it's frequency response would be given that is not just a simple RC circuit.
If you worked out the Thevenin equivalent you would see that it is a simple RC - first order low pass with extra attenuation due to the resistive divider.

Quote
It is in effect a circuit in which I that you consider the resistor changing rapidly or the voltage applied changing albeit by not very much.
It's not the sensor response I'm looking at. What I am looking at is if this was just a resistor divider with capacitor what would the frequency response be to say for example injected noise.

So what I'm actually planning to do it in my hopes of over sampling on the ADC was to inject some of the PWM output from my controller back into the input pin via a resistor. Obviously I don't want that input to change instantly so I put a capacitor in so that to some degree the voltage will swing around about the measurement point. The hope is to gain a bit more resolution (it's purely an experiment and I don't strictly need the resolution) and ultimately there is going to be noise to filter out anyway so my sampling algorithm will filter the signal. Whether or not I get the extra resolution is another matter and beside the point there is another thread on that. What I was wondering was what value of capacitor to use so that I produce a reasonable amount of noise rejection but don't over filter for my intentionally injected noise which would come via a high value resistor. So in this case the sensor and its pull-up are at around 470 ohms each. If I were to use a 470 kilo Ohm resistor from my output to my sensor input I would want to look at the change of voltage that resistor being connected first to 5 V and then to ground causes. The effect of immediately jumping the voltage up or down by a few millivolts will be delayed by the capacitor. This would allow the voltage to be moved around its actual voltage and hopefully squeeze a bit of resolution out.

I have just carried out an experiment and the voltage jumped about by 5 to 10 mV with a 5 V input to the divide and using the 470 Kilo Ohm resistor to inject a 5 V square wave onto the capacitor.
I think you're chasing a nonexistent rabbit into hole with this extra resolution idea. But if you are going to dither the input in order to eke out a few more bits at least use a noise source that is not correlated with your signal.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #15 on: February 19, 2017, 08:32:41 pm »
Instead of putting a capacitor directly across the thermistor, why not put a separate RC filter on the output of the voltage divider? Then you can calculate the filter properties independently of the thermistor circuit. If you make the R in the RC significantly higher than the themistor resistance it will not affect the thermistor voltage response.

Not really possible as the resistance of the sensor is fixed and the allowed input impedance is fixed so I'd never get orders of magnitude apart. It's going to be a bit of a fudge either way and I was getting curious on a theoretical point of view regardless of how I fundge it together and see what comes out.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #16 on: February 19, 2017, 08:39:48 pm »

If you worked out the Thevenin equivalent you would see that it is a simple RC - first order low pass with extra attenuation due to the resistive divider.

So if this was just a divider with one capacitor in it I'd have to consider it in two step, first when charging as the norton equivalent of the resulting voltage and the resistors in parallel and then in discharging where if the main voltage source has gone dead the top resistor is no longer part of the circuit so it's just the capacitor and the bottom resistor. Hence as I said it's a non symetrical charge/discharge waveform.

Quote

I think you're chasing a nonexistent rabbit into hole with this extra resolution idea. But if you are going to dither the input in order to eke out a few more bits at least use a noise source that is not correlated with your signal.


Well like I said it's just an experiment and I'm not relying on it to produce results. The PWM output I am using has nothing to do with my input signal, it just happens to be a PWM with a frequency whoes period is about the same as the time it will take to run my sample function.
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: Time constant involving a resistor divider
« Reply #17 on: February 19, 2017, 08:40:26 pm »
Not really possible as the resistance of the sensor is fixed and the allowed input impedance is fixed so I'd never get orders of magnitude apart. It's going to be a bit of a fudge either way and I was getting curious on a theoretical point of view regardless of how I fundge it together and see what comes out.

I don't understand this. The input to the ADC has to have a high impedance. It is not likely to influence the readings from your voltage sensor.

Also, if you wish for more sensitivity or precision from the temperature sensor, you might consider putting it in a Wheatstone bridge rather than just a simple voltage divider (but then you'd need to amplify the output signal up to the input range of the ADC, so more parts needed).
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: Time constant involving a resistor divider
« Reply #18 on: February 19, 2017, 08:43:42 pm »
Not really possible as the resistance of the sensor is fixed and the allowed input impedance is fixed so I'd never get orders of magnitude apart.

BTW, it doesn't have to be orders of magnitude apart. If the thermistor is 470 ohms, a 10 k filter resistor in the RC circuit should be fine.
 

Offline Andy Watson

  • Super Contributor
  • ***
  • Posts: 2074
Re: Time constant involving a resistor divider
« Reply #19 on: February 19, 2017, 08:53:52 pm »
if the main voltage source has gone dead

Dead ? Or to zero volts ? If the source is still connected, even at zero volts, it is still part of the circuit and the "top" resistor is still active.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #20 on: February 19, 2017, 08:57:26 pm »
if the main voltage source has gone dead

Dead ? Or to zero volts ? If the source is still connected, even at zero volts, it is still part of the circuit and the "top" resistor is still active.

Dead as is diconected. I have just verified on the breadboard. If I put a diode in series with the sig gen input to ensure only powered charge happens then the discharge time is twice the charge time. Aint theory great when you understand it (with some help)
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Time constant involving a resistor divider
« Reply #21 on: February 19, 2017, 10:25:01 pm »
ADC filter?

Ah!  Then your answer is this:

If the source impedance is varying (R depends on T!), then your filter won't be consistent.  That's bad!

How to solve?

Add a resistor in series, from the divider, to the ADC.  Make this resistor value several times larger than the thermistor's highest value.  Place the cap-to-GND after this resistor.

If you have a 10k + 10k(thermistor) divider, the maximum Thevenin resistance will be between 1 and 10k, for most temperatures you'd measure.  Add a 47k in series from this point, and follow it with, say, a 0.1uF cap, to get a time constant of 4.8 to 5.7 milliseconds. :-+

If you can't tolerate a large series resistance (maybe this application is low current, and the thermistor is huge, like 1Meg, and the ADC can't reliably read from a source resistance of 5Meg -- actually it probably will, despite what the datasheet says, but at that point, it depends), then the alternative is to buffer the signal.  You'd still use a capacitor on the thermistor, accepting that it won't do your final filtering job -- its job is only to set a maximum bandwidth.  This goes into an op-amp voltage follower, which is followed by another filter, which will have a constant cutoff frequency.  (You may also be able to use the op-amp as a Sallen-Key active filter, and get even sharper cutoff.  Not an issue for temperature inputs, but a valuable approach for faster analog inputs.)

This becomes very important at high frequencies, for example for a function generator output circuit: the DAC output needs to be AA filtered, but you can't connect the filter to the outside world because its impedance isn't constant (it depends on frequency -- that's why it's a filter, after all!).  You'd place the buffer (and you most likely need a lot of gain, anyway) after the filter, so the filter response remains constant, no matter what gain setting or load you have attached.

Tim
« Last Edit: February 19, 2017, 10:29:37 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: Time constant involving a resistor divider
« Reply #22 on: February 19, 2017, 10:38:16 pm »
Add a resistor in series, from the divider, to the ADC.  Make this resistor value several times larger than the thermistor's highest value.  Place the cap-to-GND after this resistor.

That's what I said in Reply #13. I'm glad my suggestion wasn't totally crazy.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Time constant involving a resistor divider
« Reply #23 on: February 19, 2017, 10:51:21 pm »
Add a resistor in series, from the divider, to the ADC.  Make this resistor value several times larger than the thermistor's highest value.  Place the cap-to-GND after this resistor.

That's what I said in Reply #13. I'm glad my suggestion wasn't totally crazy.

Yup, it's a good way to go :)

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

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9886
  • Country: us
Re: Time constant involving a resistor divider
« Reply #24 on: February 20, 2017, 01:02:07 am »

I don't understand this. The input to the ADC has to have a high impedance. It is not likely to influence the readings from your voltage sensor.

I wouldn't count on this.  The ADC input impedance of most uCs is fairly low and requires driving impedances down around 20k or less.  For the ATmega328 (Arduino), the source impedance needs to be less than 10k

Quote
The ADC is optimized for analog signals with an output impedance of approximately 10 k? or
less. If such a source is used, the sampling time will be negligible. If a source with higher impedance
is used, the sampling time will depend on how long time the source needs to charge the
S/H capacitor, with can vary widely. The user is recommended to only use low impedance
sources with slowly varying signals, since this minimizes the required charge transfer to the S/H
capacitor.


Emphasis added...

So, given that there will need to be a voltage follower from the high impedance thermistor (it is high impedance, right?), why not use the op amp as an integrator on the way by.  Put a capacitor in the feedback path. and work out the math for the RC time constant.  Or, just smooth the signal out a bit and let the uC do the integration.

« Last Edit: February 20, 2017, 01:04:13 am by rstofer »
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: Time constant involving a resistor divider
« Reply #25 on: February 20, 2017, 01:36:34 am »

I don't understand this. The input to the ADC has to have a high impedance. It is not likely to influence the readings from your voltage sensor.

I wouldn't count on this.  The ADC input impedance of most uCs is fairly low and requires driving impedances down around 20k or less.  For the ATmega328 (Arduino), the source impedance needs to be less than 10k

Quote
The ADC is optimized for analog signals with an output impedance of approximately 10 k? or
less. If such a source is used, the sampling time will be negligible. If a source with higher impedance
is used, the sampling time will depend on how long time the source needs to charge the
S/H capacitor, with can vary widely. The user is recommended to only use low impedance
sources with slowly varying signals, since this minimizes the required charge transfer to the S/H
capacitor.


Emphasis added...

So, given that there will need to be a voltage follower from the high impedance thermistor (it is high impedance, right?), why not use the op amp as an integrator on the way by.  Put a capacitor in the feedback path. and work out the math for the RC time constant.  Or, just smooth the signal out a bit and let the uC do the integration.

Interesting. However, since a thermistor will have a significant thermal time constant (measured in milliseconds) I'm not sure that fast sampling would be necessary or helpful. Also Simon mentioned his thermistor having a resistance of about 500 ohms, so that should permit a pretty low source impedance even after adding a smoothing filter.

I guess this shows assume nothing, always read the data sheet. Does the datasheet give any indication of sample time required for a stable reading at different source impedances?
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Time constant involving a resistor divider
« Reply #26 on: February 20, 2017, 01:41:00 am »
They give that spec as a best-results suggestion.  The internal series resistance is around 10k, so to charge the capacitor as fast as possible, the source should be less than 10k, so the total ESR is near 10k.

This maximizes analog bandwidth, but if you don't need analog bandwidth, it doesn't matter too much.

If you provide more acquisition time (between selecting the pin with the mux, and possibly reducing the clock divider to the low side of the recommended range), the source resistance (to maintain analog bandwidth higher than the sample rate) can be higher.

The voltage left on the ADC input (at the internal capacitor) is +/- 1 LSB from the value put into it.  If you continuously acquire from a single input channel, the capacitor remains charged between samples, so the DC load on the input is very small.

There should be a cross-talk between inputs, if you are acquiring several channels in sequence, using the mux.  Namely, that the residual charge on the capacitor bleeds into the next channel, and so on.  I've tested this on an ADC before (the MCP3208), and found very little effect, which is nice.

You're acquiring very few bits, anyway: the ATMEGA analog peripherals stink.  You barely get 8 bits without calibration, and 10 bits maximum.  (Most MCU ADCs are 12 bits.)  There's really very little to worry about, when the bandwidth and accuracy are so low as here. ;)

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

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #27 on: February 20, 2017, 07:36:46 am »
Well Ultimately I need to design a new board at some point to include a buffer amplifier and I'm starting to look to ARM in the form of a teensy that has more resolution on the analogue channels but the whole circuit analysis was starting to bug me as I've often thoiught about it in various applications.
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1395
Re: Time constant involving a resistor divider
« Reply #28 on: February 20, 2017, 10:17:18 am »
Well Ultimately I need to design a new board at some point to include a buffer amplifier and I'm starting to look to ARM in the form of a teensy that has more resolution on the analogue channels but the whole circuit analysis was starting to bug me as I've often thoiught about it in various applications.

Hello there,

If you post your circuit in full detail we can analyze this exactly with no guessing.  Circuit analysis is exact and will provide a guideline for what you should be doing.

For example, it sounds like you have three resistors and one thermistor and one cap and you are perturbing the junction with one of those resistors and a square wave from a digital output pin.  On the other hand, you were asking about what happens when the top resistor is disconnected from the power source.  So it's a little hard to tell exactly what circuit you are using.  Once we know the exact circuit we can do an exact analysis.

Here are two circuits drawn in text 'code' but a drawn picture is usually better.  Vcc is the positive supply voltage, Vin is the square wave input.  The output is taken from the junction of all the components in both circuits (top of C1).

Code: [Select]

Vcc o---R1---+---R2---o GND
             |
             C1
             |
             GND


            Vin
             o
             |
             R3
             |
Vcc o---R1---+---R2---o GND
             |
             C1
             |
             GND





                 

« Last Edit: February 20, 2017, 10:23:53 am by MrAl »
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3233
  • Country: gb
Re: Time constant involving a resistor divider
« Reply #29 on: February 20, 2017, 11:33:22 am »
if the main voltage source has gone dead

Dead ? Or to zero volts ? If the source is still connected, even at zero volts, it is still part of the circuit and the "top" resistor is still active.

Dead as is diconected. I have just verified on the breadboard. If I put a diode in series with the sig gen input to ensure only powered charge happens then the discharge time is twice the charge time. Aint theory great when you understand it (with some help)

This is the bit I don't understand.  You say you want to inject a pwm signal to dither thermistor signal, but then you seem to be implying that your PWM signal can only source current, and not sink it.  Is this correct, does you PWM come from an open collector/drain output?

PWM isn't going to work for this anyway unless it's fixed at 50%, since varying the duty cycle will obviously vary the voltage across the thermistor.
« Last Edit: February 20, 2017, 11:35:08 am by mikerj »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #30 on: February 20, 2017, 11:36:05 am »
As I said I was looking at the general circuit analysis and trying to work out the correct method. I gave the context of what I am doing but my original question was to work out how to analyse the system which I was unsure of despite just finishing studying this stuff.

Sent from my phone so mind the autocorrect.

 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #31 on: February 20, 2017, 12:37:52 pm »
PWM isn't going to work for this anyway unless it's fixed at 50%, since varying the duty cycle will obviously vary the voltage across the thermistor.

That is true
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21609
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Time constant involving a resistor divider
« Reply #32 on: February 20, 2017, 08:39:44 pm »
I would've thought that's the point, so you can do subtractive dithering for example?

In that case you want the PWM signal added to the thermistor signal.  It may be easier to supply the thermistor with a CCS, and put the thermistor "on top of" a low-value voltage divider that's driven by filtered PWM.

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

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #33 on: February 20, 2017, 10:16:08 pm »
If I put a 470K or 1M resistor from a 50% PWM to the thermistor/ADC input with a capacitor in parallel I'd be altering in turn the thermistor resistance and the pull up resistor by a very small percent and the capacitor will charge and discharge around the original voltage of the thermistor. A small capacitor would work if it had a series resistor
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 11790
  • Country: us
Re: Time constant involving a resistor divider
« Reply #34 on: February 21, 2017, 12:29:42 am »
I'd say there's no point dithering until you are first using the full available range of the ADC. So you would want to identify the minimum and maximum temperature you wish to measure, and then scale the output of the measuring circuit to cover the full input range of the ADC over that temperature range.
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #35 on: February 21, 2017, 07:32:12 am »
I'd say there's no point dithering until you are first using the full available range of the ADC. So you would want to identify the minimum and maximum temperature you wish to measure, and then scale the output of the measuring circuit to cover the full input range of the ADC over that temperature range.

That is right, however I am working to improve performnce on a board I have already designed. In a next version I would certainly put in an instrumentation amplifier with the option to bypass it where not needed. I'm also looking at using the teensy 3.6 as I'd also like to dable in CAN in the future so i'd have a higher resolution ADC.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19345
  • Country: gb
  • 0999
Re: Time constant involving a resistor divider
« Reply #36 on: February 21, 2017, 03:24:00 pm »
I wouldn't count on this.  The ADC input impedance of most uCs is fairly low and requires driving impedances down around 20k or less.  For the ATmega328 (Arduino), the source impedance needs to be less than 10k

Quote
The ADC is optimized for analog signals with an output impedance of approximately 10 k? or
less. If such a source is used, the sampling time will be negligible. If a source with higher impedance
is used, the sampling time will depend on how long time the source needs to charge the
S/H capacitor, with can vary widely. The user is recommended to only use low impedance
sources with slowly varying signals, since this minimizes the required charge transfer to the S/H
capacitor.


Emphasis added...

So, given that there will need to be a voltage follower from the high impedance thermistor (it is high impedance, right?), why not use the op amp as an integrator on the way by.  Put a capacitor in the feedback path. and work out the math for the RC time constant.  Or, just smooth the signal out a bit and let the uC do the integration.
But the sample and hold capacitor is tiny, a few pF at most. If the potential divider has a high impedance, then a capacitor across one of the resistors would help to provide a current spike to charge the sample and hold capacitor. The capacitor doesn't have to be big, a couple of nF would do.
 

Offline BrianHG

  • Super Contributor
  • ***
  • Posts: 7661
  • Country: ca
Re: Time constant involving a resistor divider
« Reply #37 on: February 22, 2017, 07:51:11 am »
Ok, we are back at this thermometer ADC resolution.  I've attached a design trick I did with a PIC getting a 0.1 degree resolution from -20 to 120 degrees centigrade with a 10 bit ADC, no over sampling or filters, or noise injection.  See attached image:

Since the thermosistor response isn't linear, I'm using 2 different switched restive loads.  It only requires a 2N3906, a 2.2k resistor and 1 additional 100k resistor.  No buffers, no filters.  Only 2 programmed temp conversion curves, the 100k setting always measured & if the ADC is below a set threshold, I turn on the 10K restive load and re-ADC getting the finer resolution at higher temperatures.  (In my design, RA2 is the 10 bit ADC, The thermosistor is tied to a thermosistor, then the other side to the GND, IO RC0 adds the 10kohm load to switch between high and low temperature range.)

I though this might be an alternative to trying to squeeze and ADC to read the upper half of the curve with your fixed 1 load on the thermosistor.  Also, having the 100k as the default only shortly pulsing the 10k just before and during sampling will use less power and reduces the heat in the thermosistor generated by the voltage across it.

For your lower impedance thermosistor, I would change the 10k in my schematic to 1k and the 100k to 10k.
« Last Edit: February 24, 2017, 12:24:15 am by BrianHG »
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1395
Re: Time constant involving a resistor divider
« Reply #38 on: February 22, 2017, 06:00:08 pm »
Hi,

You really have to show the circuit.  Which circuit is it?
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1395
Re: Time constant involving a resistor divider
« Reply #39 on: February 22, 2017, 06:24:34 pm »
For example, in the second circuit shown in post #28 we would get this:

Vc=(-(((Vcc-v)*R2-v*R1)*R3+(Vin-v)*R1*R2)*e^((-(t*R2+t*R1)*R3-t*R1*R2)/(C*R1*R2*R3))+Vcc*R2*R3+Vin*R1*R2)/((R2+R1)*R3+R1*R2)

where
Vcc is the supply voltage,
Vc is the cap voltage after time t,
v is the initial cap voltage at time t=0.
R1, R2, R3 shown in post #28.

To apply this, start with v=0 and Vin=pulse high voltage and go from there.  For the first pulse use t=pulse width, then calculate Vc.  For the low portion of the pulse, set Vin=0 and v=last value of Vc, then calculate the new Vc.
For the next high pulse, set Vin=high pulse voltage again and v=last value of Vc calculated and t=next high pulse width, then calculate another Vc.  Repeat that process for any number of pulses of any width and spaced apart by any amount.
The only trick is to set v equal to the last value of Vc calculated in the previous step.

Notes:
You may be able to simplify that expression a little algebraically.
For a constant pulse width and constant spacing, there may be a dual closed form of the expression that calculates the highest point and the lowest point.
The expression shown allows us to calculate the voltage at any time even when the pulse width and/or spacing between pulses varies.
« Last Edit: February 22, 2017, 06:35:52 pm by MrAl »
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1395
Re: Time constant involving a resistor divider
« Reply #40 on: February 23, 2017, 02:44:28 pm »
Hello again,

I thought i should add that the AC averaged model analysis result of the above circuit and associated formula is much simpler:
Vc=(Vcc*R2*R3+d*Vin*R1*R2)/(R2*R3+R1*R3+R1*R2)

where the added variable 'd' is the duty cycle (0.50=50 percent duty cycle, 0.25=25 percent duty cycle, etc.).

This is valid as long as the cap value is large enough (together with the resistors) to prevent nearly complete discharge or nearly complete charge.  This is usually the case anyway when we filter a signal where there is only a relatively small amount of ripple.

This expression, being the result of an AC averaged analysis, is of course void of the small AC contributions to the capacitor voltage (as it should) which means we cant see the highest and lowest point using that formula.  To see that we could easily use the original formula or apply the original (long) formula after we calculate the average capacitor voltage using this new formula.  This voltage would be used as the initial cap voltage in the longer formula and then we could calculate a peak or a valley or both as needed.  This should provide enough accuracy for study of the behavior.  It certainly would not hurt to use a circuit simulator though  too :-)



« Last Edit: February 23, 2017, 02:48:54 pm by MrAl »
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #41 on: February 24, 2017, 09:31:07 pm »
Well for the result of this little network on my actual data aquisition you can go here: https://www.eevblog.com/forum/microcontrollers/(avr)-adc-oversampling-function/new/#new where the original oversampling function I came up with was refined and discussed.
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1395
Re: Time constant involving a resistor divider
« Reply #42 on: February 24, 2017, 10:01:22 pm »
Well for the result of this little network on my actual data aquisition you can go here: https://www.eevblog.com/forum/microcontrollers/(avr)-adc-oversampling-function/new/#new where the original oversampling function I came up with was refined and discussed.

Hi Simon,

Oh so you got it to work as you need it to work?  I thought you wanted to delve into the theory a little more just more or less to understand the operation a little better or perhaps to optimize the process of oversampling through mathematics.

One thing i did not understand is what the capacitor was for in the first place.  Any ideas?
 

Offline SimonTopic starter

  • Global Moderator
  • *****
  • Posts: 17728
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Time constant involving a resistor divider
« Reply #43 on: February 24, 2017, 10:16:20 pm »


Hi Simon,

Oh so you got it to work as you need it to work?  I thought you wanted to delve into the theory a little more just more or less to understand the operation a little better or perhaps to optimize the process of oversampling through mathematics.

One thing i did not understand is what the capacitor was for in the first place.  Any ideas?


Yes initially I needed to understand the maths and analysis technique to work out the component values work with the frequency I was going to use hence I needed to know the charge and discharge constant of a capacitor in such a network. This was in itself quite a theoretical question and something that in fact I should supposedly be able to answer myself having just studied this very topic and got a merit in the assignment for it. However I struggled.

Yes the context of be doing this analysis was to get this working with an oversampling function I had also developed. In order for the oversampling function to work the requisite amount of noise at the correct frequency is required and to get that to work it is quite an analogue circuit problem to solve. I won't pretend I have solved it scientifically but it is near enough and the overall solution comprising of this analogue analysis and my new code is giving me the result I desired.
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1395
Re: Time constant involving a resistor divider
« Reply #44 on: February 25, 2017, 12:43:14 pm »
Hi,

Ok sounds like you are done with this circuit then.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf