too many possibilities

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.

The more general issue, which I've thought some about over the years, is that there are a large number of circuits that can be made from a given number of parts. I'm not sure how many.

I've thought it would be fun to teach a class in circuit design, where each student gets 10 parts.

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin
Loading thread data ...

If you've got any resistor locations that don't need a tolerance, then maybe the location that does can supply them. One reel feeder still serves both.

RL

Reply to
legg

Let the computer do it. You have your spreadsheet, well, this fully generalizes and automates it:

formatting link

Tim

-- Seven Transistor Labs, LLC Electrical Engineering Consultation and Design Website:

formatting link

Reply to
Tim Williams

...

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. Most PC power supplies do this, because the required parts are not mechanically similar to each other, thus a mechanically sturdy board with through holes works best for the power wiring and a surface-mount daughterboard takes on all the overhead functions.

Reply to
whit3rd

That seems to find 2-terminal values, not dividers. It's really a different problem. But it is cute.

I have a program that picks two resistors that we have in stock, to make dividers, but I only want to use parts already on the board, and need more complex networks than two resistors.

formatting link

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin

For two components you don't need to try every component. Pick one compone nt and search for the optimal mate. Pick the next value of the first compo nent and you only need to start with the same value of the second component and work in one direction until the match peaks. Lather, rinse, repeat. Often only one new second component will need to be checked or two at most if the candidates are equally spaced. If you are working with the parts al ready in the BOM the searching may be a bit longer... or shorter is more li kely. While the jumps are not even, they are also a lot wider.

With more than two components the searching is more complex, but the same m ethod applies to trim the rather large search tree.

It's hard to imagine needing this sort of precision in a resistor divider w hen there is often not so much more precision in the rest of the circuit. What's the voltage reference rated at? What precision are you trying to ac hieve?

--

  Rick C. 

  - Get 1,000 miles of free Supercharging 
  - Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

On Sat, 10 Oct 2020 10:41:06 -0700, snipped-for-privacy@highlandsniptechnology.com wrote:

This works, with 4 resistors that are already on the BOM.

Sadly, the values were found by pure guessing and fiddling.

4.7 nF is the only reasonable cap available to use for compensation, which further constrains the divider values.

Version 4 SHEET 1 1140 680 WIRE -64 -48 -272 -48 WIRE 32 -48 -64 -48 WIRE 288 -48 128 -48 WIRE 496 -48 288 -48 WIRE 688 -48 496 -48 WIRE 880 -48 688 -48 WIRE 992 -48 880 -48 WIRE 1056 -48 992 -48 WIRE -272 0 -272 -48 WIRE 288 0 288 -48 WIRE 688 16 688 -48 WIRE 112 48 112 0 WIRE 880 64 880 -48 WIRE 1056 64 1056 -48 WIRE 496 96 496 -48 WIRE -272 128 -272 80 WIRE 688 128 688 80 WIRE -64 144 -64 -48 WIRE 288 144 288 80 WIRE -96 160 -144 160 WIRE 48 176 -32 176 WIRE 112 176 112 128 WIRE 112 176 48 176 WIRE 880 176 880 128 WIRE -208 192 -272 192 WIRE -96 192 -208 192 WIRE 112 192 112 176 WIRE -272 224 -272 192 WIRE -64 240 -64 208 WIRE 688 272 688 208 WIRE 1056 272 1056 144 WIRE -144 288 -144 160 WIRE 112 288 112 256 WIRE 112 288 -144 288 WIRE 288 288 288 224 WIRE 288 288 112 288 WIRE 400 288 288 288 WIRE 496 288 496 176 WIRE 496 288 400 288 WIRE -272 352 -272 304 WIRE 288 352 288 288 WIRE 496 400 496 288 WIRE 288 480 288 432 WIRE 288 608 288 560 WIRE 496 608 496 480 WIRE 496 608 288 608 WIRE 288 640 288 608 FLAG 688 272 0 FLAG 1056 272 0 FLAG 288 640 0 FLAG -272 352 0 FLAG -272 128 0 FLAG -64 240 0 FLAG 880 176 0 FLAG 48 176 G FLAG 992 -48 +20 FLAG -208 192 REF FLAG 400 288 E SYMBOL res 272 -16 R0 WINDOW 0 67 43 Left 2 WINDOW 3 53 76 Left 2 SYMATTR InstName R1 SYMATTR Value 6.04K SYMBOL res 272 336 R0 WINDOW 0 61 44 Left 2 WINDOW 3 54 79 Left 2 SYMATTR InstName R2 SYMATTR Value 10K SYMBOL nmos 32 0 R270 WINDOW 0 -7 -45 VRight 2 WINDOW 3 -43 -63 VRight 2 SYMATTR InstName M1 SYMATTR Value RSR025N05 SYMBOL res 96 32 R0 WINDOW 0 63 34 Left 2 WINDOW 3 57 68 Left 2 SYMATTR InstName R3 SYMATTR Value 49.9 SYMBOL Opamps\\UniversalOpamp2 -64 176 R0 WINDOW 0 30 -37 Left 2 SYMATTR InstName U1 SYMBOL cap 96 192 R0 WINDOW 0 65 14 Left 2 WINDOW 3 57 47 Left 2 SYMATTR InstName C1 SYMATTR Value 4.7n SYMBOL cap 672 16 R0 WINDOW 0 60 17 Left 2 WINDOW 3 57 58 Left 2 SYMATTR InstName C2

SYMBOL res 672 112 R0 WINDOW 0 59 48 Left 2 WINDOW 3 59 80 Left 2 SYMATTR InstName Resr SYMATTR Value 30m SYMBOL voltage -272 -16 R0 WINDOW 0 60 46 Left 2 WINDOW 3 62 81 Left 2 SYMATTR InstName V1 SYMATTR Value 24 SYMBOL voltage -272 208 R0 WINDOW 0 50 84 Left 2 WINDOW 3 26 127 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName Vref SYMATTR Value PULSE(3 2.9 100m 1u 1u 100m) SYMBOL res 1040 48 R0 WINDOW 0 56 42 Left 2 WINDOW 3 52 74 Left 2 SYMATTR InstName R5 SYMATTR Value 500 SYMBOL cap 864 64 R0 WINDOW 0 62 13 Left 2 WINDOW 3 58 48 Left 2 SYMATTR InstName C3

SYMBOL res 272 464 R0 WINDOW 0 64 43 Left 2 WINDOW 3 61 71 Left 2 SYMATTR InstName R4

SYMBOL res 272 128 R0 WINDOW 0 62 40 Left 2 WINDOW 3 59 69 Left 2 SYMATTR InstName R6 SYMATTR Value 49.9K SYMBOL res 480 80 R0 WINDOW 0 62 40 Left 2 WINDOW 3 63 78 Left 2 SYMATTR InstName R7 SYMATTR Value 1T SYMBOL res 480 384 R0 WINDOW 0 72 42 Left 2 WINDOW 3 61 75 Left 2 SYMATTR InstName R8 SYMATTR Value 1Meg TEXT 808 432 Left 2 !.tran 500m TEXT 712 104 Left 2 ;polymer TEXT 904 144 Left 2 ;ceramics TEXT 784 344 Left 2 ;P505C +20 Supply TEXT 768 384 Left 2 ;J Larkin Oct 10 2020

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin

That means multiply by 0.01.

Always glad to be of help to nice people.

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin

Picky picky, use this one then:

formatting link

Doesn't seem to be one that does both at once. You can always populate the list with all N-level S-P combinations of your inventory.

Or, technically this does it all, it's just "harder to operate" (some code may or may not be missing ;-) ):

formatting link

Tim

--
Seven Transistor Labs, LLC 
Electrical Engineering Consultation and Design 
Website: https://www.seventransistorlabs.com/
Reply to
Tim Williams

he

e

I created a spread sheet ages ago that uses the E24 values in a table showi ng all the ratios. Then finding a close fit is just a matter of scanning a diagonal. I can fill in a copy with values from the current project and d o the same thing so I don't need to add parts to the board. This also all ows me to see where the gaps are so when I do add a new part I can pick one that fills in a gap.

A board I designed some time back with 80 resistors and 70 capacitors and 1

5 ICs only required 35 line items in the BOM. The assembly house mentioned to me once that they were surprised they didn't need to change out reels f or my board. I had made a significant effort to keep the BOM to a minimum by carefully selecting values that worked together. One amp stage used bot h positive and negative feedback so five different value resistances. I pi cked those values so they could be used in other circuits and only added a line item when absolutely necessary. It's not hard if you spend a little t ime on it. This has paid in lower assembly costs for the last 12 years.
--

  Rick C. 

  + Get 1,000 miles of free Supercharging 
  + Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

E96 resistors are readily available and not particularly expensive. If you can live with a +/-1% tolerance they can be quite cheap. Down around wha tit cost you to place them on a PCB.

The spread sheet would be bigger.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

I like the Thevenin lower and upper limit parameters !

Reply to
boB

You only have a quite finite number of resistor values on the board enumerate their possible values in the series and series parallel combinations you are prepared to allow and then create a sorted list to search for your chosen ratio at acceptable precision.

It isn't unlike writing a solver for the TV show "Countdown" where with reasonable reliability you can hit any 3 digit target from 6 random numbers and the various arithmetic operators. Bit more limited in this case since you only have additive series or parallel combinations.

formatting link

Negative resistors are very hard to come by.

--
Regards, 
Martin Brown
Reply to
Martin Brown

On Sun, 11 Oct 2020 02:17:59 -0700, boB wrote:

That keeps me from using 2 ohm or 100 meg resistors.

The program reads a simple text file that our material control system generates, so it could be used by anyone who can put their available parts into such a file.

It does use parts that we have in stock, not the entire Exx lists. If I was willing to buy new parts, I wouldn't need the program.

PowerBasic.

