I wanted the Go to G30 to move the Z axis up first and then the XY axes so I wouldnt crash a tool when going to the change position.
I ended up modifying this file: remap.py
to do just that. Here are the mods - if anyone is in the same boat:
CHANGE THIS SECTION OF CODE in "remap.py":
def g300(self, **words):
if self.task == 0: return INTERP_OK
print('remapped g30:')
for key in words:
print("word '%s' = %f" % (key, words[key]))
self.status.poll()
# get machine G30 position in current G20/21 units
x = self.params[5181] * get_linear_scale(self)
y = self.params[5182] * get_linear_scale(self)
z = self.params[5183] * get_linear_scale(self)
# an axis must be referenced only if that axis is to be moved
g30m998_move_z_only = self.redis.hget('machine_prefs', 'g30m998_move_z_only')
# unconditionally change motion mode to G90 to prevent stack underrun error
self.execute('G90')
if g30m998_move_z_only == 'True':
# other words on this line are ignored because we're doing Z only, per settings screen
position = ' Z%.4f' % z
print 'G53 G0' + position
self.execute('G53 G0' + position)
# done
else:
# handle easy case - no words on line
if len(words) == 0:
position = 'X%.4f Y%.4f Z%.4f' % (x, y, z)
self.execute('G53 G0' + position)
else:
# there are coordinates supplied on the G30 line.
# G0 to these coordinates, then G0 to G30 position
position = ''
if 'x' in words:
position += ' X%.4f' % words['x']
if 'y' in words:
position += ' Y%.4f' % words['y']
if 'z' in words:
position += ' Z%.4f' % words['z']
print 'G0' + position
self.execute('G0' + position)
# Now go to the G30 (absolute) position
position = 'X%.4f Y%.4f Z%.4f' % (x, y, z)
self.execute('G53 G0' + position)
return INTERP_OK
-------------------------------------------------
TO THIS:
def g300(self, **words):
if self.task == 0: return INTERP_OK
print('remapped g30:')
for key in words:
print("word '%s' = %f" % (key, words[key]))
self.status.poll()
# get machine G30 position in current G20/21 units
x = self.params[5181] * get_linear_scale(self)
y = self.params[5182] * get_linear_scale(self)
z = self.params[5183] * get_linear_scale(self)
# an axis must be referenced only if that axis is to be moved
g30m998_move_z_only = self.redis.hget('machine_prefs', 'g30m998_move_z_only')
# unconditionally change motion mode to G90 to prevent stack underrun error
self.execute('G90')
if g30m998_move_z_only == 'True':
# other words on this line are ignored because we're doing Z only, per settings screen
position = ' Z%.4f' % z
print 'G53 G0' + position
self.execute('G53 G0' + position)
# done
else:
# handle easy case - no words on line - I added the first position/print/self.exec lines below to try to move z first
if len(words) == 0:
position = ' Z%.4f' % z
print 'G53 G0' + position
self.execute('G53 G0' + position)
position = 'X%.4f Y%.4f Z%.4f' % (x, y, z)
self.execute('G53 G0' + position)
else:
# there are coordinates supplied on the G30 line.
# G0 to these coordinates, then G0 to G30 position - I added the print + self.exec lines under 'Z' to move z first
position = ''
if 'z' in words:
position += ' Z%.4f' % words['z']
if 'x' in words:
position += ' X%.4f' % words['x']
if 'y' in words:
position += ' Y%.4f' % words['y']
print 'G0' + position
self.execute('G0' + position)
# Now go to the G30 (absolute) position - following is original PP
position = ' Z%.4f' % (z)
self.execute('G53 G0' + position)
position = 'X%.4f Y%.4f' % (x, y)
self.execute('G53 G0' + position)
return INTERP_OK