too many possibilities...

On 12/10/2020 16:27, jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1

However, you have one in twice (inverted) and missed R25||R26 + R27||R28

Now I have 19 different resistor values on my BOM. That makes
something like 8^19 possibilities. I also have 5 quad r-packs, each of
which can have 15 possible arrangements to make an equivalent
resistor.

There are a relatively finite number of possible configurations:


N Circuits Nodes Resistor choices

2 1 1 19^2
3 2 2+1 19^3
4 5 5+4 19^4

+M other internal nodes present that could be used

So we have 8^34 possibilities. Many more if you are flexible about how
you use the r-pack sections. The program would run for millenia. It
might take millenia just to write.

You actually have only 19^2+3*19^3+9*19^4 combinations to consider which
is less than a quarter of a million using a brute force attack for N<4.

Since A+B = B+A and A||B = B||A you can easily gain a couple of factors
of two increase in speed by insisting that certain values must be larger
than their friend in any pairs.

--
Regards,
Martin Brown
 
On Mon, 12 Oct 2020 08:27:53 -0700, jlarkin@highlandsniptechnology.com
wrote:

On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1

Now I have 19 different resistor values on my BOM. That makes
something like 8^19 possibilities. I also have 5 quad r-packs, each of
which can have 15 possible arrangements to make an equivalent
resistor.

So we have 8^34 possibilities. Many more if you are flexible about how
you use the r-pack sections. The program would run for millenia. It
might take millenia just to write.

And this is a simple problem. My main point is that very many circuits
can be made from a few parts.

It\'s a 32-page schematic, and this is just one dumb voltage regulator.

Somehow our brains deal with this, and we get things to work.

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Next, allow two different r-pack values. We have 26 in stock.

In Computability Theory, this is like the bin-packing problem - the
possibilities grow at least proportional to 2^k for k entities, so toy
problems are easy, and practical problems are impractical. The name
of the class containing this kind of problem is \"NP Complete\".

..<https://en.wikipedia.org/wiki/Bin_packing_problem>

Lots of economically significant problems fall into this class. The
classic practical approach is to look for adequate answers, versus
theoretically optimum answers.

Joe Gwinn
 
On Mon, 12 Oct 2020 17:29:02 +0100, Martin Brown
<\'\'\'newspam\'\'\'@nonad.co.uk> wrote:

On 12/10/2020 16:27, jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1

However, you have one in twice (inverted)

They have different division ratios, 0.6 and 0.4.

>and missed R25||R26 + R27||R28

Wouldn\'t that be 0.5? 0.5 is the easiest one!

I wasn\'t trying to find all possible topologies, but all possible
ratios. Did I miss a ratio?

It would be cool to do something with two quad r-packs. They are cheap
and don\'t take much more room that a single resistor. One probably
couldn\'t make a list of all possible ratios, but one could make a list
of all practical ratios, given tolerances.

The downside is that using r-packs on a schematic gets really ugly.



--

John Larkin Highland Technology, Inc

Science teaches us to doubt.

Claude Bernard
 
On Mon, 12 Oct 2020 12:35:45 -0400, Joe Gwinn <joegwinn@comcast.net>
wrote:

On Mon, 12 Oct 2020 08:27:53 -0700, jlarkin@highlandsniptechnology.com
wrote:

On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1

Now I have 19 different resistor values on my BOM. That makes
something like 8^19 possibilities. I also have 5 quad r-packs, each of
which can have 15 possible arrangements to make an equivalent
resistor.

So we have 8^34 possibilities. Many more if you are flexible about how
you use the r-pack sections. The program would run for millenia. It
might take millenia just to write.

And this is a simple problem. My main point is that very many circuits
can be made from a few parts.

It\'s a 32-page schematic, and this is just one dumb voltage regulator.

Somehow our brains deal with this, and we get things to work.

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Next, allow two different r-pack values. We have 26 in stock.

In Computability Theory, this is like the bin-packing problem - the
possibilities grow at least proportional to 2^k for k entities, so toy
problems are easy, and practical problems are impractical. The name
of the class containing this kind of problem is \"NP Complete\".

