Welcome! Log In Create A New Profile

Advanced

One last problem (I hope) - Thermistor reading - help!

Posted by richrap 
One last problem (I hope) - Thermistor reading - help!
September 07, 2010 04:33PM
So I think I have just one more thing to resolve then I can start to try printing with my repstrap - smileys with beer

I'm using the Gen3 electronics (5D Firmware) and have an issue getting the correct temperature reading in Reprap host from the Extruder board.

I'm using an EPOCS B57560G104F -Thermistor

I tried this thermistor lookup on the Wiki, but it didn't read correctly after about 140 deg C and higher - Wiki thermistor lookup table for B57560G104

So using the data in this datasheet - Thermistor datasheet
I adjusted the beta to 4085 and ran the Python script giving me a new table -
// Made with createTemperatureLookup.py (http://svn.reprap.org/trunk/reprap/firmware/Arduino/utilities/createTemperatureLookup.py)
// ./createTemperatureLookup.py --r0=100000 --t0=25 --r1=0 --r2=4700 --beta=4085 --max-adc=1023
// r0: 100000
// t0: 25
// r1: 0
// r2: 4700
// beta: 4085
// max adc: 1023
#define NUMTEMPS 20
short temptable[NUMTEMPS][2] = {
   {1, 827},
   {54, 253},
   {107, 207},
   {160, 182},
   {213, 165},
   {266, 152},
   {319, 141},
   {372, 132},
   {425, 123},
   {478, 115},
   {531, 107},
   {584, 100},
   {637, 93},
   {690, 86},
   {743, 78},
   {796, 70},
   {849, 61},
   {902, 49},
   {955, 34},
   {1008, 3}
};

But I get incorrect readings so to test a few known values using resistors instead of the thermistor (I didn't have a POT handy)-

With a 3k9 resistor input I get a temperature reading of 136 Deg C, and a voltage of 2.25V on the Analogue input, according to the datasheet 3k9 should be about 118 Deg C

With a 1k2 resistor input I get a temperature reading of 340 Deg C, and a voltage of 1.005V on the Analogue input, according to the datasheet 1k2 should be about 163 Deg C

With a 560R resistor input I get a temperature reading of 837 Deg C, and a voltage of 0.529V on the Analogue input, according to the datasheet 560R should be about 200 Deg C

I made a second Thermistor circuit (10u cap and 4k7 res) to use the spare Analogue input on the Extruder (Used by Adrian for the Heater Bed) and updated the other thermistor lookup table to the above and I get the same results reported as above for this heatbed input so I don't think it's a faulty input...

I checked the on-board resistor - ok at 4k7
I checked the Aref pin, that's ok, just a 100n to GND

I'm too close to the problem and it's driving me mad ! hot smiley Anyone have any ideas?

I could just bodge the lookup table, but I want to know why it's not working. I must be doing something wrong.

Please Help, if you can confused smiley

Rich.
Re: One last problem (I hope) - Thermistor reading - help!
September 07, 2010 05:27PM
Odd.

With 3K9 you got 2.25, which is correct, 3.9 * 5 / (3.9 + 4.7) = 2.27V

That should give an ADC reading of 1023 * 2.25 / 5 = 460. Looking at the table that should give a reading between these two

{425, 123},
{478, 115},

Interpolating gives (460 - 425) / (478 - 425) * (123 - 115) + 115 = 120C, very close to the datasheet 118C. To get 136C the ADC reading would need to be below 372.

So I can't explain your findings. Are you sure you have actually compiled and downloaded this generated table?

If not it looks like the ADC is not working properly.


[www.hydraraptor.blogspot.com]
Re: One last problem (I hope) - Thermistor reading - help!
September 07, 2010 05:48PM
Hi Nophead, thanks for checking my problem. it's bonkers ! I just can't see what else could be wrong?

I have tested and downloaded a few different tables and can see them making a difference to the readings and also added bits of debug code to check It's downloading correctly so I can only imagine the ADC has some sort of internal problem?

I have also checked that it's a nice 5V supply so the only thing I can think of now is getting hold another ATMega168 based board and try that out.
I'm not going to get another Extruder board, it seems to be quite a poor way to implement this functionality.

I'm not using the stepper driver on the Extruder so I only need to control the heaters and read the Thermistors, if I get time I may just use a PIC.

I Just need to get something working so I can implement some better electronics while it's printing out my Mendel smiling smiley

Thanks.

Rich
Re: One last problem (I hope) - Thermistor reading - help!
September 07, 2010 06:13PM
Perhaps you can work out a linear correction formula for the ADC and apply it to the first column of the table.


[www.hydraraptor.blogspot.com]
Re: One last problem (I hope) - Thermistor reading - help!
September 07, 2010 06:48PM
I will give it a try, but I may just end up with low accuracy at the high temperatures end. I'll mess about with it and try to just focus the table on being accurate at around 240 Deg C.
Re: One last problem (I hope) - Thermistor reading - RESOLVED
September 15, 2010 06:41AM
Just a quick update on this -

I just spotted comments in Reprap DEV about Analogue Ground not being connected, this was exactly the problem I had with the above.

The GRRF Extruder board WILL work without Analogue ground connected, but will give very odd (but still consistent) ADC measurements.
Driving the onboard stepper will not work as it totally messes up the POT reading.

Spent a good few days working out what was going on with this, Most of my problems on Gen3 Electronics have been due to manufacturing errors, I'm suprised not to be contacted by GRFF about the Extruder problem especially after finding the fix for the Stepper board fault ( Step signal - filter capacitor value wrong), but there you go.

This and other fixes for the GRRF Gen3 Electronics can be found here - http://grrf.de/2010/09/13/pferdefuss-in-gen3-elektronik-entdeckt/


RichRap

Edited 2 time(s). Last edit at 09/15/2010 07:36AM by richrap.
VDX
Re: One last problem (I hope) - Thermistor reading - help!
September 15, 2010 10:49AM
Hi RichRap,

... i was hunting the same 'bug', when Predatorian 'solved' the mystery on Sunday evening ...

I've spent before 3 evenings with this and hasn't found the difference on my own, even though i had a board from Makerbot and one from GRRF for comparing ... i simply searched in the wrong place, all around the POT and its weird behaviour eye rolling smiley.

AFAIK GRRF is contacting all customers by email with this infos, so maybe you haven't dropped your email adress?


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: One last problem (I hope) - Thermistor reading - help!
September 18, 2010 05:41PM
Hi Viktor

Thanks for the update, My Repstrap is running now and getting encouraging results, I have started switching over to my own makeshift electronics, The original Gen3 Extruder board is now completely designed out of my system, I hope to get some more details of alternative electronics posted shortly.

I hope you have all your electronics working now.

RichRap


[richrap.blogspot.com]
Sorry, only registered users may post in this forum.

Click here to login