Hello Guest it is September 18, 2019, 08:59:24 AM

Author Topic: Gcode help need?  (Read 1778 times)

0 Members and 1 Guest are viewing this topic.

Gcode help need?
« on: June 03, 2012, 06:40:33 PM »
 ???
Hi everybody,
I'm very new to Mach3, but I do not give up easily. I need help to start on Gcode, any help will be very welcome.

Please anyone read the description below and give some help to start this G code. I hope I can keep learning and doing all modification needed in future.
Sequence:
Apply glue over a circle line

Start

1- go to tool position
2- activate valve 1 to lock tool( stay locked till need change tool)
3- go to waiting position (stay till input signal come on line 4)
4- input signal to enable job start
5- go to circle start position
6- lower Z to position
7- start circle job
8- activate valve 2 to dispense glue
9- deactivate valve 2 at the circle end
10- go to waiting position on line 3

thanks all

Darli

Offline BR549

*
  •  6,887 6,887
    • View Profile
Re: Gcode help need?
« Reply #1 on: June 03, 2012, 07:13:21 PM »
You will need  more than just simple Gcode to get the job done. It will require a Macro to run the program as Gcode in itself cannot WAIT on a function to happen and then restart itself.

It Can be done though with a macro, (;-) TP
Re: Gcode help need?
« Reply #2 on: June 03, 2012, 07:59:18 PM »
thank you BR549,
I was thinking about that because I notice that the Gcode do not wait to execute. But as I'm new to CNC and Gcode I need any help. I know that there is somebody to help me in this great forum.

thanks
Re: Gcode help need?
« Reply #3 on: June 03, 2012, 10:21:05 PM »
Hi, this will depend on how your machine is wired up.
I'm thinking you could use the spindle and flood coolant outputs to control the valves. Your Gcode will depend on what positions and rates you want to use but I have an outline here if it is useful. I think you can get the job done with just conventional coding.

If you only use valve 1 for tool changes, why not just use a switch? Hardware solutions are robust, cheap and easy to fit.

Usual caveats apply: ymmv.

1- go to tool position - simple G0 commands
2- activate valve 1 to lock tool( stay locked till need change tool) use M8 command, usually flood coolant (or hardware switch)

Lines 3-10 need to go in a subroutine. Line 3a goes here: command M98 P1 L1000 (repeat subroutine 1 a thousand times)

M30 (stops and rewinds when the 1000 cycles are complete)
% (ensures the program rolls over the M30 correctly)


Subroutine here:

o1 (marks the start of the subroutine)
3- go to waiting position (stay till input signal come on line 4) G0 commands and M1 optional stop
4- input signal to enable job start - Click cycle start
5- go to circle start position - G0 commands to position
6- lower Z to position - G0 again
7- activate valve 2 to dispense glue - Use M3 (spindle forward)
8- start circle job - G02 OR G03 depending on direction. you can't have spindle commands in the middle of a move. But you can program delays for spindle on/off which may be useful as the glue gets going.
9- deactivate valve 2 at the circle end - Use M5 (spindle off)
10- go to waiting position on line 3
M99 (end of subroutine)

You will need to do some of the programming - Be careful and see how you get on.