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:
Context
During 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!