Hello!
I made a lever that a servo motor can rotate above the plane of the bed. At the end of this arm, there is a small wire brush that wipes off the melted material from the nozzle, and behind the brush is a small metal cylinder under which there is a microswitch push button (Voron SexBolt endstop).
The plan is that with this tool, the machine can measure the exact Z distance of the tip of the nozzle, so that in the event of a possible nozzle replacement/hotend replacement/head replacement, it always automatically knows at what height the nozzle tip is.
According to my plans, the implementation would take place as follows:
1.: The servo raises the arm.
2.: Move the probe of BL-touch over the microswitch in X-Y.
3.: Homeing on Z axis, i.e. measures the Z position of the upper surface of the cylinder above the microswitch and resets itself to it. (As if we wanted to print on the push button.)
4.: He wipes his nose on the wire brush, so that no molten material remains on it, which would prevent accurate measurement.
5.: Moves the nozzle over the microswitch in X-Y.
6.: Slowly start to raise the bed, as well as the servo arm and the push button on it, until the microswitch is pressed. Practically, it is homeing only now not with the BL-touch but with the microswitch.
7.: The two Z values (the one with BL-touch and the one with microswitch) are subtracted from each other and saved by Klipper as “z_offset” in the [bltouch] section.
The problem with this is that I don’t know if it is possible or how to make it home once with BL-touch and once with endstop. For this, the configuration settings on the machine should be changed while it is running. Is this even possible?
The other question is that if you first homeing with the BL-touch and then somehow also with the microswitch, then I will not have two measured values, since all that happens (I think) is that the BL-touch is overwritten during the new homeing measurement result obtained with. That is, perhaps it would be more necessary to not perform real homing on the microswitch with the tip of the nose, but to slowly raise the stage and as soon as the microswitch switches to stop and save the current Z value.
I wrote a macro in Klipper with a cycle that raises the bed by 0.005mm and then checks if the microswitch is switched on. If not, raise it further and look again. If the button is on, save the Z value and exit the cycle. But I found out that, unfortunately, Ninja2 only evaluates the parameters when the macro is called, so it doesn’t work.
Even if all this is in place, it must be resolved that the z_offset value of the [bltouch] section in the configuration should be a variable that is sometimes overwritten by the machine itself with such measurements, and loaded by itself when Klipper starts.
There is this Klipper mod:
https://github.com/protoloft/klipper_z_calibration
This might be right for me, but the more I read, the less sure I am.
So, unfortunately, I don’t really know how to write macros and Klipper yet. Can anyone help me implement the above? ![
(On the video, BL-touch does not work yet.)