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

    Stall detection to detect crash while probing?

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    4
    7
    699
    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.
    • lostapathyundefined
      lostapathy
      last edited by lostapathy

      I'm running a Railcore2. It seems one of the biggest sources of crashes (and crash anxiety) is users who have some sort of z-probing failure. Generally because they left something on the print bed, but sometimes due to wiring failures.

      It seems like it should be possible to modify homez.g such that:

      • Turn on stall detection on Z so that the machine throws a fault if it stalls before the probe is triggered
      • Home normally
      • Turn stall detection back off

      A couple of us have messed with every variation on M915 we could come up with and have yet to get the machine to react to it. It seems like: M915 Z S3 R2 followed by G91 G0 Z5 F250 should trigger a pause if I hold one of my z-leadscrews, but nothing happens.

      Thanks for any help. Being able to detect this type of error would be a huge safety win for these printers.

      1 Reply Last reply Reply Quote 0
      • cheeseandhamundefined
        cheeseandham
        last edited by cheeseandham

        I'm using M915 P0:1 S3 R0 F0 for sensorless homing on X & Y quite happily here. Have done since my RailCore II was built.

        I've a head crash recently, and was due to wiring fault. (what was thought was a well fastened cable coming off my mini-differential IR probe)

        My approach was to try M915 P5:6:7 S3 R3 F0with a rehome.g file. The rehome.g called M112 and M999 in order to just stop the printer dead in it's tracks.

        Homed my printer and then manually held down the bed , stalling the motors plenty - to no effect.

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

          Ideally you should be probing with as low a motor current as possible so that if it does crash the motors will just naturally stall out without doing damage.

          Stall detection on the Z axis is pretty tricky. You need to be moving at a pretty decent clip for it to register. Faster than you'll likely feel comfortable with. And when you're homing, you're using all 3 motors at the same time, so there needs to be enough sharp resistance to get them all to stall at the same time. Holding it down with your hand won't provide the same feedback.

          I really don't think the Railcore is a good candidate for a z axis stall detection.

          However, I've actually wondered if you could use stall detection to level the bed though because then you're only moving each motor individually. And when it stalls, it's stalling to the nearest full step.

          Z-Bot CoreXY Build | Thingiverse Profile

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

            Here's the macro I used to get stallguard working on my z axis about a year ago. Might not translate directly to what you're using, but these are settings that worked for me. 3 lead screws belted with single motor.

            ; 2_ZStallProbe.g
            ;
            ; Uses the Z axis StallGuard detection as a Z-Probe
            ;
            
            M291 P"Are you sure you want to proceed?" R"StallGuard Z-Probe" S3
            
            M280 P3 S160 I1 	; Alarm Release and Push-Pin UP, inverted signal
            G28
            G90                			; absolute positioning
            G1  X150 Y150 Z3 F4000 			; Always probe on the same spot
            M558 P9 Z0			; Disable BLTouch
            M558 P10 X0 Y0 Z1 H3 F200 T6000	A10 R0.1 S0.005    	; Enable Stall Z probe
            G31 X0 Y0 Z0 P200           		; Set Z probe trigger value, offset and trigger offset (overshoot due to springs)
            M574 Z1 S3         	    		; set Z-min to use motor StallGuard
            M913 Z40   		      		; reduce motor current to 20%
            M201 Z20				; Reduce acceleration mm/s2
            M915 Z S4 F0 R0			; Set StallGuard sensitivity for endstop homing
            
            M291 P"StallGuard Z-Probe Settings Loaded. Proceed with Probe?" R"Yes or No?" S3
            
            M400 
            
            G30 S-1					; Find the bed Z=0 reference
            G1 Z3
            G30 S-1 				; do a couple of repeatability tests
            G1 Z3
            G30 S-1
            G1 Z3
            G30 S-1
            G1 Z3
            G30 S-1
            G1 Z3
            G30 S-1					; Find the bed Z=0 reference
            G1 Z3
            G30 S-1 				; do a couple of repeatability tests
            G1 Z3
            G30 S-1
            G1 Z3
            G30 S-1
            G1 Z3
            G30 S-1
            G1 Z3
            
            M400
            
            M280 P3 S160 I1 	; Alarm Release and Push-Pin UP, inverted signal
            
            M291 P"Probing complete. Restoring settings." S3
            
            M913 Z100   		      				; restore current to 100%
            M201 Z300 						; Restore acceleration
            M915 Z S63 F1 R0					; Set StallGuard sensitivity for normal movement
            M574 Z1 S2						; Use zprobe and home to Z Min.
            M558 P9 X0 Y0 Z1 H3 F100 T6000 A10 R0.5	S0.005		; P9 for BLTouch, dive height 3mm, probe at 100mm/s, travel 6000mm/s, up to 10 probes, pause 0.5s
            G31 X-41.8 Y32.2 Z2.3 P25				; probe offset from nozzle, p is trigger value, set low for bltouch, set Z=0 for testing 
            

            Z-Bot CoreXY Build | Thingiverse Profile

            1 Reply Last reply Reply Quote 0
            • lostapathyundefined
              lostapathy
              last edited by

              @phaedrux said in Stall detection to detect crash while probing?:

              And when you're homing, you're using all 3 motors at the same time

              In order for a stall to be detected, I need all 3 motors to stall at once - it won't error out if just one of my z motors stalls out?

              I definitely have been stopping 1 lead screw sharply enough that it should detect a stall (turned current WAY down so it's easy to hold) but if all 3 need to stall for it to be detected, that would explain a lot.

              thanks.

              Phaedruxundefined deckingmanundefined 2 Replies Last reply Reply Quote 0
              • Phaedruxundefined
                Phaedrux Moderator @lostapathy
                last edited by

                @lostapathy said in Stall detection to detect crash while probing?:

                In order for a stall to be detected, I need all 3 motors to stall at once - it won't error out if just one of my z motors stalls out?

                I'm not 100% sure on that. @dc42 would have to answer that.

                I guess technically what you're trying to do is have stallguard working in the background rather than using it as an actual homing probe type. But either way, it's limitations would still stand.

                Z-Bot CoreXY Build | Thingiverse Profile

                1 Reply Last reply Reply Quote 0
                • deckingmanundefined
                  deckingman @lostapathy
                  last edited by

                  @lostapathy A far simpler thing to do is simply reduce the motor currents when homing, then put them back up at te end of the homing file. It isn't a complete fail safe but it does serve as a damage limitation mechanism. Stall detection will never be reliable because it can be affected by temperature apart from other things. Generally, with lead screw driven bed it is unlikely that stall detection would cut in before damage to a sensitive probe can be mitigated because it really doesn't take much force to mangle a probe.

                  Ian
                  https://somei3deas.wordpress.com/
                  https://www.youtube.com/@deckingman

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