Home All, XY in the same command?
-
I'm looking through examples and see people are issuing three G1 commands for a single move, can't this be done in a single command?
This is my config, will it work or do I need to adjust to the code below?
M98 P"0:/sys/motors_low_speed.g" ; decrease motor speed and current G91 ; relative positioning G1 H2 Z5 F6000 ; lift Z relative to current position G1 H1 X-625 Y605 F1800 ; move quickly to X and Y axis endstops and stop there (first pass) if result != 0 abort "Error during fast XY axis homing - process cancelled" G1 X5 Y-5 F600 ; go back a few mm G1 H1 X-625 Y605 F360 ; move slowly to X and Y axis endstops once more (second pass) if result != 0 abort "Error during slow XY axis homing - process cancelled" G90 ; absolute positioning G1 X{global.Bed_Center_X - sensors.probes[0].offsets[0]} Y{global.Bed_Center_Y - sensors.probes[0].offsets[1]} F1800 G30 ; home Z by probing the bed M98 P"0:/sys/motors_default_speed.g" ; reset motor speed and current
Some examples do this, but the two last commands seam redundant too me?
G1 H1 X-625 Y605 F1800 ; move quickly to X and Y axis endstops and stop there (first pass) G1 H1 X-625 F1800 ; move quickly to X and Y axis endstops and stop there (first pass) G1 H1 Y605 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
-
@Reine said in Home All, XY in the same command?:
Some examples do this, but the two last commands seam redundant too me?
G1 H1 X-625 Y605 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 H1 X-625 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 H1 Y605 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)This pattern is specific to CoreXY machines. On those machines, when either the X or the Y endstop is hit, the move is terminated because both motors need to be stopped. So either X or Y will have been homed; hence the other two lines.
On a Cartesian machine only the first line is needed.
-
@dc42 ahh makes sense, this CoreXY stuff is new too me, also RRF. Thank you for explaining.
-
@dc42 hang on, so why is the first command needed or isn't it?
Would it be enough doing:
G1 H1 X-625 F1800 G1 H1 Y605 F1800
Or do I have to run all three?
G1 H1 X-625 Y605 F1800 G1 H1 X-625 F1800 G1 H1 Y605 F1800
-
@Reine you could omit the first command. Including it makes homing faster, because both axes will move towards the endstop at the same time until one of them has reached its endstop.
-
@Reine ahh that makes sense, good to know thank!
With three commands like that, does my
if result != 0
work as "expected" or will it only look at the outcome of the last command? -
@Reine the result is the outcome of the last command.