RRF3.2 request to enable G43 & G44 Tool height offset
-
here's how I get around the issue for tool changes.
I have 2 probes that I use with my CNC machine.
I have one of these https://vers.by/en/touch-probes/9-vers-pr.html and one of these https://www.amazon.co.uk/dp/B08CC752D6/ref=cm_sw_em_r_mt_dp_d66QFbZZXNK0CI use the vers.by probe to set the workplace co-ordinates of the material in X and Y.
This is for XM558 P5 C"servo0" K0 F150 ; Change the probe input pin for the vers.by probe M558 F1500 ; Set the initial probing speed G38.2 X1000 P0 ; Probe the material as a first pass G91 ; Set the movements to relative G1 X-5 ; Move 5mm away from the material G90 ; Set the movements to absolute M558 F150 ; Set the final probing speed G38.2 X1000 P0 ; Probe the material again M400 ; Make sure all movement is complete G10 L2 X{move.axes[0].machinePosition+1} ; Record the stop position as the workpiece co-ordinate in X M400 ; Make sure all data recording is complete G91 ; Set the movements to relative G1 X-5 ; Move 5mm away from the material G90 ; Set the movements to absolute ; Set the movements to absolute
This is for Y
M558 P5 C"servo0" K0 F150 ; Change the probe input pin for the vers.by probe M558 F1500 ; Set the initial probing speed G38.2 Y600 P0 ; Probe the material as a first pass G91 ; Set the movements to relative G1 Y-5 ; Move 5mm away from the material G90 ; Set the movements to absolute M558 F150 ; Set the final probing speed G38.2 Y600 P0 ; Probe the material again M400 ; Make sure all movement is complete G10 L2 Y{move.axes[1].machinePosition+1} ; Record the stop position as the workpiece co-ordinate in Y M400 ; Make sure all data recording is complete G91 ; Set the movements to relative G1 Y-5 ; Move 5mm away from the material G90 ; Set the movements to absolute
I also use the probe to probe the top of the material, the top of the spoil board and the the top of the top of the touch plate. I use the extra workplace co-ordinates to store the positions as a work around until variables are implemented.
M558 P5 C"servo0" K0 F150 ; Change the probe input pin for the vers.by probe M291 P"Put the probe over the workpiece" S2 X1 Y1 Z1 ; Pop up box asking for operator input M558 F1500 ; Set the initial probing speed G38.2 Z-200 P0 ; Probe the top of the material G91 ; Set the movement to relative G1 Z5 ; Move back up 5mm G90 ; Set the movement to absolute M558 F150 ; Set the second probing speed G38.2 Z-200 P0 ; Probe the top of the material again M400 ; Make sure the movement is complete G10 L2 P9 Z{move.axes[2].machinePosition} ; Record the material height in the 9 Z workplace coordinate M400 ; Make sure the recording is complete G91 ; Set the movement to relative G1 Z10 ; Move back up 10mm G90 ; Set the movement to absolute M291 P"Put the probe over the spoilboard" S2 X1 Y1 Z1 ; Pop up box asking for operator input M558 F1500 ; Set the initial probing speed G38.2 Z-200 P0 ; Probe the top of the spoilboard G91 ; Set the movement to relative G1 Z5 ; Move back up 5mm G90 ; Set the movement to absolute M558 F150 ; Set the second probing speed G38.2 Z-200 P0 ; Probe the top of the material again M400 ; Make sure the movement is complete G10 L2 P8 Z{move.axes[2].machinePosition} ; Record the spoilboard height in the 8 Z workplace coordinate M400 ; Make sure the recording is complete G91 ; Set the movement to relative G1 Z10 ; Move back up 10mm G90 ; Set the movement to absolute M291 P"Put the probe over the tool block" S2 X1 Y1 Z1 ; Pop up box asking for operator input M558 F1500 ; Set the initial probing speed G38.2 Z-200 P0 ; Probe the top of the spoilboard G91 ; Set the movement to relative G1 Z5 ; Move back up 5mm G90 ; Set the movement to absolute M558 F150 ; Set the second probing speed G38.2 Z-200 P0 ; Probe the top of the material again M400 ; Make sure the movement is complete G10 L2 P7 Z{move.axes[2].machinePosition} ; Record the touch plate height in the 7 Z workplace coordinate M400 ; Make sure the recording is complete G91 ; Set the movement to relative G1 Z25 ; Move back up 25mm G90 ; Set the movement to absolute
This sets up all the information I need about the job and I can then fit the cutting tool.
Once the tool is installed, I then probe the touch plate to get the tool position using this macro.M558 P5 C"!e1stop" K0 F150 ; Change the probe input pin for the touch plate M291 P"Have you attached the connector?" S2 ; Pop up to remind the operator about the connector to be fitted to the tool M558 F300 ; Set the initial probing speed G38.2 Z-200 P0 ; Probe the touch plate G91 ; Set the movement to relative G1 Z5 ; Move up 5mm G90 ; Set the movement to absolute M558 F150 ; Set the second pass probing speed G38.2 Z-200 P0 ; Probe the touch plate M400 ; Make sure the movement is complete G10 L2 P6 Z{move.axes[2].machinePosition} ; Record the tool height in the 6 Z workplace coordinate M400 ; Make sure the data recording is complete G91 ; Set the movement to relative G1 Z5 ; Move up 5mm G90 ; Set the movement to absolute
Now I have the height of the tool recorded.
If I want to work with the top of the material set as my Z datum (set as 0), then I use this macro to calculate the tool offsetG10 L2 P5 Z{move.axes[2].workplaceOffsets[6]-move.axes[2].workplaceOffsets[5]} ; Take away the tool height from the touch plate height and put it into 5 Z workplace co-ordinates G10 L2 Z{move.axes[2].workplaceOffsets[8]-move.axes[2].workplaceOffsets[4]} ; Take away the above offset from the material height and place in the live (1) Z workplace co-ordinates
And if I want to work with the spoilboard set as my Z datum (set as 0), then I use this macro to calculate the tool offset
G10 L2 P5 Z{move.axes[2].workplaceOffsets[6]-move.axes[2].workplaceOffsets[5]} ; Take away the tool height from the touch plate height and put it into 5 Z workplace co-ordinates G10 L2 Z{move.axes[2].workplaceOffsets[7]-move.axes[2].workplaceOffsets[4]} ; Take away the above offset from the spoilboard height and place in the live (1) Z workplace co-ordinates
Then when I want to carry out a tool change, I fit the new tool, probe the touch plate, and then calculate the new offset depending on what I want as my datum.
Seems to work well so far. -
@jay_s_uk Thanks for sharing that! There's a lot of food for my thoughts, and the touch probes look really good btw. My set up is a little different as I have a stationary button which acts as my tool touch probe. It is also set below the surface of my wasteboard at the front of my machine.
So this is not tested, but I imagine I could use:
M291 X1 Y1 Z1 ; jog to wasteboard G10 L2 P9 Z{move.axes[2].machinePosition} ; Save coordinate to G59.3 WC M500 ; Store to memory
I can then move to my probe location at the front of my machine:
M291 P"STAND CLEAR! Move to Probe Location." R"Warning" S3 G90 ; absolute movement G53 G0 Z-10; ; move to safe Z in machine coordinate system G53 G0 X83 Y41.7 ; move X and Y second in machine coordinate system above stationary probe button
and then perform my probe cycle.
M291 P"Ensure tool is above stationary probe location." R"Warning" S3 G10 P8 X0 Y0 Z0 ; reset axis tool offset G30 S-1 ; Probe at the current XY position and report G91 ; incremental movement G10 L8 P8 Z{move.axes[2].machinePosition} ; adjust G59.2 WCS G10 L20 P1 Z{move.axes[2].workplaceOffsets[9]-move.axes[2].workplaceOffsets[8]} ; Set origin of G54 Z relative to the current position of the tool, minus wasteboard offset from tool probe offset??? M500 ; store to memory G53 G0 Z-10 ; move to safe z position
Going to have to trail this out when I next have time. It didn't occur to me that I could save axis location to workspace coordinates but this is a great lead. And in theory I won't have to perform the first part until I resurface flat the wasteboard. I'll report back on the weekend once I have tested it. Cheers!
-
@jay_s_uk I'm going to have to wait till I wire up the test rig onto my CNC machine to test this. It's too confusing to imagine the stages without seeing the machine moving. May take a while to report back.
-
@EducatingSavvas don't worry, I won't be going anywhere
-
@jay_s_uk Can I ask what firmware version you are using. I'm following your workflow but having to make random changes. I'm using RRF 3.2 beta 2.
-
I'm also running 3.2beta3.2
-
I can confirm I've been able to create macros to set the wasteboard and tool length. My wasteboard setting macro is:
M291 P"Jog spindle until tool tip touches surface of waste board." R"Set Waste Board" S3 X1 Y1 Z1 ; jog to wasteboard G10 L2 P9 Z{move.axes[2].machinePosition} ; save coordinate to G59.3 WC G10 L2 P2 Z{move.axes[2].workplaceOffsets[8]} – {move.axes[2].workplaceOffsets[7]} ; Subtract G59.3 from G59.2 and set offset in G55 M400 ; wait for last command to end M500 ; store to memory G55 ; swap to G55 WC
and stationary tool length setting macro:
G55 ; return to G55 WC G10 P1 X0 Y0 Z0 ; reset axis tool offset M291 P"Press Ok to peform probe cycle" R"Warning" S3 G30 S-1 K0 ; begin probing movement G91 ; incremental movement G1 F500 Z3 ; move up 3mm G90 ; absolute movement G30 S-1 K0 ; begin probing movement M400 ; wait for current move to finish G10 L2 P8 Z{move.axes[2].machinePosition} ; store probe ocaiton to G59.2 P8 G10 L2 P2 Z{move.axes[2].workplaceOffsets[8]} – {move.axes[2].workplaceOffsets[7]} ; Subtract G59.3 from G59.2 M500 ; store to memory G53 G0 Z-10 ; move to safe z position
I use G54 to mirror the G53 machine position - so work in G55. I use G59.3 to set the wasteboard, and G59.2 for stationary touch probe. for set Thank @jay_s_uk for pointing me in the right direction.
-
@jay_s_uk Hi, thanks for sharing this macro. When you write "G10 L2 Z" which system coordinate will change the G53 ? Because there is no P parameters
Thanks, -
@tom33 I don't use G53 in my probing macros. I've only used it in the context of tool changing. But, it uses the machine coordinates as a base (so from the machine 0,0 position) and not workplace coordinates
-
@jay_s_uk ok so like that there is no a G54/G55 for change the work coordinate system at the begining of a gcode ?
-
@tom33 I believe setting the system in CNC mode (M453) automatically puts the machine in G54
-
Guys this seems to be a great work around for the limitation on variables, as from what I can tell you are using the work offsets of non used coordinate systems to store the values from your probing, and then performing the math on them to get the result you desire.
The only syntax that I am having a hard time following is where do the "move.axes[].machinePosition" and "move.axes[].workplaceOffsets[]" come from. I assume they are calling something at the firmware level, but it seems documentation on this is limited.
I have seen other threads where people are using these meta commands, but finding documentation on them is rather limited. I've gone so far as to dig into linuxCNC as it appears some of this work is derived from there. Any suggestions on where to learn more on the meta command structure would be greatly appreciated.
-
@chiefmonkey https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands
Have you seen this? Actual variables are now available as well.
-
@phaedrux said in RRF3.2 request to enable G43 & G44 Tool height offset:
I have seen that, we are a bunch of mechanical oriented guys in our group, so programming is taking us quite a while, so much different then C that I used to use.
-