How can I absolutely know where my tool head is?
-
I keep finding myself in these situations where I crash my tool.
I have pretty thorough checks in all of my scripts to make sure the bed is out of the way, but sometimes it fails.
For example, I check to see if the bed is even within 15mm of the tool and if so, to move the bed down 15mm before pulling the tool out.
This works 99% of the time, but just today, I had to manually T0 P0 then T-1 P0. I checked the coordinates and the empty tool head and everything was correct, Z=1, I then hit T0 on the screen and when it did the tool change, it never moved the bed out of the way, so the script must have thought the bed was far enough away.
I feel like there is either a bug in switching to tool offsets, or I am not checking the position correctly.
What is the exact correct way to determine the position of the bed and the tool?
-
@gnydick do you also check in your tool change files that the axes it will move have been homed?
-
@dc42 yep, I do. I also make sure move without homing is disabled.
-
@dc42 is there any advice? When checking coordinates, are they always absolute? Things like that.
-
@gnydick you can get tool position or machine position from the object model. Coordinates reported in that way are always absolute.
Also you can use G53 in front of G1 to specify that the move is done in machine co-ordinates, not tool co-ordinates (that's helpful in tool change files where the tool co-ordinates are not applied for every file).
One other possibility is you have a left an unclosed relative move somewhere (i.e it's possible in some combination to leave you machine in relative mode)
-
@T3P3Tony thanks. That all sounds like what I'm doing.
-
@dc42 this is what I have for my tpost0.g
What are the coordinates for the
state
? Machine based or tool based?; called after tool 0 has been selected ;Drop the bed var zRestore = state.restorePoints[0].coords[2] var zTool = move.axes[2].userPosition var newPos = var.zRestore + 5 ; in case it's needed if {!exists(var.zRestore)} G91 G1 Z20 G90 elif { var.zRestore > var.zTool } var message = "zRestore higher at: " ^ {var.zRestore} ^", zTool: " ^ {var.zTool} ^ " need to adjust Z, moving to " ^ {var.newPos} M118 S{var.message} P0 G1 Z{var.newPos} elif { var.zRestore < var.zTool } var message = "zRestore lower at: " ^ {var.zRestore} ^", zTool: " ^ {var.zTool} ^ " no need to adjust Z" M118 S{var.message} P0 if heat.heaters[1].current > 170 ; Checking for safe clearances then wiping M98 P"/macros/tools/safeX" M98 P"/macros/tools/safeY" M98 P"/macros/tools/safeZ" M98 P"/macros/tools/wipe_tall" else G91 G1 X-60 F1800 G1 X-40 F6000 G90 ; enable fan if it was running M106 R2