Maker Pro
Maker Pro

Prefered resistor range

G

Glenn Gundlach

OK, but if you're doing an active filter and needing resistors closer
than 1%, don't you need capacitors to that precision as well?

My stuff wasn't using RC but sometimes a fairly precise voltage
reference using an AD588 for the +/- 5 volt references. Uusally I could
juggle 2 series values to get within a 5 mV range.
GG
 
T

The Phantom

You appear to have assumed that the resistors
to be used would be 1% tolerance. It happens
that the 0.1% tolerance parts come in the same
values, (or more, for more money), so there is a
use for calculations such as the above example.

You don't have to be using .1 % resistors to get a benefit.

Imagine that you have designed a filter and need a 134.985k resistor.
The nearest E96 values are 133k and 137k. As it happens, 134.985k is
about 1.5% greater than 133k and 1.5% less than 137k, so you can't
find a standard 1% value that is actually guaranteed to be within 1%
of 134.985k. In fact, you can't get any closer than about 1.5%.

There are gaps like that between nearly every pair of adjacent E96
standard values where, in that gap, you are further than 1% away from
either of the nearest standard values (all but 4 adjacent pairs are
like this).

But if you parallel the two standard values 255k and 287k, you are in
effect synthesizing a 135.027675k resistor that is guaranteed to be
within 1% of that value. Since this is within .03% of 134.985k, we
have a resistance that is guaranteed to be within just about 1% of the
134.985k we want, instead of only 1.5%.
 
T

Terry Given

Glenn said:
OK, but if you're doing an active filter and needing resistors closer
than 1%, don't you need capacitors to that precision as well?

depends on the sensitivity of the topology to the cap values, but maybe.
My stuff wasn't using RC but sometimes a fairly precise voltage
reference using an AD588 for the +/- 5 volt references. Uusally I could
juggle 2 series values to get within a 5 mV range.
GG

Cheers
Terry
 
T

Terry Given

Larry said:
[Regarding finding accurate resistor combinations]
I do this with Brute Force (ie matlab). I have a simple s-file that takes an array of available values, which may or may not be
entire ranges - smt design optimisation usually involves minimising the number of different parts.

Then I calculate every possible 1,2,3,4 resistor combination, using:

1 resistor
2 series
2 parallel
1 paralleled with (2 series)
2 paralleled with (2 series)

and for each of the 5 cases sort the result in order of increasing error

I specify a required accuracy, then throw away all results which are worse.

then display the first 10 entries in each of the 5 combinations.

Yeah, it makes HAL9000 do a *lot* of calculations, but so what - it results in a barely perceptible delay between hitting <enter>
and getting the answers.


What I did is almost brute force, in that it tries
a number of combinations. But because of the
algorithmic derivation of available value from
desired value, it is much less brutish than the
approach you outline. That said, I would not
be the one to criticize the approach merely
for using more likely spare cycles. Wetware
cycles are becoming the scarcer resource
these days, (excepting, naturally, the most
brilliant among us, whoever they are.)

If you are willing to share that code, I would
like to see it (via email).

Its pretty easy really:

R is a row vector containing all the resistor values you have to work
with (in our case, all the ones fitted to the smt machine)

the only subtlety here is an s-file prints a variable (or calculation
result) if you dont put a ';' after it - that is what the "bestfit"
lines by themselves do.


function bestfit=resistor(rnom);
%find best fit for limited set of resistors
%connected as (R1+R2) // R3 // R4
%0 means not fitted

R = [1.5, 3.3, 10, 24, 47, 100, 150, 330, 470, 1000, 1330, 3010, 3300,
4700, 6650, 10000, 16500, 20000, 26700, 33000, 47000, 63400, 100000,
330000, 470000, 1000000];
besterror = 100;

% R3 only
for n3=1:1:length(R)
r=R(n3);
error = (r-rnom)/rnom;
if abs(error) < abs(besterror)
besterror = error;
bestfit = [0, 0, R(n3), 0, besterror*100];
end
end
bestfit

% R3 // R4 only
for n3=1:1:length(R)
for n4=n3:1:length(R)
r=R(n3)*R(n4)/(R(n3)+R(n4));
error = (r-rnom)/rnom;
if abs(error) < abs(besterror)
besterror = error;
bestfit = [0, 0, R(n3), R(n4), besterror*100];
end
end
end
bestfit

% R1 + R2 only
for n1=1:1:length(R)
for n2=1:1:length(R)
r = R(n1) + R(n2);
error = (r-rnom)/rnom;
if abs(error) < abs(besterror)
besterror = error;
bestfit = [R(n1), R(n2), 0, 0, besterror*100];
end
end
end
bestfit

% (R1 + R2) // R3
for n1=1:1:length(R)
for n2=1:1:length(R)
for n3=1:1:length(R)
rser = R(n1) + R(n2);
r = rser*R(n3)/(rser+R(n3));
error = (r-rnom)/rnom;
if abs(error) < abs(besterror)
besterror = error;
bestfit = [R(n1), R(n2), R(n3), 0, besterror*100];
end
end
end
end
bestfit

% (R1 + R2) // R3 // R4
for n1=1:1:length(R)
for n2=1:1:length(R)
for n3=1:1:length(R)
for n4=n3:1:length(R)
rser = R(n1) + R(n2);
r = 1/(1/rser + 1/R(n3) + 1/R(n4));
error = (r-rnom)/rnom;
if abs(error) < abs(besterror)
besterror = error;
bestfit = [R(n1), R(n2), R(n3), R(n4), besterror*100];
end
end
end
end
end
bestfit


Pretty easy really, and a doddle to implement in any programming
language. Here's a calculated result:

resistor(6.33125e3);
bestfit =
1.0e+003 *
0 0 6.65000000000000
0 0.00503455083909

[so a 6.65k resistor (which I have) is within 5.034%]

bestfit =
1.0e+005 *
0 0 0.06650000000000
1.00000000000000 -0.00001514720263

