Fun with resistors - Page 1
Forum section: electronics / projects

author: theageman
author_rank: Contributor
timestamp: August 12, 2015, 12:03:22 am
content: Hello everybody,I'm not really an electronics engineer. I'm a hobbyist in electronics but i'm a software-engineer as well. Lately I needed to develop an android application, so I installed Qt Creator and all associated android dev-tools on my system.To get started I decided to develop a small program that I had mind for a long time.It allows you to synthesize a resistor-circuit based on a given value and the number of resistors to use:Really funny results can be achieved by constraining the minimum and maximum allowed value to be used. If, for example, you only have 4k7 resistors but you need a 1234.5678 ohm value, you could do something like this:I know this is just an academic exercise, but if there is interest in the binary or code:Athttps://github.com/theageman/rfun/releasesyou can get both!Greetings, Olli!EDIT:I started this project in C++/Qt/QML. But I changed it to Delphi XE2 later in the process.To get the latest version, please have a look athttps://github.com/theageman/rfun/releases.The most recent version at the moment is here :https://github.com/theageman/rfun/releases/tag/0.25.Have fun,Olli.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 12, 2015, 12:14:58 am
content: Heh, coolWould it be possible to add tolerance calculation to that? That is, assuming each resistor is maybe 3 sigma = rated tolerance (+/- 5%), and adding up the total for the derived network.Tim

author: theageman
author_rank: Contributor
timestamp: August 12, 2015, 12:19:06 am
content: I think that should not be a real problem (if I get the maths right).Is there a paper out there regarding that subject?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 12, 2015, 12:52:33 am
content: You're evaluating an expression, implicitly or otherwise, as you produce the correct value; you need only keep a second expression which contains the derivative. More math than circuits, at least(?). I'd have to scratch on some paper to see what the correct formula is (per stage or holistically).Important note: tolerance is the derivative divided by the nominal value, hence unitless. The derivative doesn't change for resistors in series, but the tolerance does.There's also the issue of dependent versus independent; all the derivative contributions need to be summed as RMS, not just added. And all resistors need to be assumed as independent, so you can't just push in the same derivative and have it come out right (which would give the same total tolerance as rated, which is intuitively wrong).Worst case max/min might be interesting too, but probably not very useful.By the way, what method are you using to generate networks? If it's straight approximation (add until high enough, parallel until low enough, repeat until within spec), it's guaranteed to terminate but not to be optimal. Not sure what would do that, exactly. Probably a tree search starting from the final value (which is either composed of series or parallel, which are composed of...), and finding the path of descent along that tree which gives all values within tolerance. Hmm, that still might not be very fast, there's no obvious way to choose a unique path.Tim

author: theageman
author_rank: Contributor
timestamp: August 12, 2015, 01:29:46 am
content: Quote from: T3sl4co1l on August 12, 2015, 12:52:33 amI just asked Wikipedia about 3 sigma(just briefly flew over the presented article)Standard deviation seems to be the topic.Give me a few days...Quote from: T3sl4co1l on August 12, 2015, 12:52:33 amVery interesting!Quote from: T3sl4co1l on August 12, 2015, 12:52:33 amWell, that's the easiest thing to implementQuote from: T3sl4co1l on August 12, 2015, 12:52:33 amSorry, I planned to include some information about the algorithm. (i will write a paper about the implementation in a few days).Basically we are talking about two algo's, one data-structure and one (designed) limitation here.The limitation:There are two operations (|| = parallel, + = serial combination).So you can say R = R1 || R2 + R3, for example. But this gets evaluated from back to front, so in reality you get R = R1 || (R2 + R3).The limitation in this app is, that you can't set parantheses in the expression. Everything gets evaluated from back to front.This limitation leads to the data-structure used:Just a simple list of:Code:struct entity {double value;Operation op;}The algorithm used to find a solution works recursivly (pseudo code):Code:double findCombination(double value, double currentError, double min, max etc.){// serial combinationsfor (resistor=min; resistor<max; resistor++){idealValue = value-resistor;actualValue = findCombination(idealValue, err, min, max)calc errif newMinium(err) store result...}// parallel combinationsfor (resistor=min; resistor<max; resistor++){idealValue = (value*resistor)/(value-resistor);actualValue = findCombination(idealValue, err, min, max)calc errif newMinium(err) store result...}}I hope that this makes at least a little sense ;)Greetings, Olli.

author: slateraptor
author_rank: Frequent Contributor
timestamp: August 12, 2015, 03:18:03 am
content: Struck me as relevant to the discussion:Combining Multiple Resistors to Improve Tolerance - P. OliveiraTL;DR summary: Assuming identical resistors and normal distribution, tolerance of the Thevenin-equivalent resistor network is proportional to the inverse root of the number of resistors used...relative to specific manufacturer bias, not nominal value.EDIT: Goofed the URL tag...fixed.

author: BravoV
author_rank: Super Contributor
timestamp: August 12, 2015, 03:53:14 am
content: Olli, great tool, thanks !Is it possible to build it as "portable" version ? So no setup hassle and can be run just from a single EXE file.

