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

    Motor stall detection as Z probe

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    11
    45
    10.7k
    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.
    • Shenundefined
      Shen
      last edited by

      [[language]]
      M913  Z30:30 ; Reduce current
      M201 Z100; Reduce acceleration
      M915 P1:2 S1 F0; Set stall detection threshold (you don't need this if you have it in config.g file)
      
      G91
      G1 S1 Z-210 F600 ; probe
      G90
      
      M201 Z1250 ; Restore acceleration
      M913 Z50:50; Restore current
      
      G92 Z0
      G1 Z0.4 F3600; Stall triggers at -0.4mm, raise nozzle by 0,4mm.
      G92 Z0
      
      ```Here is my code for z probe. The exact configuration would probably be different between each setup. You'll need to look for a setup that trigger the stall detection with the lowest impact force between the bed and the nozzle. Here is how I figured out mine:
      First you need to lower your Z acceleration so stall detection won't trigger due to the force of z acceleration.
      Then you need to figure out the lowest current that stall detection works reliably(M913). I found my motor moves reliably at 20% current, but stall detection works reliably at 30% current.
      Then find the lowest stall detection thresh hold(M915). Mine is 1\. To avoid damage your printer always start with low values that would trigger the stall detection immediately, and increase the value until you can move the z axis.
      You might also want to find the lowest speed as well to further reduce the impact force, but I just used F600.
      Change any of the current, stall detection thresh hold and speed will probably effect the other 2\. You need to find a combination that works reliably and has the lowest impact force. To determine the impact force, I put a piece of print between the nozzle and the bed, and check the mark left by the nozzle after impact.
      I don't have a spring under my bed, this might now work for you if you have a soft sprint under the bed.
      1 Reply Last reply Reply Quote 1
      • DjDemonDundefined
        DjDemonD @Phaedrux
        last edited by

        @phaedrux said in Motor stall detection as Z probe:

        This is interesting. I have very high steps on my Z axis. 3200, giving 0.005mm for a single step. That's better than the repeatability I'm getting from the BLTouch.

        @Shen Would you mind sharing how you have it configured?

        This is what I wondered about. It's not, according to what I read about it here when the stall detect and sensorless homing was first included microsteps, it's full motor steps.

        This is why I am wondering how this can work well. My delta (0.9deg steppers and 16t pulleys) is 200 (micro)steps/mm, but this is at 1/16th so its 12.5 full steps/mm which is 80 microns per step! That's quite a big chunk given we are getting (upto) 5 micron accuracy using the Orion Z-probe.

        However I might try it.

        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
        • Mystaundefined
          Mysta
          last edited by

          I'm going to try on my 1.5m delta as well, I will probably probe each print since so far most of my prints take forever anyway so why not.

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

            I have implemented this as Z probe type 10 in the latest build of firmware 2.0alpha. I've a few more things to test and at least one thing to fix before I do another 2.0alpha release.

            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
            • Shenundefined
              Shen
              last edited by

              This would probably not work very well on deltas. If you use 5mm pitch screw with 0.9 degree stepper on Z axis, each full step is only 0.0125mm.

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

                @shen said in Motor stall detection as Z probe:

                This would probably not work very well on deltas. If you use 5mm pitch screw with 0.9 degree stepper on Z axis, each full step is only 0.0125mm.

                That's right, it will only work when the Z steps/mm is high enough so that one full step provides sufficient resolution, but low enough that the motor stall can be detected before too much force is applied between the nozzle and the bed.

                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
                • Mystaundefined
                  Mysta
                  last edited by

                  Oops must have followed a link and forgot, was referring to endstop not probe. Have smart Effector for probing.

                  1 Reply Last reply Reply Quote 0
                  • DjDemonDundefined
                    DjDemonD
                    last edited by

                    It works fine for endstops, but because it is not very accurate, and I can confirm this having an endstop-less delta running, you need to auto-calibrate after each homing or you will not have an accurate enough calibration to print. Not a particularly big problem, but it highlights that it won't work for most deltas as a z-probe. My cylinder delta is 400steps/mm as it is leadscrew driven on XYZ but this is still only a 40-microns-accuracy z probe which is a good factor of 4-8 out on a smart effector or piezo probe.

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

                    Mystaundefined 1 Reply Last reply Reply Quote 0
                    • Mystaundefined
                      Mysta @DjDemonD
                      last edited by

                      @djdemond said in Motor stall detection as Z probe:

                      It works fine for endstops, but because it is not very accurate, and I can confirm this having an endstop-less delta running, you need to auto-calibrate after each homing or you will not have an accurate enough calibration to print. Not a particularly big problem, but it highlights that it won't work for most deltas as a z-probe. My cylinder delta is 400steps/mm as it is leadscrew driven on XYZ but this is still only a 40-microns-accuracy z probe which is a good factor of 4-8 out on a smart effector or piezo probe.

                      Yeah I'm excited to try out the smart effector, my arms finally arriving today. 500mm from Haydn. Do you have your calibrate script for endstop less? I definitely don't mind probing each print.

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

                        @mysta said in Motor stall detection as Z probe:

                        Yeah I'm excited to try out the smart effector, my arms finally arriving today. 500mm from Haydn. Do you have your calibrate script for endstop less? I definitely don't mind probing each print.

                        For a script to home a delta without endstops, see the example macro file towards the end of https://duet3d.dozuki.com/Wiki/Stall_detection_and_sensorless_homing#Section_Configuring_sensorless_homing. This file is for testing homing without endstops. For actual use as a homing file you could simplify it. For example, you don't need the M574 commands to change the endstop type because you can just set stall detect endstops in config.g if that's the only type of endstop you ever use.

                        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
                        • Mystaundefined
                          Mysta
                          last edited by

                          Thanks, I'll start from there. I left the endstops on my frame just in case but I'm really interested in using some of the new functionality of the 2660

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

                            In firmware 2.0beta 1 you can now set Z probe type 10 in the M558 command, which selects a Z motor stall-detect probe. As I explained previously, this will only work if your Z steps/mm is high enough for 1 motor full step to provide sufficient resolution, and if you can find a combination of M915 stall detect settings and motor current that you can detect the stall before the Z motor drives the nozzle too hard into the bed.

                            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
                            • DjDemonDundefined
                              DjDemonD
                              last edited by DjDemonD

                              M80 ;PSU ON
                              ; Homing file for RepRapFirmware on Large Kossel
                              ; Sensorless Homing test file for RepRapFirmware on Kossel
                              M915 X Y Z S2 F1 R0 ;set stall detect drives, S-threshold (-64 to 63), F1 filtered, R-log only
                              M400 ; make sure everything has stopped before we make changes
                              M574 X2 Y2 Z2 S3 ; set endstops to use motor stall
                              M913 X30 Y30 Z30 ; reduce motor current to 50% to prevent belts slipping
                              G91 ; use relative positioning
                              G1 S1 X700 Y700 Z700 F2000 ; move all carriages up 700mm, stopping at the endstops
                              G1 Z-5 F2000 ; down a few mm so that we can centre the head
                              G90 ; back to absolute positioning
                              M400 ; make sure everything has stopped before we reset the motor currents
                              M913 X100 Y100 Z100 ; motor currents back to normal
                              G1 X0 Y0 F2000 ; centre the head and set a reasonable feed rate
                              M574 X2 Y2 Z2 S1 ; set endstops back to normal so that homedelta.g works

                              You just need to experiment with M915 R to get the threshold right.

                              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
                              • bartolomeusundefined
                                bartolomeus
                                last edited by

                                I like experimenting and would like to give this a go. I am building a corexy, with 3200steps/mm on Z with1/16th microstepping. I could also go for a 0.9 stepper motor and get 6400 steps/mm at 1/16th or 3200 at 1/8th, or 1600 at 1/4 and so on.

                                With a 1.8 stepper, accuracy would be 0.005
                                With a 0.9 stepper, accuracy would be 0.0025

                                What would be the best choice?

                                1 Reply Last reply Reply Quote 0
                                • DjDemonDundefined
                                  DjDemonD
                                  last edited by

                                  Well for Z positional accuracy at 10 microns would be fairly good, 5 microns even better, 2.5 microns is probably excessive, but then I cannot see a reason to choose 1.8 deg motor for Z, it never has to move fast.

                                  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
                                  • bartolomeusundefined
                                    bartolomeus
                                    last edited by

                                    How about steps/mm with a 0.9degree. Is 6400 doable for the duet or should I then use 1/8th microstepping, or does this have no effect at all? And then, are there any downsides to 1/8th microstepping?

                                    1 Reply Last reply Reply Quote 0
                                    • DjDemonDundefined
                                      DjDemonD
                                      last edited by

                                      6400 steps/mm is doable and given the very small amount of movement required in z it won't overly tax the processor. However in terms of stall detect only full steps count so 0.9 degree is preferable.

                                      1/8th is noisier. But try it, its very interesting to see the differences in noise, speed and (if you look really hard) print quality between different microstepping modes.

                                      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
                                      • bartolomeusundefined
                                        bartolomeus
                                        last edited by

                                        Cool, thanks!

                                        1 Reply Last reply Reply Quote 0
                                        • Francisco3Dundefined
                                          Francisco3D
                                          last edited by Francisco3D

                                          Hi @dc42!

                                          I have been able to successfully autohome X, Y and Z using sensorless homing (I am working with a coreXY).

                                          Currently I am experimenting with manual bed levelling assistant using StallGuard but I don't know how to correctly input StallGuard parameters into probing. My code is as shown below. Am I missing something?

                                          config.g file
                                          ...
                                          M671 X111:11:211 Y14.2:194:193 P0.7
                                          ...
                                          M558 P10 X0 Y0 Z0
                                          ...

                                          bed.g file

                                          G28
                                          M915 Z H200 S3 F0 R1
                                          G30 P0 X111 Y14.2 Z-99999
                                          G30 P1 X11 Y194 Z-99999
                                          G30 P2 X211 Y193 Z-99999 S3

                                          I have uploaded firmware 2.0 beta 2

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

                                            That looks correct to me, although you may need to adjust the probing speed (F parameter in M558) and you may also wish to adjust the travel speed between probe points (T parameter).

                                            Getting the Z motors to stall without applying excessive force to the nozzle will be a delicate balance. You will probably need to use M913 to reduce the Z motor current temporarily.

                                            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