# Thread: Drag knife compensation algorithm

1. ## Drag knife compensation algorithm

I'm writing a bit of code to generate some G-Code for a drag knife I've installed in my cnc router. I can do the straight stuff and turn corners fine (similar to this http://www.summa.be/pages/nfo_tangentialordrag.html).

What I am wondering about, is cutting circles and curves. If the knife has an offset, will the cut circle be smaller than the one traced? If so, how do I calculate the compensation amount for the circle? I assume it is a function of the offset and the circle diameter?

Thanks,
Frank

2. I think I worked this out...

If I keep the knife point on the circle at a tangent, then it is a simple case of using the pythagoras theorem to calculate the compensated radius...

3. That looks OK to me.
Your next problem is to move the cutter to the start of the arc will also need some trig.

4. My circles are actually holes, so it is easy enough to start in the center, move to the edge, then swivel to point in the right direction.

5. Originally Posted by ftkalcevic
I think I worked this out...

If I keep the knife point on the circle at a tangent, then it is a simple case of using the pythagoras theorem to calculate the compensated radius...

I believe the curve you are looking for is a cycloid. Search google for "brachistochrone". Your method will possibly work for a complete circle, but it will fail if you move from a line to an arc to a line. Think of a truck making a tight 90 degree turn with a long trailer. This is an interesting mathematical problem.

6. Originally Posted by SBC Cycle
I believe the curve you are looking for is a cycloid. Search google for "brachistochrone".
I googled "brachistochrone" and "cycloid", but I'm unable to see the relationship to a toolpath.

This is how I see a toolpath for a keyhole would be.
Open to corrections.

7. Examine this drawing carefully and you will see the error of the arc offset method. A simple arc offset will only approximate the path the centerline of the tool should follow (represented by the points). It may be more than sufficient for the purpose of representing a circle while cutting vinyl, but it also makes for inefficient toolpath.

Also open to corrections.

8. Originally Posted by SBC Cycle
Examine this drawing carefully and you will see the error of the arc offset method........Also open to corrections.
I am unable to duplicate your drawing.
I'm sure a trailing blade does not give a perfect shape. I imagine the blade will act like a fish tail in some areas. I guess this goes with the benefits of a trailing blade setup.

9. Originally Posted by Kiwi
I am unable to duplicate your drawing.
I'm sure a trailing blade does not give a perfect shape. I imagine the blade will act like a fish tail in some areas. I guess this goes with the benefits of a trailing blade setup.
Please, don't apologize! I very well could be wrong. When I get a moment I will start over with a fresh BobCAD file and try to explain how I got my results. I love this kind of problem. Some people are crazy over Sodoku, I get my kicks on math puzzles.

#### Posting Permissions

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!