# Thread: Tool compensation

1. ## Tool compensation

Hello!
I can't find the best thread for my topic, so I open a new one.
I program a motion controller, it can interpolate 2 axis (X,Y). I can insert an edges sequence. Every edges can be a segment or an arc (clockwise or not). The program is not a g-code, but the mean is the same: a sequence of moving instructions. So far is all ok. Now I want move the tool on the XY plane to cut some materials. But I want take care of the tool dimension (diameter).
I want insert in my program the management of G41 and G42 instructions because the motion controller has not those instructions.
Where can I find some documentation to solve this problem.

Thank you

bg_izio

2. Sounds like a difficult task to start from scratch, when the problem has been addressed with g-code controllers already.

For a dedicated machine making simple movements, you are probably just as far ahead to create tool radius compensation offsets in cadcam and make use of the coordinates derived from the offset path.

What kind of controller software are you using? Do you intend to run a coordinate transformation equation on each motion command as it moves along? Such an equation would have to include tool diameter, direction of offset (left or right of command position), and then include a series of IF statements to process the coordinates, depending on whether an arc or a line is encountered. Some profiles simply cannot be offset correctly within certain ranges of profile radii and tool diameters. How will you catch this problem?

Perhaps it is possible to write a coordinate transformation subroutine that is held within your controller memory, to process every motion command via a jump to the subroutine. Is this what you intend to do? Is your controller software running fast enough to do this?

3. Hi HuFlungDung,
I can program the motion controller with a structured language. Further, this controller has a firmware function to interpolate two axis XY. I can insert in this function the list of XY coordinates and the speed and then I can start the movement. The XY axis bring the tool toward the first XY point and then change the direction toward the next and so on.
So if the path is an arc, I have to simulate the arc with a lot of segments (polyline).
I have to calculate the path before to start, the path with tool compensation too.
I'd like to know if there is a special technic to do that in the world of CNC (or in CAM world).

thank you, in any case.

izio

4. Izio,

Many CAM systems will create the final path for you, this is common. This will permit you to simply enter the coordinates and let your machine execute the movements. Your controller may not understand gcode. There may be a special command language used.

One would have to compare the syntax of your controller language with the syntax of gcode instructions, to see if a post processor could be made to give direct output ready to download to your controller.

### About CNCzone.com

We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

### Follow us on

Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.