531,647 active members*
2,983 visitors online*

# Thread: How To handle Workpiece Rotation

1. ## How To handle Workpiece Rotation

Can Planet CNC handle workpiece rotation and is yes, what’s the workflow.

I would like to solve the following situation as an example:
My stock material is a rectangle of 200mmx300mm
In CAM the x&y 0 is set to the middle of the stock.
The GCode should put a chamfer on the edge of the stock
When putting the Material on the Bed the stock is not placed perfectly square and the Software needs to compensate for this.

In my old software this was quite easy, measuring a few points, it automatically got the correct center of the part and the rotation. In TNG I was able to find a way to measure the angle of the stock, and a way to rotate the gcode. But the gcode is always rotated on the origin of the coordinate system, not the xy0 of the gcode. Additionally I have found no way to measure the middle of the part if the part is not square.

BR,
Klaus

2. ## Re: How To handle Workpiece Rotation

In TNG you can also measure points and calculate rotation. This is called transformation, in this case, transformation from points.

There are other ways to do rotation. Coordinate system rotation rotates whole system around its origin. With axis rotation (G68) you can specify rotation center.

3. Is there some documentation or howto guide available that describes this process step by step?

4. ## Re: How To handle Workpiece Rotation

After a lot of tinkering, trying and testing I think I finally figured it out.

I figured that G0, G1 and G38 moves are moving the axis correctly in a rotated Work Coordination system.
With this information I basically combined the angle measurement routine with a rewrite of the Protrusion Measurement.
I measure the rotation, use G10 to set it for the current coordination system and replaced all G53 moves with relative moves in the work coordination system.
To not totally loose my head I restricted it to start always on the left side of the workpiece, measure the rotation, measure X position followed by Y position.
Seems to work OK, but man programming C somehow seems no longer so bad, and I have the feeling I didn't even do anything fancy.