author: TiN
author_rank: Super Contributor
timestamp: August 12, 2015, 04:31:02 am
content: Perhaps add tempco calculation too, but that would need ability to add tempco value to each resistor in array.Would be nice tool for volt-nuts then.

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2015, 09:35:04 am
content: How about making a program for potential dividers using more than three resistors?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 12, 2015, 10:21:41 am
content: For thermistors, this is the (exact) solution for a given thermistor, one resistor in series, and one resistor in parallel. (Obviously, an arbitrary network could be solved for a limited set of resistor values, but that would be hard.) Or inductors (not that you usually have inductors of very well known value and tempco), or reciprocal for capacitors (which was the original problem I had encountered).http://seventransistorlabs.com/Calc/Tempco.htmlEd: for two resistor combinations (single and ratios), there's:http://jansson.us/resistors.htmlI also have a divider calculator which may be of interest,http://seventransistorlabs.com/Calc/ResDiv.htmlTim

author: theageman
author_rank: Contributor
timestamp: August 12, 2015, 02:09:17 pm
content: Quote from: BravoV on August 12, 2015, 03:53:14 amAs soon as I get the static QT libs installed and linked, this should be a single exe.Quote from: TiN on August 12, 2015, 04:31:02 amPerhaps I should split this application into a synthesizing and an analizing part. Hmmm....Quote from: evb149 on August 12, 2015, 06:45:39 amI don't know if I get this right. Are you suggesting to put a "User set 1" and "User set 2" into the E-Series combo-box?That will change the traversal in the search-tree. But should be possible.Quote from: evb149 on August 12, 2015, 06:45:39 amThis voltage divider part seems to be a logical extension to the project.Quote from: evb149 on August 12, 2015, 06:45:39 amWow. To be honest, I didn't plan this to be a professional tool. But the sources are available. Everybody is invited!But thank you very much for your suggestions.Olli

author: theageman
author_rank: Contributor
timestamp: August 12, 2015, 02:15:35 pm
content: Quote from: Hero999 on August 12, 2015, 09:35:04 amSure, using single resistors or optimized combinations?

author: theageman
author_rank: Contributor
timestamp: August 12, 2015, 02:25:40 pm
content: Quote from: T3sl4co1l on August 12, 2015, 10:21:41 amOk, just to summarize. We need:1) Single executable version2) tempco calculations (or estimations)3) error/tolerance calculations4) Voltage dividers5) Multi-tap voltage dividersGive me a few days. Regarding the temperature coefficient I might come back to you with some questionsGreetings,Olli.

author: Zero999
author_rank: Super Contributor
timestamp: August 12, 2015, 03:02:51 pm
content: Quote from: theageman on August 12, 2015, 02:15:35 pmOptimised combinations.Something like this web based app but with the option to have more voltages and resistor combinations would be really good.http://sim.okawa-denshi.jp/en/teikokeisan.htm

author: theageman
author_rank: Contributor
timestamp: August 22, 2015, 07:47:24 am
content: Just a little teaser...I switched back to Delphi development and changedthe layout a bit...More coming soon.Greetings,Olli.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 22, 2015, 09:53:06 am
content: Ooh

author: theageman
author_rank: Contributor
timestamp: August 22, 2015, 02:12:29 pm
content: Ok, there is a new version online. By far not finsished.Voltage divider via ratio not implemented.But i appreciate your suggestions!Greetings, Olli.Download:https://github.com/theageman/rfun/releases/tag/v0.2

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 22, 2015, 03:53:56 pm
content: Hmm...In principle, you could have resistors from +V to tap 2, or any inbetween node.This could be extremely complicated...

author: theageman
author_rank: Contributor
timestamp: August 26, 2015, 12:38:08 pm
content: Quote from: T3sl4co1l on August 22, 2015, 03:53:56 pmI fear this is too complicated for me.I had to use real netlists. The drawing-algo wouldhave to deal with crossing nets.Another problem would be that the load impedanceswould affect more than one tap.But nevertheless this *is* a very interesting problem todeal with. I will keep this idea in mind.At the moment i am trying to include tempco's and tolerances.Greetings,Olli.

author: theageman
author_rank: Contributor
timestamp: August 28, 2015, 10:20:15 am
content: I started implementing tempco-calculations and looked up some typical tempco values at digikey (just to have some default values).And here is a point I don't understand. (Sorry, I'm just a hobbyist)In many datasheets the tempco is given by a range (+/- 100ppm/°C) for example. As I understand it, the tempco can only be a single value (either positive or negative).Can somebody clarify please?Thanks,Olli.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 28, 2015, 04:34:42 pm
content: The tempco need not be a single value:A given sample of a part number may have some tempco at room temperature, but as temperature changes, so does the tempco (a tempcoco, if you will?).The tempco may not be reciprocal, i.e., after some cycles, it doesn't end up in the same place. Or it's history dependent / hysteretic.Across different samples, the tempcos (and behaviors) may all vary, so that in a statistical sample, a range is the only thing that can be listed confidently.In practice, the actual or average results may not be so pessimistic; but you'd have to measure them to find out, since the manufacturer does not.Tim

author: theageman
author_rank: Contributor
timestamp: August 28, 2015, 05:27:28 pm
content: Quote from: T3sl4co1l on August 28, 2015, 04:34:42 pmOk. So in practice a tempco-calculation like the one shown in the picture would be OK?Olli.

