Charly4/4U, Issues with Tool Measurement and Change (Duet3)
-
Hello everyone,
I’m new to the forum. I’m a teacher, and I’m currently working on restoring two CNC machines (Charly 2U and Charly 4U ) that my school purchased back in 2007.
I’ve replaced the old electronics with a Duet3 board. At the moment, I’m learning how to write macros to configure features and getting familiar with the G-code specific to Duet3 boards.However, I’ve been struggling for several weeks with tool measurement and tool change. The issue seems simple, but I can’t figure it out. Here’s the situation:
ContextDuring a machining process requiring multiple tools (e.g., different milling cutters), I follow these steps:
I place the tool in the spindle.
I run a macro to measure the tool's position on the Z-axis, using a sensor located 37.4 mm away from the workplane zero. This gives me the tool length relative to the spoilboard.
I set the (0,0,0) coordinates of my workpiece (the material to be machined), which updates the machine’s origin to match the workpiece zero.
I start machining.Problem
During machining, I want to change the tool. Here’s what I do:
I remove the previous tool and place a new one in the spindle.
I bring the new tool to the sensor to measure its length.The issue is that I can’t measure the tool correctly because the sensor’s position is defined relative to the workplane zero, not the workpiece zero. As a result, the tool measurement doesn’t work as expected.
My Questions
Should I use variables to store positions or perform calculations to adjust the tool height?
How can I write G-code using variables and use them to control the motion of the axes?
Is there a specific G-code command or method to handle this kind of scenario with a Duet3 board?I’m quite stuck and haven’t been able to find a clear solution. Any guidance or suggestions would be greatly appreciated.
Thank you in advance for your help!
-
@feliz_k I am not a CNC user but I think you should check out the following GCode commands:
G10 with no L parameter, or L1 parameter: https://docs.duet3d.com/en/User_manual/Reference/Gcodes#g10-set-workplace-coordinate-offset-or-tool-offset. This command sets the offset of a tool. The offset (in particular, the Z offset) is what you need to change when changing to a different length tool.
You can calculate the new tool offset to use in the G10 command by measuring the height at which your sensor is triggered by the new tool. However, you may not need to do that because there is also this command:
G30 with S-2 parameter: https://docs.duet3d.com/en/User_manual/Reference/Gcodes#g30-single-z-probe. This uses a Z probe (which could be your sensor) to set the tool offset automatically. Don't forget to use G31 to set the Z probe trigger height to the tool height at which the probe triggers.
HTH David