Question about M564



  • My duet is driving a 1000x1000 workbee cnc and I'm having some issues with homing. I had an M564 command in my config file which allowed me to drive the machine without having to home it to allow me to home the machine earlier but since taken the command out. Before taking M564 S0 H0 out of config, I was able to home everything individually and home all successfully. No, my machine will home Z, but not X, Y, or All. Additionally, it will not home all even if I have everything commented out except for the Z moves (which was proven to work with homing Z alone).

    The machine's max area is X770 Y800 Y94. The errors I'm getting is a "G28 G0/G1 target position outside machine limits". I'm wondering if I were to put an M564 S0 H0 command at the beginning of homeall.g and M564 S1 H1 command at the end of homeall.g, will it turn off soft limits during homing sequence then turn soft limits back on when its finished? Does anyone have any other possible solutions to my issue?



  • probably better to post your home file(s) and get the appropriate G0 moves with H1 set. (i suppose we'd need the M574 and M208 config(s) as well to verify)



  • Yes, please post your files. config.g and home-.g

    It should never be necessary to turn off limits, or turn on "move without homing", to home. Getting axis limit definitions right, and the content of the various homex.g files, homing will work on (almost) any setup, without changing those.



  • @Danal I'm at work so give me a few hours to provide them. Do you want me to give the files or is copy/paste enough?



  • Either way. If you do copy paste, please put three backticks on a line by themselves at the start/end of the paste.

    This

    ```
    some text
    more text
    ```

    Does this

    some text
    more text
    


  • @Danal I'm gonna test this since I never done that before

    test line 1
    test line 2
    

    That is cool! Okay, I'll be back in a few hours with the routines. I'll tag you. Thanks.



  • @Danal I'm giving you my config.g, customconfig.g, homex.g, homey.g, homez.g, and homeall.g.

    config.g

    ; Configure Drives
    M569 P0 S0 ; Drive 0 goes forwards
    M569 P1 S1 ; Drive 1 goes forwards
    M569 P2 S0 ; Drive 2 goes forwards
    M569 P3 S1 ; Drive 3 goes forwards                        
    M584 X0 Y1:3 Z2 ; Apply drive mapping to axes
    
    
    ; Configure Axes
    M92 X400 Y400 Z400 ; Set steps per mm
    M350 X16 Y16 Z16 I1 ; Configure microstepping
    M566 X500 Y500 Z500 ; Set maximum instantaneous speed changes (mm/min)
    M203 X2500 Y2500 Z2500 ; Set maximum speeds (mm/min)
    M201 X150 Y150 Z150 ; Set accelerations (mm/s^2)
    M906 X2400 Y2400 Z2400 I100 ; Set motor currents (mA)
    
    
    ; Configure Axis Limits
    M208 X0 Y0 Z0 S1 ; Set axis minima
    M208 X800 Y770 Z94 S0 ; Set axis maxima
    
    
    ; Configure Endstops
    M574 X2 Y2 Z2 S0 ; Set active low endstops
    
    
    ; Other Settings
    M140 H-1 ; Disable heated bed
    M564 S1 H1 ; Disable jog commands when not homed
    M911 S21.0 R23 P"G91 G1 Z3 F1000" ; Configure power loss resume
    M501 ; Load Stored Parameters 
    M98 Pcustomconfig.g ; Execute custom config settings
    

    customconfig.g

    ; ADD ANY CUSTOM SETTINGS BELOW
    
    ; Configure Drives
    M569 P0 S0 ; Drive 0 (X) goes forwards
    M569 P1 S1 ; Drive 1 (Y1) goes forwards
    M569 P2 S0 ; Drive 2 (Z) goes forwards
    M569 P3 S1 ; Drive 3 (Y2) goes forwards        
    
    ; Configure Axis
    M906 X1000 Y1000 Z1000 I100 ; Set motor currents (mA)
    
    ; Configure Endstops
    M574 X2 Y2 Z1 S1 ; Set active high endstops
    

    homex.g

    ; homex.g
    ; called to home the X axis
    
    G91 ; relative positioning
    G21 ; Set units to mm
    G1 H1 Z94 F900 ; move quickly to Z axis endstop and stop there (first pass)
    G1 Z-3 F2400 ; go back a few mm
    G1 H1 Z94 F300 ; move slowly to z axis endstop once more (second pass)
    G1 H1 X1500 F2400 ; move quickly to X and Y axis endstops and stop there (first pass)
    G92 X800 Z94 ; Set Home Position please - to your machine size.
    G1 X-3 F2400 ; go back a few mm
    G1 H1 X1500 F300 ; move slowly to X and Y axis endstops once more (second pass)
    G92 X800 Z94 ; Set Home Position please - to your machine size.
    G90 ; absolute positioning
    

    homey.g

    ; homey.g
    ; called to home the Y axis
    
    G91 ; relative positioning
    G21 ; Set units to mm
    G1 H1 Z94 F900 ; move quickly to Z axis endstop and stop there (first pass)
    G1 Z-3 F2400 ; go back a few mm
    G1 H1 Z94 F300 ; move slowly to z axis endstop once more (second pass)
    G1 H1 Y1500 F2400 ; move quickly to X and Y axis endstops and stop there (first pass)
    G92 Y770 Z94 ; Set Home Position - change to your machine size.
    G1 Y-3 F2400 ; go back a few mm
    G1 H1 Y1500 F300 ; move slowly to X and Y axis endstops once more (second pass)
    G92 Y770 Z94 ; Set Home Position - change to your machine size.
    G90 ; absolute positioning
    

    homez.g

    ; homez.g
    ; called to home the Z axis
    
    G91 ; relative positioning
    G21 ; Set units to mm
    G1 H1 Z94 F1500 ; move quickly to Z axis endstop and stop there (first pass)
    G92 Z94 ; Set Home Position - change to your machine size.
    G1 Z-3 F2400 ; go back a few mm
    G1 H1 Z94 F300 ; move slowly to X axis endstop once more (second pass)
    G92 Z94 ; Set Home Position - change to your machine size.
    G90 ; absolute positioning
    

    homeall.g

    ; homeall.g
    ; called to home all axes
    
    G91 ; relative positioning
    G21 ; Set units to mm
    G1 H1 Z94 F900 ; move quickly to Z axis endstop and stop there (first pass)
    G1 Z-3 F2400 ; go back a few mm
    G1 H1 Z94 F300 ; move slowly to z axis endstop once more (second pass)
    G1 H1 X1500 Y1500 F2400 ; move quickly to X and Y axis endstops and stop there (first pass)
    G92 X800 Y770 Z94 ; Set Home Position - change to your machine size.
    G1 X-3 Y-3 F2400 ; go back a few mm
    G1 H1 X1500 Y1500 F300 ; move slowly to X and Y axis endstops once more (second pass)
    G92 X800 Y770 Z94 ; Set Home Position please change to your machine size.
    G90 ; absolute positioning
    


  • G1 Z-3 F2400 ; go back a few mm

    as the second line needs H1 or H2 depending on what you want to achieve. In general you want to home z first and avoid it in the first place i think



  • Several things to clean up before we solve the real problem:

    @Perseveranze said in Question about M564:

    G1 H1 X1500 Y1500 F2400 ; move quickly to X and Y axis endstops and stop there (first pass)

    These should be separated (even if this statement works).
    AND, every move in home.g should have H1 or H2 in it, even if we don't expect it to hit the switch. (the -3 move)
    G1 H1 X1500 F2400
    G1 H1 X-3 F2400
    G1 H1 X1500

    G1 H1 Y1500 F2400
    G1 H1 Y-3 F2400
    G1 H1 Y1500

    @Perseveranze said in Question about M564:

    G92 X800 Y770 Z94 ; Set Home Position please change to your machine size.

    All the G92 should go away completely. If that results in the coordinate being off after homing, we will fix that a different way.

    @Perseveranze said in Question about M564:

    M564 S1 H1 ; Disable jog commands when not homed

    This also should not be present, or more specifically, if there are any H0 commands anywhere else, they should go away.

    Try that, and see if it homes at all. Again, if it homes but coordinates are wrong, we will fix that a different way.



  • Oh, and it looks like your limit switches on X and Y are at max, correct?



  • @Danal I'll start working at editing my files right away, and yes, I home at max



  • @Danal Everything works as intended now!

    Thank you so much guys!


Log in to reply