Helical milling with a diagonal repeat ?
- grey1beard
- Offline
- Elite Member
Less
More
- Posts: 167
- Thank you received: 0
03 Dec 2010 11:37 #5834
by grey1beard
Helical milling with a diagonal repeat ? was created by grey1beard
Having read as much as I could find, and with lots of trial and error in AXIS, I've got an example of the g-code for a canned drilling cycle which I now understand and want to modify.
The modification is to change the simple plunge drilling to a helical milling motion, so that each hole is now larger than the diameter of the tool.
As an example, my canned repeat drilling code -
g17 g21 g40 g49 g54 g80 g90 g94(my standard header line)
g00 x[0] y[0] z[5]
g91 g81 g98 x12 y20 z-6 R1.8 L3
g90
g00 z[5]
and my helical milling code -
g17 g21 g40 g49 g54 g80 g90 g94(my standard header line)
#1=21.5
#2=15
#3=5 (safe height)
#9=250
g00 x[21.5] y[15] z[#3] (1st hole position)
g00 z[0]
O100 SUB
g91 (Switch to incremental mode)
(FIND START POSITION)
g01 z[-2] F#9(drop to 1st cutting level at centre of hole)
g01 y[2] F#9(cut outwards to hole diameter)
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 F#9 (bottoming hole)
g02 y[2] J1 F#9
g01 y[-1] F#9(move to original centre position)
g01 z#3 F#9(up to safe height)
g90 (Return to absolute mode)
O100 ENDSUB
Could someone tell me by way of simple example, how to blend the two codes together, so that I have a file that I could then modify to suit.
Many thanks,
John (the old grumpy skinny one)
The modification is to change the simple plunge drilling to a helical milling motion, so that each hole is now larger than the diameter of the tool.
As an example, my canned repeat drilling code -
g17 g21 g40 g49 g54 g80 g90 g94(my standard header line)
g00 x[0] y[0] z[5]
g91 g81 g98 x12 y20 z-6 R1.8 L3
g90
g00 z[5]
and my helical milling code -
g17 g21 g40 g49 g54 g80 g90 g94(my standard header line)
#1=21.5
#2=15
#3=5 (safe height)
#9=250
g00 x[21.5] y[15] z[#3] (1st hole position)
g00 z[0]
O100 SUB
g91 (Switch to incremental mode)
(FIND START POSITION)
g01 z[-2] F#9(drop to 1st cutting level at centre of hole)
g01 y[2] F#9(cut outwards to hole diameter)
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 z[-2] F#9
g02 y[2] J1 F#9
g02 y[-2] J-1 F#9 (bottoming hole)
g02 y[2] J1 F#9
g01 y[-1] F#9(move to original centre position)
g01 z#3 F#9(up to safe height)
g90 (Return to absolute mode)
O100 ENDSUB
Could someone tell me by way of simple example, how to blend the two codes together, so that I have a file that I could then modify to suit.
Many thanks,
John (the old grumpy skinny one)
Please Log in or Create an account to join the conversation.
03 Dec 2010 14:21 - 03 Dec 2010 14:25 #5837
by andypugh
Replied by andypugh on topic Re:Helical milling with a diagonal repeat ?
I would be tempted to do it with a loop (in a subroutine. )
This is an ad-hoc bit of code written without reference to any G-code interpreter for checking.
1) Create a file in the normal G-code file location and call it spiral.ngc
O<spiral> SUB
(Parameters passed are #1 X, #2 Y, #3 topZ #4 bottom Z, #5 radius, #6 cut-per-rev #7 feed)
G90.1 (absolute arc centres)
G0 X[#1 - #5] Y#2 Z[#3 + #6]
G1 Z#3 F#7
#10 = #3
O100 WHILE [#10 GT [#4 + #6]]
#10 = [#10 - #6]
G2 I#1 J#2 Z#10 F#7
O100 ENDWHILE
G2 I#1 J#2 Z#4 F#7
G2 I#1 J#2 Z#4 F#7
O<spiral> ENDSUB
M2
You would then call the sub as a "canned cycle" from your main code with something like
O<spiral> CALL [12] [20] [1.8] [-10] [6] [2]
No guarantees, E&OE
This is an ad-hoc bit of code written without reference to any G-code interpreter for checking.
1) Create a file in the normal G-code file location and call it spiral.ngc
O<spiral> SUB
(Parameters passed are #1 X, #2 Y, #3 topZ #4 bottom Z, #5 radius, #6 cut-per-rev #7 feed)
G90.1 (absolute arc centres)
G0 X[#1 - #5] Y#2 Z[#3 + #6]
G1 Z#3 F#7
#10 = #3
O100 WHILE [#10 GT [#4 + #6]]
#10 = [#10 - #6]
G2 I#1 J#2 Z#10 F#7
O100 ENDWHILE
G2 I#1 J#2 Z#4 F#7
G2 I#1 J#2 Z#4 F#7
O<spiral> ENDSUB
M2
You would then call the sub as a "canned cycle" from your main code with something like
O<spiral> CALL [12] [20] [1.8] [-10] [6] [2]
No guarantees, E&OE
Last edit: 03 Dec 2010 14:25 by andypugh.
Please Log in or Create an account to join the conversation.
- grey1beard
- Offline
- Elite Member
Less
More
- Posts: 167
- Thank you received: 0
03 Dec 2010 14:30 #5838
by grey1beard
Replied by grey1beard on topic Re:Helical milling with a diagonal repeat ?
Thanks Andy, I'll check it out in my new Sim AXIS in front of the fire (see my other thread re AXIS )
I like your other coding touch - E&OE - must remember that one.
John
I like your other coding touch - E&OE - must remember that one.
John
Please Log in or Create an account to join the conversation.
- grey1beard
- Offline
- Elite Member
Less
More
- Posts: 167
- Thank you received: 0
03 Dec 2010 15:22 #5840
by grey1beard
Replied by grey1beard on topic Re:Helical milling with a diagonal repeat ?
The helix is great, much simpler.
At the moment I can't get the "call" to perform, but I'll experiment after a bit more reading, so it's back to the user manual first.
John
At the moment I can't get the "call" to perform, but I'll experiment after a bit more reading, so it's back to the user manual first.
John
Please Log in or Create an account to join the conversation.
- grey1beard
- Offline
- Elite Member
Less
More
- Posts: 167
- Thank you received: 0
03 Dec 2010 15:58 - 03 Dec 2010 15:59 #5842
by grey1beard
Replied by grey1beard on topic Re:Helical milling with a diagonal repeat ?
andypugh wrote:
Just read the "Calling files" in the user manual, and I now understand the significance of the above.
I'll try doing it properly this time...!
John
.........
1) Create a file in the normal G-code file location .........
Just read the "Calling files" in the user manual, and I now understand the significance of the above.
I'll try doing it properly this time...!
John
Last edit: 03 Dec 2010 15:59 by grey1beard.
Please Log in or Create an account to join the conversation.
- grey1beard
- Offline
- Elite Member
Less
More
- Posts: 167
- Thank you received: 0
03 Dec 2010 17:07 - 03 Dec 2010 17:07 #5843
by grey1beard
Replied by grey1beard on topic Re:Helical milling with a diagonal repeat ?
Now seem to have fallen down a black hole
I thought I had worked out what I'd done wrong, and tried various changes to naming and locating the spiral.ngc file.
However, nothing worked, so I thought I'd go back and start over.
Alas, I can't now get even the single spiral to run in Axis.
I load the file exactly as before -
O<spiral> SUB
#1=0
#2=0
#3=0 (topZ )
#4=-12 (bottom Z)
#5=6
#6=2
#7=250
G90.1 (absolute arc centres)
G0 X[#1 - #5] Y#2 Z[#3 + #6]
G1 Z#3 F#7
#10 = #3
O100 WHILE [#10 GT [#4 + #6]]
#10 = [#10 - #6]
G2 I#1 J#2 Z#10 F#7
O100 ENDWHILE
G2 I#1 J#2 Z#4 F#7
G2 I#1 J#2 Z#4 F#7
O<spiral> ENDSUB
M2
O<spiral> CALL [12] [20] [1.8] [-10] [6] [2]
but now it loads but nothing appears in the Axis window.
The code appears, but not the plot - "I've lost the plot"
John
I thought I had worked out what I'd done wrong, and tried various changes to naming and locating the spiral.ngc file.
However, nothing worked, so I thought I'd go back and start over.
Alas, I can't now get even the single spiral to run in Axis.
I load the file exactly as before -
O<spiral> SUB
#1=0
#2=0
#3=0 (topZ )
#4=-12 (bottom Z)
#5=6
#6=2
#7=250
G90.1 (absolute arc centres)
G0 X[#1 - #5] Y#2 Z[#3 + #6]
G1 Z#3 F#7
#10 = #3
O100 WHILE [#10 GT [#4 + #6]]
#10 = [#10 - #6]
G2 I#1 J#2 Z#10 F#7
O100 ENDWHILE
G2 I#1 J#2 Z#4 F#7
G2 I#1 J#2 Z#4 F#7
O<spiral> ENDSUB
M2
O<spiral> CALL [12] [20] [1.8] [-10] [6] [2]
but now it loads but nothing appears in the Axis window.
The code appears, but not the plot - "I've lost the plot"
John
Last edit: 03 Dec 2010 17:07 by grey1beard.
Please Log in or Create an account to join the conversation.
03 Dec 2010 17:19 #5844
by andypugh
Replied by andypugh on topic Re:Helical milling with a diagonal repeat ?
As listed there, there is an M2 (stop) between the sub and the call, so the program just stops before calling the sub.
Please Log in or Create an account to join the conversation.
- grey1beard
- Offline
- Elite Member
Less
More
- Posts: 167
- Thank you received: 0
03 Dec 2010 18:07 #5847
by grey1beard
Replied by grey1beard on topic Re:Helical milling with a diagonal repeat ?
Thanks Andy. I think I missed an edit somewhere.
Now back to the problem of getting the "call" to work.
John
Now back to the problem of getting the "call" to work.
John
Please Log in or Create an account to join the conversation.
03 Dec 2010 19:59 #5849
by andypugh
Replied by andypugh on topic Re:Helical milling with a diagonal repeat ?
Have you seen wiki.linuxcnc.org/cgi-bin/emcinfo.pl?SubProgramFiles ?
Please Log in or Create an account to join the conversation.
- grey1beard
- Offline
- Elite Member
Less
More
- Posts: 167
- Thank you received: 0
03 Dec 2010 20:13 #5851
by grey1beard
Replied by grey1beard on topic Re:Helical milling with a diagonal repeat ?
That's a new one to me, Andy, and thanks.
I must be frank though. It looks like it will take all my liguistic skills to accurately extract the gold from the dross.
Why are so many pages of examples of coding written so poorly ?
The coding is probably perfect, but the language that surrounds it is appalling.
E of R
John
I must be frank though. It looks like it will take all my liguistic skills to accurately extract the gold from the dross.
Why are so many pages of examples of coding written so poorly ?
The coding is probably perfect, but the language that surrounds it is appalling.
E of R
John
Please Log in or Create an account to join the conversation.
Time to create page: 0.078 seconds