Conditional homing and z-height fine adjustment
-
@GuidoP said in Conditional homing and z-height fine adjustment:
- Homing is initiated. X and Y homing will initiate (in the default g-code) a Z move in the z-max direction. Regardless if z-max or z-min is used
If it moves in the Z max direction when using Z min end stop then something is wrong. It should not do that.
Frederick
-
@fcwilt said in Conditional homing and z-height fine adjustment:
If it moves in the Z max direction when using Z min end stop then something is wrong. It should not do that.
Maybe he means the small lift before homing x and y for clearance?
-
@Phaedrux said in Conditional homing and z-height fine adjustment:
Maybe he means the small lift before homing x and y for clearance?
What small lift? I must do things backwards. I home Z first and then move to Z=5 before I home Y & X.
Frederick
-
@fcwilt For instance in homeall.
G1 Z5 F100 S2 ; Lower bed 5mm to ensure it is below the trigger height
-
@Phaedrux said in Conditional homing and z-height fine adjustment:
@fcwilt For instance in homeall.
G1 Z5 F100 S2 ; Lower bed 5mm to ensure it is below the trigger height
What would you do that?
Consider when homing to Z min:
G1 Z-999 H1
G1 Z20
G1 Z-999 H1When the first G1 executes if the endstop is already triggered no movement takes place and the next G1 executes which is safe.
Am I overlooking something?
Frederick
-
@fcwilt said in Conditional homing and z-height fine adjustment:
Am I overlooking something?
Yes, when using a probe you must position the probe first, so X and Y must be homed first, and by default the configurator includes a short lift of the Z axis to give clearance for the X Y move and to lift the probe above trigger height.
But I was just speculating on what he might have been meaning.
-
@Phaedrux said in Conditional homing and z-height fine adjustment:
Yes, when using a probe you must position the probe first, so X and Y must be homed first, and by default the configurator includes a short lift of the Z axis to give clearance for the X Y move and to lift the probe above trigger height.
Ah... I see.
I use a Z min endstop switch setup for homing in relation to the frame so I never encountered that issue.
I only use the Z probe for setting Z=0 and mesh comp probing, things which only occur after the ZYX homing has been done.
Thanks.
Frederick
-
@Phaedrux said in Conditional homing and z-height fine adjustment:
@fcwilt said in Conditional homing and z-height fine adjustment:
If it moves in the Z max direction when using Z min end stop then something is wrong. It should not do that.
Maybe he means the small lift before homing x and y for clearance?
Thats correct
-
Thanks all for the input, but unfortunately it does not bring me closer to an answer to the original question: Why does the conditional gcode not work as intended? Where is the bug in the code??
-
I finally got the macro working with following code:
; Source: https://forum.duet3d.com/topic/4202/homing-to-z-max-when-also-using-a-z-probe/19 ; Start g-code: G28, M98 P"0:/macros/Leveling/SetZ" ; run z fine tuning ; If the printer hasn't been homed, home it ;M291 P"checking homing status" R"Homing status" S1 ; Report status if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed ; Check if axis are not homed ;If axis are not homed, home axis echo "Axis are not homed, performing homing" M98 P"0:/sys/homeall.g" else ;If axis are already homed, home only the X and Y axis echo "axis are homed, re-homing x and Y" M98 P"0:/sys/homex.g" ; Run the Home X macro M98 P"0:/sys/homey.g" ; Run the Home Y macro ;G1 X100 Y100 H0 F1800 ; move to be centre slowly. ;End homeing check M291 P"Axis homed" R"Homing status" S1 ; Report status ;echo "start fine tuning z-level" G1 X100 Y100 H0 F1000 ; move to be centre slowly. G1 Z15 H1 F8000 ; Raise the bed to start probing G30 ; probe for z=0 G1 Z10 H1 F1000 ; raise nozzle G30 S-1 ; check z gap G1 Z10 H1 F1000 ; raise nozzle M400 ; Wait until all moves are completed
I changed and tested several different thing, but i think the trick that did it was removing the empty line between the end of the "If" block and the start of the "else" block.