Hello Guest it is March 29, 2024, 06:07:38 AM

Author Topic: Pause milling on G0  (Read 4299 times)

0 Members and 1 Guest are viewing this topic.

Pause milling on G0
« on: April 24, 2009, 10:45:51 PM »
I have a positioning stage under mach3 control and a manual z and desperately require a script that on any G0 the gcode will pause (for say 10seconds or wait for button press) so I can lift the tool when complete the G0 command and wait for me to re-lower the tool.

Can anybody hook me up as I have NO idea where to even start.

In case your wondering im doing engraving and my z has a floating head, the only reason its not under motion control yet is Ive yet to make all the necessary components and need a screw still.

EDIT:

Ok so i re-watched all the videos, I hate visual basic and don't know any syntax but I think i know what sequence of operations im going for now at least. Something like this:

if G0 then
do button 1001 (feed hold)
while input 15 is not on wait
do button 1004 (single step, do the G0 rapid)
while input 15 is not on wait
do button 1005 (resume)

and save the file as G0 so its called automatically on any G0 (I can do it with M's but haven't tried G's yet...) this way I can mount a simple push button on the feed handle of my spindle and easily sit there and go at the entire operation. If i cant use G's as macros then I could figure out how to get Mastercam to put a custom M code before and after a G0 for the same effect.
« Last Edit: April 25, 2009, 12:38:42 AM by iceblu3710 »
Re: Pause milling on G0
« Reply #1 on: April 25, 2009, 12:57:03 PM »
I was up all night after house of frustration and found one some config setting was ignoring ALL macros, after I figured that out (I copied the Mach3Mill config screen) It was a bit easier. Woke up this morning to finish the inputs and here is the finished script, works perfectly!

'M37 Macro For Manual Z-Axis Movement

Call DoOEMButton (1001)                    'Pause GCode

Message ("Move Spindle Up")

Do While IsStopped()
  If Not IsActive(INPUT1) Then             'Loop untill INPUT1 is active
    Message ("Waiting For Spindle OK")
    Sleep 100
  Else
    Message ("Loading G0")
    Call DoOEMButton (1004)                'Single Step Code Step
    Call DoOEMButton (1000)                'Start GCode
    Exit Do
  End If
Loop

Message ("Wait While GO")

While IsMoving                             'Wait for G0 to finish
Sleep 100                     
Wend

Message ("Move Spindle Down")

Do While IsStopped()                         
  If Not IsActive(INPUT1) Then             'Loop untill INPUT1 is active
    Message ("Waiting For Spindle OK")
    Sleep 100
  Else
    Message ("Continuing Program")
    Call DoOEMButton (1004)       'Disable Single Step
    Call DoOEMButton (1000)       'Resume Program
    Exit Do
  End If
Loop

Re: Pause milling on G0
« Reply #2 on: April 27, 2009, 10:55:22 AM »
I would in this case, just enabled the Optional M1 Stop in the main screen, and would have added an M1 before each G0, that way the Gcode would feed hold until cycle start would be pressed again.

Fernando
Re: Pause milling on G0
« Reply #3 on: April 27, 2009, 11:12:24 PM »
I wanted a more intuitive macro as I stand by the machine and have a button on the axis lever, everythings nice and quick now, just need to make a few more preset tool holders to shave a few more seconds off runs.