Array offset
20 May 2014 22:13 #47101
by gaeldk
Array offset was created by gaeldk
Hello,
Hello,
I have a milling operation that needs to be repeated for example 4 times.
Assume I have the GCode for the first.
How can I programm an array to repeat the operation with a specific deta in X and Y, say for example delta X 2cm, delta Y 3cm ?
That would lead to 4 times the same operation but with a homing offset of
X 0 Y 0 for the first
X 0 Y 3 for the second
X 2 Y 0 for the third
X 2 Y 3 for the 4th
Hello,
I have a milling operation that needs to be repeated for example 4 times.
Assume I have the GCode for the first.
How can I programm an array to repeat the operation with a specific deta in X and Y, say for example delta X 2cm, delta Y 3cm ?
That would lead to 4 times the same operation but with a homing offset of
X 0 Y 0 for the first
X 0 Y 3 for the second
X 2 Y 0 for the third
X 2 Y 3 for the 4th
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
20 May 2014 23:05 #47103
by Todd Zuercher
Replied by Todd Zuercher on topic Array offset
I set up some files to do just that this morning. This might not be the best way but it works for me.
To do more than 2x2 change the numbers in the brackets to the number of desired repeats in that direction.
This code will make all the repeats in an X row then start over with all the Xs in the next Y row....
G92.1
G90
O100 sub
(G-code lines to be repeated here)
G0 X0Y0
O100 endsub
O102 repeat [2] (number of rows Y repeats)
O103 repeat [2] (number of columns X repeats)
O100 call
G0 X2.0Y0 (width of columns)
G92 X0Y0
O103 end repeat
G92.1
G0 X0Y3.0 (length of rows)
G92 X0Y0
O102 endrepeat
To do more than 2x2 change the numbers in the brackets to the number of desired repeats in that direction.
This code will make all the repeats in an X row then start over with all the Xs in the next Y row....
The following user(s) said Thank You: gaeldk
Please Log in or Create an account to join the conversation.
21 May 2014 00:26 #47110
by gaeldk
Replied by gaeldk on topic Array offset
Thank you !
I see the process here.
Wouldn't it be even better with a final G92.1 to do a final offset reset ?
I see the process here.
Wouldn't it be even better with a final G92.1 to do a final offset reset ?
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
21 May 2014 01:24 #47114
by Todd Zuercher
Replied by Todd Zuercher on topic Array offset
Yes, it would. I have one in the normal post-amble of my files, and it didn't get included in the copy and paste.
Please Log in or Create an account to join the conversation.
12 Dec 2014 17:57 - 12 Dec 2014 17:58 #53950
by gaeldk
Replied by gaeldk on topic Array offset
Hello,
Found out that the G-Code was not correct when having more than 2 lines in the Y direction.
Below is a corrected G-Code
Found out that the G-Code was not correct when having more than 2 lines in the Y direction.
Below is a corrected G-Code
G92.1
(INIT G-code here)
O100 sub
(G-code lines to be repeated here)
G0 X0Y0
O100 endsub
#1=17 (number of items on Y)
#2=4 (number of items on X)
#3=72.5 (spacing for X)
#4=72.5 (spacing for Y)
O102 repeat [#1] (number of rows Y repeats)
O103 repeat [#2] (number of columns X repeats)
O100 call
G0 X#3 Y0 (width of columns)
G92 X0Y0
O103 end repeat
G0 X[#3*-#2]
G92X0
G0 X0 Y#4 (length of rows)
G92 X0Y0
O102 endrepeat
G92.1
M2
Last edit: 12 Dec 2014 17:58 by gaeldk.
The following user(s) said Thank You: crisiacuf
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
12 Dec 2014 22:03 #53961
by Todd Zuercher
Replied by Todd Zuercher on topic Array offset
Thanks,
I have never tried to run more than 2 rows in the Y, so I missed the error.
I have never tried to run more than 2 rows in the Y, so I missed the error.
Please Log in or Create an account to join the conversation.
05 Feb 2019 12:48 #125725
by crisiacuf
Replied by crisiacuf on topic Array offset
Thank you for the code!
It works for me but it makes an extra, unnecessary move on X after each line and one move on Y after the last line.
Is it the program that does that or my frankencode(I don't understand everything in it yet, is more of a work in progress understanding G code)?
This is an exemple:
G92.1
G21 G17 G90 G54 G64 P0.001
(5.5mm JOBBER DRILL)
T09 M06
S4500 M03
M08
G90 G54 G00 X0 Y0
O100 sub
T11 G43 Z25. H09
G83 G98 R3. Z-10. Q2. F354.33
G80 G00 Z25.
O100 endsub
#1=4 (number of items on Y)
#2=4 (number of items on X)
#3=72 (spacing for X)
#4=72 (spacing for Y)
O102 repeat [#1] (number of rows Y repeats)
O103 repeat [#2] (number of columns X repeats)
O100 call
G0 X#3 Y0 (width of columns)
G92 X0Y0
O103 end repeat
G0 X[#3*-#2]
G92X0
G0 X0 Y#4 (length of rows)
G92 X0Y0
O102 endrepeat
G92.1
M2
It works for me but it makes an extra, unnecessary move on X after each line and one move on Y after the last line.
Is it the program that does that or my frankencode(I don't understand everything in it yet, is more of a work in progress understanding G code)?
This is an exemple:
G92.1
G21 G17 G90 G54 G64 P0.001
(5.5mm JOBBER DRILL)
T09 M06
S4500 M03
M08
G90 G54 G00 X0 Y0
O100 sub
T11 G43 Z25. H09
G83 G98 R3. Z-10. Q2. F354.33
G80 G00 Z25.
O100 endsub
#1=4 (number of items on Y)
#2=4 (number of items on X)
#3=72 (spacing for X)
#4=72 (spacing for Y)
O102 repeat [#1] (number of rows Y repeats)
O103 repeat [#2] (number of columns X repeats)
O100 call
G0 X#3 Y0 (width of columns)
G92 X0Y0
O103 end repeat
G0 X[#3*-#2]
G92X0
G0 X0 Y#4 (length of rows)
G92 X0Y0
O102 endrepeat
G92.1
M2
Please Log in or Create an account to join the conversation.
07 Feb 2019 23:00 - 08 Feb 2019 17:59 #125959
by MaHa
Replied by MaHa on topic Array offset
This modification doesn't make unnecessary moves. Also no G92, Sub,and repeat. The problem in your routine is, the xy movement after o100, G83.
Because sometimes brackets get lost in the uploaded files, there is a screenshot, how it should look.
EDIT:
Toolpath changed to: ZigZag orthagonal along X
Because sometimes brackets get lost in the uploaded files, there is a screenshot, how it should look.
EDIT:
Toolpath changed to: ZigZag orthagonal along X
Last edit: 08 Feb 2019 17:59 by MaHa. Reason: Toolpath changed to: ZigZag orthagonal along X
Please Log in or Create an account to join the conversation.
Time to create page: 0.138 seconds