Dockable Probe Configurator Macro
-
@jay_s_uk
The main reason for this was/is the fact that there are macro's which will call retract/deploy probe in while loops. Which would cause the probe to be docked and loaded multiple times which would take a lot of time while it only needs to be loaded/docked once before and after the while loop.Lets say running bed tramming which will call g30 in 3 spots in a while loop. That will take unnecessary long when it's in the retract/deploy commands while now it's just adding the new command above and below the while loop and it's done and a lot quicker.
I have been printing myself for 2 weeks or so with this setup (before creating this script, which I really only created to help other people) without any issues and docking/loading works perfectly every time
-
@mher you should be able to call M401 manually before the first call of G30 and then it should remain undocked until you send a final M402
-
@jay_s_uk I'll do some testing tonight and potentially change the script to output the results into the retract/deploy macros. Only thing I'm slightly worried about is that it'd be overwriting any settings someone already has in there. Then again that might be a good thing
-
@jay_s_uk as promised I looked into it and I've updated the script accordingly in the start post
-
@mher Thanks for this great macro. I tried it, and most of it worked for me, but I don't see what type of probe it expects.
I configured the Klicky as z-probe switch connected to z-endstop.
I can pick it up, detach, attach etc, but after the final test is always says:M292 The probe wasnt detached, please start again
This is M558:
m558 Z Probe 0: type 5, input pin zstop, output pin nil, dive height 5.0mm, probe speeds 120,120mm/min, travel speed 6000mm/min, recovery time 0.00 sec, heaters normal, max taps 1, max diff 0.03
-
@izeman
It looks to me like the two M564 commands are indented too far.
Try aligning them with the "abort" commands -
@OwenD said in Dockable Probe Configurator Macro:
@izeman
It looks to me like the two M564 commands are indented too far.
Try aligning them with the "abort" commandsThere's several M564: Line #14,30,48,53,60,76,81. Which ones do you mean?
-
@izeman
All the ones in the if conditions which precede an abort commandif sensors.probes[0].value[0] = 1000 M291 P"Make sure the klicky probe is mounted on the toolhead" S3 if sensors.probes[0].value[0] = 1000 M564 H1 ; Don't allow movement without homing abort "The probe doesn't seem to be attached, please attach before starting the configuration again"
Should be
if sensors.probes[0].value[0] = 1000 M291 P"Make sure the klicky probe is mounted on the toolhead" S3 if sensors.probes[0].value[0] = 1000 M564 H1 ; Don't allow movement without homing abort "The probe doesn't seem to be attached, please attach before starting the configuration again"
-
@OwenD Thanks. It seems though that this was somehow auto-formated already. They all look like you said. Once you copy it here it changes the format?!
-
Reconfigured the probe now - seems it was wrong somehow.
Now I get:
M292 Error: in file macro line 270 column 7: meta command: expected string expression
-
@izeman
The first warning is a it says.
Review Klicky.g with a text editor set to show spaces and tabs.
You can see tabs before the M564 and spaces everywhere else
The second error is in a much bigger file.
Either your print file, or maybe daemon.g
Shouldn't be many files longer than 270 lines.
It'll be something like an echo or other command that doesn't have a quoted string after it. -
@OwenD I will check the file with another editor. Thanks!
But for the error in macro line 270: There is no daemon.g anywhere on the SD-card, and I'm not printing anything. I'm just calling the macro to generate deployprobe.g and retractprobe.g.
This must be some internal file that's called?!Got all the tabs removed now, and RRF doesn't complain anymore. Now everything runs fine, and in the end it throws this error:
M292 Error: in file macro line 490 column 7: meta command: expected string expression
Same error, different location ... If I knew where to search for it ...
-
@izeman
I'm guessing the version of RRF and/or DWC you're using is miscounting the line feeds or carriage returns that your editor is using.I think the actual error is caused because there were spaces in the file between "echo >" and the filename
echo > {var.deployFile} "; The deploy command for Z when using a dockable probe" ; Let's create the probe loading code file for dockable probes echo >> {var.deployFile} "if sensors.probes[0].value[0] != 0"
Should be
echo >{var.deployFile} "; The deploy command for Z when using a dockable probe" ; Let's create the probe loading code file for dockable probes echo >>{var.deployFile} "if sensors.probes[0].value[0] != 0"
See the documentation here
There must be no spaces between the > or >> symbol and <filename>. The default folder for the file is /sys.Try the attached file without editing it.
Rename it to whatever you wish
klicky_setup.g -
@OwenD Thanks for your tremendous effort, but the problem still exists.
-
I now just went to the code, and I guess I could see what it's meant to do, and basically it's not needed to be run as a macro. I can just determine the positions per hand, and then c&p the to be generated code (the last two blocks) into the .g files. I will try that.
-
Just in case someone else is looking for a deployprobe.g and retractprobe.g for a klicky probe, and got the same issues as I got. Just use the tool to determine the values, or do it manually, and c&p it into those two files:
; The deploy command for Z when using a dockable probe" ; Let's create the probe loading code file for dockable probes if sensors.probes[0].value[0] != 0 var originX = {move.axes[0].userPosition} ; Store the X position before grabbing the probe. var originY = {move.axes[1].userPosition} ; Store the Y position before grabbing the probe. G1 X238.6 Y55 F999999 ; Move tool in front of dock G1 X238.6 Y25 F999999 ; Move tool in position where probe is mounted G1 X238.6 Y55 F999999 ; Move tool in front of dock if var.originX > 238.6 || var.originY > 55 ; Move the toolhead back to the position we came from G1 X{var.originX} Y{var.originY} F999999 M400 if sensors.probes[0].value[0] != 0 abort ""Error probe not attached - aborting""
; The retract command for Z when using a dockable probe ; Let's create the docking code file for dockable probes if sensors.probes[0].value[0] != 1000 G90 G1 X238.6 Y55 F999999 ; Move tool in front of dock M400 G1 X238.6 Y25 F999999 ; Move tool in position where probe is mounted G1 X188.6 Y25 F999999 ; Move tool to detach probe G1 X238.6 Y55 F999999 ; Move tool in front of dock M400 if sensors.probes[0].value[0] != 1000 abort ""Error probe not docked - aborting""
-
@izeman
I'm afraid that error is my fault. (control character in string)
In my haste, I did a search and replace to change all the spaces to tabs to fix the first error you were having.
I did not notice that it also put tabs in the echo command (which must have only spaces)
I do not have a klicky probe, so cannot fully test this, but I have tested everything except checking the probe status and it should now work as the OP intended.
Amended file attached
klicky_setup.gBTW, you also appear to have some errors in config.g
You should runM98 P"config.g"
and investigate -
@OwenD WORKS GREAT now!! Thanks a lot!!!
-