# Align milling to rotated workpiece (around z-axis)

Hi all,

I just ordered my OF and I was wondering the following: I understand how to zero out the three axes. How would I deal with workpieces that are slightly rotated around the z-axis? For instance, I may want to start with an existing, precisely rectangular “blank” and add new cuts to it. I could “zero out” the rotation around the z-axis by measuring at least three points around the perimeter, but I don’t think this is what you guys are doing. Do I need to align it manually to the x- or y-axis to achieve that my design is exactly aligned?

Thanks for any input!

I set up some 1-2-3 blocks on a corner and then probe the inside.

I’d recommend running a grid pattern (2 inch square) on your spoil board after it is flattened, and that gives you a pretty precise line to follow that is in line with the X and Y real axis.

1 Like

Thanks for sharing the practices!

I think what I am not grasping yet is this: Let’s say I put a rectangular board on the table and I want to reference to it precisely. Ignoring z-height, I fundamentally have three degrees of freedom: x/y zero and rotation of the piece around the z-axis. The purpose of the XYZ probe is to address the x/y zero precisely, let’s say to 2-10 mil. How do I address the rotational degree of freedom with a similar precision?
It appears that eyeballing wouldn’t give me the precision, and aligning it manually and mechanically kind of defeats the purpose of using a probe to get better precision automatically. Not a criticism of the probe, naturally, but I feel that I’m missing something.

Disclaimer: Not a professional

My understanding is that the machine coordinates and the work piece coordinates must be orthogonal to each other

So there seems to be G68/69 that can rotate the x/y plane (I’m not a g-code expert). If I were to measure the difference from orthogonal, e.g. by probing three x/y locations instead of two points on the probe, I could numerically align, just as everyone is doing already for zero-point.

Edit: Corrected link as per @ConvenientWoodwork note.

Huh, I had no idea!

I guess if you had a way to measure precisely the angle your workpiece is at you could manually enter this gcode into your program. But for that to work you’d need to know precisely the machine coordinate plane in which case why not just put your workpiece there.

Edit: I just read your previous post again, probing could definitely accomplish this

Btw your link seems to be pointing to the wrong place. This should get you to the G68/69 page.

You’re certainly right, the link was wrong, I corrected.

If the OF controller supports G68 then it is just a matter of probing at least three points (or more) along either or both x and y axis plus the math. I won’t get my machine until August, but I’d be curious how this can be programmed.

If I understand you correctly you would need a way to precisely align your board correctly and get your x, y and z. Then run your program carving only the new area.

There is a lot of factors that have to work just right to make this work. I don’t think I would use this method,

Dave

@OldNewbie Yeah, I understand. I’m not trying to come up with a complicated solution to a simple problem, but to see if there is an incremental extension of what the probe concept can do already.

One of my use cases: I want to see if I can use regular woodworking tools to prep my “blanks”, e.g. pieces of furniture, then registering them in the CNC for further processing (e.g. inlays). I have no OF and no hands on experience with the repeatability.

Adding the in-plane rotation does not seem fundamentally different than using the probe plate concept for zeroing the offset. If you go the “probe route”, you already assume that you have a square, flat edge to reference from. The rest is just probing one more point and the corresponding math. It does not seem terribly more difficult than regular zero offsetting (and I have the benefit that I don’t have to manually and mechanically align the rotation). Naturally this will work only under certain circumstances: Do I have an edge to reference from? How much numerical error do I get from the measurement over longer distances?

For reference: I do not know JS or Gcode well, but it appears that the xyz-probing here could be extended easily to gauge the angle as well. From my reading this function (ignoring Z) essentially quickly finds the edge of the probe quickly (high feed rate), then goes back a bit and tries again with lower feedrate (supposedly to increase precision). In order to achieve the angle correction I would imagine the following:

1. do the probe_xyz as above, set zero (all in gcode)
2. run the X or Y probing, but offset in Y or X by less than the width of the probe (to get to a farther point) (all in gcode)
3. Retrieve the position of the probing in #2 (gcode->JS)
4. Calculate angle (in JS)
5. Issue appropriate G68 (in gcode) → done

Assuming that the probe is long enough w.r.t. workpieces size, this should give similar precision as the regular offset computation. Benefit: You don’t have to align anything, just slap the workpiece on in any orientation, calibrate, mill.

I’m sure that I may be overlooking something obvious, I’m not a machinist/CNC person.

Your zero point is just that - a point. You don’t have to use the probe at all to set your zero point, it can be wherever you want it to be. Lots of folks just move the router to the spot they want, and lower the bit to the surface they are using all manually. Your workpiece can be oriented in any direction.

From there, you only need your workpiece to be aligned with what your design is trying to do. I would think it would be simpler/easier to rotate the design than re-align the CNC to a different angle.