This topic is closed in gSender->Questions so I thought it might be worth posting here in case it wasnāt noticed by the gSender devs.
This thread is also relevant.
EDIT: I think this boils down to if the āStandard Re-zeroā tool change strategy is supposed to work with inch mode G-code and $13=0. The macro problem, while not gSenderās problem stemmed from setting $13=1 to make the tool change work.
@_Michael I may be misunderstanding the $13 problem. It seems to be an issue with a 3rd party tool change wizard that the OP is using with gSender. Am I correct? If so, I donāt see how is issue can be categorized as a gSender bug. Feel free to explain why I am wrong.
Am I mistaken? I thought it was the tool change wizard in gSender. I may very well be wrong because I donāt do tool changes in a file.
My understanding is that needing to set $13 in a macro is because of the tool change wizard running as if mm was used when it had inserted a G20 command to use inches. I assumed, and you know how that goes, that knowing a G20 was used was from examining the console output when @davebmck was diagnosing his problem.
Iām basing this mostly on this part of post #3 in the second link.
but I ran into a problem when using the tool change wizard in Gsender. If Iām running an inch based gcode file, when the tool change wizard returns the spindle to the position it was located at the M6 command, the command line uses the metric units, but puts a G20 in the line which executes the move as inch units. I think this is a bug in the wizard, but I can get it to work fine as long as I have $13=1.
So I think in the first thread he discovered a workaround by setting $13=1, but that led to a problem in the probe macro not working because he needed $13=0 there, thatās the second thread I linked. I think he wouldnāt need $13=1 at all if the tool change wizard had worked correctly.
Iāll see if I can explain. The root problem is not with the macro. It expects $13=0 which is the default. The problem (bug?) is with the tool change wizard that I outlined in the referenced thread. If Iām running an inch based gcode file and $13 is set to 0, the wizard sends the spindle to the wrong position because of the G20 in the command line. The work around is to set $13=1 and the wizard will work for inch files.
Now the next time I run the probe macro, it will fail unless I remember to reset $13=0. My post about changing $13 in a macro is another work around so I can just leave $13 set at one value.
I run most of my gcode files in inches, so for multi tool files with a tool change, I need to have $13 set to 1 for the tool change wizard to work correctly. However, when I run my XYZ probe macro, $13 must be set to 0 for that to run correctly. I am wondering if I can set $13=0 at the start of the macro in the code and then reset it to $13=1 at the end of the macro. if I have to remember to change $13 manually every time I do an XYZ probe and tool change, Iām sure to miss that at some point and my machine will go somewhere its not supposed to.
I donāt have an answer to your question. I do have a suggestion that may work for you instead.
From what Iāve seen hanging around here for awhile, what usually works best is to leave $13 at 0. Itās possible, at least in the design programs that Iām familiar with, to design in inches but use a mm post processor. gSender is also capable of displaying inches, for coordinates and visualization, when itās running a mm G-code file.
Inches are a second class citizen as far as grbl is concerned. Millimeters are more accurate and avoid several problems that crop up when inches are used. That said using the setup described above you donāt have to look at millimeters anywhere unless you are looking at the G-code itself.
The tool change settings might need to be changed if they are in inches. Iāve never used tool changes so I donāt know.
You do you but $13=1 never seems to work out from what Iāve seen.
EDIT: Donāt quote me on this because I work in mm from start to finish but I donāt think $13=1 is even needed for inch G-code files. Isnāt that what G20(set units to inches) and G21(set units to millimeters) are for?
Wanted to make sure I wasnāt hallucinating so I searched a bit. gSender may handle $13=1 better than it used to but posts like this have stuck with me.
Thanks for the response Michael. You are correct that standard gcode runs fine in either inch or metric regardless of the value of $13. Iāve always left $13 at the default 0, but I ran into a problem when using the tool change wizard in Gsender. If Iām running an inch based gcode file, when the tool change wizard returns the spindle to the position it was located at the M6 command, the command line uses the metric units, but puts a G20 in the line which executes the move as inch units. I think this is a bug in the wizard, but I can get it to work fine as long as I have $13=1. However, when I run my XYZ probe macro, $13 must be set to zero for that one to work correctly. Thatās why Iām asking if I can just set $13 in my macro.
Thanks for the additional context. I hope my post didnāt come across in a negative way.
Apparently, in the post apocalyptic wasteland that is my mind, the $13 trip wire really rattles the cans in my alarm system! I wanted to make sure it was really necessary to go there.
Unfortunately I havenāt been able to find any info on how to change a firmware setting in a macro.
EDIT:
If you havenāt done so already consider creating a post in the gSender Bug category or GitHub to get this fixed if it is indeed a bug.
$13=1 %wait
ok
$13 %wait
$13=1 (Report in inches, boolean)
ok
$13=1 (Report in inches, boolean)
ok
$13=0 %wait
ok
$13 %wait
$13=0 (Report in inches, boolean)
ok
$13=0 (Report in inches, boolean)
ok
This was done using the grblHAL simulator not my actual SLB but I could test that if needed. Maybe you tried without the %wait?
Actually, I never tried without the %wait because I saw a line in the Variables drop down, in the create/edit macros window, that was ā$# %waitā to get the value of a setting so I tested based on that.
That looks like it works. Iām running standard grbl, but I think it should work the same. Unfortunately, Iām traveling again this weekend, but Iāll test this when I get home on Monday.
I posted about the problem with the wizard in the general questions sections. Do you think it would get additional attention in the bug section?
I did it because you mentioned you were traveling and I thought it might save you some phone typing. It also seemed just as easy as answering if I thought it would get more attention. Since then youāve had to type it all anyway to clarify that thread.
Safe travels!
EDIT: Some people are wizards at phone typing but Iām at least 10 times faster on my PC keyboard than mobile devices!
@_Michael@davebmck Iāve moved all the posts to the āpossible bug in tool change wizardā topic. This way, all the conversation is in one place, and there will be no more duplicate posts.
I would suggest to @davebmck that he open a support ticket with Sienci. Keep in mind that this is a user forum and your issue may not be addressed here as promptly as you would like.
@_Michael Just to let you know, I tried changing the value of $13 in my probe macro and it does work. I can set it to 0 at the start of the macro and back to 1 at the end. The only difference I ran into was that adding the %wait to the line gives me an error:3 (invalid statement) and no change is made. Without the %wait it works fine. Maybe it has to do with me running standard grbl vs. grblhal.