I recently started using gSender and have been loving it, I’m now working on integrating some probes and tool sensors and ran into an issue with the Automated Tool Change workflows on the 1.4.1 release.
When running a tool change using the “Set Tool Sensor” mode, the tool length is being incorrectly calculated when changing tools. I used the following process:
Have a bit inserted into the CNC collet (X-Carve Pro in my case)
Zero the bit using a Z-Probe
→ G54: 0mm
→ Machine: -134.86mm
Start running a G-Code file that starts with a tool change command (M6)
Measure the initial tool height using a Tool Sensor, wait for spindle to retract
→ G54: 124.86mm
→ Machine: -10.00mm
Do not change tool, but click to measure “new tool”, wait for spindle to retract
→ G54: 132.86mm
→ Machine: -10.00mm
Go to Z0 (make sure the spindle is in a location where the tool will have clearance (in my case we have a separate fixture plate which is lower than the initial Z0).
→ G54: 0mm
→ Machine: -142.86mm
This results in the “zero” of the G54 coordinate system now being 8mm lower than the original zero.
Running this same process on v1.2.2 works correctly, I haven’t tried any other 1.4x versions yet.
The “8mm” delta seems like it could be due to the retract height after probing the sensor no longer being accounted for correctly, I haven’t looked into the source yet but wanted to share this issue to see if anyone else has experienced it.
Here is a capture of the tool probing sequence using v1.4.1, this is the sequence that results in an incorrect offset:
gSender - [Grbl]
Connected to COM3 with a baud rate of 57600
feeder G53 G0 Z-16.225
ok
feeder G91 G21
ok
feeder G38.2 Z-131.775 F200
[PRB:-30.576,-1183.767,-84.344:1]
ok
feeder G0 Z4
ok
feeder G38.2 Z-10 F50
[PRB:-30.576,-1183.767,-84.363:1]
ok
feeder G0 Z4
ok
feeder G4 P0.3
ok
feeder (TLO set: 58.357)
ok
feeder G90 G21
ok
feeder G53 G0 Z-10
ok
feeder (Moving back to configured location)
ok
feeder G90 G53 G0 Z-10
ok
feeder G90 G53 G0 X-30.576 Y-1183.767
ok
feeder G53 G0 Z-16.225
ok
feeder G91 G21
ok
feeder G38.2 Z-131.775 F200
[PRB:-30.576,-1183.767,-84.350:1]
ok
feeder G0 Z4
ok
feeder G38.2 Z-15 F50
[PRB:-30.576,-1183.767,-84.363:1]
ok
feeder G0 Z4
ok
feeder (Set Z to Tool offset and wait)
ok
feeder G4 P0.3
ok
feeder G21 G10 L20 P0 Z62.357
ok
feeder (Set Z to Tool offset and wait)
ok
feeder G53 G21 G0 Z-10
ok
feeder G21 G91
ok
Here is a capture of the tool probing sequence using v1.4.1, this is the sequence that results in a correct offset:
gSender - [Grbl]
Connected to COM3 with a baud rate of 57600
feeder G53 G0 Z-16.225
ok
feeder G91 G21
ok
feeder G38.2 Z-131.775 F200
[PRB:-30.576,-1183.767,-84.338:1]
ok
feeder G0 Z4
ok
feeder G38.2 Z-10 F50
[PRB:-30.576,-1183.767,-84.338:1]
ok
feeder G0 Z4
ok
feeder G4 P0.3
ok
feeder (TLO set: 54.3884)
ok
feeder G90 G21
ok
feeder G53 G0 Z-10
ok
feeder (Moving back to configured location)
ok
feeder G90 G53 G0 Z-10
ok
feeder G90 G53 G0 X-30.576 Y-1183.767
ok
feeder G53 G0 Z-16.225
ok
feeder G91 G21
ok
feeder G38.2 Z-131.775 F200
[PRB:-30.576,-1183.767,-84.338:1]
ok
feeder G0 Z4
ok
feeder G38.2 Z-15 F50
[PRB:-30.576,-1183.767,-84.338:1]
ok
feeder G0 Z4
ok
feeder (Set Z to Tool offset and wait)
ok
feeder G4 P0.3
ok
feeder G21 G10 L20 P0 Z54.38844
ok
feeder (Set Z to Tool offset and wait)
ok
feeder G53 G21 G0 Z-10
ok
feeder G21 G91
ok
I believe that the G10 command in the line containing " G21 G10 L20 P0 " is having an incorrect offset input, and the “TLO set:” line also has the TLO shifted by 4mm (which is the current retract distance in the Probe Settings).
Yup. There’s a problem with the code…I have a pretty good idea what it is. Give me a few to look at the source.
Edit: @KGN looks like these variables are treated like strings and concatenated rather than added like Numbers.
I remember dealing with this at some point when writing macros, but I can’t find where. They could explicitly convert those variables to numbers or do the g10 before the retract. Either way, it’s an easy fix for @KGN and the team. I’d do a pull request, but I hate doing those and it’ll take them a minute to fix.
@lowderd basically, instead of adding 4mm because of the 4mm retract, it’s tacking a ‘4’ into the end of the “TLO set”.
I’m your case, you set an initial probe location at Z54.3884
With a retract of 4mm, it should have set the second tool at Z54.3884 + 4 = 58.3884
But instead it was set at 54.38844 (note the ‘4’ tacked onto the end)