Author Topic: Fun with resistors  (Read 27240 times)

0 Members and 2 Guests are viewing this topic.

Offline alexanderbrevig

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
Re: Fun with resistors
« Reply #50 on: September 03, 2015, 08:05:15 am »
[...]The actual code is in the zip file and is Delphi Pascal.

I'm seeing Qt/C++... Am I missing something?
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #51 on: September 03, 2015, 01:48:24 pm »
[...]
I 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 ? :)

I started this project in C++/Qt to learn programming for my new Android tablet. Then I broke my tablet  |O and 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.
Jazz is not dead, it just smells funny
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #52 on: September 03, 2015, 04:01:13 pm »
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.
Jazz is not dead, it just smells funny
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #53 on: September 04, 2015, 01:32:52 pm »
I just made use of your program :) gave you a star on github as well. If I ever feel I should add something I'll give you a pull request.

Thanks!

I'm seeing Qt/C++... Am I missing something?

There 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.
Jazz is not dead, it just smells funny
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #54 on: September 04, 2015, 06:20:07 pm »
I have included context sensitive help to the project.

https://github.com/theageman/rfun/releases/tag/0.25

Context 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.
Jazz is not dead, it just smells funny
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Fun with resistors
« Reply #55 on: September 05, 2015, 07:13:36 pm »
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 they could contain 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...



 

Offline alexanderbrevig

  • Frequent Contributor
  • **
  • Posts: 700
  • Country: no
  • Musician, developer and EE hobbyist
    • alexanderbrevig.com
Re: Fun with resistors
« Reply #56 on: September 05, 2015, 08:36:39 pm »
Git is new to me, I used SVN before.

Then you should definitely check out http://gitimmersion.com/, it's quick 10-15 minutes of excellence.
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #57 on: September 06, 2015, 12:46:45 am »
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 they could contain 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...



Anything wrong with my release?

Quote
Microsoft Compiled HTML Help files in the .chm format are default blocked because they could contain malicious code, etc. Of course there is no prompt for this to let you know, you just get a blank help page.
Jazz is not dead, it just smells funny
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Fun with resistors
« Reply #58 on: September 06, 2015, 01:04:15 am »
Anything wrong with my release?
Of course not. There is nothing wrong with 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.
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #59 on: September 06, 2015, 01:15:09 am »
Ok.

Alternatives?
Jazz is not dead, it just smells funny
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #60 on: September 06, 2015, 01:23:46 am »
I could publish pdf's.
Jazz is not dead, it just smells funny
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Fun with resistors
« Reply #61 on: September 06, 2015, 12:04:40 pm »
PDFs are good. :)


Sent from my Smartphone
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline ralphd

  • Frequent Contributor
  • **
  • Posts: 445
  • Country: ca
    • Nerd Ralph
Re: Fun with resistors
« Reply #62 on: September 08, 2015, 01:26:59 am »
Publishing the android app on f-droid would make it easier.
Unthinking respect for authority is the greatest enemy of truth. Einstein
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #63 on: September 08, 2015, 11:21:58 am »
PDFs are good. :)


Sent from my Smartphone

Ok, pdf attached.

Greetings,
Olli.

Jazz is not dead, it just smells funny
 
The following users thanked this post: Cliff Matthews

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #64 on: September 08, 2015, 11:23:36 am »
Publishing the android app on f-droid would make it easier.

Sorry, but I have stopped android-development of this application.

Greetings,
Olli.
Jazz is not dead, it just smells funny
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #65 on: September 08, 2015, 11:42:08 am »
Anything wrong with my release?
Of course not. There is nothing wrong with 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.

Does 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.
« Last Edit: September 08, 2015, 11:44:16 am by theageman »
Jazz is not dead, it just smells funny
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Fun with resistors
« Reply #66 on: September 08, 2015, 12:00:19 pm »
Have you not tried right-clicking a .chm file and checking its properties - like I posted. Right there at the bottom of the dialog under Security is 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.
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Fun with resistors
« Reply #67 on: September 08, 2015, 12:12:15 pm »
Plenty of web pages on this topic on google, like this one from National Instruments
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #68 on: September 08, 2015, 01:19:09 pm »
Have you not tried right-clicking a .chm file and checking its properties - like I posted. Right there at the bottom of the dialog under Security is a brief description and a checkbox to tick to allow the file.
There have not been a checkbox probably because that chm-file was built on my computer ;)

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

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

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

Right.  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
Jazz is not dead, it just smells funny
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Fun with resistors
« Reply #69 on: September 08, 2015, 02:11:47 pm »
Yes, I scanned the binary with a hex editor. I'm not sure what

Code: [Select]
64 65 6C 20 63 3A 5C 77 69 6E 64 6F 77 73 5C 73
79 73 74 65 6D 33 32

is doing in there though  ;) :-DD
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #70 on: September 08, 2015, 02:33:22 pm »
Yes, I scanned the binary with a hex editor. I'm not sure what

Code: [Select]
64 65 6C 20 63 3A 5C 77 69 6E 64 6F 77 73 5C 73
79 73 74 65 6D 33 32

is doing in there though  ;) :-DD

Just a hidden usefull feature.
But it only gets triggered once a month ;)
Jazz is not dead, it just smells funny
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #71 on: September 09, 2015, 04:43:11 pm »
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.
Jazz is not dead, it just smells funny
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21860
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Fun with resistors
« Reply #72 on: September 09, 2015, 10:47:31 pm »
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
« Last Edit: September 09, 2015, 10:59:44 pm by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #73 on: September 10, 2015, 01:33:30 am »
[...]

Wow! Thank you very much for this beautiful explanations.

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

Yep, the german Wikipedia-article mentions the possibility to approximate the Steinhart-Hart equation using a third-order polynomial.

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!

Vishay has tables. And they give you actually all parameters you need to approximate these tables (or graphs if you like).

Quote
[...]
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

Luckily a missing DIV-instruction is not my problem. I even have a vector-unit . ;)

Thanks again,
Olli.
Jazz is not dead, it just smells funny
 

Offline theagemanTopic starter

  • Contributor
  • Posts: 39
  • Country: de
    • My Blog
Re: Fun with resistors
« Reply #74 on: September 12, 2015, 02:45:44 pm »
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.
Jazz is not dead, it just smells funny
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf