Since I'm still waiting for the rowing boat to arrive from China with a couple key parts for the control housing, I'm sat here contemplating how I'm going to wire a touch probe in, and it's got me back to thinking about tool changes.

The toolchanger has been working well. I still need to create a recovery/setup screen in KMotionCNC, so I can control it directly from KMCNC, rather than having to toggle things manually should things go wrong (what I really mean is when I screw up the toolchange position, and send toolholders flying in various directions, or jam the carousel against the workpiece...).

Like most CNC programs, KMCNC has a tool table. For every tool you can set the usual offsets, toolID, a description, image file (for if you want an accurate image shown in the viewer) and a Slot.
For a toolchanger, the slot is key. When you request a toolchange in G-code, KMCNC looks for that in the ToolID column, then tells the KFlop to load the tool in the corresponding slot. Off course, it's up to the operator to ensure the correct tool is in the correct slot.
This means you can have multiple tools stored along with their offsets, and when you load the tools into the carousel, KMCNC already knows the offsets, and all you have to do is update the slot ID.

What this also does, is give the ability to control how tool changes are handled.
I've written my changer code, so a request for slot 1-6, results in a fully automatic tool change. Then anything above 6 through to 98, results in a manual tool change, then 99 simply unloads the spindle.
Everything is tracked, so if I go from say slot 3 to 50, it'll automatically unload the tool, retract the tool carousel, and then ask the operator to insert tool 50. Or going back the way, it'll ask the operator to remove the tool, confirm it's been removed, then bring the carousel back out and load tool 3.

Now what's this got to do with a touch probe, other than needing to load it manually?
I'm going to allocate an additional series of slots (probably 95-98), which will get handled differently, and will cause the spindle to align to a known position (index mark on servo) to maximise repeatability, and prevent it from running (you really don't want your touchprobe in a spinning spindle while plugged in...).
Plus I can then force all moves while a touchprobe is loaded, to be protected moves. By protected, it means if the touchprobe gets triggered, all motion is halted, as though you were performing a G31 probing move. It probably won't stop things getting damaged at full speed rapids (I'll probably also add a feedrate override to limit rapid speeds), but it should stop issues like jogging the probe into things stronger than the probe.

Now I'm of to stare blankly at my toolchange code, and think about how I can implement this..