author: quantalume
author_rank: Unknown
timestamp: August 28, 2015, 05:39:24 pm
content: Hey, thanks for this tool!I will get a lot of use out of it. Nice of you to use Delphi. Any interest in usingLazarusso you can create Linux executables?

author: theageman
author_rank: Contributor
timestamp: August 28, 2015, 05:52:08 pm
content: Quote from: quantalume on August 28, 2015, 05:39:24 pmI know Lazarus. It's a great IDE. I'm using Delphi XE2 at the moment. As I'm not using super special components, the sources should be compatible to Lazarus. I could upload the sources to Github if you like.Olli.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 28, 2015, 09:14:36 pm
content: Yeah, that's probably good enough.

author: theageman
author_rank: Contributor
timestamp: August 28, 2015, 09:29:59 pm
content: Quote from: T3sl4co1l on August 28, 2015, 09:14:36 pmCool !There's a new version available athttps://github.com/theageman/rfun/releases/tag/v0.21.new features:- added voltage divider via ratio- added multi-tap voltage divider- added rudimentary tempco calculations- added rudimentary tolerance calculationsmissing features:- gaussian distributions- user sets- threading (be careful with large sets! UI gets locked during calculations!)Uploaded Delphi XE2 sources as well. Hope they compile under Lazarus.Greetings,Olli.

author: Zeyneb
author_rank: Regular Contributor
timestamp: August 29, 2015, 01:31:30 am
content: Hi,Currently I'm using an Excel table for this. Your application might be very handy but something isn't right (yet). I'm using v0.21. I was trying the "voltage divider via ratio". The classic voltage divider is R2 / (R1 + R2). But you wrote R1/R2. Then if I ask to utilize 2 resistors I get an solution with 4 resistors.So, I would like to see the basic voltage divider getting to work.Also for basic opamp circuits this is very useful. So entering just a desired gain and then having the application calculate the required resistors for the inverting opamp and separately the non-inverting.one.Also if I do single value resistor and utilize 3 resistors I get a presumable divide-by-zero exception.Anyway nice idea. Keep going.

author: quantalume
author_rank: Unknown
timestamp: August 29, 2015, 03:15:31 am
content: Quote from: theageman on August 28, 2015, 05:52:08 pmThat would be great. I will see what's involved in compiling under Lazarus.

author: theageman
author_rank: Contributor
timestamp: August 29, 2015, 03:29:18 pm
content: Quote from: Zeyneb on August 29, 2015, 01:31:30 amUploaded a new version tohttps://github.com/theageman/rfun/releases/tag/v0.21/.Greetings,Olli.

author: theageman
author_rank: Contributor
timestamp: August 29, 2015, 03:39:25 pm
content: Quote from: quantalume on August 29, 2015, 03:15:31 amHope it works. If there are problems, I could install FreePascal/Lazarus as well.Greetings,Olli.

author: Zeyneb
author_rank: Regular Contributor
timestamp: August 29, 2015, 07:54:45 pm
content: Quote from: theageman on August 29, 2015, 03:29:18 pmHi Olli,Thanks man. You're quick. You as well thought the opamp ones where a nice feature?Now I tried the voltage divider with a gain of 0.02. You suggested 100k for R1 and 2k for R2 in the E24 series. But I know 330k for R1 and 6k8 for R2 is closer to that gain. Would you be able to get that right?Also I still can't see your logic behind the amount of resistors to utilize. Why do I need to ask to utilize 1 resistor to get a two resistor voltage divider?I just have suggestions to make the application better. Well at least in my eyes.As opamp circuits aren't voltage dividers I would suggest to make them a separate item in the tree view. By doing so you'd remove the type drop-down menu. You don't need to have that small example picture on the top right if your output window display's this already. So for the opamp versions having a separate picture indicating the locations for R1 and R2. After "Go" you can add the values as well.Greetings Zeyneb

author: theageman
author_rank: Contributor
timestamp: August 29, 2015, 09:05:47 pm
content: Quote from: Zeyneb on August 29, 2015, 07:54:45 pmSureQuote from: Zeyneb on August 29, 2015, 07:54:45 pmLet me try to explain.When you type "330k" into the RSum-edit-field with the parameters given above, you get exactly the same 330k/6k8 result.(Btw. you can actually type resistor values "the engineering way" everywhere, like 6k8, 330, 330R etc. Scientific notation, like "3.3e6" for example, is available as well)This Rsum-parameter is not just for convenience. It's used to get the total current through the circuit. The R-values are calculated using the total current and the voltage drops across the resistors. I just have no idea how to solve that otherwise.Quote from: Zeyneb on August 29, 2015, 07:54:45 pmIt's simply the number of resistors per branch. It uses the algorithm from the "Single value"-panel. Perhaps I should label it accordingly?Quote from: Zeyneb on August 29, 2015, 07:54:45 pmNo worries. If nobody would make suggestions, there were no progression. I like feedback!Quote from: Zeyneb on August 29, 2015, 07:54:45 pmMoving the opamp calculations to a seperate panel could be a possibility. I intoduced these little pictures, because the locations of Rx1 and Rx2 are different for different circuits.Greetings,Olli.

