• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

Convert Marlin Thermistor Table To M305

Scheduled Pinned Locked Moved
General Discussion
5
12
3.5k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    wilriker
    last edited by 11 Jun 2018, 14:55

    I bought a Chinese V6 clone and it says I should use Marlin thermistor #13 (100k Hisens B25/50 3950). I was looking around a lot but I could not find any datasheet for this kind of thermistor that also includes a temperature table.

    But Marlin already does have a working configuration so someone must have measured the correct values for this kind of thermistor already (I don't have any means to measure high temperatures e.g. a thermocouple).

    Did anyone already convert Marlin thermistor tables to the values required for M305? I have a hard time to understand their code regarding thermistor tables otherwise I would do that myself. They have a two dimensional short array with an (to me) unknown value mapping to what seems to be a temperature.

    // Hisens thermistor B25/50 =3950 +/-1%
    const short temptable_13[][2] PROGMEM = {
    { OV( 20.04), 300 },
    { OV( 23.19), 290 },
    { OV( 26.71), 280 },
    { OV( 31.23), 270 },
    { OV( 36.52), 260 },
    { OV( 42.75), 250 },
    { OV( 50.68), 240 },
    { OV( 60.22), 230 },
    { OV( 72.03), 220 },
    { OV( 86.84), 210 },
    { OV(102.79), 200 },
    { OV(124.46), 190 },
    { OV(151.02), 180 },
    { OV(182.86), 170 },
    { OV(220.72), 160 },
    { OV(316.96), 140 },
    { OV(447.17), 120 },
    { OV(590.61), 100 },
    { OV(737.31), 80 },
    { OV(857.77), 60 },
    { OV(939.52), 40 },
    { OV(986.03), 20 },
    { OV(1008.7), 0 }
    };

    and

    #define OVERSAMPLENR 16
    #define OV(N) int16_t((N)*(OVERSAMPLENR))

    I cannot make any sense of the first value. Any ideas?

    Manuel
    Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
    with probably always latest firmware/DWC (incl. betas or self-compiled)
    My Tool Collection

    1 Reply Last reply Reply Quote 0
    • undefined
      Dougal1957
      last edited by 11 Jun 2018, 17:07

      you don't need to RRF doesn't use thermistor tables and you need to supply the correct values and then do a pid tune and the Duet will take care of it

      use something like

      M305 P1 T100000 R4700 B3950

      This will set the Duet thermistor params for you then do a PID autotune using M303 and follow the guide at Duet Temp Tuning

      1 Reply Last reply Reply Quote 0
      • undefined
        DjDemonD
        last edited by DjDemonD 6 Nov 2018, 17:50 11 Jun 2018, 17:49

        If you want to determine the Beta value (or verify it) you can use this spreadsheet. Choose two temperatures that are either side of the range you typically want to use i.e. 180-250 for hotends then you get a better approximation of the actual temperature. I've used it with unknown brand thermistors.

        But as Doug said if the Beta value is known then you just enter it and then autotune.

        https://1drv.ms/x/s!Apv79JfGbPIwgv9DIbujMxNtMwHQpg

        Simon. Precision Piezo Z-Probe Technology
        www.precisionpiezo.co.uk
        PT1000 cartridge sensors NOW IN, just attach to your Duet board directly!

        1 Reply Last reply Reply Quote 0
        • undefined
          wilriker
          last edited by 11 Jun 2018, 17:50

          I know that RRF does not make use of thermistor tables. But after all I read just setting this thermistor with

          M305 P1 T100000 B3950

          will not give me a good precision at higher temperatures - but as a hotend thermistor this is of course what it is all about. And PID autotune is no help here because this would only set hotend heater power based on the imprecise readings of the thermistor.
          This beta value of 3950 is being given for 25/50°, so I will probably have to raise this. I found a temperature-resistance-table for another 100K 3950 thermistor and plugged its values into the calculator at https://configurator.reprapfirmware.org/ and it gave me a B value of something above 5000.

          The thermistor tables of Marlin must have the temperature-resistance-relation somehow encoded in the given code snippet (or maybe some code that depends on this) so it is mainly a question how to get this information out of there to plug these values into the above linked calculator for RRF.

          Manuel
          Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
          with probably always latest firmware/DWC (incl. betas or self-compiled)
          My Tool Collection

          1 Reply Last reply Reply Quote 0
          • undefined
            wilriker
            last edited by wilriker 6 Nov 2018, 17:56 11 Jun 2018, 17:54

            My main issue is that I have nothing to externally confirm the real temperature. So if I set the hotend to e.g. 190°C then of course RRF will heat up until the thermistor reports 190°C.
            But I cannot confirm if that is accurate or if this is rather 175°C or 210°C in reality. Then there is no use in measuring the resistance at these temperatures because I could not tell what exact temperature that reading is at.

            I own neither a thermocouple nor an IR thermometer.

            EDIT: Best thing I have is a DHT22 - I could strap one with kapton tape to the hotend and slowly heat it up. Just kidding - worst case I melt the DHT22 to the heatblock. 😂

            Manuel
            Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
            with probably always latest firmware/DWC (incl. betas or self-compiled)
            My Tool Collection

            undefined 1 Reply Last reply 11 Jun 2018, 18:01 Reply Quote 0
            • undefined
              Nuffe @wilriker
              last edited by 11 Jun 2018, 18:01

              @wilriker You can put the thermistor to a boiling water and measure the resistance. 100C will give you at least one accurate point.

              undefined 1 Reply Last reply 11 Jun 2018, 18:06 Reply Quote 1
              • undefined
                wilriker @Nuffe
                last edited by 11 Jun 2018, 18:06

                @nuffe said in Convert Marlin Thermistor Table To M305:

                @wilriker You can put the thermistor to a boiling water and measure the resistance. 100C will give you at least one accurate point.

                @nuffe Why didn't I come up with this? 🤦

                I just remembered that I bought an overly expensive BBQ thermometer a couple of years ago that a basically used once. I have to check if I can poke this somehow into the hotend. That should give me another reading at least around 200°C (don't remember what its top temp was but it probably should go a lot higher).

                Manuel
                Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                with probably always latest firmware/DWC (incl. betas or self-compiled)
                My Tool Collection

                1 Reply Last reply Reply Quote 0
                • undefined
                  dc42 administrators
                  last edited by 11 Jun 2018, 20:41

                  I suggest you use configtool at https://configurator.reprapfirmware.org/. Go to the Heaters page, click on Calculate thermistor coefficients, then enter 3 temperatures and the corresponding resistances from the resistance vs. temperature table. I suggest you choose 25C, a value at the bottom end of the extrusion temperature range you use (e.g. 180C), and a value at the top end of that temperature range (e.g. 250C). It will calculate the B and C values for you. Then go to the final page, click Finish, view the config.g file, and extract the M305 line from it.

                  Duet WiFi hardware designer and firmware engineer
                  Please do not ask me for Duet support via PM or email, use the forum
                  http://www.escher3d.com, https://miscsolutions.wordpress.com

                  undefined 1 Reply Last reply 12 Jun 2018, 08:14 Reply Quote 0
                  • undefined
                    wilriker @dc42
                    last edited by 12 Jun 2018, 08:14

                    @dc42 I know, I even referenced the calculator in my first post. My issue was that I would have had no means to measure the real temperature - until I remembered my BBQ thermometer. I can not use the thermistor reading if I want to calibrate this exact thermistor. 😁

                    Manuel
                    Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                    with probably always latest firmware/DWC (incl. betas or self-compiled)
                    My Tool Collection

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      dc42 administrators
                      last edited by 12 Jun 2018, 08:42

                      With reference to your original question, in the Marlin temperature table I think the first value is the theoretical 10-bit ADC reading and the second value is the temperature that gives that reading. If we call the ADC reading A and the thermistor resistance R, then A = 1024 * R / (R + 4700). From that, R = 4700 * A / (1024 - A).

                      Duet WiFi hardware designer and firmware engineer
                      Please do not ask me for Duet support via PM or email, use the forum
                      http://www.escher3d.com, https://miscsolutions.wordpress.com

                      undefined 1 Reply Last reply 12 Jun 2018, 08:48 Reply Quote 1
                      • undefined
                        wilriker @dc42
                        last edited by 12 Jun 2018, 08:48

                        @dc42 Thanks!

                        One question regarding the procedure of measuring resistance at various temperatures: can I measure this resistance while the thermistor is plugged into the Duet? I would need to use the heater cartridge to heat it up but that will only work if a thermistor is plugged in as well (even if the temperature is off). And I don't see how I could fit the thermistor in my current MK8 hotend to the V6 heaterblock while at the same time having the new thermistor in the block... oh, wait... I could insert the existing thermistor into the filament path, couldn't I?

                        Manuel
                        Duet 3 6HC (v0.6) with RPi 4B on a custom Cartesian
                        with probably always latest firmware/DWC (incl. betas or self-compiled)
                        My Tool Collection

                        1 Reply Last reply Reply Quote 0
                        • undefined
                          dc42 administrators
                          last edited by 12 Jun 2018, 10:38

                          No you can't measure the thermistor resistance with the Duet operating and the thermistor connected to the Duet. You could unplug the thermistor when the temperature is stable, and measure the resistance quickly before the temperature drops very much.

                          Duet WiFi hardware designer and firmware engineer
                          Please do not ask me for Duet support via PM or email, use the forum
                          http://www.escher3d.com, https://miscsolutions.wordpress.com

                          1 Reply Last reply Reply Quote 0
                          5 out of 12
                          • First post
                            5/12
                            Last post
                          Unless otherwise noted, all forum content is licensed under CC-BY-SA