Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: widpyro on November 15, 2011, 06:52:39 PM

Title: Using M7 without interrupting G01
Post by: widpyro on November 15, 2011, 06:52:39 PM
I would like to use the M7 and M9 commands without pausing or stopping the g01 travel. What is the correct code order to achieve this?

Thanks,
-jim
Title: Re: Using M7 without interrupting G01
Post by: BR549 on November 15, 2011, 06:56:31 PM
In Gcode just add the M7/9 where ever you want it to occur.

G01 x10 y10 M7
code
code
code
G01 X1 Y1 M9

(;-) TP
Title: Re: Using M7 without interrupting G01
Post by: widpyro on November 15, 2011, 07:31:45 PM
I guess I was not entirely clear. I need to have the M7 and M9 commands happen WHILE the cutter moves along the X or y axis. It must start and stop while the mill head advances without pausing. Specifically, I need the M7 command to happen at the beginning of an G01 command and then the M9 command to happen before the end of the g01 run, IE without stopping the movement of the mill head along the X or Y axis.

I am not using the M7 and M9 for cutting fluid, -it is for a different application. When I add the M7 or M9 commands anywhere in the code, the mill head stops momentarily while the commands are carried out. Is there a way to avoid this?
thanks,
-jim
Title: Re: Using M7 without interrupting G01
Post by: HimyKabibble on November 15, 2011, 07:45:56 PM
G-code is executed one block at a time, and the currently executing block must complete before the next one will be executed.  So, what you're asking for can't be done.

Regards,
Ray L.
Title: Re: Using M7 without interrupting G01
Post by: BR549 on November 15, 2011, 07:54:22 PM
Is this a large application or something simple with a few lines of code. IF it is a simple application it may be possible to monitor Key postion points with a macropump watching the dros and have it cycle the M9 off mid line .

(;-) TP
Title: Re: Using M7 without interrupting G01
Post by: widpyro on November 15, 2011, 08:37:43 PM
It is a simple bit of code. Basically it does a rectangle shape repeatedly. The m7-m9 commands occur at the beginning few centimeters of each corner of the rectangular path. I am not familiar with the technique you mentioned so I'll need instructions aimed at a relative neophyte.
thanks,
-jim
Title: Re: Using M7 without interrupting G01
Post by: BR549 on November 15, 2011, 09:27:12 PM
OK Just tested a simple macropump BUT it is too slow. I tested a Brain and it will work.

You will have to learn how to program a brain and then develope a strategy to toggle off the M9 when it crosses the trigger points in your Gcode.

a simple brain would be like this     (oemDro(0) )-------->  If >5.00 ------------------> Dobutton(113).

It monitors the DRO and when the value crosses the 5.00 threshold it then toggles OFF the Coolant(M9)

You will need to develope a ladder structure to comply with all the way points BUT still allow the program to function.


Can you post an example of the needed Gcode that drives the function. It may be possible to rearrange the gcode to get it to do what you need rather than the Brains approach.


Hope that helps, (;-) TP

Title: Re: Using M7 without interrupting G01
Post by: widpyro on November 15, 2011, 09:54:08 PM
Here is the basic block of the code:

f500
m7 g01 x9
m9 g01 x44.18
m7 g01 y-9
m9 g01 y-30
m7 g01 x35.18
m9 g01 x0
m7 g01 y-21
m9 g01 y0

This is repeated several times. If you can re-create this using your recommended technique so that there is no pause during the M7-M9 cycle, it would be great. Thanks for accepting this unusual request!

-jim
Title: Re: Using M7 without interrupting G01
Post by: BR549 on November 15, 2011, 11:37:38 PM
Here is the test Gcode and the BRAIN. Load up the brain and run the Gcode. It move until it gets to the target point then shuts off the mist. At the next corner the Mist turns on with the Gcode and then when it gets to the target point it shuts off the mist, etc,etc

f100
m7 g01 x44.18
m7 g01 y-30
m7 g01 x0
m7 g01 y0
m30

Hope that helps, (;-)TP
Title: Re: Using M7 without interrupting G01
Post by: BR549 on November 16, 2011, 12:09:53 AM
If you want to try the macropump version this is the code to add to the macropump

If GetDro(1)=0 And GetDro(0)>9.000 Then
DoOemButton(114)
Else
If GetDro(0)= 44.18 And GetDro(1)> -9.000 Then
DoOemButton(114)
Else
If GetDro(1)=-30.000 And GetDro(0)< 35.18 Then
DoOemButton(114)
Else
If Getdro(0)=0 And Getdro(1)>-21.00 Then
DoOemButton(114)
End If

End

(;-) TP
Title: Re: Using M7 without interrupting G01
Post by: stirling on November 16, 2011, 05:07:19 AM
Reading between the lines this looks like the old problem that laser and 3D extrusion printer users face where they want to activate/deactivate the laser or extruder mid travel to avoid burns or over deposits.

This is exactly what Art created the E commands for but apparantly these got broken some releases back. One commonly used workwround was to use a spare axis DIR signal to toggle the required output.

It's discussed in various threads - here's one example. Tweakie's your man I think for this technique.

http://www.machsupport.com/forum/index.php?topic=18263.0 (http://www.machsupport.com/forum/index.php?topic=18263.0)

Ian
Title: Re: Using M7 without interrupting G01
Post by: widpyro on November 16, 2011, 06:10:51 PM
Here is the test Gcode and the BRAIN. Load up the brain and run the Gcode. It move until it gets to the target point then shuts off the mist. At the next corner the Mist turns on with the Gcode and then when it gets to the target point it shuts off the mist, etc,etc

f100
m7 g01 x44.18
m7 g01 y-30
m7 g01 x0
m7 g01 y0
m30

Hope that helps, (;-)TP

Sorry to be obtuse, but what is a "brain" and exactly how do I load this code into it?

thanks,
-jim
Title: Re: Using M7 without interrupting G01
Post by: BR549 on November 16, 2011, 07:24:34 PM
You are going to have to do some reading and watch the videos on Brains

(;-)TP