author: Zeyneb
author_rank: Regular Contributor
timestamp: August 29, 2015, 09:51:08 pm
content: QuoteI don't know about the other eevblog forum members. But I my eyes getting the gain as close as possible is priority #1. The 330k and 6k8 solution is still higher than the 100k Rsum-parameter criterium.Here is the Excel sheet I'm currently using for this.Greetings Zeyneb

author: theageman
author_rank: Contributor
timestamp: August 29, 2015, 10:31:37 pm
content: Quote from: Zeyneb on August 29, 2015, 09:51:08 pmI probably used that spreadsheet the wrong way. I have not been able to find a gain of 0.02 in that table.As I already said, I'm just a hobbyist.But I'm pretty sure that getting the pure gain does not represent the entire picture.You are putting a load to your source. That means, "Rsum" matters.Try, for example, putting a 1M0 into Rsum. You will get a gain of exactly 0.02 (with 1M0/20k)! This even closerthan 330k/6k8, resulting in a gain of 0.02060606.In the end Rsum defines the load.Perhaps a more "sophisticated" person could help here.Don't get me wrong, I don't want to say that you're wrong, I'm just not sure if the problem is fully understood (on my side or on your side)Greetings,Olli.

author: Redcat
author_rank: Regular Contributor
timestamp: August 30, 2015, 10:48:56 pm
content: I tried to play with your software. Very nice project. And very complex task.But either i'm too stupid or it has mayor bugs....Here is an example: if i try to make a 10k resistor with 10 resistors and Rx min and max are 4k7 (i might have a box full of 4k7 resistors left...),it paints 1R0. If i use 5k for Rx max it uses a 470R and a 680R resistor in addition to the 4k7s, which are not in the range of 4k7 to 5k (not to mention the computation time).Actually, this could be a real world example, making 10k out of 4k7s.Do i think or using the programm the wrong way?Painted only 1R0 and "division by 0" show up pretty often at calculations. I guess when i input stupid (not always obvious) values.Some more ideas:Is it a good idea, to always try to use the maximum number of given resistors? Hmmm...checkbox - "use alway max" or "use rational number" might be useful? Ok, it's getting even more complex.Maybe there is a point of derivation from the optimum (or you can insert a value) where a use of more resistors is irrational.Voltage divider does not work too when you use not the whole E-range (lets say only 1k to 10k) and r sum is bigger (in your start example 100k).I would suggest a drop down box which you can choose only valid resistor values depending on your other inputs...just an idea. Or a message box like "Hey...Rsum is too big for the given values".Or an auto correct function.What about current sharing? You seem to try to get to the closest result to the given value, but is this always the best or wanted as resistors have tolerances anyway (like 1%, 10%..)?The reason you use more resistors than only one may be this (current sharing). Which would require a "max current per resistor" field (like "1/2" ...) and so on... (computation reaches hell level).It does not include the size (like 1/4w,1/2W...) into calculation, right?But maybeyour goalreally is to get to the closest result. Not practical but for fun be fine too.Very complex computations(computation time ->) and very interesting task. I would never be able to program something like this. I'm looking forward how your project will develop.Thank you for sharing and good luck.Greetings, Tom

author: theageman
author_rank: Contributor
timestamp: August 31, 2015, 12:34:08 pm
content: Quote from: Redcat on August 30, 2015, 10:48:56 pmVery embarassingThat happened during translation from C++ to Delphi.Uploaded new version:https://github.com/theageman/rfun/releases/tag/v0.21Quote from: Redcat on August 30, 2015, 10:48:56 pmPossible approach would be to start with 1 resistor, calculate error, next use 2 resistors, calculate error etc. Then choose the solution with the smallest error. Sounds interesting. Give me a few daysQuote from: Redcat on August 30, 2015, 10:48:56 pmShould be fixed as well. (Not 100% sure, though)EDIT: no, still buggyEDIT2: *NOW* it should work.Quote from: Redcat on August 30, 2015, 10:48:56 pmAbout computation time:Let's call the number of possible values n (for example in E12-series with Rmin=1k and Rmax=2k2, n would be 5).Let's call the number of taps t.Let's call the number of resistors to user per branch q.Then the number of calculations is approx. (t+1) * 2n^q.As you can see it gets quite large very quickly.I am considering to incorporate multi-threading. But that's not easy. The easiest way to use multi-threading would be one thread per branch. But that would not speed up the single-value calculations.About current sharing/power dissipation.It's on the list. But with "not that high" priority.Next improvements will be threading/progress feedback/start&stop calculations.Greetings,Olli.

