M915 stall detection problems/experiences with high speed steppers

  • Hi !

    I use high-speed steppers and i know that this might not be the best case for using stall detection. Nevertheless, i want to use it for homing.
    I did expect a lot of false alarms, but independently of what i do, i don't get any stall detection at all. So my problem is, that i don´t get any stall detected, the opposite of having false alarms. Therefore i guess i must be doing something completely wrong.

    I used the following settings and moved the axes with move commands (100 -500 mm/s) and stopped them by hand, to stall them completely. I tried different mA settings from 30/50/80 %, M915 different H values and movement speeds to generate more back EMF up to 500 mm/s, with filter F1 or without F0, different actions R1, R2, R3, different sensitivities down to S-64.
    Whatever i do it seems the stall detection doesn´t work at all for me. Homing doesn´t work at all (no surprise if other actions also don´t show any reaction). My 24V PSU seems to be stable, as far as i can judge - which seems also to be important for stallguard.

    In general, i use 1-10g for printing and 20g for travel moves. As far as i understood high load/torque/acceleration should provide more false alarms - nop, not in my case. I also tried using only 0.5 g acceleration (just to test the unlikely).

    M115 shows
    FIRMWARE_NAME: RepRapFirmware for Duet WiFi FIRMWARE_VERSION: 1.20beta11 ELECTRONICS: Duet WiFi 1.0 + DueX5 FIRMWARE_DATE: 2017-11-28

    I use a Duet Wifi & DueX5 as shown above. My axes setup is M584 X5:6 Y7:8 Z9 (so all moving axes are on the Duex5, Es on the Wifi). I use e.g. the following M915 command to ensure that all drivers are set for stall detection.
    M915 P0:1:2:3:4:5:6:7:8:9 F0 S-50 R1 H200

    What do i do wrong ?
    What can i check ?

    According to the TMC2660 datasheet, in addition to SGT and SFILT (which is S & F of M915) there is a 3rd tuning parameter SG available, to tune the load factor. I don´t know how to understand this parameter yet, but i guess in my case, the load compared to what the stepper is able to is very small (unless i stop the stepper or use really high accelerations) - maybe this is the problem ? Why does M915 not use the TMC2660 SG parameter ?

    I think in the long term, maybe some autotune feature would help (the TMC2660 datasheet describes what has to be done -> ch4.1, but it is tricky without seeing the trend of the needed values/parameters). It would already help a lot, if we would see some "filtered" real-time values, of the parameters which have to be adjusted.

  • administrators

    What is the specification of your stepper motors?

    SG is not a tuning parameter, it is a status word. It changes constantly with motor load. I guess I could have the firmware report the minimum and maximum values it reads.

    Stall detection won't work if the driver supply voltage is too low for the speed you are trying to move the motors at. See https://duet3d.com/wiki/Choosing_stepper_motors#How_to_work_out_the_power_supply_voltage_you_need to work it out (there is a link to a spreadsheet at the end).

  • they have 1.25 Ohm, 1.8 mH, 2.3 A, so they won´t run out of voltage with 24V up to e.g. 500 mm/s and 30 or 50 % Amps, therefore i didn´t go beyond that.

    Thanks for the clarification about SG (reading and not just looking at the datasheet can help a lot).

  • administrators

    I'm wondering whether the very low inductance of those motors means they develop low back EMF. Nevertheless, I would expect you to get false stall detection if you use low H values in the M915 command.

  • thanks, i will try lower H values, i have tried to test it at higher speeds (500 mm/s) to increase back EMF, but somewhen 24 V won´t be enough.

    So i assume i did nothing obviously wrong. I will also test a CNC high impedance stepper, to see if i manage it there.

  • I tried it with different H values down to 10.
    I also tried it with a different stepper type. I don´t have a spec for that type, but it is for sure not a low impedance one.

    Just to be sure, option M915 R1 should give an entry in the log file and R2 should call the pause.g file or ?

    I don´t know what is wrong, but if something isn´t completely wrong stall detection is for nuts…

  • administrators


    Just to be sure, option M915 R1 should give an entry in the log file and R2 should call the pause.g file or ?

    Yes, provided that you have enabled stall detection using the other parameters and you are running firmware 1.20beta15 1.20beta11.

    Send e.g. M915 P0 or M915 X with no other parameters to check what stall detect settings you have set on drive 0 or on the X drive(s).

  • Where do i get 1.20beta15 ?

    I search always https://github.com/dc42/RepRapFirmware/blob/dev/WHATS_NEW.md, last one there is beta 11 - which i have installed.

  • administrators

    Sorry, that was a typo, I meant beta 11.

  • i did copy some lines which may be of interest

    overall motion config:
    M584 X5:6 Y7:8 Z9 E3:4 U0
    M350 X16 Y16 Z16 E16:16 U16 I1
    M92 X100 Y80 Z800 E837:837 U100
    M906 X2000 Y2000 Z2000 E2000:2000 U2000 I50
    M913 X50 Y50 Z50 U50
    M208 X400 Y400 Z400 U400
    M204 P50000 T100000
    M201 X100000 Y100000 U100000 V100000 Z10000 E10000:10000 ; Accelerations (mm/s^2)
    M203 X30000 Y30000 U30000 Z1000 E6000:6000 ; Maximum speeds (mm/min) 60000 => 1000 mm/s
    M566 X1000 Y1000 Z100 U1000 V1000 E800:800 ; Maximum instant speed changes mm/minute

    one of hundreds of tested M915 commands
    M915 P0:1:2:3:4:5:6:7:8:9 F0 S-10 R2 H100

    test script:
    M98 Ppause.g ; test to see what should happen when stalled
    ; move carriages and stop them by hand
    G1 X100 Y100 U100 F12000
    G1 X-100 Y-100 U-100 F6000
    G1 X100 Y100 U100 F12000
    G1 X-100 Y-100 U-100 F6000
    G1 X100 Y100 U100 F12000
    G1 X-100 Y-100 U-100 F6000
    G1 X100 Y100 U100 F12000
    G1 X-100 Y-100 U-100 F6000
    G1 X100 Y100 U100 F12000
    G1 X-100 Y-100 U-100 F6000
    G1 X100 Y100 U100 F12000
    G1 X-100 Y-100 U-100 F6000
    …. and so on, in between variations of M915 to test a lot of possibilities quickly

    M117 PAUSE.G
    M300 S300 P1000

    On X & Y fast steppers, on U slow stepper - no chance to get any stall triggered….

    BTW i found an interesting app note https://www.trinamic.com/fileadmin/assets/Support/Appnotes/AN002-stallGuard2.pdf. It would really help a lot to get at least some min/max/mean values of the SG values.

    M915 P0 and so on shows exactly what was configured before.

  • administrators

    The next beta will provide min and max SG load values in the M122 report.

Log in to reply