Stall detection on Z still not working!



  • Re: How to tune Stall Detection?

    Since this old post has been hijacked, I open a new one.
    Stall detection on Z is still not working for me, no matter what I try. This is one of the most important features I bought the Duet Wifi for.
    Stall detection on X an Y works though.

    There must be a solution to this...
    I am currently using v1.21.



  • https://forum.duet3d.com/topic/3986/how-to-tune-stall-detection/35

    and

    https://forum.duet3d.com/topic/3986/how-to-tune-stall-detection/37

    Have you followed these suggestions?

    Maybe the Z motors you are using need to be changed?

    Sounds like higher Z homing speeds help when using Z lead screws.



  • The Stallguard depends on a set of base parameters:

    • Motor parameters (EMF constant, inductance, and resistance): Unfortunately to modify these variables you have to change motors and is not an option for tuning.
    • Supply voltage: for me stallguard started working on Z with 24V, but never worked with 12V (at least I could not make it work relyably, it would stall completely or not at all).
    • Current: I got best result with lower currents. I runt he gode "M913 Z40" to reduce the current to 40% before I home, then I restore the 100%.
    • Speed: For me F600 is working fine. You need to find the correct speed, but everytime you change something, the response on other parameter settings will vary. For that reason, I started with currrent and once I see the motor moving, I fix the value and do not change again.
    • And last but not least the amount of mechanical load: Try to modify the weight on the Z and see if it makes any changes.


  • So one thing I have found is that changing the motor current for drives other than X, Y, Z and E does not seem to work.

    This is a problem for my usecase because I want to home the two motors of my Z-axis independently. So the left one is mapped as U and the right one as V.
    When I try to set the motor current to let's say 25% (M913 U25 V25), this does not work. When moving U or V after this will always move it with full power.
    Is it possible to set the current by drive numbers instead of axes?



  • Okay, so now it does not even work on X any more... I have no idea what I am doing wrong 😞



  • So, just to be clear, what are the correct stall detection settings (and speeds) for these drives on my z axis?

    Motor:
    Step Angle: 1.8°
    Accuracy: +/- 0.5°
    Phase: 2
    Voltage: 3.96V
    Current: 0.9A
    Resistance: 4.4 Ohms +/- 10%
    Temperature Rise: 80K max.
    Ambient Temps: -20°C ~ 50°C
    Ambient Humidity: 90% max.
    Insulation Resistance: 100MOhms min 500VDC
    Insulation: B level
    Keep Moment: 0.4NM
    Weight: 280g

    Current Settings:
    Acceleration: 500mm/s²
    Maximum Speed: 180mm/min
    Jerk: 18mm/min
    Steps/mm: 400 (interpolated * 16 => 6400)

    Current (not working) Stall Configuration:
    M915 Z S-10 F0 R1

    So how can I get this working?
    Thanks





  • The problem is that stall detection obviously only works when printing gcode files. If I want to use it for homing, it has to work using the DWC as well.
    Is there a setting to change this behaviour or is this coming in one of the next releases?



  • What do you mean? It works when homing in the DWC as well.

    What I've found though is that the sensitivity of the detection seems to vary quite a bit depending on the position of the axis and the temperature of the motors. For instance it Triggers more when higher on the axis where there is more friction on my lead screws. So the behaviour can seem inconsistent and settings that work at one point stop working when conditions change.

    I'd put this feature under the heading of, yes it works but you probably shouldn't rely on it unless you have to.



  • There are no correct settings someone can provide for you even knowing the motor specs. It will take a lot of testing to narrow down a working configuration.

    I can tell what worked for me as an example and the reasoning for it but you'll have to test out different values to see what works in your system.

    Jerk 1, acceleration 10, speed 200, sensitivity 3, trigger value 200, current 40% of 2000

    Changing any of those values even slightly was enough to make it either too sensitive or not sensitive enough.



  • Whenever I start a print, I get stall warnings during the homing process.
    If I start the homing by clicking on the button in DWC, I do not get these warnings.



  • That's interesting. I can't think of why that would be.



  • Well, but that's the way it is. 100% reproducible.



  • Can you post your homing files?



  • This is the code used to home:

    ; homeall.g
    ; called to home all axes
    ;
    ; generated by RepRapFirmware Configuration Tool on Fri Feb 02 2018 20:19:38 GMT+0100
    G91 ; relative positioning
    G1 S2 Z5 F6000 ; lift Z relative to current position
    G1 S1 X-235 Y-230 F1800 ; move quickly to X or Y endstop and stop there (first pass)
    ;G1 S1 X-235 ; home X axis
    ;G1 S1 Y-235 ; home Y axis
    G1 X5 Y5 F6000 ; go back a few mm
    G1 S1 X-235 F360 ; move slowly to X axis endstop once more (second pass)
    G1 S1 Y-235 F360 ; then move slowly to Y axis endstop
    G1 S1 Z-255 F1800 ; move Z down stopping at the endstop

    M564 H0 S0 ; Allow moving unhomed axes
    M906 Z5 ; Set Z motor current to some mA
    G1 S0 V-10 ; Move Z down with little force to even the axis out
    M18 Z ; Disable the stepper motors for Z
    G4 S0.1 ; Wait 0.1 second
    M906 Z900 ; Set Z motor current back to 900mA
    M564 H1 S1 ; prevent unhomed axes from moving

    G90 ; absolute positioning
    G92 Z0 U0 V0 ; zero position for Z, U(Z1) and V(Z2)

    G1 Z10 F1800 ; uncomment this line to 0lift the nozzle after homing


  • administrators

    @garv3 said in Stall detection on Z still not working!:

    M906 Z5 ; Set Z motor current to some mA
    G1 S0 V-10 ; Move Z down with little force to even the axis out
    M18 Z ; Disable the stepper motors for Z

    I presume you have warn-on-motor-stall enabled. You are deliberately stalling the Z motor in that move. You could use M915 V R0 to disable warning on stall detect before that move, and M915 V R1 afterwards.



  • The problem is not that I get the warning. I want the warning to pop up. The problem is that I get the warning only when printing gcode files. I want it to pop up when using DWC too. Otherwise using stall detection for homing will not work for DWC.


  • administrators

    You don't need to have warnings pop up when using stall detection for homing; although having warnings appear may help while you are tuning the stall detection threshold.

    Warning messages that are not associated with a particular command should appear on all input devices. If they are not appearing in DWC, maybe this is connected with your DWC user interface settings. Have you checked whether they are shown on the GCode Console page of DWC?



  • I know the messages are not necessary for the homeng after tuning but I need them to tune the detection and therefore I want to use them.
    They do not appear in the console when using DWC to home. When printing a file, they pop up and are logged in the console.
    Additionally I cannot be sure stall detection will work if I do not get messages. I cannot try it before I know it works.


  • administrators

    The easiest way of getting warning that I can think of is to put the commands you want to test in a GCode file and print it. However, when I was testing stall detection endstops, I didn't find any need to do this. If the stall detection is working then the homing move stops when the tower or axis reaches the hard stop. If it tries to keep going, then stall detection isn't working. You should use reduced current when homing with stall detection anyway, to make sure that the motor does stall instead of the belt jumping on the pulley.


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.