voltage divider program - helps find best ratio

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,307
That has a place in the design phase, but later you need testing by a fool before you can address making something foolproof. The dog isn't foolish enough. A human fool is a very tricky thing to anticipate.
Foolproof is a myth. The best you can ever hope for is fool-resistant!
 

crutschow

Joined Mar 14, 2008
38,526
And going one step further, you can take three resistors and come up with an infinite number of combinations for a voltage divider with any amount of tolerance desired.
You can do it to any amount of precision, but the tolerance (accuracy) is no better than the tolerance of the resistors used, of course.
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,307
You can do it to any amount of precision, but the tolerance (accuracy) is no better than the tolerance of the resistors used, of course.
Yeah, at first l was interested in seeing what I could do with programming something to pick the more complex resistor arrangements, but so far even the two resistor arrangements can get much closer than the tolerances of the resistors I'm using, so it seems kind of pointless.

I mean, I might write the program anyway, just for coding practice, but I can't imagine I'd use it much!
 

joeyd999

Joined Jun 6, 2011
6,305
You can do it to any amount of precision, but the tolerance (accuracy) is no better than the tolerance of the resistors used, of course.
No. We had this argument once before. A series combination of n randomly chosen resistors of value X will approach the value of nX ohms exactly.
 

crutschow

Joined Mar 14, 2008
38,526
even the two resistor arrangements can get much closer than the tolerances of the resistors I'm using, so it seems kind of pointless.
Not at all.
If you can get the ratio precise, than the divider tolerance is no worse than the resistor tolerance.
If you just arbitrarily select two resistors to get the divider, than the error is the tolerance plus how much the ratio differs from the desired.
For example below is the result from my program for an arbitrary ratio with two 1% resistor values:
Note that the first two ratios are more than 1% from the desired, and the worst-case ratio error would be that value ±1%.
For the first ratio, the worst-case error would thus be 2.2%.
The best case for the bottom resistor selection would be 1.6%
If you added a third resistor to get the theoretical divider error down to a negligible value, then the worst-case actual error would be 1%.

upload_2019-2-10_12-37-45.png
 

AlbertHall

Joined Jun 4, 2014
12,626
A series combination of n randomly chosen resistors of value X will approach the value of nX ohms exactly.
This assertion is true if, and only if, the assumption that the resistor values are randomly assorted around their nominal value is valid.
This is a dangerous assumption unless you have an ohmmeter which can confirm the assumption.
 

joeyd999

Joined Jun 6, 2011
6,305
This assertion is true if, and only if, the assumption that the resistor values are randomly assorted around their nominal value is valid.
This is a dangerous assumption unless you have an ohmmeter which can confirm the assumption.
Like I've said, we've had this argument prior. No need to rehash it.
 

WBahn

Joined Mar 31, 2012
32,875
You can do it to any amount of precision, but the tolerance (accuracy) is no better than the tolerance of the resistors used, of course.
No, you can't do it to any amount of precision (by which I mean you are talking about the nominal value and not the ability to repeat the value).

You have a finite number of values you can use for the three resistors (since, after all, if we are talking about a continuous range of possible resistor values, the same result could be achieved with one fixed resistor and a second resistor that we get to choose the value for). That means that you can enumerate every possible voltage divider ratio for all possible combinations of three resistors. If you plot them on a number line, there will be a finite number of dots on that line. Fine the two that are the furthest apart and take the average. Now find a set of resistors that yields that ratio. You can't! Because if you could there would already be a dot there!
 

WBahn

Joined Mar 31, 2012
32,875
No. We had this argument once before. A series combination of n randomly chosen resistors of value X will approach the value of nX ohms exactly.
But let's keep in mind that this isn't an option here. The claim is that using THREE resistors we can get ANY desired voltage division ratio to ANY desired tolerance.
 

Thread Starter

ebeowulf17

Joined Aug 12, 2014
3,307
Not at all.
If you can get the ratio precise, than the divider tolerance is no worse than the resistor tolerance.
If you just arbitrarily select two resistors to get the divider, than the error is the tolerance plus how much the ratio differs from the desired.
For example below is the result from my program for an arbitrary ratio with two 1% resistor values:
Note that the first two ratios are more than 1% from the desired, and the worst-case ratio error would be that value ±1%.
For the first ratio, the worst-case error would thus be 2.2%.
The best case for the bottom resistor selection would be 1.6%
If you added a third resistor to get the theoretical divider error down to a negligible value, then the worst-case actual error would be 1%.

View attachment 169935
I'll admit that "pointless" was an over-statement. All I meant to say was that the amount of error due to resistor tolerances was going to swamp the amount of error in the ratio of selected resistors. I had already been amazed by how close I could get to the desired target ratio with E48 values. I did a little number crunching before replying, and now I see where I went wrong.

I've been running a lot of test samples in my mode "2" where it allows the combined use of all E24 and E48 series values. By allowing resistors from both series, I'm able to get ratios very close to the target ratio... but with the higher 5% tolerance that comes with E24 values. So in that scenario, I'm getting a really good ratio, but a crummy resistor tolerance. If I limit the system to E48 (2%) values, I can't get as close to the target ratio, so the ratio error becomes a bigger factor, relative to the now smaller resistor tolerance.

It was the combining of E24 and E48 series values that made it seem to me like it was easy to find ratios that are very, very close to the target ratio, but I realize now that in practice this improved ratio could be lost to the potential resistor tolerance errors.

Maybe I'll play around with the three resistor calculation system sometime after all! As long as I'm continuing to improve this, I might as well add the E96 series too. If I get these improvements implemented, I'll share the results here.
 
Top