tag:blogger.com,1999:blog-4339813531032979196.post5928415008485581638..comments2024-02-28T07:32:59.864+00:00Comments on HydraRaptor: Measuring temperature the easy waynopheadhttp://www.blogger.com/profile/12801535866788103677noreply@blogger.comBlogger36125tag:blogger.com,1999:blog-4339813531032979196.post-70982979680936476482013-05-10T09:20:19.412+01:002013-05-10T09:20:19.412+01:00I assume this is referring to the code in my later...I assume this is referring to the code in my later article "More accurate thermistor tables".<br /><br />The code breaks if three points are given that can't be right for a real thermistor as the logarithmic equation used can not fit three arbitrary points.<br /><br />The values you give seem very odd for a 500K thermistor and you will never get it accurate if you are trying to measure 0.22R with a 4K7 pullup.nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-68420246216274611342013-05-10T06:04:50.247+01:002013-05-10T06:04:50.247+01:00Looking for a hand here. I am using a 500K thermis...Looking for a hand here. I am using a 500K thermistor (for very good reason) & it seems that entering 500K breaks the code. I was able to make something that works with the thermistor calculator at http://calculator.josefprusa.cz/#TempLookup (missing atm) but I wanted to make something far more accurate as I will be going to 400C with this thermistor. My variables are:<br /><br /> r0 = 500000<br /> t0 = 25<br /> rp = 4700<br /><br /> t1 = 200; r1 = resistance(3.605)<br /> t2 = 400; r2 = resistance(0.2258)<br /><br />Can you help me out with this? Thanks in advance!Anonymoushttps://www.blogger.com/profile/09388149773948899429noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-73167017097943300482013-03-11T17:44:30.304+00:002013-03-11T17:44:30.304+00:00Not sure. If it is inductively coupled noise then ...Not sure. If it is inductively coupled noise then presumably the source impedance is the impedance of the inductance of the loop of wire plus the resistance of the thermistor.nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-42593497942621301502013-03-11T15:54:52.921+00:002013-03-11T15:54:52.921+00:00I observed actual noise at the Vn junction, which ...I observed actual noise at the Vn junction, which I thought I would have to model (in SPICE, or on paper) as an injected noise with zero impedance. When finally got around to using an an oscilloscope, I noticed that I had 50kHz noise at Vref as well, ultimately due to a noisy ATX power supply. The noise path to V through R2 gets filtered by the R2*C1, but the noise path into Vref wasn't significantly filtered (Direct connection to an ATX V_sb with 0.1uF), so the internal ADC sensor reported noisy readings with respect to Vref.<br /><br />How would one model real world, observed noise at a terminal other than as a low impedance injection? Swap capacitors, measure the attenuation, calculate the impedance, then model it as a perfect signal generator followed by the calculated resistance?drf5nhttps://www.blogger.com/profile/12917695018240093981noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-60803510607435963392013-03-10T06:17:46.140+00:002013-03-10T06:17:46.140+00:00Nophead wrote an update: http://hydraraptor.blogsp...Nophead wrote an update: http://hydraraptor.blogspot.com/2012/11/more-accurate-thermistor-tables.htmldrf5nhttps://www.blogger.com/profile/12917695018240093981noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-68444357048329463282012-11-08T18:59:44.415+00:002012-11-08T18:59:44.415+00:00The time constant is only zero if you inject noise...The time constant is only zero if you inject noise from a source with zero impedance, which unless you make a direct connection with a perfect signal generator, is impossible. The capacitor will always provide some attenuation for real world noise sources.nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-1917128508085301902012-11-08T18:06:29.844+00:002012-11-08T18:06:29.844+00:00I didn't want an R4 so much for current limiti...I didn't want an R4 so much for current limiting as for some RC filtering on noise injected at Vn. Without any resistance between the noise source and the capacitor, the noise is injected at the output of the RC filter. Looking at it as summing parallel impedances leading into the capacitor, any Vn noise injected behind an R4 would make the total parallel resistance 1/(1/R1+1/R2+1/Rtherm+1/R4), and as R4 approaches zero, Rsum would approach R4, and the time constant would go to zero. However it is moot because rather than noise from my long leads, I think the noise I was attempting to filter actually comes from the +/-1LSB of resolution of the ADC at low temps due to my poor choice of Rmagic.<br /><br />I thought my cheap breadboard hardware was likely noisy because it has lots of extra parallel traces fed by a spaghetti-nest of wires, but I now think it was likely due to large ADC noise at room temp due to a poor selection of a magic temperature.<br /><br />I had been picking the magic value to be in the middle of the *operating* temperatures. For my Epcos B57540G1104 (100K, beta=4092) if I'm looking to match 624 ohms at 200C, then with the divider calcs from the above I get R1=892, R2=2081, and I get .75C/count at 200C, but about 7C/count at 35C. Some ought-to-have-been-expected 1-bit ADC noise of ~7C at the low end was likely my problem and wouldn't have been filtered out by an R4-like thing anyway.<br /><br />I'm eliminating R1 and going with 2.5V mid-scale at 130C using R2=2700 with 0.37C/count at 200C and 1.0 C/count at 20C. I expect 1/7th the ADC noise at room temp, and 1/2 the ADC noise at working temps. <br /><br />If the max 2.31mW or 6C of self heating at 130C is a problem, I'll look into adding an R5=6800 between Vcc and Vref and hooking Vref to the AREF ADC input.<br /><br />Thanks for your article, the program, and the comments. I think I understand the effects of interactions between Rmagic, the 100K vs 10K thermistors, the biasing vs non-biasing voltage division circuits, and their effects on ADC resolution much better. Thanks again.Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-53027474634644321972012-11-07T21:58:30.177+00:002012-11-07T21:58:30.177+00:00I don't have access to the internal 1.5v Vref,...I don't have access to the internal 1.5v Vref, so I need the second resistor to prevent room temperature being off the scale.<br /><br />I don't know why you are current limiting at high temps. The maximum dissipation in the thermistor is when its resistance equals the impedance of the divider, which is normally in the mid range, it is a power rather than current limitation.<br /><br />To get more resolution at the top end then the parallel resistance of R1 and R2 needs to be lower, or if that creates too much self heating the thermistor needs to be a higher resistance.<br /><br />Most people use 100K with 5V systems. I put a 100K on my electronics but kept the resistors the same. It gives much smoother readings at 240C but is very noisy at room temp.<br /><br />Why is you "cheap hardware" noisy? <br />nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-77049155095156588462012-11-07T21:38:49.398+00:002012-11-07T21:38:49.398+00:00Around 200C, The resolution is coarser than a degr...Around 200C, The resolution is coarser than a degree per count. Per a patched version of the above program:<br /><br />createTemperatureLookupNophead.py --r0=10000 --t0=25 --r1=671 --r2=1579 --num-temps=160 --beta=3500<br /><br />...<br /> {63, 204},<br /> {64, 202},<br /> {65, 201},<br /> {66, 200},<br /> {67, 199},<br /> {68, 197},<br /> {69, 196},<br /> {70, 195},<br />...<br /><br />Since Hydraraptor uses a 1.5V vRef instead, you don't need to do the dividing with R1, and you can use R2=470 or whatever else instead and get around .25C/step resolution:<br /><br /><br />createTemperatureLookupNophead.py --r0=10000 --t0=25 --r1=0 --r2=470 --num-temps=320 --beta=3500<br /><br />...<br /> {214, 203},<br /> {217, 201},<br /> {220, 200},<br /> {223, 199},<br /> {226, 198},<br /> {229, 197},<br /> {232, 196},<br />...<br /><br /><br />I know this circuit works for lots of people, but the vDiv resolution sacrifice costs about 3/4 of the resolution in the region of interest. With 5V and a 68ohm R4 as a current limiter at high temps, you don't need to dump 3/4 of the resolution.<br /><br />There wasn't firmware that worked for my admittedly cheap and noisy hardware, so I had to adapt Teacup and then write the oversampling and averaging routine myself. Since the bed and extruder temperature signal varies with a time constant on the order of tens of seconds, it seems the firmwares would not have needed oversampling and averaging if the input conditioning circuits were robust against the noise some people have experienced.<br /><br />(--num-temps= patch at http://reprap.org/wiki/Talk:Thermistor#num_temps_patch )<br /><br /><br />Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-15056694345533297672012-11-07T18:34:20.450+00:002012-11-07T18:34:20.450+00:00Adding your R4 reduces the resolution at the high ...Adding your R4 reduces the resolution at the high temperature end, which is where we need it accurate.<br /><br />The time constant is not R4 C1 as I keep telling you. It is R2 in parallel with R4 for noise injected at Vn from a zero impedance source.<br /><br />Yes if VREF is on an external pin you can reduce it to reduce self heating. Reprap simply uses a 100K thermistor.<br /><br />The circuit works fine. Noise isn't normally a problem because the capacitor filters most of it and the firmware does over sampling and averaging. nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-27094003653040455102012-11-07T17:37:56.066+00:002012-11-07T17:37:56.066+00:00I don't yet have an oscilloscope to do actual ...I don't yet have an oscilloscope to do actual testing, but it seems like if I dropped R1, put an R4 in series with the high leg of the thermistor, with a circuit like:<br /><br /><br />GND---Rtherm--Vn-R4---Vdiv---R2---Vcc<br />GND---C1-------------/<br /><br />With values like: R4=68, R2=470, C1=10uf Ttherm=(10K@25, B=3600)<br /><br />You would get a lowpass RC filter on any lead noise noise injected at Vn of 1/(2pi R4 C1) = 236Hz.<br /><br />Current limiting of Vcc/(R2+R4+Rtherm(T<300C)) < 7ma @5V<br /><br />Voltage at Vdiv varying from 0.63 to 5, with the thermistor short- to open- circuited (ADC of 130 to 1023)<br /><br />If one is concerned about about self heating, why not break R2 into two segments and hook the ADC's Vref to the reduced voltage rather than the +5V Vcc?<br /><br />At a 1.1Vref, with r2=470, r4=30, I calculate 2mW at 300C, 1.7mw at 200C, 0.4C/count around 200C, and about a 1.1C/count around 20C.<br /><br />Is this the best circuit for this application or is it historically what RepRappers have been using?<br /><br /><br /><br /><br /><br /><br />Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-11972601815899836872012-11-03T13:31:16.841+00:002012-11-03T13:31:16.841+00:00I'm using a atmega32U4 (>10K impedance reco...I'm using a atmega32U4 (>10K impedance recommended) in a set of noise-prone electronics, http://reprap.org/wiki/Teensy_Breadboard , so I'm trying to figure out what's happening with the noise.<br /><br />My thoughts are these:<br /><br />If the capacitor is on the ADC side of the series resistor, the ADC should charge and settle quite fast. <br /><br />Any DC leakage current from the ADC can only flow towards the voltage divider junction and would actually be minimized by larger R. If the ADC is at Vref, the series resistor would be parallel with R1 and make the top leg resistance 1/(1/R1 + 1/Rseries). <br /><br />If Vref is the Vref of the ADCs, it seems like noise injected there would be common to both the input and comparator, so it should be ignored.<br /><br />It still looks like a superposition of three filters to me. Depending on the location of the noise injection, its path past the capacitor will travel through different resistances. Zero for an injection at the voltage divider junction or in the hot leg of the thermistor. <br /><br />I'm going to have to buy myself an oscilloscope and a signal generator and actually test these suppositions.<br /><br />Test-wise, I jammed a 10uf cap in parallel with the low leg of the voltage divider in my noisy system and it didn't seem to reduce the noise in my readings. <br /> <br /><br /> Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-68457528653543489882012-11-03T09:11:02.953+00:002012-11-03T09:11:02.953+00:00If noise is injected at VREF it will be attenuated...If noise is injected at VREF it will be attenuated more but the time constant of the filter will always be equal to the parallel resistance of the three resistors times the capacitor. <br /><br />Yes your maths is right. my guess was wrong.<br /><br />Yes a series resistor before the capacitor would allow a bigger R in the RC but don't make it too big or the leakage current of the ADC input will cause a DC offset. Also the sample and hold input of the ADC might need a low impedance to settle fast enough, check the datasheet.nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-80479863572029431152012-11-03T05:37:40.834+00:002012-11-03T05:37:40.834+00:00... or maybe swap the capacitor and R1 in the last...... or maybe swap the capacitor and R1 in the last diagram and put a 1K between them. Then I'll get a 16Hz lowpass filter on any thermistor noise.Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-39116978326083293312012-11-03T04:45:26.469+00:002012-11-03T04:45:26.469+00:00Like R=1/(1/R1+1/R2+1/Rtherm) ?
I've been qui...Like R=1/(1/R1+1/R2+1/Rtherm) ?<br /><br />I've been quite error prone lately, so I wouldn't be surprised. I did my math in R as:<br /><br />> C=10e-6;R=c(470,1600,680,1/(1/470+1/670+1/1600), 1); 1/(2*pi*R*C)<br />[1] 33.862754 9.947184 23.405139 67.564407 15915.494309<br /><br />Looking at the last schematic, it seems like it is an analog adder and there are separate filters depending on where the noise is injected. Vref noise would be filtered by the R2*C lowpass, but noise induced in the long hot lead to the thermistor would be shunted directly to V. Noise in the ground thermistor lead would be filtered by Rtherm*C lowpass.<br /><br />If I want to filter out 60Hz noise on my long leads, it seems like I'd need another resistor in series with those leads.<br /><br /> Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-34490052134939299942012-11-02T20:16:52.440+00:002012-11-02T20:16:52.440+00:00It will make a low pass filter with the resister b...It will make a low pass filter with the resister being parallel combination of the two resistors and the thermistor. I think it will be much higher frequency than Hz though. I think you have a decimal point in the wrong place.nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-51373594758205520302012-11-02T19:59:01.422+00:002012-11-02T19:59:01.422+00:00About the 10uF capacitor...
Does this make the c...About the 10uF capacitor... <br /><br />Does this make the circuit a low-pass filter with a cutoff frequency of 1/(2*pi*R_thermistor*C)=33Hz, one with 1/(2*pi*R2*C)=9.9Hz, or something else?Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-57012455149195240402012-02-09T20:43:16.932+00:002012-02-09T20:43:16.932+00:00That makes sense. The little decimal points may n...That makes sense. The little decimal points may not always print well on real components. I understand now -- my electronics experience was all pre-SMD.Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-50408237287977540742012-02-09T20:24:03.502+00:002012-02-09T20:24:03.502+00:00Yes it is 1.6K when spoken. 1K6 is a standard way ...Yes it is 1.6K when spoken. 1K6 is a standard way of writing it though on schematics and components as it uses less space. Perhaps in prose it should be 1.6K.nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-69277945324548406162012-02-09T19:46:33.348+00:002012-02-09T19:46:33.348+00:00It looks to me as if it should say "1.6k"...It looks to me as if it should say "1.6k"? If it is not a typo transposing the period and the K, maybe I'm reading it in american english. Would you speak 1600 as "one k six"? I'd speak it aloud as "one point six k" or "sixteen-hundred"Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-40112799863312367422012-02-09T19:20:15.164+00:002012-02-09T19:20:15.164+00:00Hi Dave,
Sorry, but what is the typo?
"pre...Hi Dave,<br /> Sorry, but what is the typo?<br /><br />"preferred values are 680 and 1K6"<br /><br />It looks OK to me.nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-65795551387217332402012-02-09T18:56:13.383+00:002012-02-09T18:56:13.383+00:00Thanks for the posting. The hot end is the next ...Thanks for the posting. The hot end is the next thing on my list.<br /><br />There is a tiny typo at the end: "... values are 680 and 1K6."Dave Xnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-76716383586854030442011-09-02T13:46:46.750+01:002011-09-02T13:46:46.750+01:00Nice Python script and useful blog - Thanks for yo...Nice Python script and useful blog - Thanks for you work and time<br /><br />RayAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-51995069893956028612011-06-06T12:30:21.677+01:002011-06-06T12:30:21.677+01:00GREAT workGREAT workAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-4339813531032979196.post-7442010612079814972011-03-01T16:56:01.798+00:002011-03-01T16:56:01.798+00:00No I only delete spam comments.No I only delete spam comments.nopheadhttps://www.blogger.com/profile/12801535866788103677noreply@blogger.com