Shop OBEX P1 Docs P2 Docs Learn Events
Percentage Error - Page 2 — Parallax Forums

Percentage Error

2

Comments

  • T ChapT Chap Posts: 4,223
    edited 2014-05-12 05:31
    You can't or shouldn't take raw 14bit value straight into an equation, since the bit 0= .25C, bit 1 = .5C, bit 2 =1C, bit 3=2C. You could easily divide that raw value by 4 and get the correct temp, maybe losing the lowest 2 bits but that's ok. Is the Thermo direct to the PCB or are there wires inserted(gauge?). There are a few caveats on the datasheet.
  • TCTC Posts: 1,019
    edited 2014-05-12 06:02
    T Chap wrote: »
    You can't or shouldn't take raw 14bit value straight into an equation, since the LSB = .25C, bit 2 = .5C, bit 3 =1C, bit 4=2C.

    I figured that out. I use excel for large equations so I can see each variable. I will just only worry about the upper 12bits. That would give me

    raw MAX31855 12bit value = 100 (100°C)
    Corrected MAX31855 value = 131
    Is the Thermo direct to the PCB or are there wires inserted(gauge?). There are a few caveats on the datasheet.

    The board I have is made by Maxim. It includes a Omega thermocouple connector
    7755.jpg
    . The thermocouple uses the mating connector, with no extension wire. Online, I was seeing MAX31855 breakout boards for around $15. These boards were around $20. I figured Maxim would design A better product then the other breakout boards I was seeing. That is why I bought them.
    200 x 86 - 52K
  • kwinnkwinn Posts: 8,697
    edited 2014-05-12 07:57
    No problem. A lot of instruments use curve fitting equations like cubic spline, quadratic, etc. to convert readings from some sort of sensor to the units they want. That maxim chip has some type of processor in it to convert the current reading to degrees using an equation somewhat like the one I sent you.
    TC wrote: »
    At work, we have different kinds of thermocouples, (probes, thick wire, thin wire, high speed, etc..) I will grab a few and test them out and see if they make any difference. At work we only use Omega K type thermocouples.

    Thank you for the "third order cubic spline" I had no idea equations like that existed. Like I said, math is not one of my strong points. I am assuming the equation is the raw (14bit) value from the MAX31855. I will make a "DAT" table that will convert the temps.
  • trangertranger Posts: 179
    edited 2014-05-12 15:31
    No problem. A lot of instruments use curve fitting equations like cubic spline, quadratic, etc. to convert readings from some sort of sensor to the units they want. That maxim chip has some type of processor in it to convert the current reading to degrees using an equation somewhat like the one I sent you.

    Reading the Maxim datasheet, it looks like it uses a straight-up linear fit @ 41.276 microvolts / C. http://datasheets.maximintegrated.com/en/ds/MAX31855.pdf

    It doesn't look too bad compared to an eighth-order fit found in this Omega doc. http://www.omega.com/temperature/z/pdf/z021-032.pdf

    At 250C the difference is about 4C.

    kwinn - where did those cubic fit values come from?

    Thanks...

    -Russ
  • TCTC Posts: 1,019
    edited 2014-05-12 16:44
    tranger wrote: »
    Reading the Maxim datasheet, it looks like it uses a straight-up linear fit @ 41.276 microvolts / C.

    How does that work? I thought thermocouples were not linear.
    It doesn't look too bad compared to an eighth-order fit found in this Omega doc. http://www.omega.com/temperature/z/pdf/z021-032.pdf


    Thank you for the PDF, there is a lot of good information in there.

    kwinn - where did those cubic fit values come from?

    I second that question. I thought of redoing the equation for the coefficients from NIST, and see what happens. I dont know if it would work or not, but cant hurt to try.

    Tomorrow I am going to see if I can barrow our Omega thermocouple tester, to confirm the exact temperature.
  • tonyp12tonyp12 Posts: 1,951
    edited 2014-05-12 17:18
    To not create cycling due to temperature overshoots due to the time the temperature goes through air to reach the sensor + delay you have in between reading sensor etc,
    When you are getting close to targeted temperature I think you have to start using a table of pwm values to use based on current temperature and how much you want to change it.

    It's like turning off the garden hose before the bucket is full because you know how much water will still come while you turning the knob,
    something a human learns after a few try but computer's are not so good at unless your program in fussy logic so it learns by its mistake.
  • trangertranger Posts: 179
    edited 2014-05-12 17:46
    How does that work? I thought thermocouples were not linear.

    You're right, they aren't. But, a K type is really close and many times linear is close enough (and very simple in comparison).

    I was playing with a spreadsheet showing the "rocket-science" polynomial (8th order) versus linear. See attached....

    31855-TC-Info2.xls


    -Russ
  • TCTC Posts: 1,019
    edited 2014-05-12 18:29
    tonyp12 wrote: »
    To not create cycling due to temperature overshoots due to the time the temperature goes through air to reach the sensor + delay you have in between reading sensor etc,
    When you are getting close to targeted temperature I think you have to start using a table of pwm values to use based on current temperature and how much you want to change it.

    I was thinking of doing that for the heating slope (2°C/s). But I am still trying to get the temperature to be correct. The thermocouples are less than 1in from each other.
    Thermocouple placement.jpg


    tranger wrote: »
    You're right, they aren't. But, a K type is really close and many times linear is close enough (and very simple in comparison).

    I was playing with a spreadsheet showing the "rocket-science" polynomial (8th order) versus linear. See attached....

    31855-TC-Info2.xls


    -Russ

    I could deal with that error. But I still cant find out what my problem is yet. I am still thinking it is the cold junction in the chip. lets say (just an example) the Fluke is reading 150°C, and my oven is reading a lower temp. If I place my finger on the chip (add heat) I can get the oven to match the Fluke. But that's not the way it should work.

    Kwinn's calculation is off. I had to subtract the cold junction temp from the thermocouple temp, then add 4 just to get close
    long[TempPtr][idx] := TempCorrection[ (X~>(32-12))- (X << 16) ~> (32-8)+4] 
    
    DAT
    
            TempCorrection  word  0,    0,    0,    0,    0,    2,    3,    4,    5,    7,    8,    9,    11,   12,   13,   15
                            word  16,   17,   19,   20,   21,   23,   24,   25,   27,   28,   30,   31,   32,   34,   35,   36
                            word  38,   39,   40,   42,   43,   44,   46,   47,   49,   50,   51,   53,   54,   55,   57,   58
                            word  60,   61,   62,   64,   65,   66,   68,   69,   71,   72,   73,   75,   76,   77,   79,   80
                            word  82,   83,   84,   86,   87,   88,   90,   91,   93,   94,   95,   97,   98,   99,   101,  102
                            word  104,  105,  106,  108,  109,  110,  112,  113,  115,  116,  117,  119,  120,  121,  123,  124
                            word  126,  127,  128,  130,  131,  132,  134,  135,  136,  138,  139,  140,  142,  143,  145,  146
                            word  147,  149,  150,  151,  153,  154,  155,  157,  158,  159,  161,  162,  163,  165,  166,  167
                            word  168,  170,  171,  172,  174,  175,  176,  178,  179,  180,  181,  183,  184,  185,  187,  188
                            word  189,  190,  192,  193,  194,  195,  197,  198,  199,  201,  202,  203,  204,  205,  207,  208
                            word  209,  210,  212,  213,  214,  215,  216,  218,  219,  220,  221,  222,  224,  225,  226,  227
                            word  228,  229,  231,  232,  233,  234,  235,  236,  237,  239,  240,  241,  242,  243,  244,  245
                            word  246,  247,  249,  250,  251,  252,  253,  254,  255,  256,  257,  258,  259,  260,  261,  262
                            word  263,  264,  265,  266,  267,  268,  269,  270,  271,  272,  273,  274,  275,  276,  277,  278
                            word  279,  280,  281,  282,  283,  284,  284,  285,  286,  287,  288,  289,  290,  291,  291,  292
                            word  293,  294,  295,  296,  296,  297,  298,  299,  300,  300,  301,  302,  303,  304,  304,  305
                            word  306,  307,  307,  308,  309,  309,  310,  311,  311,  312,  313,  313,  314,  315,  315,  316
                            word  317,  317,  318,  318,  319,  320,  320,  321,  321,  322,  322,  323,  324,  324,  325,  325
                            word  326,  326,  327,  327,  328,  328,  328,  329,  329,  330,  330,  331,  331,  331,  332,  332
    
    910 x 522 - 89K
  • T ChapT Chap Posts: 4,223
    edited 2014-05-12 18:46
    Is the chip near the oven to have it's own temperature affected when the oven heats up?
  • TCTC Posts: 1,019
    edited 2014-05-12 18:51
    T Chap wrote: »
    Is the chip near the oven to have it's own temperature affected when the oven heats up?

    It is about 10in away from the oven. I have not seen the cold junction temp go up. That is why I did not think it was a concern. Plus, I will have to account for it somehow, everything will be placed inside a plastic box that is hooked to the side of the oven. But that is after all the bugs are worked out.
  • T ChapT Chap Posts: 4,223
    edited 2014-05-12 18:59
    If the temperatures is affected by the proximity to the oven, that is not ideal.
    Avoid placing heat-generating
    devices or components near the MAX31855 because this
    could produce cold-junction-related errors.
    Because of the small signal levels involved, thermocou
    -
    ple temperature measurement is susceptible to power-
    supply coupled noise. The effects of power-supply noise
    can be minimized by placing a 0.1
    F
    F ceramic bypass
    capacitor close to the V
    CC
    pin of the device and to GND.
    The input amplifier is a low-noise amplifier designed to
    enable high-precision input sensing. Keep the thermo
    -
    couple and connecting wires away from electrical noise
    sources. It is strongly recommended to add a 10nF
    ceramic surface-mount differential capacitor, placed
    across the T+ and T- pins, in order to filter noise on the
    thermocouple line.
  • kwinnkwinn Posts: 8,697
    edited 2014-05-12 22:16
    tranger wrote: »
    Reading the Maxim datasheet, it looks like it uses a straight-up linear fit @ 41.276 microvolts / C. http://datasheets.maximintegrated.com/en/ds/MAX31855.pdf

    It doesn't look too bad compared to an eighth-order fit found in this Omega doc. http://www.omega.com/temperature/z/pdf/z021-032.pdf

    At 250C the difference is about 4C.

    kwinn - where did those cubic fit values come from?

    Thanks...

    -Russ

    They were calculated using the readings from the Fluke meter and the oven controller by a curve fit program normally used to produce the calibration curves for an optical spectrometer. It does a maximum of 100 iterations and selects the curve constants with the lowest overall absolute error.
  • TCTC Posts: 1,019
    edited 2014-05-13 03:36
    kwinn wrote: »
    They were calculated using the readings from the Fluke meter and the oven controller by a curve fit program normally used to produce the calibration curves for an optical spectrometer. It does a maximum of 100 iterations and selects the curve constants with the lowest overall absolute error.

    I am sorry kwinn, I was unaware that you would use the Fluke as a reference. I have had the meter for a couple years now, and the meter was right next to the oven. So the cold junction in the Fluke could've been skewed a little. I am going to barrow a thermocouple tester from work. The unit I want to barrow is our brand new Omega thermocouple thermometer. I know that unit is correct, it has been calibrated until next year. That way I can provide you an accurate temp comparison.

    What I will also do is, start the oven at room temp. Then raise it to 50°C, leave it there for 5 or so minutes, so the temp can stabilize. Then take a reading with the Omega unit, and compare the readings. And continue with the same pattern, increasing the temp by 50°C. Or do you think I should do 25°C per test pattern? I am just trying to provide the most information I can for everyone. Because you all have been a great help with this.
  • trangertranger Posts: 179
    edited 2014-05-13 15:33
    ...take a reading with the Omega unit...

    You mean like this?

    IMG_3726.JPG


    When I was working with a MAX6675 (5V version) I had a hard time getting stable readings, until I added some filtering caps. There was a VFD running nearby and it probably generated a lot of noise.

    Like this:

    Max6675.jpg


    After getting things to settle down, temps matched good enough between the MAX6675 and the Omega unit - maybe 3 or 4C, if I recall correctly. I was running at about 160C.

    -Russ
    800 x 600 - 88K
    1024 x 713 - 105K
  • TCTC Posts: 1,019
    edited 2014-05-13 16:06
    tranger wrote: »
    You mean like this?

    IMG_3726.JPG


    When I was working with a MAX6675 (5V version) I had a hard time getting stable readings, until I added some filtering caps. There was a VFD running nearby and it probably generated a lot of noise.

    Like this:

    Max6675.jpg


    After getting things to settle down, temps matched good enough between the MAX6675 and the Omega unit - maybe 3 or 4C, if I recall correctly. I was running at about 160C.

    -Russ

    Close, Like this
    HH802_803_l.jpg


    I thought of noise, I have caps out the nose on my breadboard.

    I have the list of temps from the oven and the temps from the Omega unit. I put another thermocouple next to the MAX31855 chips to confirm the cold junction temps. I did cycles from 25C(oven was at 26C, program didn't run) to 250C. There was a 5 minute hold for each set temp. I did that to get everything in the oven to saturate.

    Thermo temp list.jpg
    396 x 450 - 20K
    453 x 243 - 49K
  • kwinnkwinn Posts: 8,697
    edited 2014-05-13 16:54
    No worries. Start at room temp, go to 50 as you described, then go in steps of 25. I went from 27.8 to 40.6 and then in steps of approximately 20 for the next 13 steps. Steps of 25 will be more than enough for generating a good curve fit.
    TC wrote: »
    I am sorry kwinn, I was unaware that you would use the Fluke as a reference. I have had the meter for a couple years now, and the meter was right next to the oven. So the cold junction in the Fluke could've been skewed a little. I am going to barrow a thermocouple tester from work. The unit I want to barrow is our brand new Omega thermocouple thermometer. I know that unit is correct, it has been calibrated until next year. That way I can provide you an accurate temp comparison.

    What I will also do is, start the oven at room temp. Then raise it to 50°C, leave it there for 5 or so minutes, so the temp can stabilize. Then take a reading with the Omega unit, and compare the readings. And continue with the same pattern, increasing the temp by 50°C. Or do you think I should do 25°C per test pattern? I am just trying to provide the most information I can for everyone. Because you all have been a great help with this.
  • TCTC Posts: 1,019
    edited 2014-05-13 17:00
    kwinn wrote: »
    No worries. Start at room temp, go to 50 as you described, then go in steps of 25. I went from 27.8 to 40.6 and then in steps of approximately 20 for the next 13 steps. Steps of 25 will be more than enough for generating a good curve fit.

    I dont know if you seen it but here is the temp list I got.
    Thermo temp list.jpg
    Thanks for your help.
    453 x 243 - 49K
  • kwinnkwinn Posts: 8,697
    edited 2014-05-13 17:10
    Missed it. I will run the numbers and post results later tonight.
  • T ChapT Chap Posts: 4,223
    edited 2014-05-13 17:16
    Can you post a pic of the breadboard connected to the modules? Where is the power coming from to the module? Is the ground and power to the module routed through the breadboard?
  • trangertranger Posts: 179
    edited 2014-05-13 17:41
    While you can certainly analyze the "error" and compensate in software, it just doesn't feel quite right. (Excel works pretty well for curve fitting...)

    tc-fit.png


    Unless the readings will be stable and repeatable, then compensation will fall apart.

    This http://www.analog.com/library/analogdialogue/archives/44-10/thermocouple.pdf is an interesting read on t/c's and signal conditioning.


    -Russ
    864 x 392 - 29K
  • TCTC Posts: 1,019
    edited 2014-05-13 18:04
    T Chap wrote: »
    Can you post a pic of the breadboard connected to the modules? Where is the power coming from to the module? Is the ground and power to the module routed through the breadboard?

    Sure.

    With the MAX31855 modules in place.
    MAX31855 breadboard.jpg



    With the modules removed
    MAX31855 breadboard 2.jpg



    Let me know if you see anything because I cant see anything that could be creating the error.
    796 x 596 - 153K
    727 x 477 - 89K
  • TCTC Posts: 1,019
    edited 2014-05-13 18:10
    tranger wrote: »
    While you can certainly analyze the "error" and compensate in software, it just doesn't feel quite right. (Excel works pretty well for curve fitting...)

    I agree with you there. But I am getting tired of chasing the error.

    Unless the readings will be stable and repeatable, then compensation will fall apart.

    This http://www.analog.com/library/analogdialogue/archives/44-10/thermocouple.pdf is an interesting read on t/c's and signal conditioning.

    I do agree with you there. I would be so mad t do all this work, have a board made up, and find out I did something wrong now and have to fix what I have done.

    I do like the signal conditioning of the PDF, Thank you
  • TCTC Posts: 1,019
    edited 2014-05-13 18:11
    kwinn wrote: »
    Missed it. I will run the numbers and post results later tonight.

    No problem, there is no hurry.
  • T ChapT Chap Posts: 4,223
    edited 2014-05-13 18:13
    A breadboard is always suspect. Although the data seems to be transmitting fine, I would be concerned about grounding, noise, bad connections. You need .1uf caps near at the power on each row on the breadboard, where the jumpers run from the bus upwards.
  • TCTC Posts: 1,019
    edited 2014-05-13 18:21
    T Chap wrote: »
    A breadboard is always suspect. Although the data seems to be transmitting fine, I would be concerned about grounding, noise, bad connections. You need .1uf caps near at the power on each row on the breadboard, where the jumpers run from the bus upwards.

    I didn't place .1uF caps on the breadboard because they are on the modules next to the chips. I only assumed that would be ok to help with noise for the chips.
  • T ChapT Chap Posts: 4,223
    edited 2014-05-13 18:31
    I would solder in a direct connect from the module's VSS to the power supply GND. I would put the blame on some issue with ground. breadboard connections, power supply.
  • kwinnkwinn Posts: 8,697
    edited 2014-05-13 18:53
    Here are the new corrections using the Omega data. Since the "d" portion of the equation is 0 you do not need to include that part of the equation in the program.

    BTW I think tranger and T Chap have a point. When you go to a PCB these problems may go away. When you get to that point it would be a good time to repeat the temperature comparison.
    1024 x 350 - 48K
  • trangertranger Posts: 179
    edited 2014-05-13 18:54
    From the pictures of the modules, it looks like you have signal conditioning on those. Must be similar to this schematic: http://designs.digikey.com/library/4294959886/4294959871/825

    I have a 31855 on a sparkfun breakout board and am tempted to do some testing.... But, got to go out-of-town for a while. Maybe when I get back?

    Good luck...
  • TCTC Posts: 1,019
    edited 2014-05-13 21:23
    T Chap wrote: »
    I would solder in a direct connect from the module's VSS to the power supply GND. I would put the blame on some issue with ground. breadboard connections, power supply.

    Yea I guess that couldn't hurt to try it.

    kwinn wrote: »
    Here are the new corrections using the Omega data. Since the "d" portion of the equation is 0 you do not need to include that part of the equation in the program.

    BTW I think tranger and T Chap have a point. When you go to a PCB these problems may go away. When you get to that point it would be a good time to repeat the temperature comparison.

    Thank you so much kwinn, I will try them out when I get off work. After I try giving each module its own ground wire.

    tranger wrote: »
    Must be similar to this schematic:

    I guess you could say similar. I did not make the modules, I bought them just the way they are. Maxim designed and manufactured them. I bought them from DigiKey. DigiKey's order number MAX31855PMB1#-ND

    have a 31855 on a sparkfun breakout board and am tempted to do some testing.... But, got to go out-of-town for a while. Maybe when I get back?

    Good luck...

    I first went that route, made my own board and everything
    i.png


    But I was not happy with it. That is when I decided just to buy the ones from DigiKey.
    262 x 336 - 16K
    i.png 16.1K
  • trangertranger Posts: 179
    edited 2014-05-14 05:38
    Yeah, I like the looks of those little boards and the price isn't bad. What appeared to be identical between the board I was able to find and the one you have is the conditioning between the reference junction (t/c connection) and the chip. However, I see that C1 and C4 are not populated. Wonder why? These are caps between each leg of the t/c and gnd. It looks like there are solder pads on the backside. Somebody could add those if they wanted. :innocent:

    That Analog doc I referred to in an earlier post also shows a 1Meg resistor between t/c (-) and gnd. :innocent:
Sign In or Register to comment.