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

    Stallguard detection not working

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    4
    7
    567
    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.
    • StaticRedundefined
      StaticRed
      last edited by

      Hey im using a duet 3 mini. And i configured stallguard like this:

      M915 Y X S3 R1 F2 H200		
      

      Im using a CoreXY Machine so i directly used the axis. I then configure my sensorless homing like this:

      M574 X1 S3                               ; configure active-high endstop for low end on X via pin ^io4.in
      M574 Y1 S3                              ; configure active-high endstop for low end on Y via pin !io3.in
      

      To home the machine i use this macro:

      G91               ; relative positioning
      G1 H2 Z5 F6000    ; lift Z relative to current position
      M913 X70 Y70 ; drop motor current to 70%
      G1 H1 Y-175 F3500 ; move quickly to Y axis endstop and stop there (first pass)
      G1 Y5 F6000       ; go back a few mm
      G1 H1 Y-175 F360  ; move slowly to Y axis endstop once more (second pass)
      G1 H2 Z-5 F6000   ; lower Z again
      M913 X100 Y100 ; return current to 100%
      G90               ; absolute positioning
      

      Sadly this does not work, my motors just crash into the frame and become really loud. Even if i use an S Value like -50 it does not work. Maybe i missconfigured something?

      1 Reply Last reply Reply Quote 0
      • demonlibraundefined
        demonlibra
        last edited by demonlibra

        1. It is useless doing two pass for homing with sensorless because this type not accurate.
        2. You must using StealthChop mode for drivers TMC2209.
        3. You must calculate and set special M915 Hnn for your speed. Hnn working like a filter.
          Set big value Hnn and drivers will determine noise.
          Set low value Hnn and drivers will not determine stall.
        4. If motor 1.8 degree, try H90 and speed F1200.

        My file homeall.g

        ; homeall.g
        ; called to home all axes
        
        M17                     ; Enable all stepper motors
        G4 S1                   ; Wait 1 second
        
        ;HOMING Z
        M150 X2 R200 U0 B0 S3   ; Change LedLight of the screen to blue
        G91                     ; relative positioning
        M913 Z60                ; set 60% motor current for safety before move
        G1 H2 Z-1 F300          ; lift Z relative to current position
        G1 H1 Z160 F600         ; move Z up until the endstop is triggered
        G1 H2 Z-3 F300          ; lift Z relative to current position
        G1 H1 Z3.5 F75          ; move Z up until the endstop is triggered
        M400                    ; Wait for current moves to finish
        M913 Z100               ; set 100% motor current for motor Z
        
        
        ;PREPARING HOMING X and Y
        G4 S1                   ; Wait 1 second
        M569 P0 D3 V40          ; Change from SpreadCycle to StealthChop at low speed for X axis
        M569 P1 D3 V40          ; Change from SpreadCycle to StealthChop at low speed for Y axis
        M913 X30 Y30            ; Decrease motors current to 30%
        M566 X1 Y1              ; Decrease Jerk mm/min
        M201 X300 Y300          ; Decrease Accelerations mm/sec^2
        G91                     ; Relative positioning
        M915 X Y H90 S45 F0 R0  ; Configure motor stall detection for 20 mm/sec
        
        ;HOMING X
        G1 H1 X5 F600           ; Move X axis from left stop
        G4 P100                 ; Wait 100 msec
        G1 H1 X-154 F1200       ; Move X axis to left stop at 20 mm/sec
        G4 P100                 ; Wait 100 msec
        G1 X10 F600             ; Move X axis from left stop
        M400
        
        ;HOMING Y
        G1 H1 Y5 F600           ; Move Y axis from left stop
        G4 P100                 ; Wait 100 msec
        G1 H1 Y-159 F1200       ; Move Y axis to left stop at 20 mm/sec
        G4 P100                 ; Wait 100 msec
        G1 Y10 F600             ; Move Y axis from left stop
        M400                    ; Wait for current moves to finish
        
        M913 X100 Y100          ; Return motors current to 100%
        M566 X900 Y900          ; Return Jerk to 15 mm/min
        M201 X1500 Y1500        ; Return Accelerations 1500 mm/sec^2
        G90                     ; Absolute positioning
        M400                    ; Wait for current moves to finish
        
        ;HOMING X and Y manual without limit switches
        ;M150 X2 R0 U0 B200 S3    ; Change LedLight of the screen to blue
        ;M18 X Y                  ; Switch off motor X and Y
        ;M300 P500                ; Beep
        ;M291 P"Move head X0 Y0" R"HOMING X Y" S2 ; Show message on the screen
        ;M17                      ; Switch on all motors
        ;G92 X0 Y0                ; Set current position X=0 Y=0
        
        Del87undefined 1 Reply Last reply Reply Quote 2
        • Del87undefined
          Del87 @demonlibra
          last edited by

          @demonlibra thanks for the advices!

          Сan i ask you a couple of questions:

          1. What is the repeatability of sensorless parking with your parameters?

          2. What parameters or mechanical stuffs are essential for the high repeatability?

          Dmitry

          oliofundefined demonlibraundefined 2 Replies Last reply Reply Quote 0
          • oliofundefined
            oliof @Del87
            last edited by

            The best repeatability you will get with sensorless homing is +- 2full steps, an order of magnitude worse than the worst mechanical switch endstops. It's fully sufficient if you never aim for fully repeatable position between two homing runs, but if you want to do reliable re-homing after a power event, I'd rather go with Omron mechanical endstops.

            On top, endstops are much easier to configure.

            <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

            Del87undefined 1 Reply Last reply Reply Quote 0
            • Del87undefined
              Del87 @oliof
              last edited by

              @oliof of course you are right, but what about sensorless parameters? Mb M915 H or F have some influence in repeatability?

              Dmitry

              oliofundefined 1 Reply Last reply Reply Quote 0
              • oliofundefined
                oliof @Del87
                last edited by oliof

                @del87 F will definitely affect repeatability:

                Fn Stall detection filter mode, 1 = filtered (one reading per 4 full steps), 0 = unfiltered (default, 1 reading per full step),

                here the variance increases from +-1 full step to +-4 full steps!

                The H value helps make sure minimum speed for a reliable reading is reached. As @demonlibra said before: Too low H will cause false negatives (no detection of stall), Too high H will cause false positives (faulty detection of stall). In edge cases this could mean more imprecision/reduced repeatability.

                <>RatRig V-Minion Fly Super5Pro RRF<> V-Core 3.1 IDEX k*****r <> RatRig V-Minion SKR 2 Marlin<>

                1 Reply Last reply Reply Quote 2
                • demonlibraundefined
                  demonlibra @Del87
                  last edited by

                  @del87 said in Stallguard detection not working:

                  What is the repeatability of sensorless parking with your parameters?

                  I dont look to the sensorless homing like to the preciese type of homing.

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