.<https://en.wikipedia.org/wiki/Bin_packing_problem

Lots of economically significant problems fall into this class. The
classic practical approach is to look for adequate answers, versus
theoretically optimum answers.

Joe Gwinn

Certainly. But even my fairly simple problem had no obvious systematic
way to find a good-enough solution. I seem to spend a lot of time on
BOM optimization, specifically juggling resistor values all over the
schematic.

We have a few chips, like ethernet PHYs and DRAMS, that want specific
resistor values. And we need, or think we need, a few cardinal values
like 49.9 ohms, so that at least nails down some starting points.



--

John Larkin Highland Technology, Inc

Science teaches us to doubt.

Claude Bernard
 
jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1

Hmm, you use only identical resistors. And how do you count them?
On the drawing there are 9 different ratios and by symmetry one
can get few more. When using different resistors there are
more possibilities for different ratios. First, look at
possibilities for single resistor. We can just use one resistor,
that is 1 possibility. We can use two resistors in
series or in parallel, that give 2 possibilities.
Using three resistors we can put them in series, in parallel
or in three series-parallel combinations. Two series-parallel
combinations give the same value, so we get 4 possible values.
In divider when one branch consists of single resistor we
can use up to three for other branch, which gives 1*7 = 7 possibilities.
When one branch is two resistors, the other is up to two
resistors which gives 2*3 = 6 possibilities. When one
branch is three resistors, the other is single resistor so
we get 4*1 = 4 possibilities. Together 17 possibilities.
You get few more if you allow combinations that strictly
speaking are not dividers (like tap between R27 and R29
in your picture).

Now I have 19 different resistor values on my BOM. That makes
something like 8^19 possibilities.

No, if you use indentical resistors in divider then ratio
does not depend on resistor value, so you have just fixed
number of combinations. When using different resistor
for each of 17 configurations you have up to 19^4 choices
of components. In fact, when design requires fixed ratio
once you make choice of one resistor in divider value of
the other is determined and you can look up is this value
appears in list of obtainable combinations (this is similar
to what Chris wrote).


--
Waldek Hebisch
 
On Mon, 12 Oct 2020 20:18:38 +0000 (UTC), antispam@math.uni.wroc.pl
wrote:

jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1


Hmm, you use only identical resistors.

The exercise was assuming 1206-size quad r-packs, in which the four
resistors are the same value. They cost under 1 cent per pack and the
resistors seem to match very well, probably laser trimmed together.

Making a divider from two identical r-packs, or two different value
packs, gets more interesting.

>And how do you count them?

Count what?


On the drawing there are 9 different ratios and by symmetry one
can get few more. When using different resistors there are
more possibilities for different ratios. First, look at
possibilities for single resistor. We can just use one resistor,
that is 1 possibility. We can use two resistors in
series or in parallel, that give 2 possibilities.
Using three resistors we can put them in series, in parallel
or in three series-parallel combinations. Two series-parallel
combinations give the same value, so we get 4 possible values.
In divider when one branch consists of single resistor we
can use up to three for other branch, which gives 1*7 = 7 possibilities.
When one branch is two resistors, the other is up to two
resistors which gives 2*3 = 6 possibilities. When one
branch is three resistors, the other is single resistor so
we get 4*1 = 4 possibilities. Together 17 possibilities.
You get few more if you allow combinations that strictly
speaking are not dividers (like tap between R27 and R29
in your picture).

Now I have 19 different resistor values on my BOM. That makes
something like 8^19 possibilities.

No, if you use indentical resistors in divider then ratio
does not depend on resistor value, so you have just fixed
number of combinations. When using different resistor
for each of 17 configurations you have up to 19^4 choices
of components. In fact, when design requires fixed ratio
once you make choice of one resistor in divider value of
the other is determined and you can look up is this value
appears in list of obtainable combinations (this is similar
to what Chris wrote).

I posted a pic of my program that selects resistors that we already
have in stock, to make ratios.

It\'s trivial to make ratios if you are willing to buy new parts for
stock.
 
On Monday, October 12, 2020 at 8:28:06 AM UTC-7, jla...@highlandsniptechnology.com wrote:

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Do you mean different dividers? And with identical resistors?
There\'s at least nine ways to make a 2:1 ratio.

> Next, allow two different r-pack values. We have 26 in stock.

Better, would be if you could get 1,1,2,2,3,3,5,5 eightpacks (at
manufacture time, Bourns could do that easily). You could even get
a pinout (5,3,2,1,1,2,3,5) that allowed end/end reversal.
 
On Mon, 12 Oct 2020 15:13:22 -0700 (PDT), whit3rd <whit3rd@gmail.com>
wrote:

On Monday, October 12, 2020 at 8:28:06 AM UTC-7, jla...@highlandsniptechnology.com wrote:

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?


Do you mean different dividers? And with identical resistors?

I want different ratios, which is a subset of all possible dividers. I
did say 1K.

The number of possible dividers that you can makes from 8 resistors
must be largish.

Given that we have two resistor packs, all that really matters is that
we can hit a desired voltage divider ratio. I guess that if multiple
topologies can hit a target ratio within 0.1% or something, we\'d pick
the simplest one, to make the pcb layout easy.

You\'d only need 998 circuits to go from 0.001 to 0.999 in steps of
0.001. If that\'s possible.


>There\'s at least nine ways to make a 2:1 ratio.

In that case, just use two of the resistors in one r-pack.

Next, allow two different r-pack values. We have 26 in stock.

Better, would be if you could get 1,1,2,2,3,3,5,5 eightpacks (at
manufacture time, Bourns could do that easily). You could even get
a pinout (5,3,2,1,1,2,3,5) that allowed end/end reversal.

Those would cost more than a penny, and wouldn\'t solve the problem of
finding a topology to hit a target ratio.

My big theme is that it\'s hard, sometimes borderline impossible, to
find the right way to connect a few resistors.
 
On Monday, October 12, 2020 at 4:33:24 PM UTC-7, John Larkin wrote:
On Mon, 12 Oct 2020 15:13:22 -0700 (PDT), whit3rd <whi...@gmail.com
wrote:
On Monday, October 12, 2020 at 8:28:06 AM UTC-7, jla...@highlandsniptechnology.com wrote:

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Given that we have two resistor packs, all that really matters is that
we can hit a desired voltage divider ratio. I guess that if multiple
topologies can hit a target ratio within 0.1% or something, we\'d pick
the simplest one, to make the pcb layout easy.

You\'d only need 998 circuits to go from 0.001 to 0.999 in steps of
0.001. If that\'s possible.

There\'s at least nine ways to make a 2:1 ratio.

Better, would be if you could get 1,1,2,2,3,3,5,5 eightpacks (at
manufacture time, Bourns could do that easily). You could even get
a pinout (5,3,2,1,1,2,3,5) that allowed end/end reversal.

Those would cost more than a penny, and wouldn\'t solve the problem of
finding a topology to hit a target ratio.

