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

    G31 and temperature tables

    Scheduled Pinned Locked Moved
    Firmware wishlist
    2
    6
    1.1k
    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.
    • carlossprundefined
      carlosspr
      last edited by

      According to the Wiki, the facility to setup a G31 temperature and compensation tables is deprecated and likely to be removed in a future version of RepRapFirmware (C and S parameters).

      Both capacitive and inductive proximity sensors drift with temperature and some clarification on the logic and feature might help increasing accuracy of these sensors.

      Is it possible to explain the calculation behind the logic and hot to setup the C and S parameters?. I would like to play with the feature to improve the accuracy of my probes.

      1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators
        last edited by

        As the wiki says, in the G31 command the C parameter is the temperature coefficient in mm/degC and the S parameter is the temperature at which the trigger height in the Z parameter is correct. Although these parameters were introduced to help support an ultrasonic sensor, they can be used with any type of sensor. The bed temperature reading is used to calculate the correction.

        So far as I know, nobody is using these parameters any more.

        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

        carlossprundefined 1 Reply Last reply Reply Quote 0
        • carlossprundefined
          carlosspr @dc42
          last edited by

          @dc42 Thanks for the answer. This means that this is a linear relationship and I could calculate the offset for a certain Bed temperature and the firmware would recalculate for different temperatures using a linear relationship [Offset_at_T'] = [Offset_at_T] + C*(T'-T) ?
          I find it is really usefull to compensate on temperature drifts for Inductive and capacitive probes. I am using a capacitive probe and the drift can be more and 0.1mm in 80C, which is driving me crazy for Mesh leveling, because it is changing the height of my nozzle and this could be a very good fix.
          I will try tonight.

          dc42undefined 1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @carlosspr
            last edited by

            @carlosspr said in G31 and temperature tables:

            @dc42 Thanks for the answer. This means that this is a linear relationship and I could calculate the offset for a certain Bed temperature and the firmware would recalculate for different temperatures using a linear relationship [Offset_at_T'] = [Offset_at_T] + C*(T'-T) ?

            That is correct.

            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
            • carlossprundefined
              carlosspr
              last edited by

              I have dome some measurements to validate the compensation for my capacitive probe (this would also apply to inductive probes or probes that drift with temperature). The following are my results:

              1./ Calibrate the Z probe trigger height to zero at near room temperature
              2./ Run G31 S-1 and annotate the Trigger height reported. (I run it on a script 25 times and record the average value).
              3.- Repeat the process increasing temperature 10C on each run.

              We end up with a table like this:

              Temperature Trigger Height (mm)
              30 1.92944
              40 1.90196
              50 1.84032
              60 1.80004
              70 1.81672
              80 1.66856
              90 1.3272
              100 1.28496
              110 1.23432

              If we plot these values, we can see that the relationship compared with a linear trendline:
              0_1526904672963_Screenshot from 2018-05-21 16-00-43.png

              Now I use the trendline as the "ground truth" for the trigger distance and calculate the errors versus the average measurements. On a second colums I calculate the error versus a fixed heigh at 80C without temperature compensation.
              Temp Error (mm)
              (linear – Measurement) (linear – fixed height at 80C)
              30 0.10134222222219 0.260880000000001
              40 0.03233555555552 0.2334
              50 -0.00251111111115 0.171760000000001
              60 -0.05871777777782 0.13148
              70 -0.17188444444449 0.148160000000001
              80 -0.120211111111159 0
              90 0.12466222222217 -0.341359999999999
              100 0.0704155555555 -0.383599999999999
              110 0.02456888888883 -0.43424

              Definitely the temperature compensation reduces error, but the accuracy is still not so good.

              I understand this feature is going to be deprecated and it might make sense, but then different solutions to the problem might be needed. Some solutions that I came across are:

              • Setup the G31 code for the specific bed temperature on the Slicer (under filament custom start G code) - I could perform the mesh leveling on this section, with different Trigger height based on filament bed requirements.

              • I had the idea to use the motor stall probe on the same point of the bed every time to run a G30, the change the probe to the capacitive/inductive, report the trigger and then update the G31 parameter. With this update I would peroform a mesh level with the reported trigger height. If would be great if the G30 S-1 could update automatically the G31 value based on the reading )or an average of readings).

              If somebody has other solutions, I would be glad to try them.

              1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators
                last edited by

                If people are using the temperature compensation feature, I'll leave it in.

                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
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA