Calculating Tool Offset - CNC
-
I use RRF3 to control a CNC router that I've built (printNC) and I've recently purchased a setting probe.
The probe allows me to find the edges of a workpiece as well as the top of the workpiece. I also have a CNC touch plate https://www.amazon.co.uk/gp/product/B08CC752D6/ref=ppx_yo_dt_b_asin_title_o05_s00?ie=UTF8&psc=1What I'm looking to do with probe the top of the workpiece with the setting probe and using the touch plate to calculate the offset for each tool.
So far, I have a macro setup which probes the top of the workpiece, the spoil board and the top of the touch plate and another macro to probe the top of the touch plate with the cutting tool fitted. Each coordinate is saved into a workpiece coordinate using G10 L2 PX.My question is, how do I recall those workpiece coordinates to allow a simple calculation to be carried out? Are they stored in the object model? Is there a gcode I can use to get them?
-
There are two ways to use a Z probe to set the Z offset of a tool:
-
Use G30 S-2. This has been implemented for some time.
-
In RRF 3.2beta you can query sensors.probes[n].lastStopHeight and then use the result to calculate a new G10 Z parameter. I can't remember whether lastStopHeight is in 3.2beta1 or whether I added it subsequently, but the whatsnew file should mention it if it is in beta1.
-
-
PS - you can also recall the workplace coordinates, you will find them within move.axes[n].