Interesting results from playing with stall detection.

  • A little baseline:

    Duet WiFi, firmware 1.20. Printer is a custom delta with 1500mm towers, 1000mm linear slides, 42BYGHM809 steppers (0.9 Deg, 68 Oz In). 720mm "Hayden Huntley" diagonal rods. Duet Smart Effector. Baseline config, as suggested by the online tool and slightly tweaked by me, shown in first code block below. Many successful prints on this printer, since I commissioned it about three or four weeks ago, with these settings.

    File below is what I ran over and over to test. All the weird Z changes are because the logged stall detect states what Z; with these unique values, I can tell what moves caused the stall.


    ; Original parameters from config.g, as suggested by the online reprap tool:
    M566 X1200  Y1200  Z1200  E1200      ; Set maximum instantaneous speed changes (mm/min)
    M203 X18000 Y18000 Z18000 E1200      ; Set maximum speeds (mm/min)
    M201 X4000  Y4000  Z4000  E2000      ; Set accelerations (mm/s^2)
    M906 X1200  Y1200  Z1200  E1400 I30  ; Set motor currents (mA) and motor idle factor in per cent.  DE 2018 02 02

    Gcode used to test:

    ; Test Stall Detection
    M915 P0:1:2 S15 F1 R1  	;P axis S sensitivity -64 to +64 F Filter on (four steps) off (one step) R action 0=nothing 1=log 2=pause
    ; Re-establish defaults, just in case. 
    M203 X18000 Y18000 Z18000 E1200      ; Set maximum speeds (mm/min)
    M906 X1200  Y1200  Z1200  E1400 I30  ; Set motor currents (mA) and motor idle factor in per cent.  DE 2018 02 02
    ; Test parameters
    M566 X300  Y300  Z300           ; Set maximum instantaneous speed changes (mm/min)
    M201 X6500  Y6500  Z6500           ; Set accelerations (mm/s^2)
    G4 S1				; Delay for a second after all those settings.   Probably completely unnecessary. 
    G28				; Home
    G0 F3600   X-300 Y-300 Z500	; Move slowly near one limit
    G0 F36000  X300  Y300  Z400	; Move quickly a long way
    G0 Z410
    G0 X0 Y0			; Move quickly back near center
    G0 Z420
    G0 X10 Y10			; Make some short moves. 
    G0 X0  Y0			; Repeat them, and some even shorter. 
    G0 Z430
    G1 X-2.368 Y31.34 
    G1 X-2.298 Y31.413 
    G1 X-2.266 Y31.451 
    G1 X-2.243 Y31.484 
    G1 X-2.164 Y31.63 
    G1 X-2.142 Y31.683 
    G1 X-2.106 Y31.784 
    G1 X-2.057 Y32.01 
    G1 X-2.105 Y32.202 
    G1 X-2.18 Y32.402 
    G1 X-2.21 Y32.463 
    G1 X-2.239 Y32.51 
    G1 X-2.267 Y32.55 
    G1 X-2.278 Y32.563 
    G1 X-2.408 Y32.7 

  • Now, the interesting findings. By the way, "interesting" means "I'm confused".

    1. HUGE differences in reported (logged) "stall detects" as you adjust M915 S in the 1 to 15 range. No actual stalls (that I can tell) though…

    In fact, with M915 S1 and P0, I get stall detects just homing the machine!! Yes, at those very slow feedrates. Again, I've had many successful prints. This is clearly too sensitive.

    I finally settled on S15 and P1 (filter on) for most of the testing. I have no idea if this is a good or bad setting with which to test.

    1. Even with the confusing sensitivity settings, it is pretty clear that the config tool defaults for acceleration were very conservative. This is probably a good thing, to get successful prints at "the defaults" for a broad range of printers.

    Accel was 4000 to start. I repeatedly get stall detects at 7000. I clearly don't at 6500. Once again though, I'm not sure that these stall detects really have anything to do with physical skipped steps.

    1. No matter what I do to "jerk", called maximum instantaneous speed changes, I never get a stall detect.

    However, if I set jerk to really ridiculous values, I do get a loud scream out of the machine and see the effector way, way off from where it should be. In other words, extremely high jerk settings DO cause missed steps, and DO NOT cause a stall detect.

  • I am also speculating on the very best way to catch missed steps, when not at extremes that cause obvious major skips.

    I am considering mounting a small (i.e. light) laser pointer on the effector, aimed at a mirror on the bed at roughly 45 degrees, so that a X0Y0 the beam shines far across the room onto a wall (my printer happens to be in a fairly large room). This gives a long lever arm to make offsets obvious.

    Then the move file above would be adjusted to have several moves to X0Y0 and long pauses, to check for repeatability of where the spot hits (blue painters tape, black marker, etc, etc).


  • administrators

    Thanks for sharing your results. Some notes:

    • I suspect S15 is too high for reliable stall detection on most machines. On my delta I found values of 2 to 4 worked best; but it depends on your motors.

    • Bear in mind that stall detection doesn't work at low motor speeds. To avoid false stall detection at low speeds, we provide the H parameter to set the minimum speed that stall detection will be used for. On Delta printers, some of the carriages move very slowly at some points in the print, and stall detection won't operate at those points.

  • Thanks David. I will re-run some experiments with a higher minimum speed and a more sensitive detection.

Log in to reply