I would like to add features to the resistor portion of the PCB calculator.

The reason for this is my primary need from a resistor calculator is simply
to tell me the correct/nearest e-series value for a value I have just
calculated. I use 1% resistors almost all the time so E96 is what I need.
But the calculator doesn't do E96.

I prototyped adding this and so I see inside why it doesn't (computational
complexity). I have taken this into account for my proposal. However, there
is also one existing piece of functionality I would have to change. I will
mention that first.

That is, the functionality of automatically excluding the entered value
from the list of possible results works against you when you are looking
for the closest match. For example, if I were to type in '100' (100K) the
closest match is 100K and I'd like that as a match. The proposal assumes
this functionality has been removed and I will discuss at the end what to
do about replacing that functionality.

I would propose adding e96 (and possibly e48) to the selections in the
calculator. When you enter a value using e96 mode it will calculate the
nearest single resistor to that value. It also will calculate the nearest
you can get with two resistors. Did you know that with at most two e96
resistors in series you can create any value to 3 significant figures? For
example, say you want 164K, that's 105K + 59K. If you want 241 Ohms, that's
182 + 59. Oh, you actually wanted 165K? That's an E96 value by itself, a
single 165K resistor. This property isn't an accident, it is a feature of
the E96 series. It is a feature (to lesser precision) of the other series
too.

Given E96 resistors are 1% accurate that really means you never need more
than 2 resistors, you are already within 1% of the requested value (often
much better). But if it is desired I could calculate 3 resistors or 4 to
approximate the value even more closely. However I do not see a lot of
value in this. These 3 and 4 resistor values would not be guaranteed to be
the best possible as the search would not be exhaustive and not all
topologies would be considered.

This algorithm is not well suited for the available option of two excluded
values. However I think I can make it work.

I use values below 10 Ohm and (rarely) above 1M, so I would extend the
range it will attempt to match down to 1 Ohm and up to 10M for E96. I could
even go further. This is not a problem for the E96 algorithm. And due to
how the algorithm works it would not cause the algorithm to use resistors
outside the 10 to 1M range for the 2 resistor solutions unless you request
a value at the ends of that range. This is the case as the resistors
returned for the 2 value answers are always in the same decade as the
desired value or the top portion of the one below. So if you ask for 97.6K
it's never going to suggest you use a 97.5999K and 0.1 Ohm resistor in
series.

Now about the issue of automatic exclusion of the entered value.

My preferred solution would be to remove this functionality. I just don't
think it is a common use. As the 'exclude values' remain the user could
just enter the initial value into the exclude box if she wants another
approximation. The target value could even be automatically entered into
the exclude box when you enter a value but I do not recommend as the common
case is to find the nearest e-series value and it would make that a two
step process.

I also propose that optionally an option to exclude higher or lower results
could be added. The reason for this would be if you want a resistance which
is *at least* the entered value or *at most* the entered value. I do feel
this would make the window busy and is not needed in the most common case.
However if you did need a value that was *at least* the entered value and a
lower one is returned then you are in a situation where you either need to
consult E-series tables yourself, do a bunch of math on your own, or start
entering iterative values into the target resistance until you get a value
that meets your criteria. So there is an argument for it.

-- 
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/CAEZguRJ6iLBm8VWX_1ibobGq565gY-xAHkSWA0iVt119Fy_hqA%40mail.gmail.com.

Reply via email to