Automatic Z trigger height calibration
-
First of all: Hi, I'm new here!
I just got my Duet Wifi, and I'm in the process of setting everything up.
Right now I'm using an inductive probe and therefore have to set the trigger height using G31.
I've been working on a way to automatically find the correct trigger height using a quite simple method:1 - Get a thin metal plate (I'm using a part of a blank PCB), connect it to the Z sensor pin (together with the inductive sensor) and mount it on the bed at a place where you won't print (or use a servo to move it into place)
2 - Connect the hotend to ground (I'm connecting it to one of the fins on my E3D V6), which will also ground the nozzle
3 - Reset the Z trigger height using G31
4 - Probe the plate using the inductive sensor with G30, which sets the probed height to Z=0
5 - Probe the plate using the nozzle (when the nozzle touches the plate the Z sensor signal is lowered to GND) with G30 S-1, which returns the difference between the inductive sensor and the nozzle
6 - Fill the returned value into G31 manuallyThis is the macro that I'm using:
G31 X-12 Y28 Z0 ; Reset probe location
G1 Z10 F1000 ; Lower bed
G1 X280 Y152 F10000 ; Move to inductive probe position
G30 F100 ; Raise bed, stop when probe triggered
G1 Z10 F1000 ; Lower bed
G1 X268 Y180 F10000 ; Move to contact probe position
G30 S-1 F100 ; Raise bed, stop when probe triggered
G1 Z10 F1000 ; Lower bedWhile I'm quite happy with this already, I'd really like to automate step 6. So what I want is something like the following at the end of the macro:
G31 X-12 Y28 ZA
Where A is the value returned by step 5.Edit:
Alternatively the nozzle could first be probed, and Z set to 0, followed by a probe using the inductive sensor, which will stop at the trigger height. Would it then be possible to set the current Z to the trigger height, similar to G92?Is there any way that I can do that or something similar?
-
G30 S-3 will probe the bed and set the Z probe trigger height to the height at which the probe stops. After that, M500 P30 will save a pile of parameters to config-override.g including the Z probe parameters.
-
@dc42 said in Automatic Z trigger height calibration:
G30 S-3 will probe the bed and set the Z probe trigger height to the height at which the probe stops. After that, M500 P30 will save a pile of parameters to config-override.g including the Z probe parameters.
Thank you for your reply, but it doesn't seem to work. This is the macro I'm using:
G31 X-12 Y28 Z0 ; Reset probe height
G1 Z10 F1000 ; Lower bed
G1 X280 Y152 F10000 ; Move to inductive probe position
G30 F100 ; raise bed, stop when probe triggered, set Z=0
G1 Z10 F1000 ; Lower bed
G1 X268 Y180 F10000 ; Move to contact probe position
G30 S-3 F100 ; raise bed, stop when probe triggered
G1 Z10 F1000 ; Lower bed
M500 P30 ; Store parametersIf I then look at config-override.g I get:
G31 T1 P50 X-12.0 Y28.0 Z0.00
But Z should be around -2 mm (which is returned I get when I use G30 S-1 instead of G30 S-3). -
Nevermind, my firmware wasn't up to date. It's working now. Thanks!