585,996 active members*
4,636 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Tormach Personal CNC Mill > Tormach PathPilot™ > Goto G30 - moves all 3 axes at once. Dangerous for a tool change.
Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2007
    Posts
    701

    Goto G30 - moves all 3 axes at once. Dangerous for a tool change.

    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

  2. #2
    Join Date
    Jul 2004
    Posts
    1424

    Re: Goto G30 - moves all 3 axes at once. Dangerous for a tool change.

    Sounds like this might be worth a program enhancement submission to Tormach.

    http://www.tormach.com/pathpilot_tracking.html

    But... from a practical standpoint, the SETTINGS tab has a check mark selection for "G30 move in z axis only" which means you would never get a crash.

    I am not sure the value of an XY-axis movement when conducting a tool change (unless you have a tool storage rack on the mill table). Or maybe you have some longer tools in the ATC and you want to move the vise/workpiece to the other side of the mill head before swinging the ATC?
    Tim
    Tormach 1100-3, Grizzly G0709 lathe, Clausing 8520 mill, SolidWorks, HSMWorks.

  3. #3
    Join Date
    Aug 2007
    Posts
    701

    Re: Goto G30 - moves all 3 axes at once. Dangerous for a tool change.

    Tmarks- the move in z only is great if u are using all tools in a repeatable holder. I have a tool touch plate mounted to my table that I use to measure drills, etc. so I have the g30 programmed to move over my touch plate.

  4. #4
    Join Date
    Jul 2004
    Posts
    1424

    Re: Goto G30 - moves all 3 axes at once. Dangerous for a tool change.

    ahh, that makes sense.

    Nice job on the *.py file.

    Looking at the original, it really does look like a bug. You should submit it as a bug fix along with your code suggestion.
    Tim
    Tormach 1100-3, Grizzly G0709 lathe, Clausing 8520 mill, SolidWorks, HSMWorks.

Similar Threads

  1. How to change Tool change position(About MAZATROL T1 control)
    By liushuixingyun in forum Mazak, Mitsubishi, Mazatrol
    Replies: 6
    Last Post: 01-07-2014, 01:33 AM
  2. Modify lathe post to separate X&Z moves after tool changes
    By colton_m in forum Post Processors for MC
    Replies: 10
    Last Post: 09-27-2013, 09:43 AM
  3. cant frigure out why 1 tool moves
    By biwmc in forum Daewoo/Doosan
    Replies: 1
    Last Post: 12-15-2011, 05:51 AM
  4. Can you use tool comp for X-Z moves instead of XY
    By Dennis Fletcher in forum Haas Mills
    Replies: 8
    Last Post: 10-29-2010, 12:06 AM
  5. Rapid tool moves when not cutting?
    By Fleck in forum G-Code Programing
    Replies: 2
    Last Post: 04-22-2009, 07:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •