Helical milling with a diagonal repeat ?
10 Dec 2010 17:35 #5961
by ArcEye
Replied by ArcEye on topic Re:Helical milling with a diagonal repeat ?
Hi
I'm not able to get to my workshop to test it, so there may be a stupid error in it, but this is a simple example of what I am trying to explain.
Also shows that using labels makes it all much more readable.
Unless you want to re-use code with different files, the sub routine is most easily located at the foot of the same file, rather than a separate file.
Once you have your head around this, you can make the sub routine do your helical mill and use the loop in the main section to move between hole positions.
;;**********************************************************************************************
(Mill diagonal series of holes at X20 Y20 offsets from corner of workpiece)
G17 G21 G40 G49 G54 G80 G90 G94
(global labels have leading underscore)
#<_Holes> = 5
#<_Counter> = 0
#<_X_offset> = 20
#<_Y_offset> = 20
#<_TopZ> = 5
#<_BottomZ> = -10
#<_Feed> = 200
#<_Z_Feed> = 20
G28
M3 S600
M7
(position over corner)
G00 X0 Y0 Z20
G00 Z#<_TopZ>
O100 WHILE[#<_Counter> LT #<_Holes>]
G91
G00 X#<_X_offset> Y#<_Y_offset>
G90
O101 CALL
#<_Counter> = [#<_Counter> + 1]
ENDWHILE
G28
M5
M9
M30
M2
;;*************************************************************************************************
O101 sub
(Local sub so uses the global parameters)
G01 Z#<_BottomZ> F#<_Z_Feed>
G00 Z#<_TopZ>
O101 endsub
hope this helps
regards
ArcEye
I'm not able to get to my workshop to test it, so there may be a stupid error in it, but this is a simple example of what I am trying to explain.
Also shows that using labels makes it all much more readable.
Unless you want to re-use code with different files, the sub routine is most easily located at the foot of the same file, rather than a separate file.
Once you have your head around this, you can make the sub routine do your helical mill and use the loop in the main section to move between hole positions.
;;**********************************************************************************************
(Mill diagonal series of holes at X20 Y20 offsets from corner of workpiece)
G17 G21 G40 G49 G54 G80 G90 G94
(global labels have leading underscore)
#<_Holes> = 5
#<_Counter> = 0
#<_X_offset> = 20
#<_Y_offset> = 20
#<_TopZ> = 5
#<_BottomZ> = -10
#<_Feed> = 200
#<_Z_Feed> = 20
G28
M3 S600
M7
(position over corner)
G00 X0 Y0 Z20
G00 Z#<_TopZ>
O100 WHILE[#<_Counter> LT #<_Holes>]
G91
G00 X#<_X_offset> Y#<_Y_offset>
G90
O101 CALL
#<_Counter> = [#<_Counter> + 1]
ENDWHILE
G28
M5
M9
M30
M2
;;*************************************************************************************************
O101 sub
(Local sub so uses the global parameters)
G01 Z#<_BottomZ> F#<_Z_Feed>
G00 Z#<_TopZ>
O101 endsub
hope this helps
regards
ArcEye
Please Log in or Create an account to join the conversation.
- grey1beard
- Offline
- Elite Member
Less
More
- Posts: 167
- Thank you received: 0
10 Dec 2010 21:29 #5966
by grey1beard
Replied by grey1beard on topic Re:Helical milling with a diagonal repeat ?
As a first step to enlightenment, I turned your code example(many thanks) into a file "example.ngc" and placed in my emc2/nc folder, the idea being to get a look at it in 3d as well as reading the code.
Then I loaded AXIS sim, and opened the file, but it gives me an error "unable to open file <101>.
I have an idea that the call file needs to be loaded separately, also into the nc folder, but I'm not sure if this is so, or the details of how to do it.
Can you put me right on this ?
Many thanks
John
Then I loaded AXIS sim, and opened the file, but it gives me an error "unable to open file <101>.
I have an idea that the call file needs to be loaded separately, also into the nc folder, but I'm not sure if this is so, or the details of how to do it.
Can you put me right on this ?
Many thanks
John
Please Log in or Create an account to join the conversation.
10 Dec 2010 23:27 #5969
by BigJohnT
Replied by BigJohnT on topic Re:Helical milling with a diagonal repeat ?
John,
You can put the o100 sub at the top of the file or create a file called 100.ngc and make sure you have a M2 at the end of the 100.ngc file if you do it that way.
www.linuxcnc.org/docview/html/gcode_main.html#r3_7
John
You can put the o100 sub at the top of the file or create a file called 100.ngc and make sure you have a M2 at the end of the 100.ngc file if you do it that way.
www.linuxcnc.org/docview/html/gcode_main.html#r3_7
John
Please Log in or Create an account to join the conversation.
- grey1beard
- Offline
- Elite Member
Less
More
- Posts: 167
- Thank you received: 0
11 Dec 2010 10:10 - 11 Dec 2010 10:11 #5972
by grey1beard
Replied by grey1beard on topic Re:Helical milling with a diagonal repeat ?
Thanks John. Once I'd got the file named correctly it worked fine.
Thanks ArcEye. I now have another bit of coding I can start to use.
And thanks to Andy for getting the ball rolling.
Regards,
John
Thanks ArcEye. I now have another bit of coding I can start to use.
And thanks to Andy for getting the ball rolling.
Regards,
John
Last edit: 11 Dec 2010 10:11 by grey1beard.
Please Log in or Create an account to join the conversation.
16 May 2013 22:38 - 16 May 2013 22:39 #34198
by edsimmons
Replied by edsimmons on topic Helical milling with a diagonal repeat ?
Hi all,
I've just tried out the sub routine for a spiral (posted by Andy) and it seems to generate a perfect spiral for the most part, but the first 1/4 of a circle pass and the last passes at the bottom of the hole are slightly elliptical. Do you have any idea why and how to correct this? My G-code arc fu is weak!
Thanks,
Ed
I've just tried out the sub routine for a spiral (posted by Andy) and it seems to generate a perfect spiral for the most part, but the first 1/4 of a circle pass and the last passes at the bottom of the hole are slightly elliptical. Do you have any idea why and how to correct this? My G-code arc fu is weak!
Thanks,
Ed
Last edit: 16 May 2013 22:39 by edsimmons.
Please Log in or Create an account to join the conversation.
16 May 2013 22:43 #34199
by andypugh
G-code can't actually do ellipses. Is it possibly a backlash/flex thing?
Replied by andypugh on topic Helical milling with a diagonal repeat ?
the first 1/4 of a circle pass and the last passes at the bottom of the hole are slightly elliptical.
G-code can't actually do ellipses. Is it possibly a backlash/flex thing?
Please Log in or Create an account to join the conversation.
16 May 2013 22:45 #34200
by edsimmons
Replied by edsimmons on topic Helical milling with a diagonal repeat ?
Interesting - it's certainly doing something odd, there's a definite difference between the radius of the spiral and the radius of the start/stop points. It shows it in axis too when run, I set up the sub routine file then called it using the command entry in axis, this gave me a little test spiral but definitely not quite what I expected!
Thanks,
Ed
Thanks,
Ed
Please Log in or Create an account to join the conversation.
16 May 2013 22:53 #34202
by edsimmons
Replied by edsimmons on topic Helical milling with a diagonal repeat ?
I don't suppose you've got a lathe, Andy? I could stop all these circular shenanegans if I could find someone who'd be willing to run a few passes on a little alu part!
Please Log in or Create an account to join the conversation.
16 May 2013 22:59 #34204
by andypugh
It isn't a very good one, but it is at least CNC.
Replied by andypugh on topic Helical milling with a diagonal repeat ?
Yes, actually.I don't suppose you've got a lathe, Andy?
It isn't a very good one, but it is at least CNC.
Please Log in or Create an account to join the conversation.
16 May 2013 23:02 #34206
by edsimmons
Replied by edsimmons on topic Helical milling with a diagonal repeat ?
Well, I was just considering purchasing this: www.ebay.co.uk/itm/190756617817 to do what amounts to about 10 seconds work for a CNC lathe.
I have a little threaded part with an internal bore, this needs to be enlarged to be a snug fit onto a tube. If you'd like a small job of this ilk, name a price and I'm sure we can work something out! Thanks
Ed
I have a little threaded part with an internal bore, this needs to be enlarged to be a snug fit onto a tube. If you'd like a small job of this ilk, name a price and I'm sure we can work something out! Thanks
Ed
Please Log in or Create an account to join the conversation.
Time to create page: 0.160 seconds