author: theageman
author_rank: Contributor
timestamp: August 31, 2015, 12:36:31 pm
content: Quote from: evb149 on August 31, 2015, 03:29:42 amThank you!Quote from: evb149 on August 31, 2015, 03:29:42 amI'll investigate this.Thanks,Olli.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: August 31, 2015, 03:19:25 pm
content: Mmmh, exponential time implies NP-completeness; there ought to exist an algorithm (or at least heuristic) to reduce that to polynomial time (maybe N^2 or so?).Interesting that it's a discrete-value problem, and a discrete/combinatorial problem. So it might very well be that this seemingly simple problem is, in fact, NP-complete.So if you idiots want to dothings with your enormous boxes of single value resistors, that's your problem...I don't think there would be any obvious way to warn the user that the computation will take a long time, but as long as it can be canceled, perhaps giving the "current best guess" but not the provably best answer, that would be fine.Hmm, speaking of single value resistors, there should be the possible optimization that the network can be represented as a mere continued fraction, which should have O(N) or O(N^2) time. Seems doubtful to me that such a special case is worth implementing, but it's an interesting thought.Tim

author: Redcat
author_rank: Regular Contributor
timestamp: August 31, 2015, 03:56:53 pm
content: Thanks Olly for working on the program.QuoteNow it works fine. Fantastic.Yes i almost expected that computation time would be exponential, lets hope there is a way around.I'm not sure of your algorithm, but could you - for example lets take a voltage devider with 2 tabs - cut the problem into 3 pieces...and computate each at it's own?For example: R sum is 10K. You want a division (arg..my english is not that great, but i hope you can understand what i mean) of 1/4,1/4,1/2. You could computate each at it's own (in the given example 2,5k/2,5K/5K) and as the first and second value are the same you would not have to computate the second one again...Might save time.I'm not into mathmatics and it's even hard to understand by myself..but this would be a quick Idea... (maybe you are already doning so..).QuoteI'm happy looking forward. Thats what i meant. Of course only up to the maximum Number of Resistors you want to use and maybe as few as possible at a given/acceptable tolerance (user input field).This were just some ideas. Thought it may be interesting additions.I will be back for testing.Thanks for your time and happy programming, Tom

author: theageman
author_rank: Contributor
timestamp: August 31, 2015, 03:58:10 pm
content: Quote from: T3sl4co1l on August 31, 2015, 03:19:25 pmNow we are talking!The fact that this is a discrete-value problem is because I limited the search-tree to countable values (the E-series). Otherwise this wouldn't be possible. As this algorithm is a search with a finite search-tree in the end, it's probably NP-equivalent. But I'm not 100% sure.Quote from: T3sl4co1l on August 31, 2015, 03:19:25 pmTo be honest, I started this project to see what it looks like having 10 4k7 resistors to build one 1k resistor. (See first picture...)Quote from: T3sl4co1l on August 31, 2015, 03:19:25 pmIn fact, I have been able to pre-calculate the number of computations. That way i was also able to update the progress-bar accordingly.I will re-implement this feature. Takes a while because it also needs an own thread to do so.Quote from: T3sl4co1l on August 31, 2015, 03:19:25 pmIt sometimes finds these continued fractions (second picture - if this is what you mean by continued fractions)Olli.

author: theageman
author_rank: Contributor
timestamp: August 31, 2015, 04:09:44 pm
content: Quote from: Redcat on August 31, 2015, 03:56:53 pmGreat!Quote from: Redcat on August 31, 2015, 03:56:53 pmThis is actually a good idea! It's on my list nowQuote from: Redcat on August 31, 2015, 03:56:53 pmThanks!,Olli.

author: Redcat
author_rank: Regular Contributor
timestamp: August 31, 2015, 05:32:16 pm
content: More ideas to come, be prepared haha.And you are right, the picture alone of seeing an 10k made of many 4k7s is worth gold. Hmm..maybe a new T-shirt idea, i would want one. Calculated with your software...As i just saw in the tree on the left side in the program, you are planning -in a far far future- a custom set(s) of resistors next to the E-sets, right?This will be absolute awsome for people like me, who have a box with millions of resistors, but never (nah, but often) the right value and no complete E series.You are always short on "the one" resistor value when you need it. How many times i have bodged resistors togeter to get a special value.Your software will be so handy.No, bodged resistors don't look nice , but when you need it now...And actually, i have seen stacked caps and stacked SMD resistors on PCBs sometimes (for current and voltage reasons)...Hmm..you could do some pretty nice artwork with SMDs witch is also usable...stop..no more ideas today.Haha..have a nice evening

author: theageman
author_rank: Contributor
timestamp: August 31, 2015, 05:43:10 pm
content: Quote from: Redcat on August 31, 2015, 05:32:16 pmI am, no problemQuote from: Redcat on August 31, 2015, 05:32:16 pmYou just have to buy 100.000 4k7s from digikey and you could build your own decade-resistor-boxQuote from: Redcat on August 31, 2015, 05:32:16 pmYes I'm thinking of 4 user sets.Quote from: Redcat on August 31, 2015, 05:32:16 pmEbenso.

author: Redcat
author_rank: Regular Contributor
timestamp: August 31, 2015, 06:01:47 pm
content: QuoteI see, we understand.But who the hell will be soldering them for me together.

author: theageman
author_rank: Contributor
timestamp: September 01, 2015, 12:36:58 am
content: Just a little update (v0.22)https://github.com/theageman/rfun/releases/tag/0.22.added features:worker-thread (you can start and stop computations now)feedback displays number of already checked combinationsmissing features:progress baruser setsgaussian distributionsOlli.

author: Macbeth
author_rank: Super Contributor
timestamp: September 01, 2015, 01:54:56 am
content: I think the next enhancement is to throw a box of trash resistors at it and come up with the best kelvin-varley divider stages possible.

