BLtoch trigger event for sanity check
-
Hi guys,
I want to use a BLtouch for a sanity check, to check if there is a tool mounted on the Y axis or not.
The Bltouch is mounted to the removable tool and I use TMC2209's on a STM based board running on a SBC. Sensorless homing is activated and working.
The sanity check should looks like this:
- Home Axis (in my case the Y axis)
- If sensorless homing triggers --> abort homing process and print an error message "No tool mounted, please mount tool before proceeding"
- If the BLtouch triggers --> finish homing
I want to normally home sensorless and if the BLtouch is triggered do something with a trigger event (M581?).
My problem now is that I can't get a reading from the BLtouch. I did some research and found that it is not working as a switch. It sends a pulse when it is triggered.
Is there a way to read that pulse and use it with meta gcode commands to use this as a trigger event?Thanks in advance!
-
@semi55 you could configure it as a zprobe. Then you can query the zprobe reading from the object model. Not sure what the actual code would be off the top of my head though
You would have to deploy the bltouch pin though with M401, then retract it after -
@engikeneer Thanks for your comment, sry I did not mention that I’ve already setup the BLtouch as Z-probe.
I've tested your recommendation.
First, I’ve tested the code for the "zProbeAsEndstop" object model:This is my test macro:
G91 ;relative positioning M564 H0 ;allow movement without homing G1 H2 Y-15 X15 F10000 ;lift y relative to current position M401 ;deploy probe G1 H1 Y-285 F2400 ;move Y down until BLTouch is triggered ;check status of Bltouch if sensors.endstops[1].triggered == true M291 P{" Probe triggered"} S1 G1 Y4 F30000 ;Backoff 3mm else M291 P{" Not recognized"} S1 G1 Y4 F30000 ;Backoff 3mm
Second test was the probe value itself:
This is the second test macro:
G91 ;relative positioning M564 H0 ;allow movement without homing G1 H2 Y-15 X15 F10000 ;lift y relative to current position M401 ;deploy probe G1 H1 Y-285 F2400 ;move Y down until BLTouch is triggered ;check status of Bltouch if sensors.probes[0].value[0] > 0 M291 P{" Probe triggered"} S1 G1 Y4 F30000 ;Backoff 3mm else M291 P{" Not recognized"} S1 G1 Y4 F30000 ;Backoff 3mm
Unfortunately, I always get "Not recognized" as message
-
-
@fcwilt because I use the BLtouch also for leveling purposes and I want to make use of this sensor as it is already mounted on the tool.
-
@semi55 said in BLtoch trigger event for sanity check:
@fcwilt because I use the BLtouch also for leveling purposes and I want to make use of this sensor as it is already mounted on the tool.
If you are using it for leveling purposes how will it trigger when moving the Y axis?
Frederick
-
@fcwilt I am using it on a belt printer with a tilted 45 degree axis, so the leveling happens on the Y-Axis
-
@semi55 said in BLtoch trigger event for sanity check:
@fcwilt I am using it on a belt printer with a tilted 45 degree axis
Interesting.
-
@semi55 I'm having the same problem with the probe value. After a major crash, putting together a BlTouch self-check macro. No matter what, I can't get the value to change unless the BlTouch is in the alarm mode.
-
@brainiac27 said in BLtoch trigger event for sanity check:
@semi55 I'm having the same problem with the probe value. After a major crash, putting together a BlTouch self-check macro. No matter what, I can't get the value to change unless the BlTouch is in the alarm mode.
The value is changing but you are likely not going to be able to catch that change as it is quickly cleared.
Frederick
-
@brainiac27 That is exactly what I've done right now as a work around. I let the BLtouch enter the alarm mode and use that as a trigger event for further commands.
-
@fcwilt Thanks for pointing that out, I now see how the probe value blips during a mesh level. Now I just check that the value is 0 before and after running a BlTouch self test for a couple seconds. Already saved my hide once while I figure out my intermittent issue.