Helical milling with a diagonal repeat ?

More
12 years 3 months ago - 12 years 3 months ago #48746 by cncnoel
Replied by cncnoel on topic Helical milling with a diagonal repeat ?
Glad to hear you're making good progress markjacks B)

As you've probably noticed, the <tunepin> subroutine uses the values, whereas the <hole> subroutine uses named GLOBAL variables.
A named global variable has an underscore before it's name as in #<_safeZ>, and once defined (#<_safeZ> = 5.0) can be used in any subroutine.
A named LOCAL variable such as #<Feed> (no underscore) can’t be accessed outside of its subroutine - that way you can
use the same parameter name with a different value in different subroutines.

I like to use lots of white space in my G-code too, because it makes it easier for me to read (6 or so months) later on. Because the interpreter ignores
white space, it makes good sense for us humans to take advantage of this.
Code:
G91 G1 F500 Y1.1 (HELIX-BORE TO DEPTH) G3 Y-2.2 J-1.1 Z-0.1 Y 2.2 J 1.1 Z-0.1 Y-2.2 J-1.1 Z-0.1 Y 2.2 J 1.1 Z-0.1 Y-2.2 J-1.1 Z-0.1 Y 2.2 J 1.1 Z-0.1 Y-2.2 J-1.1 Z-0.1 Y 2.2 J 1.1 Z-0.1 (STAY AT BOTTOM) G1 F500 Z-0.1 Y-2.2 J-1.1 Y 2.2 J 1.1 (RETURN TO POSITION) G1 F500 Y-1.1 F1000 Z 1 G90
is a lot easier to read than
Code:
G91 G1 F500 Y1.1 (HELIX-BORE TO DEPTH) G3 f500 Y-2.2 J-1.1 Z-0.1 G3 f500 Y2.2 J1.1 Z-0.1 G3 f500 Y-2.2 J-1.1 Z-0.1 G3 f500 Y2.2 J1.1 Z-0.1 G3 f500 Y-2.2 J-1.1 Z-0.1 G3 f500 Y2.2 J1.1 Z-0.1 G3 f500 Y-2.2 J-1.1 Z-0.1 G3 f500 Y2.2 J1.1 Z-0.1 (STAY AT BOTTOM) G1 f500 Z-0.1 G3 f500 Y-2.2J-1.1 G3 f500 Y2.2J1.1 (RETURN TO POSITION) G1 f500 Y-1.1 G1 f1000 Z1 G90

I have my text editor set to show a right margin at 80 characters & tabs set to 4 spaces
& lately I have set it to replace tabs with spaces, so when using a different editor, things still align OK.

Playing with white space a bit, adding the P parameter, plus sexy entry an exit maneuvers (improves work finish) your code might look like
Code:
(Hole Centre) G90 G00 Z10 F500 X100 Y100 Z0.1 (Swoop in) G91 G2 Y-1.1 J-0.55 Z-0.1 (Helix bore to depth) J1.1 Z-0.8 P8.0 J1.1 (Helix out) J1.05 Z0.9 (Hole Centre) G90 G00 Z10 X100 Y100 M30
I prefer my comments off to the right so the flow of the code isn't interrupted.
Here is an over-commented example, using a line-feed to separate the sections
Code:
(drill_code) G90 (absolute position) G00 Z10 F500 (Safe height) X100 Y100 (Hole Centre) Z0.1 (pre-swoop height) G91 (increment position) G2 Y-1.1 J-0.55 Z-0.1 (Swoop in) J 1.1 Z-0.8 P8.0 (Helix bore to depth) J 1.1 (level at depth) J 1.05 Z0.9 (Helix out) G90 (absolute position) G00 Z10 (Safe height) X100 Y100 (Hole Centre) M30 (sweep the chips up)
Hope this helps.
Regards to all
Noel
Last edit: 12 years 3 months ago by cncnoel.

Please Log in or Create an account to join the conversation.

Time to create page: 1.000 seconds
Powered by Kunena Forum