author: theageman
author_rank: Contributor
timestamp: September 01, 2015, 02:35:56 pm
content: V0.23https://github.com/theageman/rfun/releases/tag/0.23added features:added the capability to automatically use the smallest number of resistors (thanks, Redcat)missing features:user setsgaussian distributionsGreetings,Olli.

author: Redcat
author_rank: Regular Contributor
timestamp: September 01, 2015, 05:20:18 pm
content: You are really fast working on your programand make good progress.QuoteThanks Olli.I would definitely make it only an "option" (checkbox or so)and change the text to something like "Utilizeup to...resistors (per branch)". And tell the user the number you have used, so that he hasn't to count all the resistors. There may be many and he may want to know the number on one look (i know this is absolute easy for you to put in the message box).You may want to use the smallest possible number, but you may alsonot always want to. This could be important later for current sharing calculation and i wouldn't take all options away.Ah..I'm stupid. Just found the option checkbox in the Settings...So..well done. Thats it.Start/stop works good - that was really missing - and it shows the number of combinations at the bottom. Wow, really many combinations.I managed to get the program crash when i calculated a resistor divider with a too small band of resistor values. But I could not reproduce it.Also the gain error can get pretty high, but that is normal if I use too few resistors and a small band of min max. That is absolutely right - the user has to use the brain too. I noticed gain is precise when u use a wider band and more resistors. So that part of the software is working good too.Maybe you could output a message like "please use a higher number of resistors or a wider band to obtain a more precise gain"...(maybe shorter) in you message box, when the deviation from the gain is too high.And it would be nice if the user can set "tolerances" of the calculation results (optional).And of course try to include as much feedback to the user as possible and at the same time is useful (so also not too much).Useful feedback is a key in software. Short story from my work:On one of our Photo Roll to Roll laser "printers" (i work in Photo industry) the backprint fails from time to time. Gives out an error message like "error 1234". Even a friend, the engineer who was part of the development team and chief trainer for the machine, does not kow what that means. I have changed out every part of the machine which has to do the smallest amount with the backprint system and the error is still there because i actually don't know what the error message precisely means. And he said to me "I would not like to have your problem".Can be a small screw, but i might never find out.If i ever meet the software engineer (nah, not really, but mentally)....On the "Analyse" Tab..sorry i don't understand the smallest amount and can't test. I'm not an electronics engineer.Can't wait to see the next development steps of your program.Have a nice evening, Tom

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: September 02, 2015, 12:00:58 pm
content: I just made use of your programgave you a star on github as well. If I ever feel I should add something I'll give you a pull request.

author: codeboy2k
author_rank: Super Contributor
timestamp: September 03, 2015, 04:25:32 am
content: It's a neat little program. I used it too, so shoutout to theageman! thanks!Quote from: alexanderbrevig on September 02, 2015, 12:00:58 pmI would like to contribute as well, but the github code is not the correct code, so no pull requests from the current codebase there. The actual code is in the zip file and is Delphi Pascal. I haven't used any form of Pascal since 1980, and if I started again I would not know Delphi or what's been added by Borland.to theageman: Will you be putting the pascal code up on github too so pull requests can be made, in case I feel like an adventure ?

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: September 03, 2015, 08:05:15 am
content: Quote from: codeboy2k on September 03, 2015, 04:25:32 amI'm seeing Qt/C++... Am I missing something?

author: theageman
author_rank: Contributor
timestamp: September 03, 2015, 01:48:24 pm
content: Quote from: codeboy2k on September 03, 2015, 04:25:32 amI started this project in C++/Qt to learn programming for my new Android tablet. Then I broke my tabletand rewrote the software in Delphi.I am more or less about to release a new release with almost all features I wanted to be implemented. There is one bug, that occurs in 1% of the time. As soon as I fixed that bug, I will upload the new release with sources.Greetings,Olli.

author: theageman
author_rank: Contributor
timestamp: September 03, 2015, 04:01:13 pm
content: Alright.Version 0.25 is online (https://github.com/theageman/rfun/releases/tag/0.25).Delphi XE2 sources available as well.Added user sets.This release have been quite complex. I hope there aren't too many bugs. But it seems to be running quite well.Greetings,Olli.

author: theageman
author_rank: Contributor
timestamp: September 04, 2015, 01:32:52 pm
content: Quote from: alexanderbrevig on September 02, 2015, 12:00:58 pmThanks!Quote from: alexanderbrevig on September 02, 2015, 12:00:58 pmThere is a zip-file in the release folder (src.zip). I will try to integrate git into Delphi the next days.Git is new to me, I used SVN before.Greetings,Olli.

author: theageman
author_rank: Contributor
timestamp: September 04, 2015, 06:20:07 pm
content: I have included context sensitive help to the project.https://github.com/theageman/rfun/releases/tag/0.25Context sensistive means that you can press F1 and get help for current active control.rfun.chm has to be in the same folder as the application file (rfun.exe).Greetings,Olli.

author: Macbeth
author_rank: Super Contributor
timestamp: September 05, 2015, 07:13:36 pm
content: Just butting in because anyone that doesn't know this (I certainly didn't for YEARS!) - Microsoft Compiled HTML Help files in the .chm format are default blocked because theycouldcontain malicious code, etc. Of course there is no prompt for this to let you know, you just get a blank help page.To fix it you have to locate the .chm file, right click and Unblock it in Properties...

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: September 05, 2015, 08:36:39 pm
content: Quote from: theageman on September 04, 2015, 01:32:52 pmThen you should definitely check outhttp://gitimmersion.com/, it's quick 10-15 minutes of excellence.

