fragmuffin / pygcode

GCODE Parser for Python
GNU General Public License v3.0
123 stars 38 forks source link

G80 returns from canned cycle #21

Open swinman opened 4 years ago

swinman commented 4 years ago

G80 is a return from a can cycle.. there is nothing wrong with the following (from the perspective of a machine)

strs = ['G0 G90 X0 Y0', 'S100 M3', 'G81 Z0 F100', 'G80', 'X1 Y1']
m = Machine()
for s in strs: m.process_str(s)

but running the above causes the error:

MachineInvalidState: modal parameters 'X1 Y1' cannot be assigned when in mode: <Mode: G17 G90 G91.1 G94 G21 G40 G49 G54 G61 G97 M3 M9 F100 S100 T0>

The mode when this comes out of the can cycle (with G80) should be G0 -- so the X1 Y1 command should cause the machine to rapid to X1 Y1

swinman commented 4 years ago

OKAY -- i tested this on my haas this morning. When G80 is called to return from a canned cycle the machine stays in the same Group 1 mode it was in before the G81 call... in other words if the mode was G0, it stays in rapid movement mode but if the mode was G1 it drops back into linear feed mode

Part of the problem is that, at least with a haas, group 1 includes G0, G1, G2, G3 whereas G73 - G89 are members of Group 9 -- see https://www.haascnc.com/content/dam/haascnc/en/service/manual/operator/english---mill-ngc---operator's-manual---2017.pdf section 7.1.1 -- so G80 (group 9) should not change the movement mode (group 1)