In quantity, it wouldn\'t cost Bourns very much; if the need is widespread, it
would be a good product opportunity, and you can afford an extra cent.
Rational-number ratios are easy to hit from a few prime-number steps, was
my thought. Fibonacci steps are another possibility (any three adjacent values
makes another 2:1 possibility, though; there\'s a lot of repeat and near-repeat ratios).
 
On 13/10/2020 02:27, jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1

Now I have 19 different resistor values on my BOM. That makes
something like 8^19 possibilities. I also have 5 quad r-packs, each of
which can have 15 possible arrangements to make an equivalent
resistor.
Ok, I had not expected 19 values in your BOM. Maybe an exhaustive search
of all of those is not worthwhile as it would take some thought or
effort to make it fast. Probably you would not lose much by excluding
the milliohm and gigaohm values when doing feedback dividers for your LDO.

If you use a quad R-pack, to me that counts as 4 resistors, at least for
computing effort. You were talking about 4 resistors total in the post
that I replied to.

So we have 8^34 possibilities. Many more if you are flexible about how
you use the r-pack sections. The program would run for millenia. It
might take millenia just to write.

And this is a simple problem. My main point is that very many circuits
can be made from a few parts.

It\'s a 32-page schematic, and this is just one dumb voltage regulator.

Somehow our brains deal with this, and we get things to work.

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Well, the one that I have actually written used identical unit resistors
because they match well on chips, and the limit where it started to take
more than a few seconds was 13 resistors on my desktop machine 15 years
ago, and a couple more resistors on a bigger machine.

I just tried it again on a dumpster PC, and for example, a pi kOhm
resistor can be made from nine 1 kOhm resistors as:
1+1+((1+1)//(1+1+(1//(1+1))))
There were no better combinations using 10 to 13 resistors.
 
On Tue, 13 Oct 2020 12:06:20 +1100, Chris Jones
<lugnut808@spam.yahoo.com> wrote:

On 13/10/2020 02:27, jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1

Now I have 19 different resistor values on my BOM. That makes
something like 8^19 possibilities. I also have 5 quad r-packs, each of
which can have 15 possible arrangements to make an equivalent
resistor.
Ok, I had not expected 19 values in your BOM.

There are 1024 parts on this board, which includes 19 different
single-resistor values (1 ohm to 1 Meg) and 5 different quad r-pack
values. It was a fight to get it down to that. The pick-and-place is
just about out of feeders. As if this wasn\'t hard enough already.

Maybe an exhaustive search
of all of those is not worthwhile as it would take some thought or
effort to make it fast. Probably you would not lose much by excluding
the milliohm and gigaohm values when doing feedback dividers for your LDO.

Exhaustive is a good word.


If you use a quad R-pack, to me that counts as 4 resistors, at least for
computing effort. You were talking about 4 resistors total in the post
that I replied to.

An r-pack just takes one feeder, and has a bunch of value
possibilities. Makes the math problem worse.



So we have 8^34 possibilities. Many more if you are flexible about how
you use the r-pack sections. The program would run for millenia. It
might take millenia just to write.

And this is a simple problem. My main point is that very many circuits
can be made from a few parts.

It\'s a 32-page schematic, and this is just one dumb voltage regulator.

Somehow our brains deal with this, and we get things to work.

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Well, the one that I have actually written used identical unit resistors
because they match well on chips, and the limit where it started to take
more than a few seconds was 13 resistors on my desktop machine 15 years
ago, and a couple more resistors on a bigger machine.

I just tried it again on a dumpster PC, and for example, a pi kOhm
resistor can be made from nine 1 kOhm resistors as:
1+1+((1+1)//(1+1+(1//(1+1))))
There were no better combinations using 10 to 13 resistors.

I might try writing a program for 8 resistors, namely two r-packs.
Different values in the two packs would make it more interesting. But
I want divider ratios, not resistor values.





--

John Larkin Highland Technology, Inc

Science teaches us to doubt.

Claude Bernard
 
On 10/10/20 10:41 AM, jlarkin@highlandsniptechnology.com wrote:
I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

This is where the old sliderule shines. In the past I have used one to
find LC ratios and such from catalog values, and there you have much
less selection versus resistors. Maybe a sliderule method using only
entered BOM values could be poured into code?

One day at a big company one of their engineers tapped on my shoulder.
\"You know, we do have electricity available here\".

[...]

--
Regards, Joerg

http://www.analogconsultants.com/
 
On 13/10/2020 00:33, John Larkin wrote:
On Mon, 12 Oct 2020 15:13:22 -0700 (PDT), whit3rd <whit3rd@gmail.com
wrote:

On Monday, October 12, 2020 at 8:28:06 AM UTC-7, jla...@highlandsniptechnology.com wrote:

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?


Do you mean different dividers? And with identical resistors?

I want different ratios, which is a subset of all possible dividers. I
did say 1K.

The number of possible dividers that you can makes from 8 resistors
must be largish.

But not very evenly distributed. Most of the ratios you can hit with a
pack of identical resistors tend to be of the form p+q/r : s+t/u

p+q+r+s+t+u = N

With a rather high degeneracy factor for the ratio 1:1.

Given that we have two resistor packs, all that really matters is that
we can hit a desired voltage divider ratio. I guess that if multiple
topologies can hit a target ratio within 0.1% or something, we\'d pick
the simplest one, to make the pcb layout easy.

You\'d only need 998 circuits to go from 0.001 to 0.999 in steps of
0.001. If that\'s possible.

Maybe but to get that resolution would use up more than two packs of 8.

Rmax = NR
Rmin = R/N

The largest bounding ratios you can ever hope to make with N resistors
are of the form series and parallel (N-m:1/m)

Nm-m^2:1

Maximised when m = N/2 with a value N^2/4:1

So to get 1:1000 ratio would require at least a 20 pack of identical
resistors.

There\'s at least nine ways to make a 2:1 ratio.

In that case, just use two of the resistors in one r-pack.


Next, allow two different r-pack values. We have 26 in stock.

Better, would be if you could get 1,1,2,2,3,3,5,5 eightpacks (at
manufacture time, Bourns could do that easily). You could even get
a pinout (5,3,2,1,1,2,3,5) that allowed end/end reversal.

Those would cost more than a penny, and wouldn\'t solve the problem of
finding a topology to hit a target ratio.

My big theme is that it\'s hard, sometimes borderline impossible, to
find the right way to connect a few resistors.

No it isn\'t you just have to develop an algorithm to do it. After a
little thought and doodles on the back of an envelope I think that the
maximum number of distinct graphs with N identical resistors is
determined by the Catalan numbers (or something very closely related).

https://oeis.org/A000108
A000108
Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!).

(1,) 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786,

The problem starts to get interesting for N=5 when you start to get the
possibility of internal resistors bridging a pair of potential dividers
a la Wheatstone bridge (which can be used to give you very fine
adjustment with a suitable choice of non-identical values).

Rats nest territory after that...

--
Regards,
Martin Brown
 
On 12/10/2020 23:13, whit3rd wrote:
On Monday, October 12, 2020 at 8:28:06 AM UTC-7, jla...@highlandsniptechnology.com wrote:

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Do you mean different dividers? And with identical resistors?
There\'s at least nine ways to make a 2:1 ratio.

Next, allow two different r-pack values. We have 26 in stock.

Better, would be if you could get 1,1,2,2,3,3,5,5 eightpacks (at
manufacture time, Bourns could do that easily). You could even get
a pinout (5,3,2,1,1,2,3,5) that allowed end/end reversal.

If you are going to do it like that then the optimum pattern for minimal
redundancy series additive values is 1,1,3,6,12,24,48,... 3x2^N.

It is more fun when you can add and subtract which gives rise to Golumb
rulers only the first few of which are perfect.

https://en.wikipedia.org/wiki/Golomb_ruler

--
Regards,
Martin Brown
 
On 13/10/2020 15:32, jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 12:06:20 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 13/10/2020 02:27, jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1

Now I have 19 different resistor values on my BOM. That makes
something like 8^19 possibilities. I also have 5 quad r-packs, each of
which can have 15 possible arrangements to make an equivalent
resistor.
Ok, I had not expected 19 values in your BOM.

There are 1024 parts on this board, which includes 19 different
single-resistor values (1 ohm to 1 Meg) and 5 different quad r-pack
values. It was a fight to get it down to that. The pick-and-place is
just about out of feeders. As if this wasn\'t hard enough already.

Maybe an exhaustive search
of all of those is not worthwhile as it would take some thought or
effort to make it fast. Probably you would not lose much by excluding
the milliohm and gigaohm values when doing feedback dividers for your LDO.

Exhaustive is a good word.



If you use a quad R-pack, to me that counts as 4 resistors, at least for
computing effort. You were talking about 4 resistors total in the post
that I replied to.

An r-pack just takes one feeder, and has a bunch of value
possibilities. Makes the math problem worse.




So we have 8^34 possibilities. Many more if you are flexible about how
you use the r-pack sections. The program would run for millenia. It
might take millenia just to write.

And this is a simple problem. My main point is that very many circuits
can be made from a few parts.

It\'s a 32-page schematic, and this is just one dumb voltage regulator.

Somehow our brains deal with this, and we get things to work.

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Well, the one that I have actually written used identical unit resistors
because they match well on chips, and the limit where it started to take
more than a few seconds was 13 resistors on my desktop machine 15 years
ago, and a couple more resistors on a bigger machine.

I just tried it again on a dumpster PC, and for example, a pi kOhm
resistor can be made from nine 1 kOhm resistors as:
1+1+((1+1)//(1+1+(1//(1+1))))
There were no better combinations using 10 to 13 resistors.


I might try writing a program for 8 resistors, namely two r-packs.
Different values in the two packs would make it more interesting. But
I want divider ratios, not resistor values.

If you\'re willing to divulge the ratios you want, I can probably find
time to adapt my program to work out ratios, and see if it can give you
an answer - just for fun.
 
On Tue, 13 Oct 2020 11:23:35 +0100, Martin Brown
<\'\'\'newspam\'\'\'@nonad.co.uk> wrote:

On 13/10/2020 00:33, John Larkin wrote:
On Mon, 12 Oct 2020 15:13:22 -0700 (PDT), whit3rd <whit3rd@gmail.com
wrote:

On Monday, October 12, 2020 at 8:28:06 AM UTC-7, jla...@highlandsniptechnology.com wrote:

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?


Do you mean different dividers? And with identical resistors?

I want different ratios, which is a subset of all possible dividers. I
did say 1K.

The number of possible dividers that you can makes from 8 resistors
must be largish.

But not very evenly distributed. Most of the ratios you can hit with a
pack of identical resistors tend to be of the form p+q/r : s+t/u

p+q+r+s+t+u = N

With a rather high degeneracy factor for the ratio 1:1.

A divider can drive a divider, a ladder attenuator. That can be
referenced to V+ or to ground. I get 0.0294 (34:1) with eight
identical resistors.

Given that we have two resistor packs, all that really matters is that
we can hit a desired voltage divider ratio. I guess that if multiple
topologies can hit a target ratio within 0.1% or something, we\'d pick
the simplest one, to make the pcb layout easy.

You\'d only need 998 circuits to go from 0.001 to 0.999 in steps of
0.001. If that\'s possible.

Maybe but to get that resolution would use up more than two packs of 8.

Rmax = NR
Rmin = R/N

Or two different quad packs. We have a lot of those in stock, from 10r
to 100K. So I can do 10000^4 attenuation.

The largest bounding ratios you can ever hope to make with N resistors
are of the form series and parallel (N-m:1/m)

Nm-m^2:1

Maximised when m = N/2 with a value N^2/4:1

So to get 1:1000 ratio would require at least a 20 pack of identical
resistors.

There\'s at least nine ways to make a 2:1 ratio.

In that case, just use two of the resistors in one r-pack.


Next, allow two different r-pack values. We have 26 in stock.

Better, would be if you could get 1,1,2,2,3,3,5,5 eightpacks (at
manufacture time, Bourns could do that easily). You could even get
a pinout (5,3,2,1,1,2,3,5) that allowed end/end reversal.

Those would cost more than a penny, and wouldn\'t solve the problem of
finding a topology to hit a target ratio.

My big theme is that it\'s hard, sometimes borderline impossible, to
find the right way to connect a few resistors.

No it isn\'t you just have to develop an algorithm to do it. After a
little thought and doodles on the back of an envelope I think that the
maximum number of distinct graphs with N identical resistors is
determined by the Catalan numbers (or something very closely related).

https://oeis.org/A000108
A000108
Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!).

(1,) 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786,

The problem starts to get interesting for N=5 when you start to get the
possibility of internal resistors bridging a pair of potential dividers
a la Wheatstone bridge (which can be used to give you very fine
adjustment with a suitable choice of non-identical values).

Rats nest territory after that...

I was thinking about how to even enumerate the possible dividers, and
then how to calculate each divider ratio, and how to report the
results. Sounds like a project.

Each divider has one input and an output at every node.




--

John Larkin Highland Technology, Inc

Science teaches us to doubt.

Claude Bernard
 
On Tue, 13 Oct 2020 11:35:08 +0100, Martin Brown
<\'\'\'newspam\'\'\'@nonad.co.uk> wrote:

On 12/10/2020 23:13, whit3rd wrote:
On Monday, October 12, 2020 at 8:28:06 AM UTC-7, jla...@highlandsniptechnology.com wrote:

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Do you mean different dividers? And with identical resistors?
There\'s at least nine ways to make a 2:1 ratio.

Next, allow two different r-pack values. We have 26 in stock.

Better, would be if you could get 1,1,2,2,3,3,5,5 eightpacks (at
manufacture time, Bourns could do that easily). You could even get
a pinout (5,3,2,1,1,2,3,5) that allowed end/end reversal.

If you are going to do it like that then the optimum pattern for minimal
redundancy series additive values is 1,1,3,6,12,24,48,... 3x2^N.

It is more fun when you can add and subtract which gives rise to Golumb
rulers only the first few of which are perfect.

https://en.wikipedia.org/wiki/Golomb_ruler

Interesting, as applied to resistor networks. Digikey doesn\'t have
Golumbs yet.

People already make R:2R ladder networks. One of those plus one
additional tweak resistor, or two ladders, give divider possibilities.

Multiple taps of one ladder can be connected to taps of another. More
math fun.



--

John Larkin Highland Technology, Inc

Science teaches us to doubt.

Claude Bernard
 
whit3rd wrote:

There\'s a common solution to the too-many-to-automate and several other
related problems: split the circuit board into two, one big \'un with
the parts that (for instance) need power and dissipate heat, and
a smaller one with the precision stuff.

This technique also works when the routing becomes a nightmare. Once
upon a time, I was working on a heavily protected 3-phase mains-powered
board. I wasn\'t able to meet all the requirements at once (safety
clearance, functional HV insulation spacing, etc.) even on a 4-layer
board, given the size constraints. Identifying and cutting out the most
challenging part of that routing allowed me to use a dirt-cheap 2-layer
board with a module encapsulating the problematic piece. It was much
smaller than required, too.

Best regards, Piotr
 
jlarkin@highlandsniptechnology.com wrote:

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

The equations describing a divider composed of N resistors are simple
for any value of N. If you feed them with all possible values of the
available resistors and store, say, 100 most promising candidates, you
will get your divider. There is no point in going with N>4 anyway, as
the tolerance is finite.

MIPS are cheap nowadays, and there are so many of them per night. Let
the computer compute it for you when you are sleeping. There are more
sophisticated approaches based on, e.g. gradient descent, but you should
stick to a brute-force self-evidently correct 50-liner in C++, Java,
Matlab or whatever you like. The most challenging part is typing all
that E192 mantissa values.

Best regards, Piotr
 
On Tue, 13 Oct 2020 22:56:53 +1100, Chris Jones
<lugnut808@spam.yahoo.com> wrote:

On 13/10/2020 15:32, jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 12:06:20 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 13/10/2020 02:27, jlarkin@highlandsniptechnology.com wrote:
On Tue, 13 Oct 2020 00:12:58 +1100, Chris Jones
lugnut808@spam.yahoo.com> wrote:

On 11/10/2020 04:41, jlarkin@highlandsniptechnology.com wrote:


I\'m tweaking a big schematic to get to my layout guy first thing
Monday.

I\'ve got a few places where I need a specific resistor ratio. One is
for a home-made LDO to make a lot of clean 3.3 volt power. Another is
to make a very accurate +20 volt supply. Another is to scale a DAC
output into a varicap. Our pick-and-place will use almost all its
feeders on this board, so I prefer to use only resistors that are
already on the BOM.

A little futzing with a calculator suggests that I don\'t have values
available, given two resistors per divider and parts already on the
BOM. The BOM has already been brutally minimized.

I can tweak a divider with a third resistor. In series with the upper
or lower resistor, or in parallel with either. I could even use four
resistors. We also have several values of quad resistor pack on the
board, and a quad pack has a lot of options.

So the general problem is that there are zillions of possibilities,
surely some good ones, but no good way to find them. Spicing would at
least save a lot of calculator use, but still has no methodical
approach.

I could write a program that brute-force tries all possibilities of
values in some series-parallel circuit, say with 8 places where 4
resistors might go. It might run in minutes or years. Ugly.

No, if you write it in C you should be able to do pretty much all
possible combinations of (many) more than 4 resistors, in a time that is
negligible for a human. Computers are very fast nowadays.

1. Make a list, of all the resistor values given.
2. Make another list with each thing on the first list in parallel with
each thing on the first list.
3. Make a third list with each thing on the first list in series with
each thing on the first list.
4. Put everything on any of the lists you have so far, into the first list.
5. If you haven\'t used enough resistors yet, go to step 2 again.
6. Now you have a big list. Go through it and pick the thing closest to
what you want. In your case, try all combinations of two things on that
list, as upper and lower resistors in a divider. Try them all and pick
the best one, by whatever criteria make it best for you.

You could do it with some recursive program I guess. I just stored them
all in RAM because I had a lot of resistors to approximate. I also made
it figure out what the standard deviation of the combined resistor was,
because some topologies give better averaging than others.

There are lots of ways to be clever and do it quicker, but there is no need.

I think that there are 8 different dividers that you can make from
four resistors

https://www.dropbox.com/s/m56k4bp21z4fb6z/Rpak_Dividers_1.jpg?raw=1

Now I have 19 different resistor values on my BOM. That makes
something like 8^19 possibilities. I also have 5 quad r-packs, each of
which can have 15 possible arrangements to make an equivalent
resistor.
Ok, I had not expected 19 values in your BOM.

There are 1024 parts on this board, which includes 19 different
single-resistor values (1 ohm to 1 Meg) and 5 different quad r-pack
values. It was a fight to get it down to that. The pick-and-place is
just about out of feeders. As if this wasn\'t hard enough already.

Maybe an exhaustive search
of all of those is not worthwhile as it would take some thought or
effort to make it fast. Probably you would not lose much by excluding
the milliohm and gigaohm values when doing feedback dividers for your LDO.

Exhaustive is a good word.



If you use a quad R-pack, to me that counts as 4 resistors, at least for
computing effort. You were talking about 4 resistors total in the post
that I replied to.

An r-pack just takes one feeder, and has a bunch of value
possibilities. Makes the math problem worse.




So we have 8^34 possibilities. Many more if you are flexible about how
you use the r-pack sections. The program would run for millenia. It
might take millenia just to write.

And this is a simple problem. My main point is that very many circuits
can be made from a few parts.

It\'s a 32-page schematic, and this is just one dumb voltage regulator.

Somehow our brains deal with this, and we get things to work.

It would be cool to write a program that found the best divider that
can be made from two 1K quad r-packs. Even that would be a serious
chore. How many dividers can you make from 8 resistors?

Well, the one that I have actually written used identical unit resistors
because they match well on chips, and the limit where it started to take
more than a few seconds was 13 resistors on my desktop machine 15 years
ago, and a couple more resistors on a bigger machine.

I just tried it again on a dumpster PC, and for example, a pi kOhm
resistor can be made from nine 1 kOhm resistors as:
1+1+((1+1)//(1+1+(1//(1+1))))
There were no better combinations using 10 to 13 resistors.


I might try writing a program for 8 resistors, namely two r-packs.
Different values in the two packs would make it more interesting. But
I want divider ratios, not resistor values.


If you\'re willing to divulge the ratios you want, I can probably find
time to adapt my program to work out ratios, and see if it can give you
an answer - just for fun.

Here\'s a case where I wanted to make a good 20-volt supply based on a
3-volt reference.

https://www.dropbox.com/s/g4q4v2twdv3flc4/P20_Divider.jpg?raw=1

I got to 20.25 with already available parts and manual guesswork.

I have a lot of stuff on this board that\'s referenced to the +3R, so
many things are ratiometric and errors cancel.

Here\'s another ad-hoc hack:

https://www.dropbox.com/s/djchmdox0tsag83/P12_Switcher.jpg?raw=1




--

John Larkin Highland Technology, Inc

Science teaches us to doubt.

Claude Bernard
 

Welcome to EDABoard.com

Sponsor

Back
Top