Stall homing - Works but fails if machine has already been homed



  • As the title states I am seeing an issue where my stall homing on my x and y axis is working great. But if I try to home the machine when it already has been homed, the stall detection appears to be disabled.

    Any ideas? Or am I just overlooking something in my code?

    my homeall.g script is below:

    [[language]]
    ; homeall.g
    ; called to home all axes
    ;
    M400			; make sure everything has stopped before we make changes
    M913 X50 Y50	; drop motor currents to 50%
    M915 X Y S3 R0 		; set sensitivity to +3 unfiltered
    G91			; use relative positioning
    G1 S1 X-400  F6000	; move X all the way left and stop at end
    G1 X16			; move to edge of glass
    G92 X0			; set X0 at edge of glass
    G1 S1 Y-400  F6000	; move Y all the way left and stop at end
    G1 Y42			; move to edge of glass
    G92 Y0			; set Y0 at edge of glass
    G1 X195 Y195		; go to back center of bed for measurement			; probe bed to set z0
    G30 Z			; probe bed
    G29 S1			; load heightmap
    G90			; back to absolute positioning
    M400			; make sure everything has stopped before we reset the motor currents
    M913 X100 Y100 Z100 	; motor currents back to 100%
    M574 X1 S0 		; redefine active low and unused microswitches
    M574 Y1 S1 		; redefine active low and unused microswitches
    

  • Moderator

    @Fickert Do you set M574 X1 S3 and M574 Y1 S3 in config.g? Because you switch to mechanical endstops at the end of your script, but don't switch to stall detection at the beginning! So the next time around it's looking for mechanical endstops.

    Which firmware version? Because M574 ... S0 isn't supported in RRF3.

    Ian


  • administrators

    When using stall homing, before the first G1 H1 (or G1 S1) move on each axis you should always back off the motor(s) by at least a full step (or 4 full steps if you use the F1 parameter in M915) using a G1 H2 move. That handles the case of the drivers already reporting that they are stalled.

    But I think @droftarts has given the more important reason why it isn't working for you.



  • This is my home all that works perfect

    ; homeall.g

    ; Endstops
    M574 X1 S3 F0 R0 ; Set active High endstops (S1=SENSORED) (X-MIN(1)) (S3=SENSORLESS)
    M574 Y2 S3 F0 R0 ; Set active High endstops (S1=SENSORED) (Y-MIN(1)) (S3=SENSORLESS)
    M915 X Y S3 R0 F0 ; set X and Y to sensitivity 5, do nothing when stall, unfiltered
    M400

    M201 X500 Y500 Z50:50 E500 ; Set accelerations (mm/s^2) 500,500

    ;Home Y First
    M400 ; make sure everything has stopped before we make changes
    M913 X50 Y50 ; reduce motor current to 50% to prevent belts slipping
    G91 ; relative positioning
    G1 Z5 F4800 S2 ; lift Z relative to current position
    G4 P500 ; wait 500msec
    G1 S1 Y430 F4800 ; move quickly to X or Y endstop and stop there (first pass)
    G4 P500 ; wait 500msec
    G1 Y-10 ; Move Away 20mm X axis
    G4 P500 ; wait 500msec
    ;G1 Z-5 F6000 S2 ; lift Z relative to current position
    ;G90 ; absolute positioning
    ;M400 ; make sure everything has stopped before we reset the motor currents
    ;M913 X100 Y100 ; motor currents back to normal

    ; Home X Second
    M400 ; make sure everything has stopped before we make changes
    ;M913 X50 Y50 ; reduce motor current to 40% to prevent belts slipping
    ;G91 ; relative positioning
    ;G1 Z5 F4800 S2 ; lift Z relative to current position
    ;G4 P500 ; wait 500msec
    G1 S1 X-305 F4800 ; move quickly to X or Y endstop and stop there (first pass)
    G4 P500 ; wait 500msec
    G1 X10 ; Move Away 10mm X axis
    ;G4 P500 ; wait 500msec
    ;G1 Z-5 F6000 S2 ; lift Z relative to current position
    G90 ; absolute positioning
    M400 ; make sure everything has stopped before we reset the motor currents
    M913 X100 Y100 Z100 ; motor currents back to normal

    G1 X150 Y150 F6000 ; go to first bed probe point and home Z
    G30 ; home Z by probing the bed
    ;M915 P0 S4 R0 F1 H300
    ;M915 P1 S4 R0 F1 H300
    ;Stall Detection
    M915 X Y S5 F0 H400 R4700 ; X / Y Axes

    ;M201 X2000 Y2000 Z100 E9000
    M566 X600 Y600 Z24 E500 ; Set maximum instantaneous speed changes (Jerk) (mm/min)
    ;M203 X20000 Y20000 Z500 E3600 ; Set maximum speeds (mm/min)
    ;M201 X3000 Y3000 Z200 E1000 ; Set accelerations (mm/s^2)

    ;testing
    ;M566 X400 Y400 Z8 E2 ; Set maximum instantaneous speed changes (mm/min)
    M203 X35000 Y35000 Z1200 E5000 ; Set maximum speeds (mm/min)
    M201 X6000 Y6000 Z400 E2500 ; Set accelerations (mm/s^2)



  • @droftarts I do not have my config.g infront of me, but I am pretty certain that the m574 X1 Y1 S3 is in there, will need to double check when I get home.

    As for firmware I am still on 2.05 I believe. I haven't had good luck with betas back in 1.18 and 1.19 so I stay away from betas anymore.

    Thanks for the obvious call out though! clearly after my script is ran it defaults to mechanical endstops, and since I don't call back the stall detection (m574...S3) it is still thinking I am running mechanical switches.

    To be honest I was having a heck of a time getting this to work and was modifying copied scripts I was finding in the forums. Something I totally missed.

    @dc42 I usually manually move the gantry but I should just put it in the start of the homing script, save me the hassle. Thanks!

    @Benny Thanks for uploading your script. May I ask, is there any specific reason you have the G4 command there?



  • Quick update, I removed the M574 commands at the end of the script for homeall.g

    Still didn't work. So I looked around in my config.g and I do have M574 X Y S3, but I also had my endstops programmed as "M574 X2 Y2 S3" which I think puts the endstops at max correct? So I changed that to "X1" and "Y1" and seems to be fixed. Small mistake from messing around with the stall homing apparently.


Log in to reply