Hello Guest it is March 28, 2024, 11:14:06 AM

Author Topic: Gcode repeat Cycle help  (Read 23238 times)

0 Members and 1 Guest are viewing this topic.

Gcode repeat Cycle help
« on: August 14, 2012, 03:09:36 PM »
Hi all,

I have a simple gcode installed for my machine to move in a zig zag motion however I wanted to know if the mach 3 supports such configurations like DO Loop where I can type in a set of gcodes and have it repeat a consistent movement along the y axis... instead of writing out each individual increment (which takes up a whole lot of time and also looking for a more efficient way).

Any help would be appreciated.

Thanks,
V

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Gcode repeat Cycle help
« Reply #1 on: August 14, 2012, 05:24:32 PM »
You could probably code in incremental moves and repeat it as many times as you wanted, would mean you could just type the first zigzag then copy and paste it as many times as you want it to do that.
Hood
Re: Gcode repeat Cycle help
« Reply #2 on: August 14, 2012, 10:44:52 PM »
Hood-

Right now I have

g0 g21 g90 g50 g80 f100
g0 z0 g0 x0 y0
m98 p1 l10
g0 x0
m30
%
o1

g91 g1 z-.5 f50
g90
g1 x-50 f200
g1 y-2
g1 x0
g1 y-4
g1 x-50
g1 y-6
g1 x0
......ETC until .
g1 y-48
g1 x50

is there a way I can repeat the same incremental movements without typing it out all these gcodes?

V

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Gcode repeat Cycle help
« Reply #3 on: August 14, 2012, 11:09:07 PM »
See if this would work

G90G0X0X0X0
G91G1Z-.5F50
X-50F200
Y-2
X50

Then copy and paste the
X-50F200
Y-2
X50

as many times as you want it to repeat.

There are probably other ways but thats how I would do it.
Hood
Re: Gcode repeat Cycle help
« Reply #4 on: August 14, 2012, 11:12:21 PM »
Rather than cut and paste, put the lines to be repeated into a subroutine, then call the subroutine as many times as needed.

G90G0X0X0X0
G91G1Z-.5F50
M98 P01 L10
M30

O01
X-50F200
Y-2
X50
M99
%

Regards,
Ray L.
Regards,
Ray L.

Offline Hood

*
  •  25,835 25,835
  • Carnoustie, Scotland
    • View Profile
Re: Gcode repeat Cycle help
« Reply #5 on: August 14, 2012, 11:13:13 PM »
There you go even easier :)
Hood