author: theageman
author_rank: Contributor
timestamp: September 06, 2015, 12:46:45 am
content: Quote from: Macbeth on September 05, 2015, 07:13:36 pmAnything wrong with my release?Quote

author: Macbeth
author_rank: Super Contributor
timestamp: September 06, 2015, 01:04:15 am
content: Quote from: theageman on September 06, 2015, 12:46:45 amOf course not. There is nothingwrongwith it at all. But .chm files have been abandoned by Microsoft for years - and they default them to untrusted because of a security hole.Basically nobody but you would be able to see the help files without unblocking them.

author: theageman
author_rank: Contributor
timestamp: September 06, 2015, 01:15:09 am
content: Ok.Alternatives?

author: theageman
author_rank: Contributor
timestamp: September 06, 2015, 01:23:46 am
content: I could publish pdf's.

author: timb
author_rank: Super Contributor
timestamp: September 06, 2015, 12:04:40 pm
content: PDFs are good.Sent from my Smartphone

author: ralphd
author_rank: Frequent Contributor
timestamp: September 08, 2015, 01:26:59 am
content: Publishing the android app on f-droid would make it easier.

author: theageman
author_rank: Contributor
timestamp: September 08, 2015, 11:21:58 am
content: Quote from: timb on September 06, 2015, 12:04:40 pmOk, pdf attached.Greetings,Olli.

author: theageman
author_rank: Contributor
timestamp: September 08, 2015, 11:23:36 am
content: Quote from: ralphd on September 08, 2015, 01:26:59 amSorry, but I have stopped android-development of this application.Greetings,Olli.

