On Sat, Sep 20, 2014 at 12:28:46PM -0400, Kip Shaffer wrote: > When rotation_xy is 0 (and tool_offset is all zeros) the following is true: > > Work position = actual_position - g92_offset - g5x_offset > > However, when rotation_xy is not zero, a rotation has to be applied. The > question is where?
This is tricky to get right! Tool offsets don't rotate G5x offsets don't rotate G92 offsets DO rotate Don't forget wrapped rotaries Don't forget units The canonical code for this is what AXIS uses: see glcanon.py around line 1265 and in fact you can see this very clearly in AXIS if you mess with the offsets and rotation, and see what the preview does. It represents each offset with a labeled line from the old to the new origin. You can see that the g92 line rotates (within the G5x system) but the g5x line doesn't. You can find equivalent code in touchy's emc_interface.py around line 300 Start with unoffset position subtract tool length subtract g5x offset rotate x,y (negative direction) subtract g92 offset for each rotary, if it's wrapped, adjust mod 360 adjust units for presentation to user, if necessary, for xyz and uvw ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that Matters. http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
