On Sun, May 18, 2008 at 11:48:51PM -0400, xtra209 wrote: > > As an example... there would be two home points: (I'm making up numbers > here!) one could be X0, Y10 and the other home point could be X24, Y7. > Then I would like the X axis to be a straight line between these two points.
It sounds like you want coordinate system rotation, not really anything to do with homing. EMC2 doesn't currently have rotation, but with ingenuity you can use its advanced gcode features to get it to do the work for you anyway. Using your two points as an example, here is a way to do what you want in gcode: (the two reference points) #1000=0 (X1) #1001=10 (Y1) #1002=24 (X2) #1003=7 (Y2) (calculate the rotation angle) #1010=ATAN[#1003-#1001]/[#1002-#1000] (set up a subroutine O10, which takes three) (arguments X,Y,Z, and works like G0, but rotated) O10 sub G0 X[#1*COS[#1010]-#2*SIN[#1010]] Y[#1*SIN[#1010]+#2*COS[#1010]] Z#3 O10 endsub (set up a subroutine O11, which takes three) (arguments X,Y,Z, and works like G1, but rotated) O11 sub G1 X[#1*COS[#1010]-#2*SIN[#1010]] Y[#1*SIN[#1010]+#2*COS[#1010]] Z#3 O11 endsub (now use them to cut a rectangle) G90 (this is like G0 X0 Y0 Z0) O10 call [0] [0] [0] F10 (this is like G1 X2 Y0 Z0) O11 call [2] [0] [0] G91 (also works for relative mode) O11 call [0] [1] [0] O11 call [-2] [0] [0] O11 call [0] [-1] [0] G90 M2 Arcs are left as an exercise for the student, as they say in math class. If you can use R format, you would only need to rotate the endpoint. If you use IJ, you'd have to rotate the endpoint and the center vector both. Now that I see this, I like Ray's idea better: generate the rotations outside of the gcode. Chris ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users