Electronics > Projects, Designs, and Technical Stuff
standard value resistor / capacitor combination tool
Kirr:
--- Quote from: mariush on November 03, 2019, 10:22:24 am ---I've updated the code on github (see post above), used a trick to make it much faster and not have to cache stuff on disk, now it runs faster and with much less memory usage.
--- End quote ---
Nice. Will have to download and play with it some time.
--- Quote from: mariush on November 03, 2019, 10:22:24 am ---Yes, the version I made currently lacks the feature of going "three levels deep" as in :
474: ~474.001 = 470k || (4.7 + (470 || 1M)) (0.000%)
it can do R1 || R2, or R1+R2, and then goes one level deeper where R1 or R2 or both are split and the operation between these two resistors is the opposite of the operation between R1 and R2
So, you get
(R1a+R1b) || R2
R1 || (R2a + R2b)
(R1a+R1b) || (R2a + R2b)
I do this (alternate parallel and sum) because if the user says "i want up to 4 resistors", I'd get duplicate results otherwise ex.
Solution 1: 2 resistor groups: (R1a+R1b) + (R2a+R2b)
Solution 2: 4 resistors R1a + R1b + R2a + R2b
I can certainly add a third level, provided the maximum number of resistors allows going deeper.
ex if you say up to 4 resistors, and a solution is 0.5% close to desired value and looks like this R1 || ( 2sR2), the code could further split the 2 R2 in series to R2 + ( R3||R4) and I arrive to your result.
--- End quote ---
Interesting, because my tools works from the opposite direction: Starts with single resistors, and then combines them into networks of two. Then combines those into next set of networks, and so on.
--- Quote from: mariush on November 03, 2019, 10:22:24 am ---I was reluctant to add this because when using E96 or E192 ranges it takes a long time even with just 4 resistors (20s or so to go through the 20 million or whatever unique combinations of 4 resistors, using only 128 closest resistors to desired value)
It would work ok with a reduced set, like E24 and restricting to let's say 1 ohm min, 100k max
--- End quote ---
Yes, huge number of combination is a major problem with the brute force approach (which I also use). My tool stops searching when the number of network required for next iteration (with another added resistor) is greater than 20 million (IIRC). However when the stocked range is small, even larger networks are possible, up to 6 resistors in case of my tool. (Although for practical uses simple approaches are often enough).
sleemanj:
FWIW some years ago I made this...
https://sparks.gogo.co.nz/resistor_paralleler.html
which works on a slightly different basis in that it is focused around using resistors you actually keep in stock rather than just a full set of all values in a series.
I keep roughly a "half set" of a series, with a few "holes" (values I don't keep) and "bumps" (values not in the series but I do keep), I made the tool to help me find appropriate mostly parallel combinations (because SMD resistors can easily be stacked on top of each other in a hobby situation), and as a last resort some series ones.
Kirr:
--- Quote from: sleemanj on November 04, 2019, 04:52:40 am ---FWIW some years ago I made this...
https://sparks.gogo.co.nz/resistor_paralleler.html
--- End quote ---
Yes, another fine tool. I have it linked in the links section on the about page of my tool.
By the way, OM222O and mariush, please let me know if you like your tools linked there (and url).
--- Quote from: sleemanj on November 04, 2019, 04:52:40 am ---which works on a slightly different basis in that it is focused around using resistors you actually keep in stock rather than just a full set of all values in a series.
I keep roughly a "half set" of a series, with a few "holes" (values I don't keep) and "bumps" (values not in the series but I do keep), I made the tool to help me find appropriate mostly parallel combinations (because SMD resistors can easily be stacked on top of each other in a hobby situation), and as a last resort some series ones.
--- End quote ---
I think we both share the idea of using the real actual stock. (Your "holes" and "bumps" are "gaps" and "extras" in my tool, but otherwise same thing). :-+
mariush:
You can do whatever you want, the repository is public
I added loading resistors from a file (values separated by new lines, commas, tabs , and it's also possible to enter 2r2 or 100k or 0.1m .. that's all, just r,k,m are detected and handled)
Making an exclusion list would also be possible and easy.
Here's link again if people don't want to scroll up a lot : https://github.com/mariush-github/resistor-calculator-php
I'm still interested in doing that "deep" search ( using series and parallel and series, not just two "levels" of mixing) like your version does, but have other things to work on at the moment.
Kirr:
Added link and tweaked interface a bit.
A puzzle for testing these calculators (not a practical task, just for fun): Suppose you have E3 series from 1R to 470R (ideal resistors). Which network of at most 5 resistors gives precisely 4.64 Ohm (with 0% error)?
[EDIT] Compacted.
Navigation
[0] Message Index
[*] Previous page
Go to full version