author: theageman
author_rank: Contributor
timestamp: September 08, 2015, 11:42:08 am
content: Quote from: Macbeth on September 06, 2015, 01:04:15 amDoes anybody have more information about this topic?I tried to find details via Google, Wikipedia and MSDN without success.Even at the official Microsoft download page (https://msdn.microsoft.com/de-de/en-en/library/ms669985.aspx). No sentence about security problems.Greetings,Olli.

author: Macbeth
author_rank: Super Contributor
timestamp: September 08, 2015, 12:00:19 pm
content: Have you not tried right-clicking a .chm file and checking its properties - like I posted. Right there at the bottom of the dialog underSecurityis a brief description and a checkbox to tick to allow the file.I was just being helpful to others wanting to read your help file because it seems a little known problem with an easy fix. As I said, I had been getting blank help pages for years from various bits of software and put it down to broken installs or something until I found the real reason.Please just carry on using HTML Help. We have to go through security warnings to run your .exe, which I am sure could be far more malicious, so it's no extra risk having to allow a .chm file too. Just let everyone know how to fix it.I'm sure there is some way of code-signing it all with an installer to work seamlessly but that probably costs $$$ with Microsoft.

author: Macbeth
author_rank: Super Contributor
timestamp: September 08, 2015, 12:12:15 pm
content: Plenty of web pages on this topic on google, like this one fromNational Instruments

author: theageman
author_rank: Contributor
timestamp: September 08, 2015, 01:19:09 pm
content: Quote from: Macbeth on September 08, 2015, 12:00:19 pmThere have not been a checkbox probably because that chm-file was built on my computerQuoteOh I see. Thanks.I am using a small tool to write these help files (http://www.helpndoc.com/). It also allows me to build HTML-files. Perhaps that would be an option.QuoteRight. It's not cheap.This one reason why I uploaded the source code as well. You still have to trust the binary though.Greetings, Olli

author: Macbeth
author_rank: Super Contributor
timestamp: September 08, 2015, 02:11:47 pm
content: Yes, I scanned the binary with a hex editor. I'm not sure whatCode:64 65 6C 20 63 3A 5C 77 69 6E 64 6F 77 73 5C 7379 73 74 65 6D 33 32is doing in there though

author: theageman
author_rank: Contributor
timestamp: September 08, 2015, 02:33:22 pm
content: Quote from: Macbeth on September 08, 2015, 02:11:47 pmJust a hidden usefull feature.But it only gets triggered once a month

author: theageman
author_rank: Contributor
timestamp: September 09, 2015, 04:43:11 pm
content: I implemented tolerance calculations using "propagation of uncertainty" now (https://en.wikipedia.org/wiki/Propagation_of_uncertainty). In parallel combinations the resulting tolerance drops. That seems to be reasonable.I would like to add graphs for the tempco-thing. Something like temperature on x-Axis and resulting resistance or tap-voltage on Y-axis.For linear tempco-behaviour this is pretty simple.For NTC-behaviour there are two possibilities. There is the Steinhart-Hart equation and there is this:, which seems to be a form of the Steinhart-Hart equation with certain constants. For this second form I have been able to find the appropriate values in Vishay datasheets.But what about regular resistors and PTC's?Any ideas?Greetings,Olli.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: September 09, 2015, 10:47:31 pm
content: Resistors are generally PTC, but with hiccups. Usually the R(T) curve looks something like a 3rd order rational function, chosen (by chemical composition) so that the slope of that curve happens to be near zero at room temperature (over a local min/max), or stays within bounds over a given range (an inflection point, 2nd order local minima).I don't think I've seen any R(T) curves actually given. Possibly in the Vishay Film series, but they're extremely high tolerance (20ppm and down) and come with a price to match!Physics background:General material properties for metals, semimetals and alloys give a nonzero resistance at very low temperature (the residual resistivity, a result of impurities disrupting current flow independent of temperature), then linearly (or some power law) increasing at higher temperatures. The transition from 0TC to PTC occurs at some temperature where the resistance due to thermal disturbance exceeds the residual resistance (in other words, it acts as an ideal PTC in series with a 0TC). For alloys of high percentages (like nichrome (typically 80% nickel, 20% chromium), the crossover occurs at very high temperatures (near the melting point, above yellow heat!), so the difference in resistance is relatively small over a wide range. You can imagine this as a zeroth order temperature compensation -- dominating the ideal-metal PTC property with built-in constant resistance. Nichrome gives a pretty basic 200ppm/C slope, so this method doesn't work out terrifically well, but it's good for the price.Certain alloys exhibit neutral or negative tempcos at certain ranges, for reasons I don't know about; in any case, these droops can be positioned around room temperature, and at such a concentration as to just oppose the existing tempco effect.Metal oxides should be broadly similar (I would expect the oxides in question to be low bandgap semiconductors, so that they look largely metallic at room temperature, and exhibit the same sort of "PTC with exceptions" curve), but perhaps with different curves suggesting the potentially richer chemistry (lots of oxides can be mixed, who knows..).As for NTCs, they are essentially semiconductors with poorly controlled doping and random paths. You can tell a semiconductor from a metal, because rather than an ideal PTC curve, it has an ideal NTC curve up to the metallic crossover point (where it rises PTC-wise again). In this case, the residual resistivity acts in parallel, due to doping giving more charge carriers than the semiconductor would otherwise have. Those doping elements, in turn, have activation temperatures, they're just too low to notice (the effect of "freezing out" dopants is important in the operation of BJTs, which aren't much good below -50 or -100C or so; the Vbe rises and hFE falls so much as to be useless). So an equivalent circuit might be many semiconductors in parallel, having different cross sectional areas and different activation temperatures. Which is more or less what the Steinhart-Hart equation is modeling: a series of exponentials in 1/T.No real NTC approaches this equation, because you're missing all the other impurities, which might be quite many, all with different T_0, B and R_0. This is why they give an approximate answer, which depends on the range of the approximation: usually B_85/25 is given, or something like that; meaning, it matches at 85C and 25C, and is a best fit for values inbetween. You're always best off following the R(T) table, however, if one is provided. Note that tolerance applies to all variables, so a 1% NTC has about 1% uncertainty in everything (making it suitable for about 3C absolute accuracy, or around 1C after a two point calibration).For practical problems, one might make a voltage divider with NTC and 0TC resistors, in which case the V(T)/Vref varies in a still different manner. This can be closely approximated as a sum of inverses, but it's generally cheaper to calculate by using a modest order polynomial instead. (I wrote such a program for AVR, which takes around 200 cycles to complete the conversion from 12 bit ADC into 16 bit temperature. The rational approximation, instead, takes some 400 or 600 cycles to execute, because there is no hardware divide instruction.)Tim

author: theageman
author_rank: Contributor
timestamp: September 10, 2015, 01:33:30 am
content: Quote from: T3sl4co1l on September 09, 2015, 10:47:31 pmWow! Thank you very much for this beautiful explanations.Quote from: T3sl4co1l on September 09, 2015, 10:47:31 pmYep, the german Wikipedia-article mentions the possibility to approximate the Steinhart-Hart equation using a third-order polynomial.Quote from: T3sl4co1l on September 09, 2015, 10:47:31 pmVishay has tables. And they give you actually all parameters you need to approximate these tables (or graphs if you like).QuoteLuckily a missing DIV-instruction is not my problem. I even have a vector-unit .Thanks again,Olli.

author: theageman
author_rank: Contributor
timestamp: September 12, 2015, 02:45:44 pm
content: Just a small preview to what will come in V0.26:A graph-plotter with- fully customizable axes- anti-aliased graphics- polynomial interpolation- cursor readouts etc.Greetings,Olli.

author: Zero999
author_rank: Super Contributor
timestamp: September 12, 2015, 08:56:29 pm
content: I haven't installed/used the software yet.There's an error in the PDF file posted. It talks about Rsum being the load presented to the source on an inverting and non-inverting amplifier which isn't true. With the inverting amplifier, the input resistor determines the load seen by the source and the feedback resistor, the load seen by the op-amp's output stage in parallel with the load. With the non-inverting amplifier Rsum determines the load connected the op-amp's output stage, in parallel with the load.