585,978 active members*
4,189 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > How can I use G-Code to pause the machine?
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2008
    Posts
    139

    How can I use G-Code to pause the machine?

    I'm trying to modify a half finished coil winding plugin which runs under Mach3 to suit my needs.

    Basically the X Axis is a motor that turns while copper wire is wound onto it,while the Y Axis traverses left & right & so forth.

    What I'd like to do is build in a pause at each end of the traversal (so I can apply varnish to each layer of winding).

    I inserted a 'tool change' command as follows...

    Code "M06(Apply Varnish!)"


    ...when the program is running, Mach3 duly pauses at that line, but when I click on 'cycle start', it takes about 30 seconds before Mach3 continue! I reckon this is becuase a tool change command takes the 3 axis back to machine coordinates & then back again (I can't see this - it's just an inkling).

    therefore I was wondering what command I could use in place of a tool change to pause Mach3, but which starts off the axis moving again as soon as I click on cycle start?

  2. #2
    Join Date
    Apr 2006
    Posts
    187
    Try "M00" or "M01".

  3. #3
    Join Date
    Jul 2008
    Posts
    139
    The answer (as ever), was via Google (just need to get the correct search terms...

    http://www.cnczone.com/forums/archiv...p/t-12505.html
    Courtyesy of Al the Man...


    "M01 is Optional stop, when this is seen, the program halts and waits for a cycle start. You would have to check to see if Mach2 has this."


    I've since added...

    Code "M01(Apply Varnish!)"

    into my script & works a charm


    Edit: SCRAPWOTSCRAP ...just seen your response - bang on! (thanks)

  4. #4
    Join Date
    Apr 2006
    Posts
    187
    Now just remember to apply varnish when directed to, lol. Google is a most wonderful thing.

  5. #5
    Join Date
    Jul 2008
    Posts
    139
    I'd still love to know how I can 'kludge' accelerate & decelerate per traversal...

    Start
    Move left to right
    Gain full Speed.
    Start decelerating as the right side target coordinate nears
    Pause at right hand side
    Apply Varnish
    User clicks 'Cycle start'
    Wire feed motor traverses right to left
    Attains full Speed
    Start decelerating as left side target coordinate nears

    & so on.

    here's what I appear to have at present...

    Move left to right
    Gain full Speed.
    Abrupt stop at right hand side target coordinate.
    Apply Varnish
    User clicks 'Cycle start'
    Wire feed motor traverses right to left at full speed
    Abrupt stop at left hand side target coordinate.

    & still open to ideas!

  6. #6
    Join Date
    Apr 2006
    Posts
    187
    Well, if you know the left and right target coordinates, you might be able to achieve your accel and deccel simply by manipulating feedrates along the way to your target coordinates. Say right target is X10. Say your max feedrate is 300 ipm.

    G01 X6. F300
    G01 X8. F150
    G01 X9. F80.
    G01 X10. F20.
    M01 (apply Varnish)

    Rudimentary example but I think you'll get the idea.

  7. #7
    Join Date
    Jul 2008
    Posts
    139
    It looks like this is my only option - I guess this could be coded into the 'behind the scenes' VBscipt - just got to work out how!

    Many thanks!

  8. #8
    Join Date
    Apr 2006
    Posts
    187
    Grab your calculater and figure percentages of distances to target coordinates and apply appropriate feedrates, once you know what feedrates work best, should be a simple formula.

  9. #9
    Join Date
    Mar 2003
    Posts
    35538
    Just lower the acceleration in motor tuning. That should do what you want.
    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)

  10. #10
    Join Date
    Apr 2008
    Posts
    51
    http://www.acumotion.com/gcode.htm

    Search for pause...
    This says:
    Example
    G4 P2000
    Description
    Pause the tool for 2 seconds (2000 milliseconds) before continuing.

    This should take care of the pause.
    As far as the decel...G61 will cancel constant velocity mode and goto exact stop mode, thus decel. automatically. To cancel exact stop use g64 and you will be back in constant velocity mode.

Similar Threads

  1. Pause under G-Code control
    By gregger2k in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 8
    Last Post: 10-31-2012, 07:54 PM
  2. hardeware pause pause detected?????
    By Conquest1224 in forum Commercial CNC Wood Routers
    Replies: 1
    Last Post: 05-08-2007, 04:06 AM
  3. G Code Variances from machine to machine?
    By Miguel Gonzalez in forum G-Code Programing
    Replies: 16
    Last Post: 03-28-2007, 09:31 AM
  4. how to programmatically pause
    By Antonio_Emilio in forum LinuxCNC (formerly EMC2)
    Replies: 2
    Last Post: 01-27-2007, 06:32 PM
  5. How to pause Turbocnc
    By jimglass in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 13
    Last Post: 03-28-2006, 12:06 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
  •