Okay, let me break this idea in half. Since it's grown and we can always 
try to do both halves in succession if it makes sense.

I would suggest to do first:

All of your 6 things at the bottom. However, NOT including adding E48 and 
E96 to the calculator at this time. I say this because we don't really 
haven't made a decision to make that tool useful in the way I think it 
would be useful (remove the exclusion). So for now, just leave it alone. It 
will remain only up to E24 and with the exclusion and all the topologies. 
But as you indicate in your 6 things, remove the help text.

I think we should consider renaming "color code" because I think in the 
future we could have a decoder for SMD resistors in this same pane. Or 
would we think that is a separate pane?

After these changes it will improve my personal workflow. I won't have to 
go to: https://www.logwell.com/tech/components/resistor_values.html to find 
E96 resistors anymore. It won't do any E96 calculations (finding the best 2 
value solution), but I do that rather rarely and maybe I can just spruce up 
my python script I wrote to offer that for me.

After this is done and if we like it we can then consider adding E96 (and 
E48) into the resistor calculator using the method I mentioned. Or perhaps 
another if there is a better way.

To make my case for my suggested method not being not too calculation 
intensive to find E96 values I did a breakdown of the algorithm. A resistor 
value could be generated using the following steps.

1. Round the value to 3 significant figures. This is the target value.
2. Compose a list of every value in two E-Series decades containing the 
target value and the one below.
3. Is the target value in the list (binary search)? If so, done.
4. For every value in the list determine the difference between it and the 
target value. Is this value also in the list (binary search)? If so, done.

Step 3 would take up to 8 compares. Step 4 would take up to 1536 compares.

So it really wouldn't take long at all. If you want the value with 3 or 4 
resistors (and haven't hit it yet) then you have to change your rounding in 
step 1 to round down. Then execute the algoritm once. After that, subtract 
the target value from the initial value and repeat the algorithm for the 
difference. Then you can hit any value to 6 significant figures to within 
0.5% but with a potential error (due to resistor tolerance) of +/-2.002%. I 
really cannot see a value of any close approximation.

On Thursday, April 20, 2023 at 11:08:28 PM UTC-7 JV wrote:

> The resistor calculator is for the moment something unlucky as it 
> misleads some users from intuitive use. It is intended to find any close 
> matching combinations for values what you NOT have in your drawer. It is 
> not intended to find any (E96) value what you already have on stock.
>
> The code was written with Kicad V5 and stopped to be included as a new 
> feature in V6. In the meantime, the overcrowded calculator tabulator 
> selection is improved by a tree view selection. Unfortunately, the 
> resistor calculator went into the "Memo" section of the tree selector 
> beside the color table as its name is still "e-series". I choosed 
> E-series as it was the shortest imaginable name for use inside the 
> limited tabulator selection space and it was required to take all 
> possible language translations for names like "serial-parallel- 
> resistor-calculator" into account where there was simply no space.
>
> There is a warning to try you suggestion as the calculation time already 
> goes up for E3/E6/E12 with the cube of the iterations. If adding further 
> finer grained E-series, calculation time always goes up with higher 
> powers. E24 already required several seconds a few years ago with my 
> Intel enthusiast machine. I tried to add a progress bar to determine if 
> Kicad crashed or calculator is busy. Unfortunately, screen updates were 
> only done in background by wxWidgets and only done after iterations were 
> complete although I added calls for screen updates in the iteration 
> loops. For same reasons the decades are limited for the most used range 
> from Ohm to Megaohm. Thats why I stopped this for not missing the the 
> Version 6 closing time for new features.
>
> Higher e-series than E12 are already defined in eseries.h but not used 
> by the resistor calculator for above reasons. More reasons are the 
> component tolerances what are not taken into account by the calculator. 
> Probably in the meantime e-series header file is also shared for some 
> simulator code to avoid double definitions.
>
> To solve your and some other bug reports with your remarkable 
> motivation, I suggest following steps:
>
> - remove the E-series table in the resistor calculators help text
> (there is already a bug report therefore what you may solve with)
> - rename the resistor calculator from e-series into resistor-calculator
> - move the resistor calculator to system design branch of tree selector
> - add all series up to E96 or higher into eseries.h
> - write html format static lookup table e-series using eseries.h
> - locate this new lookup table in the memo branch of tree selector
>
> best
> Jan
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"KiCad Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to devlist+unsubscr...@kicad.org.
To view this discussion on the web visit 
https://groups.google.com/a/kicad.org/d/msgid/devlist/12298d3b-f4fb-45fb-b9b5-9b9df0575843n%40kicad.org.

Reply via email to