Tool change behavior
-
Hello
ive setup tool change on my cnc , and was wondering if when tool is called , it would check if machine is homed before running the intire macro . I tryed this in the tpre.g but it just homes evry time it called.
if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed
G28any able to help , so there no needles homing done when operating the machine .
-
@KristianP did you indent the G28 command with respect to the if-command? If you do, it should work. I use a similar sequence in my bed.g file to home the printer if I try to run delta calibration without homing first.
-
@dc42 It was copy paste from a forum thread i cant find again , and not sure what you mean with " indent the G28 command with respect to the if-command" or how to implement suggestion .
-
Got it working , only have this in tpre.g now , if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed g28 , and rest of macro in tpost.g seems to work flawless now
-
@KristianP See the docs on GCode meta commands to get a better idea of what is going on. In this case "indent" means the amount of whitespace before the G28 command, this is usually provided in the form of either one or more tabs, or one or more spaces. Best to select one (tabs) or the other (spaces) and not mix them. So for example your code above should really look like this:
if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed G28
Which is basically saying if any of the axes are not homed then execute G28. In this case I have indented the G28 with 4 spaces. Take care when copy/pasting code from places like the forum as leading tabs/spaces can easily become lost.
-
@gloomyandy thanks for the clearyfication , i will have a look at meta commands . think i have more need in that direction might aswell learn the basics if im able
-
-