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

    Polynomial Temp Compensation for Probes?

    Scheduled Pinned Locked Moved
    Firmware wishlist
    6
    27
    2.2k
    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.
    • evan38109undefined
      evan38109
      last edited by evan38109

      Hey @Kolbi ,

      Hmm...not sure what's going on there, but that doesn't look right at all. It definitely shouldn't be going down as temperatures get higher, and the magnitude also looks off, too. I don't know, but I suspect the probing method is not very accurate:

      while sensors.endstops[2].triggered = false
          G1 Z-0.00625 F300
      

      I don't understand the intricacies of RRF, but it feels like there's plenty of room for timing oddities there with the command queue.

      I much prefer G30 S-1 ... :

      G1 Z3                        ; move to first probing height
      G30 P0 X100 Y102 Z-99999 S-1 ; probe #1
      ...
      

      It's cleaner, simpler, more accurate, and it also follows your M558 parameters. I love how it will take samples until it reaches the requested tolerance; it means that each of my "samples" is actually a sample group. For instance, when probing like this, I like to set the tolerance tight, with lots of available iterations and a very slow feed rate:

      M558 ... H1.0 F180 T99999 A20 S0.001  
      

      For data , I just made a quick Google Doc with columns aligned to make data entry with the keypad easy:

      data-entry.png

      I suppose it would be possible to script that, but...ehh, that's too close to the day job for a hobby. 😉

      1 Reply Last reply Reply Quote 0
      • Kolbiundefined
        Kolbi
        last edited by

        @evan38109 Yeah, I'm not sure on the scripts accuracy either and I had/have a hard time believing the results too. 😵 Or maybe I have a poopy pinda?
        I do find it interesting that the detection height goes back down after 43c - even if the method is deemed not accurate, it still shouldn't be seeing a drop in detection height. I also noticed that once the pinda is triggered, you have to move it up a little to get back to an untriggered state.
        Eh, it's a rainy Saturday morning here, will likely toy around with it some more.

        1 Reply Last reply Reply Quote 0
        • Kolbiundefined
          Kolbi
          last edited by

          Ok, made some macro changes and I think I had more accurate results.
          Take a look:
          Screen Shot 2020-07-18 at 10.28.27 AM.png

          Macro:

          
          	G32
          
          	G1 X100 Y100 F2000
          
          	M558 P5 C"^zprobe.in" H1.0 F180 T99999 A20 S0.001              ; Set probing to slow and precise
          	M140 S100
          	M104 S240
          
          while sensors.analog[2].lastReading < 50
          
          
          	G30 Z-99999 S-1
          	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
          	G60 S0
          	G1 Z2
          	M400
          
          	G30 Z-99999 S-1
          	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
          	G60 S1
          	G1 Z2
          	M400
          	
          	G30 S-1
          	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
          	G60 S2
          	G1 Z2
          	M400
          	
          	G30 S-1
          	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
          	G60 S3
          	G1 Z2
          	M400
          	
          	
          	G30 S-1
          	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
          	G60 S4
          	G1 Z2
          	M400
          	
          	
          	G90 ; set true
          	G1 Z2 F2000
          	M400
          	G1 Z{(state.restorePoints[0].coords[2] + state.restorePoints[1].coords[2] + state.restorePoints[2].coords[2] + state.restorePoints[3].coords[2] + state.restorePoints[4].coords[2]) / 5} F100	
          	G60 S5
          
          	G90 ; set true
          	G1 Z4 F2000
          	M400
          
          
          	echo "Pinda at " ^ sensors.analog[2].lastReading ^ " average trigger at " ^ state.restorePoints[5].coords[2] ^ " millimeters."
          	echo "Trigs: "^state.restorePoints[0].coords[2]^", "^state.restorePoints[1].coords[2]^", "^state.restorePoints[2].coords[2]^", "^state.restorePoints[3].coords[2]^", "^state.restorePoints[4].coords[2]
          
          	M28 {"0:/macros/Probe Comp/"^ sensors.analog[2].lastReading ^","^state.restorePoints[5].coords[2]}  
          	M29	
          
          1 Reply Last reply Reply Quote 0
          • Kolbiundefined
            Kolbi
            last edited by

            Granted, I am not sure about the accuracy of the macro, but I did make some additions to it where once it finishes probing on heat up, then it probes on the cool down too. I've run it several times to collect a good average, lots of points. Interesting data. Making me think that maybe I should try raising the pinda temp slower, to stabilize it at every few degrees?

            @evan38109 I am curious, what variant of pinda-v2 you and I actually have. I read somewhere there are three PindaV2 variants out in the wild. I am fairly certain I have the latest revision with black wire - it's only about 2 months old as I got it for my Zaribo build. Also would be interested if you ran the macro on your machine to see if it comes close to the data you have already gathered, but if not - I don't blame you 😉

            Screen Shot 2020-07-18 at 6.17.33 PM.png
            Screen Shot 2020-07-18 at 6.19.28 PM.png

            
            	G32
            
            	G1 X100 Y100 F2000
            
            	M558 P5 C"^zprobe.in" H1.0 F180 T99999 A20 S0.001              ; Set probing to slow and precise
            	M140 S100
            	M104 S240
            
            while sensors.analog[2].lastReading < 45
            
            
            	G30 Z-99999 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S0
            	G1 Z2
            	M400
            
            	G30 Z-99999 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S1
            	G1 Z2
            	M400
            	
            	G30 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S2
            	G1 Z2
            	M400
            	
            	G30 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S3
            	G1 Z2
            	M400
            	
            	
            	G30 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S4
            	G1 Z2
            	M400
            	
            	
            	G90 ; set true
            	G1 Z2 F2000
            	M400
            	G1 Z{(state.restorePoints[0].coords[2] + state.restorePoints[1].coords[2] + state.restorePoints[2].coords[2] + state.restorePoints[3].coords[2] + state.restorePoints[4].coords[2]) / 5} F100	
            	G60 S5
            
            	G90 ; set true
            	G1 Z4 F2000
            	M400
            
            
            	echo "Pinda at " ^ sensors.analog[2].lastReading ^ " average trigger at " ^ state.restorePoints[5].coords[2] ^ " millimeters."
            	echo "Trigs: "^state.restorePoints[0].coords[2]^", "^state.restorePoints[1].coords[2]^", "^state.restorePoints[2].coords[2]^", "^state.restorePoints[3].coords[2]^", "^state.restorePoints[4].coords[2]
            
            	M28 {"0:/macros/probe-comp-going-up/"^ sensors.analog[2].lastReading ^","^state.restorePoints[5].coords[2]}  
            	M29	
            
            
            M140 S0
            M104 S0
            G4 S60
            
            while sensors.analog[2].lastReading >23
            G4 S60
            
            	G30 Z-99999 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S0
            	G1 Z2
            	M400
            
            	G30 Z-99999 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S1
            	G1 Z2
            	M400
            	
            	G30 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S2
            	G1 Z2
            	M400
            	
            	G30 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S3
            	G1 Z2
            	M400
            	
            	
            	G30 S-1
            	echo "" ^ sensors.analog[2].lastReading ^ "," ^ move.axes[2].userPosition
            	G60 S4
            	G1 Z2
            	M400
            	
            	
            	G90 ; set true
            	G1 Z2 F2000
            	M400
            	G1 Z{(state.restorePoints[0].coords[2] + state.restorePoints[1].coords[2] + state.restorePoints[2].coords[2] + state.restorePoints[3].coords[2] + state.restorePoints[4].coords[2]) / 5} F100	
            	G60 S5
            
            	G90 ; set true
            	G1 Z4 F2000
            	M400
            
            
            	echo "Pinda at " ^ sensors.analog[2].lastReading ^ " average trigger at " ^ state.restorePoints[5].coords[2] ^ " millimeters."
            	echo "Trigs: "^state.restorePoints[0].coords[2]^", "^state.restorePoints[1].coords[2]^", "^state.restorePoints[2].coords[2]^", "^state.restorePoints[3].coords[2]^", "^state.restorePoints[4].coords[2]
            
            	M28 {"0:/macros/probe-comp-going-down/"^ sensors.analog[2].lastReading ^","^state.restorePoints[5].coords[2]}  
            	M29	
            
            M558 P5 C"^zprobe.in" H0.7 F400 T8000 A20 S0.003
            M140 S0
            M104 S0
            G4 S60 
            
            dc42undefined 1 Reply Last reply Reply Quote 0
            • Kolbiundefined
              Kolbi
              last edited by

              Looking at the data for a bit, I believe the curve actually represents the thermal effects on the entire machine and the disparities (saw tooth pattern up/down) represent the probe's ability.

              I zip-tied a bltouch3.1 to the extruder and ran the same test, the only problem is that there was no probe temp to base the curve off so I based it off bed temp.
              Screen Shot 2020-07-20 at 3.19.42 PM.png

              1 Reply Last reply Reply Quote 0
              • Kolbiundefined
                Kolbi
                last edited by

                @evan38109 I tackled the temp comp issue by changing to a BLTouch - had to modify the BMGm in CAD but it was worth it, very clean and accurate install. I believe you also have a BMGm, so this might interest you:
                Screen Shot 2020-08-01 at 10.40.16 AM.jpg

                Cheers,
                Kolbi

                1 Reply Last reply Reply Quote 1
                • evan38109undefined
                  evan38109
                  last edited by

                  Hey @Kolbi,

                  Sorry, I have email notifications off and missed your latest posts until I came to the forums to check something else!

                  That BLTouch mount is pretty impressive. How did you print it? Also: are the files available on Thingiverse or elsewhere? I'm pretty happy with my PINDA for now, but I do tend to get itchy for new experiments... 😉

                  I'm racking my brain for why your measurements wound up so much different than mine. I've found my PINDA to be pretty darn stable. I've never needed more than +-0.10 babystepping for a nice first layer, regardless of the temperature at which I zero the machine. I'll keep turning it over in my brain, but...I've got nothing. 😕

                  Kolbiundefined 1 Reply Last reply Reply Quote 0
                  • Kolbiundefined
                    Kolbi @evan38109
                    last edited by Kolbi

                    @evan38109 No worries at all on posts. The modified BMGm housing with BLTouch is working extremely well, I have a couple tweaks to make to the design files and then I'll post them. Just like the ones purchased through bondtech, mine were printed using MJF / Nylon.
                    On the Pinda, I never had major issues because I always did a probe warming routine to keep all measurements on an even temp offset. I had random problems with offset because of it - more noticeable with certain build plates then others. What was enlightening to me was the probe measurement disparities between runs - didn't think it would be that bad but the saw-tooth patterns above depict it - those metrics were derived over at least 5 runs.

                    For the BLTouch - it's totally great. No more offsets for different build plates, no temp comp, and reliable repeatability.

                    Cheers,
                    Kolbi

                    Phaedruxundefined 1 Reply Last reply Reply Quote 0
                    • Phaedruxundefined
                      Phaedrux Moderator @Kolbi
                      last edited by

                      @Kolbi said in Polynomial Temp Compensation for Probes?:

                      mine were printed using MJF / Nylon.

                      That's quite the hardware to have access to, or was it printed through a service? It looks quite nice.

                      Z-Bot CoreXY Build | Thingiverse Profile

                      Kolbiundefined 1 Reply Last reply Reply Quote 0
                      • Kolbiundefined
                        Kolbi @Phaedrux
                        last edited by Kolbi

                        @Phaedrux Hehe, not mine - it was sent off for mfg. I have to modify it slightly, tighten the pocket where the mosquito sits with a set-screw to make for a no-compromising tightness. Also thinking about adding part cooling ducts into the housing sections with just a replaceable air nozzle/deflector.

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

                          @Kolbi, the forthcoming 3.2beta firmware supports 2nd order temperature compensation for trigger height.

                          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

                          Kolbiundefined 1 Reply Last reply Reply Quote 2
                          • Kolbiundefined
                            Kolbi @dc42
                            last edited by Kolbi

                            @dc42 Nice! How will the temperature offset/calibration process work?

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

                              You will have to work out the calibration manually as you have done already. Once you have worked out the first and second order temperature coefficients, you can enter them in the M558 C parameter, e.g.

                              M558 ... C0.01:0.005

                              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

                              Kolbiundefined 1 Reply Last reply Reply Quote 1
                              • Kolbiundefined
                                Kolbi @dc42
                                last edited by

                                @dc42 Thanks! Was just reading this as you replied:
                                Z probe trigger height second order temperature compensation is now supported. To use it, specify a 2-element array as the temperature coefficient, e.g. "M558 ... C0.01:0.0005"

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