Homing using additional Z max stop switch with a Duet2 WiFi
-
Currently I normally home the Z axis using a BL Touch but for the resurrection function this cannot be done due to the print still sitting on the bed; then in this particular case the bed should move downwards (CoreXY) until the max Z stop switch is reached.
(The resurrection function executes ressurect.g and ressurrect-prologue.g when the power comes back after a power outage and since axes might have moved relative to last executed move, they must be homed in presence of the print piece prior to continueing the print job).
Is it possible to configure a max Z stop switch additionally to the BL Touch to home the Z axis just for this case? To set the correct current position, the offset of both possible home positions of Z should be known and considered. But what about the connection?
-
@Triet yes configure a Z max endstop and leave the BL touch configured as a probe.
e.g.
M574 Z2 S1 P"io3.in" ; configure switch-type (e.g. microswitch) endstop for high end on Z via pin io4.inYou set the M208 value to be correct for the endstop position on Z max. its worth being accurate with this offset and use the BL touch as a z probe to confirm the distance. the more accurate you are the less of an artifact you will have for the slight variation in the Z home position and the probed bed Z0
-
@T3P3Tony said in Homing using additional Z max stop switch with a Duet2 WiFi:
yes configure a Z max endstop and leave the BL touch configured as a probe.
Thanks!!!
Actually, there is a dedicated connection for Z endstop on the Duet2 WiFi board (I was not aware because never used it). So no problem with the connection itself - I just need to install an endstop switch at the max Z position (when the bed is at its physically lowest position).I currently have in my config.g:
M574 Z1 S2 ; Set endstops controlled by probeThen I would expect Z homing to work controlled by probe as usual, but in case I need to home using the max Z endstop, then I would command the movement towards max Z (and repeat slowly) in the resurrect-prologue.g file. At this point I am unsure what to do: If the max Z endstop triggers, will this position be automatically seen as the Z home position?
If yes: Then this is the zero Z coordinate and I just need to reset the Z coordinate to my known offset (I assume that I have to first move to the offset position and then say "this is zero now").
If no: What can I do then? How is this max Z endstop position interpreted? My question is based on the assumption that there is only one way to set the Z zero coordinate. Am I wrong? -
@Triet said in Homing using additional Z max stop switch with a Duet2 WiFi:
M574 Z1 S2 ; Set endstops controlled by probe
What I mean is, if I have both lines in the config.g:
M574 Z1 S2 ; Set min endstop controlled by probe
M574 Z2 S1 P"zstop" ; Set max high endstop for Z via microswitchwhich one will be "authoritative" in order to define Z home? Or are both able to do that?
When using the command "G28 Z", will the bed move upwards to the BL Touch or downwards to the endstop switch?
-
@T3P3Tony said in Homing using additional Z max stop switch with a Duet2 WiFi:
its worth being accurate with this offset and use the BL touch as a z probe to confirm the distance. the more accurate you are the less of an artifact you will have for the slight variation in the Z home position and the probed bed Z0
Re-reading your post, I understand that there should be no discrepance between those positions, which brings me to the idea to use a more reliable endstop type for max Z. Perhaps an optical one. Because even using a "correct" value in M208, the switch might trigger slightly differently. I cannot confirm the position using BL Touch as a Z probe at resurrection time, because the print is still on the bed.
-
@Triet said in Homing using additional Z max stop switch with a Duet2 WiFi:
When using the command "G28 Z", will the bed move upwards to the BL Touch or downwards to the endstop switch?
That will depend entirely on what you have in homez.g
In my case, I use a probe to home to Z0 in homeall.g by using G30. In homez.g I use a G1 H1 Z+ move to home to the zmax endstop.
So in your resurrection files when you need to home the axis, you would call G28 X Y Z separately rather than G28 to call homeall.g
I have a set of macros I use to measure the exact distance from the probe determined Z0 position to the zmax endstop position.
This one allows me to set the optical endstop trigger to exactly 300mm by adjusting the flag.
; 0:/macros/Bed Leveling/0_Set Zmax height.g ; Automates measuring the Zmax height for optical endstop at ~300mm ; M291 P"This will set Z0 and calibrate Zmax height" R"Proceed?" S3 M291 P"Homing all axis" T5 G28 ; Home all G90 ; Absolute positioning M98 P"0:/macros/0_Center Nozzle.g" ; Move nozzle to bed center M291 P"Adjust nozzle height until it's touching bed" Z1 S3 G92 Z0 ; set Z0 M291 P"Bed will now drop to Z300" S3 G1 Z300 ; Move bed down 300mm G1 S3 Z300 F200 M500 ; save m208 value for z axis to config override M291 P"Adjust optical endstop flag until light just turns off" R"Set Zmax=300mm" S3 M291 P"ZMax homing will now be tested, starting with homing Zmin" S3 M291 P"Homing to Zmin" T5 G28 Z M291 P"Ready to test Zmax homing?" R"Proceed?" S3 M291 P"Homing to Zmax" T5 M98 P"0:/macros/2_HomeZMax.g" ; Test Zmax homing M291 P"ZMax homing test complete. Printer will now home all." R"Proceed?" S3 G28 ; Home all M291 "ZMax calibration complete." S3
This one measures the actual distance to the endstop and sets the M208 Z axis length accordingly.
; 0:/macros/Bed Leveling/0_Measure Zmax trigger.g ; Automates measuring the Zmax trigger for optical endstop at 305mm ; M291 P"This will set Z0 and calibrate Zmax height to 305mm" R"Proceed?" S3 M291 P"Homing all axis" T5 G28 ; Home all G90 ; Absolute positioning M291 P"Bed will now drop to Z305" S3 G1 Z305 ; Move bed down 305mm M291 P"Adjust optical endstop flag until light just turns off" R"Set Zmax=305mm" S3 M291 P"ZMax homing will now be tested, starting with homing Zmin" S3 M291 P"Homing to Zmin" T5 G28 M291 P"Ready to test Zmax homing?" R"Proceed?" S3 M291 P"Homing to Zmax" T5 G1 Z350 H3 F400 ; home to z max and set the trigger height as the M208 Z maxima M500 ; save the measured M208 Z maxima to config-override.g M291 P"ZMax homing test complete. Printer will now home all." R"Proceed?" S3 G28 ; Home all M291 P"ZMax calibration complete." S3
-
@Triet yes, however a good mechanical switch can be extremely relatable
-
@Phaedrux said in Homing using additional Z max stop switch with a Duet2 WiFi:
I have a set of macros I use to measure the exact distance from the probe determined Z0 position to the zmax endstop position.
Your macros have sent me to read the RRF documentation. I understood what they do and will definitely use them, although perhaps changing the commands G1 Sx to G1 Hx:
" S parameter sets laser power with range of 0-255 when M452 Laser mode set, otherwise ignored. "I also understood how homing can be implemented to achieve my goal, thanks a lot.