I was able to solve my original problem with three resistors and a lot of fiddling and no addition to the BOM.

Version 4 SHEET 1 1140 680 WIRE -64 -48 -336 -48 WIRE 288 -48 112 -48 WIRE 528 -48 288 -48 WIRE 720 -48 528 -48 WIRE 832 -48 720 -48 WIRE 896 -48 832 -48 WIRE -336 0 -336 -48 WIRE 288 0 288 -48 WIRE 528 16 528 -48 WIRE 720 64 720 -48 WIRE 896 64 896 -48 WIRE -336 128 -336 80 WIRE 528 128 528 80 WIRE -64 144 -64 -48 WIRE 288 144 288 80 WIRE -96 160 -144 160 WIRE 48 176 -32 176 WIRE 112 176 112 -48 WIRE 112 176 48 176 WIRE 720 176 720 128 WIRE -208 192 -336 192 WIRE -96 192 -208 192 WIRE 112 192 112 176 WIRE -64 240 -64 208 WIRE -336 256 -336 192 WIRE 528 272 528 208 WIRE 896 272 896 144 WIRE -144 288 -144 160 WIRE 112 288 112 256 WIRE 112 288 -144 288 WIRE 288 288 288 224 WIRE 288 288 112 288 WIRE 288 352 288 288 WIRE -336 384 -336 336 WIRE 288 480 288 432 FLAG 528 272 0 FLAG 896 272 0 FLAG 288 480 0 FLAG -336 384 0 FLAG -336 128 0 FLAG -64 240 0 FLAG 720 176 0 FLAG 48 176 G FLAG 832 -48 +20 FLAG -208 192 REF SYMBOL res 272 -16 R0 WINDOW 0 67 43 Left 2 WINDOW 3 53 76 Left 2 SYMATTR InstName R1 SYMATTR Value 23.7K SYMBOL res 272 336 R0 WINDOW 0 61 44 Left 2 WINDOW 3 54 79 Left 2 SYMATTR InstName R2 SYMATTR Value 4.99K SYMBOL Opamps\\UniversalOpamp2 -64 176 R0 WINDOW 0 30 -37 Left 2 SYMATTR InstName U1 SYMATTR Value2 Avol=1Meg GBW=1Meg Slew=1Meg SYMATTR SpiceLine ilimit=1 rail=0 Vos=0 phimargin=45 SYMBOL cap 96 192 R0 WINDOW 0 65 14 Left 2 WINDOW 3 57 47 Left 2 SYMATTR InstName C1 SYMATTR Value 4.7n SYMBOL cap 512 16 R0 WINDOW 0 60 17 Left 2 WINDOW 3 57 58 Left 2 SYMATTR InstName C2

SYMBOL res 512 112 R0 WINDOW 0 59 48 Left 2 WINDOW 3 59 80 Left 2 SYMATTR InstName Resr SYMATTR Value 30m SYMBOL voltage -336 -16 R0 WINDOW 0 60 46 Left 2 WINDOW 3 62 81 Left 2 SYMATTR InstName V1 SYMATTR Value 24 SYMBOL voltage -336 240 R0 WINDOW 0 52 87 Left 2 WINDOW 3 16 126 Left 2 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName Vref SYMATTR Value PULSE(3 3.1 100m 1u 1u 100m) SYMBOL res 880 48 R0 WINDOW 0 56 42 Left 2 WINDOW 3 52 74 Left 2 SYMATTR InstName R5 SYMATTR Value 500 SYMBOL cap 704 64 R0 WINDOW 0 62 13 Left 2 WINDOW 3 58 48 Left 2 SYMATTR InstName C3

SYMBOL res 272 128 R0 WINDOW 0 62 40 Left 2 WINDOW 3 59 69 Left 2 SYMATTR InstName R6 SYMATTR Value 4.99K TEXT 616 432 Left 2 !.tran 500m TEXT 552 104 Left 2 ;polymer TEXT 744 144 Left 2 ;ceramics TEXT 584 344 Left 2 ;P505C +20 Supply TEXT 568 392 Left 2 ;J Larkin Oct 10 2020 TEXT 752 -16 Left 2 ;20.25 TEXT -48 104 Left 2 ;TCA0372

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin

Actually, once one gets close to the target voltage, there becomes the possibility of adding a tweak resistor to the positive feedback path of the opamp.

As a college EE project, I built a 2-terminal -1K resistor, plugged the -1K value into the usual circuit equations, and demonstrated that they worked. Rising exponentials, voltage dividers with gain, negative Q's, things like that.

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin

Negative resistance is fairly easy to set up - over a finite frequency rang e. Philips had a motor control circuit that cancelled out the series resist ance of the windings in a DC motor to that iwould keep it on spinning at th e same speed even if the load increased - but only up to a point.

--
Bill Sloman, Sydney
Reply to
Bill Sloman

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.

Reply to
Chris Jones

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

formatting link

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.

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin

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

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

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

Reply to
Martin Brown

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".

.

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

Reply to
Joe Gwinn

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.