[6k65//100k within 1.514%]

bestfit =
1.0e+003 *
3.01000000000000 3.30000000000000 0
0 -0.00033563672261

[3k01 + 3k3 within 0.3356%]

bestfit =
1.0e+005 *
0.33000000000000 1.00000000000000 0.06650000000000
0 0.00000032905561

[ (33k + 100k)//6k65 within 0.0329% ]

bestfit =
1.0e+004 *
0.47000000000000 0.47000000000000 3.30000000000000
4.70000000000000 -0.00000100731309

[ (4k7 + 4k7)//33k//47k within 0.01007% ]

which checks out as 6.330612k.

Voila. Utterly trivial to have, say, E12 version. But ultimately I only
care about the bits I have in stock.

the moderately evil output scaling is just a matlab thing, I could
change it if I wanted to, but who cares :)

Cheers
Terry
 
R

Robert Monsen

The said:
Have a look at the little Basic routine I posted. Whoever
originally wrote it did a good job of curve fitting and came up with a
formula (algorithm?) that properly calculates those oddball values
that a simple root-of-10 method doesn't get right. Thus you don't
need any tables.

A table lookup is about 10000 times faster, though. Doing all that math
is going to hurt, particularly in basic...

You could also just look here:

http://www.logwell.com/tech/components/resistor_values.html

--
Regards,
Robert Monsen

"Your Highness, I have no need of this hypothesis."
- Pierre Laplace (1749-1827), to Napoleon,
on why his works on celestial mechanics make no mention of God.
 
T

Terry Given

Robert said:
A table lookup is about 10000 times faster, though. Doing all that math
is going to hurt, particularly in basic...

what the hell are you using for your calculations - an abacus?

I concede it would be a pain on a calculator, but thats about it

Although I confess I do most of this manually, without even a calculator :]

Cheers
Terry
 
L

Larry Brasfield

The Phantom said:
Have a look at the little Basic routine I posted. Whoever
originally wrote it did a good job of curve fitting and came up with a
formula (algorithm?) that properly calculates those oddball values
that a simple root-of-10 method doesn't get right. Thus you don't
need any tables.

I copied it for later study shortly after you posted it.
There is an interesting mix of both the straightforward
logarithmic decade splitting and some adjustment via
a cubic polynomial. It is quite a tangle, analytically.
I suspect it was quite a trial and error effort rather
than founded on anything like the original algorithm.

If it covers the whole set of tolerances without any
corrections, I will be amazed. But using that kind of
method is very fragile against changing requirements.
Using tables judiciously can make for better code.
 
L

Larry Brasfield

Glenn Gundlach said:
OK, but if you're doing an active filter and needing resistors closer
than 1%, don't you need capacitors to that precision as well?

No. Your point is well taken, though. If you have to
give up precision because you can only buy 5% caps,
there is a diminishing return from more accurate resistors.
The problem is that the 1% standard values are separated
by about 2.4% so the closest value can already be up to
1.2% away from what you want. (The gap actually can
be bigger or smaller due to rounding effects.) That error
adds to the error you finally accept from the resistor itself.

In active filter design, I find discovery of 5% cap pairs
where I want them to be at least as useful as having a
way of reducing that resistor interval error.
My stuff wasn't using RC but sometimes a fairly precise voltage
reference using an AD588 for the +/- 5 volt references. Uusally I could
juggle 2 series values to get within a 5 mV range.

Fun, was it?
 
T

The Phantom

I copied it for later study shortly after you posted it.
There is an interesting mix of both the straightforward
logarithmic decade splitting and some adjustment via
a cubic polynomial. It is quite a tangle, analytically.
I suspect it was quite a trial and error effort rather
than founded on anything like the original algorithm.

If it covers the whole set of tolerances without any
corrections, I will be amazed.

-------> But using that kind of
method is very fragile against changing requirements.
Using tables judiciously can make for better code.<-------

Can you explain what you mean by this? Maybe with an example of how
tables would be better than the little routine?

The routine I gave will take up less space than than all the tables
for E12, E24, E48, E96 and E192.

And in answer to Robert Monsen, modern computers are *really* fast.
You don't really notice the time the routine takes. If you're only
going to do a few computations the results will seem instantaneous.
If you're going to do what Terry is doing, do what I describe below.

I have done the same sort of thing Terry Given describes, finding
optimum combinations of resistors. I just call the Basic routine a
few times and fill an array with the values. This is just as fast as
having a static table, but I don't have to have all the tables as I
mentioned above. I just create the tables or portions therof that I
need.
 
T

The Phantom

what the hell are you using for your calculations - an abacus?

I concede it would be a pain on a calculator, but thats about it

It's not even *much* of a pain at that. On my 20 year old HP-71, it
only takes about a second to return a value. The HP48 is faster. You
just leave this little routine in your calculator and if you need a
standard value, you have it in a second. Quicker even than looking it
up on a sheet of paper.

Although I confess I do most of this manually, without even a calculator :]

Cheers
Terry
 
T

Terry Given

The said:
-------> But using that kind of



Can you explain what you mean by this? Maybe with an example of how
tables would be better than the little routine?

The routine I gave will take up less space than than all the tables
for E12, E24, E48, E96 and E192.

And in answer to Robert Monsen, modern computers are *really* fast.
You don't really notice the time the routine takes. If you're only
going to do a few computations the results will seem instantaneous.
If you're going to do what Terry is doing, do what I describe below.

I have done the same sort of thing Terry Given describes, finding
optimum combinations of resistors. I just call the Basic routine a
few times and fill an array with the values. This is just as fast as
having a static table, but I don't have to have all the tables as I
mentioned above. I just create the tables or portions therof that I
need.

Ludicrous amounts of computing power is a truly wonderful thing. It just
pisses me off when its used to animate a stupid puppy in a search
utility, thats too fucking stupid to let me select a particular
directory within which to search. Thankfully I have Ztree.

