586,115 active members*
3,383 visitors online*
Register for free
Login
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2009
    Posts
    147

    g-code homing script

    I'm looking for advice on g-code homing script that I'm going to use in machIII

    I have one z stepper, one y stepper, and 2 x steppers (typical 4 stepper gantry router X is one of the motors, A is the other)

    I've read the info from the sidebar on the home page (CNCzone.com-Machinist Community Forums - Magazine - CNC Basics And Using CNC - Using the Homing Commands (re-print from deskcnc.com)) and am attempting to wire all of the limit and homing switches into one input on my g540 controller. I want to wire the Limit/homing switches so low is not triggered and high is triggered. At least that is the plan for now.

    I guess the attempt is to use the g-code to make up for using one input but having two motors on the same axis.

    G92.2 G54 (Zero Work Coordinate Offsets)
    G30 X.5 A.5 F100 (Home the X Axis at a fast feedrate and offset by 0.5)
    G30 X.05 A.05 F1 (Re-Home the X Axis at a slower feedrate and offset)
    G30 X.05 F1 (Re-Re-Home X separately from A)
    G30 A.05 F1 (Re-Re-Home A separately from X)
    G30 Y.5 F100 (Home the Y Axis at a fast feedrate and offset by 0.5)
    G30 Y.5 F1 (Re-Home the Y Axis at a slower feedrate and offset)
    G30 Z.5 F100 (Home the Z Axis at a fast feedrate and offset by 0.5)
    G30 Z.5 F1 (Re-Home the Z Axis at a slower feedrate and offset)


    Concerning the X axis, the gantry initially will move itself near the home switches and home and when either side activates a switch it will consider it homed. Then it will come back and do each side separately in order to square itself up. I did the offsets a much lower amount the second/third time that I feel is an amount of out-of-square amount that is easy to induce in my gantry as it will be twisting while getting these sides homed.




    Does this make sense? any better way to go about this?

  2. #2
    Join Date
    Mar 2003
    Posts
    35538
    Are you slaving the motors in Mach3? If so, when you move the X, the A will move with it.

    Imo, if you need to square the gantry, then use two inputs. One for X, Y, and Z, and one for A.

    If you can live without squaring the gantry, then lose the A switch, and in General Config, check the box that says "Home Slave with Master".

    Also, I don't think G30 will home the machine. I think you need to use G28.1

    And maybe I'm not doing it right, but G92.2 G54 isn't zeroing the work coordinates. The manual says use G92.1, but that doesn't work for me either.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

    Mach3 2010 Screenset
    http://www.thecncwoodworker.com/2010.html

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

Similar Threads

  1. Z homing script?
    By antonzedd in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 0
    Last Post: 12-09-2009, 04:16 PM
  2. Run G-code from script
    By leif_brunosson in forum LinuxCNC (formerly EMC2)
    Replies: 1
    Last Post: 11-11-2008, 08:39 PM
  3. Homing axis in G-Code
    By Des Jacobsen in forum Mach Software (ArtSoft software)
    Replies: 0
    Last Post: 10-21-2008, 07:06 AM
  4. Need help with VB script Syntax Please.
    By Adamj12b in forum Mach Software (ArtSoft software)
    Replies: 6
    Last Post: 09-18-2008, 01:18 PM
  5. VB6,VB.net,VB script,What one???
    By hydrospin01 in forum Visual Basic
    Replies: 11
    Last Post: 05-25-2008, 02:09 AM

Posting Permissions

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