Cheers
Terry
 
T

The Phantom

I do this with Brute Force (ie matlab). I have a simple s-file that
takes an array of available values, which may or may not be entire
ranges - smt design optimisation usually involves minimising the number
of different parts.

Then I calculate every possible 1,2,3,4 resistor combination, using:

1 resistor
2 series
2 parallel
1 paralleled with (2 series)
2 paralleled with (2 series)

and for each of the 5 cases sort the result in order of increasing error

I specify a required accuracy, then throw away all results which are worse.

then display the first 10 entries in each of the 5 combinations.

Yeah, it makes HAL9000 do a *lot* of calculations, but so what - it
results in a barely perceptible delay between hitting <enter> and
getting the answers.

Exactly. So what? My criterion for acceptable speed has always
been; if the result is there on the monitor, or the display of my
calculator when I have picked up my pencil to write down the results
in my notebook, then that's fast enough!

I once did some designs for audio, some second order filters. Two
R's and two C's. We were using these low-cost Japanese carbon film
resistors, 5% nominal. I noticed that without fail, they were within
1% of their nominal values. But only values from the E24 series were
available. And the 5% caps we were using were similarly close to
their nominal values. So, rather than specify particular cap values
and then try to find combinations of resistors to get close to the
exact computed values, I generated arrays with a decades worth of
resistor standard values centered on the computed exact values, and
the same with the caps. Then I programmed four nested loops to try
every possible combination of 2 R's and 2 C's, sorting in order of how
closely the desired filter polynomial was realized. This was in the
late 70's, running on Microsoft interpreted Basic. It ran all night,
but there were all the possibilities in the morning! I'm pretty sure
that today it would be fast enough to meet my criterion for acceptable
speed! I guess that's your experience; I just haven't had a need to
do this for a long time.
 
J

John Woodgate

I read in sci.electronics.design that The Phantom <[email protected]>
wrote (in said:
I don't know; I was hoping you would. :)

Seriously, though, I have never seen an explanation I would consider
truly authoritative. But some years the question came up in the
British magazine, Wireless World, and I believe that "Cathode Ray"
said that slight perturbations were made so that the color
combinations on the resistor body would be more distinguishable.
Perhaps John Woodgate can help us out here.
It wasn't 'Cathode Ray' (M G Scroggie) but another nom de plume, 'Thomas
Roddam' (whose real name was published when he died but I can't find
it).

Even so, the explanation was not very convincing. If I can get the
calculation right this time, the E12 ratio is 10^(1/12) = 1.211528..

To two figures, the values 10, 12, 15, 18, 22, 56 and 68 are correctly
rounded, but the 'missing' values are 26.10157, not 27, 31.62278, not
33, 38.31187, not 39, 46.41589, not 47, and 82.54042, not 82.

The explanation put forward was that the values were adjusted to get
'better colour contrast'. This would have been plausible if 25 (red-
green) had been avoided, but it really don't hold up in the actual
cases. And the 'adjusted' values don't give even approximately equal
quantities of the different coloured paints.

I found some 48 k resistors in a piece of WW2 equipment. I guess someone
ran out of violet paint.
 
T

Terry Given

The said:
[SNIP]
Yeah, it makes HAL9000 do a *lot* of calculations, but so what - it
results in a barely perceptible delay between hitting <enter> and
getting the answers.


Exactly. So what? My criterion for acceptable speed has always
been; if the result is there on the monitor, or the display of my
calculator when I have picked up my pencil to write down the results
in my notebook, then that's fast enough!

thats good enough for me, too :)
I once did some designs for audio, some second order filters. Two
R's and two C's. We were using these low-cost Japanese carbon film
resistors, 5% nominal. I noticed that without fail, they were within
1% of their nominal values. But only values from the E24 series were
available. And the 5% caps we were using were similarly close to
their nominal values. So, rather than specify particular cap values
and then try to find combinations of resistors to get close to the
exact computed values, I generated arrays with a decades worth of
resistor standard values centered on the computed exact values, and
the same with the caps. Then I programmed four nested loops to try
every possible combination of 2 R's and 2 C's, sorting in order of how
closely the desired filter polynomial was realized. This was in the
late 70's, running on Microsoft interpreted Basic. It ran all night,
but there were all the possibilities in the morning! I'm pretty sure
that today it would be fast enough to meet my criterion for acceptable
speed! I guess that's your experience; I just haven't had a need to
do this for a long time.

Nice. Although it does remind me of the spice simulation that ran for
almost 3 days. We started it on friday afternoon, then went on the piss
(someone was leaving, so shouted a keg. great place to work :)

Alas, monday morning rolled around and we discovered the fucking hard
drive was full (after 1.4Gb of .dat file), and it had stopped late
saturday night. doh.

Cheers
Terry
 
T

Terry Given

The Phantom wrote:
[snip]
Exactly. So what? My criterion for acceptable speed has always
been; if the result is there on the monitor, or the display of my
calculator when I have picked up my pencil to write down the results
in my notebook, then that's fast enough!

I once did some designs for audio, some second order filters. Two
R's and two C's. We were using these low-cost Japanese carbon film
resistors, 5% nominal. I noticed that without fail, they were within
1% of their nominal values. But only values from the E24 series were
available. And the 5% caps we were using were similarly close to
their nominal values. So, rather than specify particular cap values
and then try to find combinations of resistors to get close to the
exact computed values, I generated arrays with a decades worth of
resistor standard values centered on the computed exact values, and
the same with the caps. Then I programmed four nested loops to try
every possible combination of 2 R's and 2 C's, sorting in order of how
closely the desired filter polynomial was realized. This was in the
late 70's, running on Microsoft interpreted Basic. It ran all night,
but there were all the possibilities in the morning! I'm pretty sure
that today it would be fast enough to meet my criterion for acceptable
speed! I guess that's your experience; I just haven't had a need to
do this for a long time.

Of course a CS type would have pissed around for a week trying to find a
smart way of doing less calculations....

Cheers
Terry
 
T

The Phantom

I read in sci.electronics.design that The Phantom <[email protected]>

It wasn't 'Cathode Ray' (M G Scroggie) but another nom de plume, 'Thomas
Roddam' (whose real name was published when he died but I can't find
it).

Do you know which issue had this discussion? I don't remember. I
sure wish Wireless World would come out with a searchable database (on
DVD perhaps) for all the issues.
Even so, the explanation was not very convincing. If I can get the
calculation right this time, the E12 ratio is 10^(1/12) = 1.211528..

To two figures, the values 10, 12, 15, 18, 22, 56 and 68 are correctly
rounded, but the 'missing' values are 26.10157, not 27, 31.62278, not
33, 38.31187, not 39, 46.41589, not 47, and 82.54042, not 82.

The explanation put forward was that the values were adjusted to get
'better colour contrast'. This would have been plausible if 25 (red-
green) had been avoided, but it really don't hold up in the actual
cases.

I had the same reaction as you; I immediately thought that perhaps
the idea had been to help out those who had red-green color blindness.
But as you say, it doesn't seem that the values chosen make sense
under this theory.

Have you ever heard any other reasonable explanation? I wonder if
there is anyone still alive who knows for sure. Or is there a written
description of the procedure followed in some old proceedings?
 
F

Fred Bloggs

John said:
I read in sci.electronics.design that The Phantom <[email protected]>


It wasn't 'Cathode Ray' (M G Scroggie) but another nom de plume, 'Thomas
Roddam' (whose real name was published when he died but I can't find
it).

Even so, the explanation was not very convincing. If I can get the
calculation right this time, the E12 ratio is 10^(1/12) = 1.211528..

To two figures, the values 10, 12, 15, 18, 22, 56 and 68 are correctly
rounded, but the 'missing' values are 26.10157, not 27, 31.62278, not
33, 38.31187, not 39, 46.41589, not 47, and 82.54042, not 82.

The explanation put forward was that the values were adjusted to get
'better colour contrast'. This would have been plausible if 25 (red-
green) had been avoided, but it really don't hold up in the actual
cases. And the 'adjusted' values don't give even approximately equal
quantities of the different coloured paints.

I found some 48 k resistors in a piece of WW2 equipment. I guess someone
ran out of violet paint.

Well- I am here to tell you that 1) the explanation about color contrast
is bunk, 2) no curve fit necessary, and 3) there exists a very-very-very
simple formulation to calculate precisely every single value to three
digits without the mysterious roundoff error effect due to preferred
values. You know how to do this too- just stop playing your games.
 
F

Fred Bloggs

Larry said:
Tables are used only for certain limited arbitrary data
and to correct for those few results that do not agree
with the publish tables when computed algorithmically.

Your inability to discern an algorithmic approach when
it is there in plain sight marks you as the pretender with
respect to claims of intellectual power.

Here's the deal , retard. If tables "...are used...for certain limited
arbitrary data and to correct for those few results that do not agree
with the publish tables when computed algorithmically" which is your
bullsh_t way of saying WHEN THE "ALGORITHM" FAILS, then you don't have
much of an algorithm, do you sh_t-for-brains. For someone who pretends
to such a high standard of excellence, you sure are one mediocre and
second rate piece of trash. But you go ahead and sit on your little
self-styled pedestal of superiority- the more you open your ignorant,
pompous, mouth, the more we can point out your pedestal is a pile of pig
sh_t.
 
F

Fred Bloggs

Larry said:
Larry Brasfield wrote:

[Cut worthless spew and off-point material.]
Ooh my- well we have been down that road before and that is NOT how you reasonably calculate a parallel combination.


Ok, Mr. superior resistor calculator. Take the
above example and find a pair that more closely
achieves the specified result. If you cannot do
that, define "reasonably calculate" such that your
method beats a few seconds of typing.

[Cut more worthless spew.]

I am not here to educate you, stupid, simple, and pretentious, nobody
that you are. But taking your wussy example as a case in point, your
little idiot program computes a 1.43M - this number is not readily
available in many manufacturer E96 lines- Xicon only has 1.0M, 1.5M, and
2.2M, other lines like IRC, and Vishay stop at 1.0M, as a standard
catalog offering available from places like Mouser. Since you are
actually a non-practitioner, you missed the fact that 1.43M was an
oddball value, anyone else would have known better. Thnx for the
ammunition though, like I said, you're so damned dumb, every time you
post, we find out more and more to confirm you are simple fraud and
incompetent.
 
J

John Woodgate

I read in sci.electronics.design that The Phantom <[email protected]>
Do you know which issue had this discussion? I don't remember. I
sure wish Wireless World would come out with a searchable database (on
DVD perhaps) for all the issues.

The previous editor wanted to recruit readers to scan and OCR back
issues! Fat chance!

There is a set of 5 full-text CDs covering 1999 to 2003. £30 each. A CD
was produced, containing the indexes for both EW and 'Television' from
1988 to 1999, but it seems not to be available any more.
I had the same reaction as you; I immediately thought that perhaps the
idea had been to help out those who had red-green color blindness. But
as you say, it doesn't seem that the values chosen make sense under this
theory.

I managed to locate T Roddam's explanation, in a Letter to the Editor,
May 1984. This includes a very interesting piece about calculations
using preferred values. I can't render it in ASCII, because it includes
logs to base 6! So I'll scan it and put it on A.B.S.E. as 'Preferred
values and colour codes'.
Have you ever heard any other reasonable explanation? I wonder if there
is anyone still alive who knows for sure.

The participants would have been middle-aged before WW2, so I think not.
Or is there a written
description of the procedure followed in some old proceedings?

Roddam isn't specific about which 'committee' was responsible. It may
have been one under the aegis of the (British) Radio Manufacturers'
Association.
 
Top