Metalworking (rec.crafts.metalworking) Discuss various aspects of working with metal, such as machining, welding, metal joining, screwing, casting, hardening/tempering, blacksmithing/forging, spinning and hammer work, sheet metal work.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 17
Default FOLLOWUP on "macro system for G code"

My thoughts are solidifying a little bit regarding a "G code macro
system". I think that I will roll my own, since I am a computer
programmer.

I started writing perl code to perform standard milling tasks. For
example, I wrote a function to print G code that would move to a given
location, both for G00 as well as for G01 (trivial).

Then I wrote a perl function that would print G code to drill a hole,
with optional pecking (drill to pecking depth, quickly withdraw,
quickly return to drilling depth, and repeat until proper depth is
reached).

For every standard type of task, like drill a bolt hole pattern, mill
out a blind hole, mill out a through hole, etc, I will write a
function to do that. I will build on functions, e.g. the bolt hole
function will use a drilling function, etc.

I am sure that this will not cover "True 3D" curvy surfaces, like
milling a statue of a naked woman in 4 axis machining, like on
YouTube, but it will cover most of the actual projects that I will
encounter.

I am attaching a function to drill a hole with pecking, and the
resulting G code (all untested).

Code to drill, say, three holes of depth (-1) in points (0, 0), (2,3),
and (3,3) at speed 5 and pecking depth of 0.3, would look like this
perl code:

g_set_clear_height( 0 );
g_drill_hole( 0, 0, -1, 5, 0.3 );
g_drill_hole( 2, 3, -1, 5, 0.3 );
g_drill_hole( 3, 3, -1, 5, 0.3 );

This is much more understandable than many other alternatives.

I am sure that I do not really know how to use G codes, but I know
that this is a good approach in general.

If it works well for me, I will release it under GPL.

i

################################################## #################### function
sub g_drill_hole {
my ($x, $y, $z, $speed, $pecking_depth) = @_;
die "For drilling application, you need to do g_set_clear_height first"
unless defined $_clear_height;

die "Drilling depth Z=$z should be LESS THAN safe height=$_clear_height."
if $z $_clear_height;

Print "(Drill a hole in [$x, $y] depth of $z.)\n";
deeper;
{
Print "(withdraw to safe height)\n";
g_goto( undef, undef, $_clear_height );
Print "(go to starting point)\n";
g_goto( $x, $y );
if ( $pecking_depth ) {
Print "(Drilling with pecking)\n";
my $cur_z = $_clear_height;
my $i = 0;
while( $cur_z $z ) {
$i++;
print "\n";
if ( $cur_z - $pecking_depth $z ) {
Print "(Peck $i -- drill, clear chips, go back)\n";
deeper;
{
g_millto( undef, undef, $cur_z - $pecking_depth, $speed );
g_goto( undef, undef, $_clear_height );
g_goto( undef, undef, $cur_z - $pecking_depth );
}
lower;
$cur_z = $cur_z - $pecking_depth;
} else {
Print "(Last drilling step)\n";
g_millto( undef, undef, $z, $speed );
$cur_z = $z;
}
}
} else {
Print "(Drilling)\n";
g_millto( undef, undef, $z, $speed );
}
Print "(Returning to safe height)\n";
g_goto( undef, undef, $_clear_height );
}
lower;
}

################################################## #################### G Code

(Drill a hole in [3, 4] depth of 0.)
(withdraw to safe height)
(Go to point Z1 )
G00 Z1

(go to starting point)
(Go to point X3 Y4 )
G00 X3 Y4

(Drilling with pecking)

(Peck 1 -- drill, clear chips, go back)
(Mill to: Z0.7 at speed F5 )
G01 Z0.7 F5

(Go to point Z1 )
G00 Z1

(Go to point Z0.7 )
G00 Z0.7


(Peck 2 -- drill, clear chips, go back)
(Mill to: Z0.4 at speed F5 )
G01 Z0.4 F5

(Go to point Z1 )
G00 Z1

(Go to point Z0.4 )
G00 Z0.4


(Peck 3 -- drill, clear chips, go back)
(Mill to: Z0.1 at speed F5 )
G01 Z0.1 F5

(Go to point Z1 )
G00 Z1

(Go to point Z0.1 )
G00 Z0.1


(Last drilling step)
(Mill to: Z0 at speed F5 )
G01 Z0 F5

(Returning to safe height)
(Go to point Z1 )
G00 Z1


  #2   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 4,632
Default FOLLOWUP on "macro system for G code"

Ignoramus21191 fired this volley in
:

I am sure that I do not really know how to use G codes, but I know
that this is a good approach in general.


Iggy,
My first experience actually writing G-codes by hand, instead of having a
CAM system generate them was when one of my vendors bought a CNC router,
and needed help getting it up.

It took, maybe, six hours of study with a CNC simulator and a couple of
hours programming on the actual machine to get the whole "feel" of the
method, and not much more than another hour to realize the need for, and
begin to actually do optimization of the codes to minimize routes,
prevent hogging and bit breakage, etc.

It's really not a big deal; Certainly not as difficult as writing a SED
script to filter and transmute a file with a couple of dozen fields per
record.

If you write in PERL, you have all the skills except actually
experiencing the machine break bits G.

I keep a piece of aluminum 1" plate around, just for memories. We had a
machinist named "Jake Flynn" who was an expert manual Bridgeport
operator, but who estimated himself to be THE expert on CNC milling.

This piece of stock has a 1.25" roughing bit literally melted into and
snapped off almost flush with the plate -- along with a milled-in note,
"Flynned AGAIN!" Not everyone who butchers metal gets the principles.

LLoyd
  #3   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 362
Default FOLLOWUP on "macro system for G code"

On Jul 19, 4:47*pm, Ignoramus21191 ignoramus21...@NOSPAM.
21191.invalid wrote:
My thoughts are solidifying a little bit regarding a "G code macro
system". I think that I will roll my own, since I am a computer
programmer.

I started writing perl code to perform standard milling tasks. For
example, I wrote a function to print G code that would move to a given
location, both for G00 as well as for G01 (trivial).

Then I wrote a perl function that would print G code to drill a hole,
with optional pecking (drill to pecking depth, quickly withdraw,
quickly return to drilling depth, and repeat until proper depth is
reached).

For every standard type of task, like drill a bolt hole pattern, mill
out a blind hole, mill out a through hole, etc, I will write a
function to do that. I will build on functions, e.g. the bolt hole
function will use a drilling function, etc.

I am sure that this will not cover "True 3D" curvy surfaces, like
milling a statue of a naked woman in 4 axis machining, like on
YouTube, but it will cover most of the actual projects that I will
encounter.

I am attaching a function to drill a hole with pecking, and the
resulting G code (all untested).

Code to drill, say, three holes of depth (-1) in points (0, 0), (2,3),
and (3,3) at speed 5 and pecking depth of 0.3, would look like this
perl code:

g_set_clear_height( 0 );
g_drill_hole( 0, 0, -1, 5, 0.3 );
g_drill_hole( 2, 3, -1, 5, 0.3 );
g_drill_hole( 3, 3, -1, 5, 0.3 );

This is much more understandable than many other alternatives.

I am sure that I do not really know how to use G codes, but I know
that this is a good approach in general.

If it works well for me, I will release it under GPL.

i

################################################## #################### function
sub g_drill_hole {
* my ($x, $y, $z, $speed, $pecking_depth) = @_;
* die "For drilling application, you need to do g_set_clear_height first"
* * unless defined $_clear_height;

* die "Drilling depth Z=$z should be LESS THAN safe height=$_clear_height."
* * if $z $_clear_height;

* Print "(Drill a hole in [$x, $y] depth of $z.)\n";
* deeper;
* {
* * Print "(withdraw to safe height)\n";
* * g_goto( undef, undef, $_clear_height );
* * Print "(go to starting point)\n";
* * g_goto( $x, $y );
* * if ( $pecking_depth ) {
* * * Print "(Drilling with pecking)\n";
* * * my $cur_z = $_clear_height;
* * * my $i = 0;
* * * while( $cur_z $z ) {
* * * * $i++;
* * * * print "\n";
* * * * if ( $cur_z - $pecking_depth $z ) {
* * * * * Print "(Peck $i -- drill, clear chips, go back)\n";
* * * * * deeper;
* * * * * {
* * * * * * g_millto( undef, undef, $cur_z - $pecking_depth, $speed );
* * * * * * g_goto( undef, undef, $_clear_height );
* * * * * * g_goto( undef, undef, $cur_z - $pecking_depth );
* * * * * }
* * * * * lower;
* * * * * $cur_z = $cur_z - $pecking_depth;
* * * * } else {
* * * * * Print "(Last drilling step)\n";
* * * * * g_millto( undef, undef, $z, $speed );
* * * * * $cur_z = $z;
* * * * }
* * * }
* * } else {
* * * Print "(Drilling)\n";
* * * g_millto( undef, undef, $z, $speed );
* * }
* * Print "(Returning to safe height)\n";
* * g_goto( undef, undef, $_clear_height );
* }
* lower;

}

################################################## #################### G Code

(Drill a hole in [3, 4] depth of 0.)
* (withdraw to safe height)
* (Go to point Z1 )
* G00 Z1

* (go to starting point)
* (Go to point X3 Y4 )
* G00 X3 Y4

* (Drilling with pecking)

* (Peck 1 -- drill, clear chips, go back)
* * (Mill to: Z0.7 *at speed F5 )
* * G01 Z0.7 F5

* * (Go to point Z1 )
* * G00 Z1

* * (Go to point Z0.7 )
* * G00 Z0.7

* (Peck 2 -- drill, clear chips, go back)
* * (Mill to: Z0.4 *at speed F5 )
* * G01 Z0.4 F5

* * (Go to point Z1 )
* * G00 Z1

* * (Go to point Z0.4 )
* * G00 Z0.4

* (Peck 3 -- drill, clear chips, go back)
* * (Mill to: Z0.1 *at speed F5 )
* * G01 Z0.1 F5

* * (Go to point Z1 )
* * G00 Z1

* * (Go to point Z0.1 )
* * G00 Z0.1

* (Last drilling step)
* (Mill to: Z0 *at speed F5 )
* G01 Z0 F5

* (Returning to safe height)
* (Go to point Z1 )
* G00 Z1


Gee, I haven't written a MACRO since the IBM 1440 and 1401 autocoder
days. Are you writing MACROs or function prototypes?

Paul
  #4   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 17
Default FOLLOWUP on "macro system for G code"

On 2010-07-20, Lloyd E. Sponenburgh lloydspinsidemindspring.com wrote:

It's really not a big deal; Certainly not as difficult as writing a SED
script to filter and transmute a file with a couple of dozen fields per
record.

If you write in PERL, you have all the skills except actually
experiencing the machine break bits G.

I keep a piece of aluminum 1" plate around, just for memories. We had a
machinist named "Jake Flynn" who was an expert manual Bridgeport
operator, but who estimated himself to be THE expert on CNC milling.

This piece of stock has a 1.25" roughing bit literally melted into and
snapped off almost flush with the plate -- along with a milled-in note,
"Flynned AGAIN!" Not everyone who butchers metal gets the principles.


Lloyd, I hear you. But I think that with good routines, I could help
myself prevent bit breakage.

i
  #5   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 17
Default FOLLOWUP on "macro system for G code"

On 2010-07-20, wrote:
On Jul 19, 4:47?pm, Ignoramus21191 ignoramus21...@NOSPAM.
21191.invalid wrote:
My thoughts are solidifying a little bit regarding a "G code macro
system". I think that I will roll my own, since I am a computer
programmer.

I started writing perl code to perform standard milling tasks. For
example, I wrote a function to print G code that would move to a given
location, both for G00 as well as for G01 (trivial).

Then I wrote a perl function that would print G code to drill a hole,
with optional pecking (drill to pecking depth, quickly withdraw,
quickly return to drilling depth, and repeat until proper depth is
reached).

For every standard type of task, like drill a bolt hole pattern, mill
out a blind hole, mill out a through hole, etc, I will write a
function to do that. I will build on functions, e.g. the bolt hole
function will use a drilling function, etc.

I am sure that this will not cover "True 3D" curvy surfaces, like
milling a statue of a naked woman in 4 axis machining, like on
YouTube, but it will cover most of the actual projects that I will
encounter.

I am attaching a function to drill a hole with pecking, and the
resulting G code (all untested).

Code to drill, say, three holes of depth (-1) in points (0, 0), (2,3),
and (3,3) at speed 5 and pecking depth of 0.3, would look like this
perl code:

g_set_clear_height( 0 );
g_drill_hole( 0, 0, -1, 5, 0.3 );
g_drill_hole( 2, 3, -1, 5, 0.3 );
g_drill_hole( 3, 3, -1, 5, 0.3 );

This is much more understandable than many other alternatives.

I am sure that I do not really know how to use G codes, but I know
that this is a good approach in general.

If it works well for me, I will release it under GPL.

i

################################################## #################### function
sub g_drill_hole {
? my ($x, $y, $z, $speed, $pecking_depth) = @_;
? die "For drilling application, you need to do g_set_clear_height first"
? ? unless defined $_clear_height;

? die "Drilling depth Z=$z should be LESS THAN safe height=$_clear_height."
? ? if $z $_clear_height;

? Print "(Drill a hole in [$x, $y] depth of $z.)\n";
? deeper;
? {
? ? Print "(withdraw to safe height)\n";
? ? g_goto( undef, undef, $_clear_height );
? ? Print "(go to starting point)\n";
? ? g_goto( $x, $y );
? ? if ( $pecking_depth ) {
? ? ? Print "(Drilling with pecking)\n";
? ? ? my $cur_z = $_clear_height;
? ? ? my $i = 0;
? ? ? while( $cur_z $z ) {
? ? ? ? $i++;
? ? ? ? print "\n";
? ? ? ? if ( $cur_z - $pecking_depth $z ) {
? ? ? ? ? Print "(Peck $i -- drill, clear chips, go back)\n";
? ? ? ? ? deeper;
? ? ? ? ? {
? ? ? ? ? ? g_millto( undef, undef, $cur_z - $pecking_depth, $speed );
? ? ? ? ? ? g_goto( undef, undef, $_clear_height );
? ? ? ? ? ? g_goto( undef, undef, $cur_z - $pecking_depth );
? ? ? ? ? }
? ? ? ? ? lower;
? ? ? ? ? $cur_z = $cur_z - $pecking_depth;
? ? ? ? } else {
? ? ? ? ? Print "(Last drilling step)\n";
? ? ? ? ? g_millto( undef, undef, $z, $speed );
? ? ? ? ? $cur_z = $z;
? ? ? ? }
? ? ? }
? ? } else {
? ? ? Print "(Drilling)\n";
? ? ? g_millto( undef, undef, $z, $speed );
? ? }
? ? Print "(Returning to safe height)\n";
? ? g_goto( undef, undef, $_clear_height );
? }
? lower;

}

################################################## #################### G Code

(Drill a hole in [3, 4] depth of 0.)
? (withdraw to safe height)
? (Go to point Z1 )
? G00 Z1

? (go to starting point)
? (Go to point X3 Y4 )
? G00 X3 Y4

? (Drilling with pecking)

? (Peck 1 -- drill, clear chips, go back)
? ? (Mill to: Z0.7 ?at speed F5 )
? ? G01 Z0.7 F5

? ? (Go to point Z1 )
? ? G00 Z1

? ? (Go to point Z0.7 )
? ? G00 Z0.7

? (Peck 2 -- drill, clear chips, go back)
? ? (Mill to: Z0.4 ?at speed F5 )
? ? G01 Z0.4 F5

? ? (Go to point Z1 )
? ? G00 Z1

? ? (Go to point Z0.4 )
? ? G00 Z0.4

? (Peck 3 -- drill, clear chips, go back)
? ? (Mill to: Z0.1 ?at speed F5 )
? ? G01 Z0.1 F5

? ? (Go to point Z1 )
? ? G00 Z1

? ? (Go to point Z0.1 )
? ? G00 Z0.1

? (Last drilling step)
? (Mill to: Z0 ?at speed F5 )
? G01 Z0 F5

? (Returning to safe height)
? (Go to point Z1 )
? G00 Z1


Gee, I haven't written a MACRO since the IBM 1440 and 1401 autocoder
days. Are you writing MACROs or function prototypes?


I call them macros, but they really are just perl functions.

i


  #6   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 58
Default FOLLOWUP on "macro system for G code"

Ignoramus21191 wrote:
My thoughts are solidifying a little bit regarding a "G code macro
system". I think that I will roll my own, since I am a computer
programmer.

I started writing perl code to perform standard milling tasks. For
example, I wrote a function to print G code that would move to a given
location, both for G00 as well as for G01 (trivial).

Then I wrote a perl function that would print G code to drill a hole,
with optional pecking (drill to pecking depth, quickly withdraw,
quickly return to drilling depth, and repeat until proper depth is
reached).

For every standard type of task, like drill a bolt hole pattern, mill
out a blind hole, mill out a through hole, etc, I will write a
function to do that. I will build on functions, e.g. the bolt hole
function will use a drilling function, etc.

I am sure that this will not cover "True 3D" curvy surfaces, like
milling a statue of a naked woman in 4 axis machining, like on
YouTube, but it will cover most of the actual projects that I will
encounter.

I am attaching a function to drill a hole with pecking, and the
resulting G code (all untested).

Code to drill, say, three holes of depth (-1) in points (0, 0), (2,3),
and (3,3) at speed 5 and pecking depth of 0.3, would look like this
perl code:

g_set_clear_height( 0 );
g_drill_hole( 0, 0, -1, 5, 0.3 );
g_drill_hole( 2, 3, -1, 5, 0.3 );
g_drill_hole( 3, 3, -1, 5, 0.3 );

This is much more understandable than many other alternatives.

I am sure that I do not really know how to use G codes, but I know
that this is a good approach in general.

If it works well for me, I will release it under GPL.

i

################################################## #################### function
sub g_drill_hole {
my ($x, $y, $z, $speed, $pecking_depth) = @_;
die "For drilling application, you need to do g_set_clear_height first"
unless defined $_clear_height;

die "Drilling depth Z=$z should be LESS THAN safe height=$_clear_height."
if $z $_clear_height;

Print "(Drill a hole in [$x, $y] depth of $z.)\n";
deeper;
{
Print "(withdraw to safe height)\n";
g_goto( undef, undef, $_clear_height );
Print "(go to starting point)\n";
g_goto( $x, $y );
if ( $pecking_depth ) {
Print "(Drilling with pecking)\n";
my $cur_z = $_clear_height;
my $i = 0;
while( $cur_z $z ) {
$i++;
print "\n";
if ( $cur_z - $pecking_depth $z ) {
Print "(Peck $i -- drill, clear chips, go back)\n";
deeper;
{
g_millto( undef, undef, $cur_z - $pecking_depth, $speed );
g_goto( undef, undef, $_clear_height );
g_goto( undef, undef, $cur_z - $pecking_depth );
}
lower;
$cur_z = $cur_z - $pecking_depth;
} else {
Print "(Last drilling step)\n";
g_millto( undef, undef, $z, $speed );
$cur_z = $z;
}
}
} else {
Print "(Drilling)\n";
g_millto( undef, undef, $z, $speed );
}
Print "(Returning to safe height)\n";
g_goto( undef, undef, $_clear_height );
}
lower;
}

################################################## #################### G Code

(Drill a hole in [3, 4] depth of 0.)
(withdraw to safe height)
(Go to point Z1 )
G00 Z1

(go to starting point)
(Go to point X3 Y4 )
G00 X3 Y4

(Drilling with pecking)

(Peck 1 -- drill, clear chips, go back)
(Mill to: Z0.7 at speed F5 )
G01 Z0.7 F5

(Go to point Z1 )
G00 Z1

(Go to point Z0.7 )
G00 Z0.7


(Peck 2 -- drill, clear chips, go back)
(Mill to: Z0.4 at speed F5 )
G01 Z0.4 F5

(Go to point Z1 )
G00 Z1

(Go to point Z0.4 )
G00 Z0.4


(Peck 3 -- drill, clear chips, go back)
(Mill to: Z0.1 at speed F5 )
G01 Z0.1 F5

(Go to point Z1 )
G00 Z1

(Go to point Z0.1 )
G00 Z0.1


(Last drilling step)
(Mill to: Z0 at speed F5 )
G01 Z0 F5

(Returning to safe height)
(Go to point Z1 )
G00 Z1



Depending on the control, you may need trailing decimal points after
whole numbers.



--
Steve Walker
(remove wallet to reply)
  #7   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 28
Default FOLLOWUP on "macro system for G code"

On 2010-07-20, Steve Walker wrote:
Ignoramus21191 wrote:
(Go to point Z0.1 )
G00 Z0.1


(Last drilling step)
(Mill to: Z0 at speed F5 )
G01 Z0 F5

(Returning to safe height)
(Go to point Z1 )
G00 Z1



Depending on the control, you may need trailing decimal points after
whole numbers.


EMC is cool with numbers.

i
  #8   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 130
Default FOLLOWUP on "macro system for G code"

On 7/19/2010 7:47 PM, Ignoramus21191 wrote:
My thoughts are solidifying a little bit regarding a "G code macro
system". I think that I will roll my own, since I am a computer
programmer.

I started writing perl code to perform standard milling tasks. For
example, I wrote a function to print G code that would move to a given
location, both for G00 as well as for G01 (trivial).

Then I wrote a perl function that would print G code to drill a hole,
with optional pecking (drill to pecking depth, quickly withdraw,
quickly return to drilling depth, and repeat until proper depth is
reached).

For every standard type of task, like drill a bolt hole pattern, mill
out a blind hole, mill out a through hole, etc, I will write a
function to do that. I will build on functions, e.g. the bolt hole
function will use a drilling function, etc.

I am sure that this will not cover "True 3D" curvy surfaces, like
milling a statue of a naked woman in 4 axis machining, like on
YouTube, but it will cover most of the actual projects that I will
encounter.

I am attaching a function to drill a hole with pecking, and the
resulting G code (all untested).

Code to drill, say, three holes of depth (-1) in points (0, 0), (2,3),
and (3,3) at speed 5 and pecking depth of 0.3, would look like this


Pretty cool that your programming your own "macros" but why not use the
canned cycles that are included with EMC?

http://linuxcnc.org/handbook/gcode/canned.html
  #9   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 28
Default FOLLOWUP on "macro system for G code"

On 2010-07-20, tnik wrote:
On 7/19/2010 7:47 PM, Ignoramus21191 wrote:
My thoughts are solidifying a little bit regarding a "G code macro
system". I think that I will roll my own, since I am a computer
programmer.

I started writing perl code to perform standard milling tasks. For
example, I wrote a function to print G code that would move to a given
location, both for G00 as well as for G01 (trivial).

Then I wrote a perl function that would print G code to drill a hole,
with optional pecking (drill to pecking depth, quickly withdraw,
quickly return to drilling depth, and repeat until proper depth is
reached).

For every standard type of task, like drill a bolt hole pattern, mill
out a blind hole, mill out a through hole, etc, I will write a
function to do that. I will build on functions, e.g. the bolt hole
function will use a drilling function, etc.

I am sure that this will not cover "True 3D" curvy surfaces, like
milling a statue of a naked woman in 4 axis machining, like on
YouTube, but it will cover most of the actual projects that I will
encounter.

I am attaching a function to drill a hole with pecking, and the
resulting G code (all untested).

Code to drill, say, three holes of depth (-1) in points (0, 0), (2,3),
and (3,3) at speed 5 and pecking depth of 0.3, would look like this


Pretty cool that your programming your own "macros" but why not use the
canned cycles that are included with EMC?

http://linuxcnc.org/handbook/gcode/canned.html


Yep, great point, I will use all those where appropriate.
  #10   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1,148
Default FOLLOWUP on "macro system for G code"

Ignoramus21191 wrote:

Then I wrote a perl function that would print G code to drill a hole,
with optional pecking (drill to pecking depth, quickly withdraw,
quickly return to drilling depth, and repeat until proper depth is
reached).

EMC2 has canned cycles for several modes of peck drill cycles, I think
it is G82? You are at the point you need to seriously get into the EMC
manuals, they are now getting quite good. There's also Chris Radek's
"cheat sheet" with tons of info on a single page. He handed out
laminated copies of it a few years ago.

Jon


  #11   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 28
Default FOLLOWUP on "macro system for G code"

On 2010-07-20, Jon Elson wrote:
Ignoramus21191 wrote:

Then I wrote a perl function that would print G code to drill a hole,
with optional pecking (drill to pecking depth, quickly withdraw,
quickly return to drilling depth, and repeat until proper depth is
reached).

EMC2 has canned cycles for several modes of peck drill cycles, I think
it is G82? You are at the point you need to seriously get into the EMC
manuals, they are now getting quite good. There's also Chris Radek's
"cheat sheet" with tons of info on a single page. He handed out
laminated copies of it a few years ago.


Yes, I have no objection to that sort of stuff, like canned
cycles. Next thing I will do is hook up the Z axis. Then I can do two
things. One is writing and testing scripts, and another is servo tuning.

After this is done, I will try to get my mill's original controls to
work.

i
  #12   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1,344
Default FOLLOWUP on "macro system for G code"

Ignoramus23878 wrote:

Depending on the control, you may need trailing decimal points after
whole numbers.


EMC is cool with numbers.


That is good, I put something in like z22 in once on a AB8400 control. Watched the
waterjet nozzle drive down into a visor hole in the waterjet buck. I managed to estop it
in time to avoid damage. Z22 = Z .022 on that control. Whoops.

Wes
  #13   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 3,444
Default FOLLOWUP on "macro system for G code"

On 7/20/2010 12:55 PM, Jon Elson wrote:
There's also Chris Radek's "cheat sheet" with tons of info on a single
page. He handed out laminated copies of it a few years ago.


That is really intriguing, Jon.
Can you tell me where I can download a copy?

Thanks!

--Winston
  #14   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1,148
Default FOLLOWUP on "macro system for G code"

Winston wrote:
On 7/20/2010 12:55 PM, Jon Elson wrote:
There's also Chris Radek's "cheat sheet" with tons of info on a single
page. He handed out laminated copies of it a few years ago.


That is really intriguing, Jon.
Can you tell me where I can download a copy?

http://linuxcnc.org/docs/html/gcode.html

or, in PDF
http://axis.unpy.net/files/01142603825/gcode.pdf

and, soory, Jeff, I gave the wrong attribution, in the Wiki i see this
was done by Jeff Epler, not Chris. (They work together, I have a lot of
trouble keeping separate what they have done.)

So, this is linked to on the Wiki, but not real easy to find, under
"Using EMC"

Jon
  #15   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 28
Default FOLLOWUP on "macro system for G code"

fOn 2010-07-20, Wes wrote:
Ignoramus23878 wrote:

Depending on the control, you may need trailing decimal points after
whole numbers.


EMC is cool with numbers.


That is good, I put something in like z22 in once on a AB8400 control. Watched the
waterjet nozzle drive down into a visor hole in the waterjet buck. I managed to estop it
in time to avoid damage. Z22 = Z .022 on that control. Whoops.


This is scary and outright stupid, kind of shocking really.

On my system, G1 x2 means go to X=2.

i


  #16   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 3,444
Default FOLLOWUP on "macro system for G code"

On 7/20/2010 3:15 PM, Jon Elson wrote:
Winston wrote:
On 7/20/2010 12:55 PM, Jon Elson wrote:
There's also Chris Radek's "cheat sheet" with tons of info on a single
page. He handed out laminated copies of it a few years ago.


That is really intriguing, Jon.
Can you tell me where I can download a copy?

http://linuxcnc.org/docs/html/gcode.html

or, in PDF
http://axis.unpy.net/files/01142603825/gcode.pdf


Much appreciated. Thanks!

--Winston
  #17   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1,344
Default FOLLOWUP on "macro system for G code"

Ignoramus23878 wrote:

fOn 2010-07-20, Wes wrote:
Ignoramus23878 wrote:

Depending on the control, you may need trailing decimal points after
whole numbers.

EMC is cool with numbers.


That is good, I put something in like z22 in once on a AB8400 control. Watched the
waterjet nozzle drive down into a visor hole in the waterjet buck. I managed to estop it
in time to avoid damage. Z22 = Z .022 on that control. Whoops.


This is scary and outright stupid, kind of shocking really.

On my system, G1 x2 means go to X=2.


On that 80's era machine, with a whopping 64K of 8bit memory, things were cut to the bone.

Since I was profiling headliners, the programs tended to be big. I wrote a couple qbasic
programs to take the g and m code and strip out any .0's and replace with ., Z7.421 became
X7.42 .

I also looked to see, since the profiles were taught in following a sample with a pointer
in the nozzle, for any move where an element of a previous move matched the current
position.

For example if one point was
X120.2 Y34.1 Z12.
and the next one was
X120.9 Y34.7 Z12.
I changed it to
X120.9 Y34.7

Back when working light without overbyte mattered. Life is so much easier now.

Wes

  #18   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 2,584
Default FOLLOWUP on "macro system for G code"

On 2010-07-20, Wes wrote:
Ignoramus23878 wrote:

fOn 2010-07-20, Wes wrote:
Ignoramus23878 wrote:

Depending on the control, you may need trailing decimal points after
whole numbers.

EMC is cool with numbers.


That is good, I put something in like z22 in once on a AB8400 control. Watched the
waterjet nozzle drive down into a visor hole in the waterjet buck. I managed to estop it
in time to avoid damage. Z22 = Z .022 on that control. Whoops.


This is scary and outright stupid, kind of shocking really.

On my system, G1 x2 means go to X=2.


On that 80's era machine, with a whopping 64K of 8bit memory, things were cut to the bone.


Sounds like my Emco-Maier Compact-5/CNC. Stepper motors, 5"
swing. Quite slow rapids. And the CPU was a 6502 (Apple-II/Commodore PET
anyone?). The 64K address space had to hold the firmware, the RAM for
program storage and stack, and the various I/O ports.

Decimal point was implied -- a different place in inch vs metric
mode.

25.4 mm was entered as "2540", and 0.001" was entered as "1", so
1" was entered as 1000". (And for Y-axis, since it accepted input in
diameter not radius, but was sill limited in step size, diameters came
out in steps of 0.002" or 0.02mm.)

Also -- because there was so little memory, there was no
provision for comments.

I wrote a pair of programs in C which would copy from the
machine to the companion Sun computer and back which would end each line
with a '#' (comment symbol) on the way from the machine (so I could edit
in comments safely) and strip off everything including and following the
'#' on the way back to the machine.

The system did not have the ability to accept axis indicators in
the G-code -- it was purely dependent on the column in which the numeric
data *ended* -- with leading zeros suppressed and replaced with spaces.
Lose one space and the meaning of *everything* in the remainder of the
line changed. :-)

But -- I'm still using this machine for certain things. It is
nice and small -- and it *is* CNC.

[ ... ]

Back when working light without overbyte mattered. Life is so much easier now.


Now there is a quote from the early days of _Dr. Dobb's
Journal_. :-)

--
Remove oil spill source from e-mail
Email: | Voice (all times): (703) 938-4564
(too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
--- Black Holes are where God is dividing by zero ---
  #19   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1,148
Default FOLLOWUP on "macro system for G code"

Ignoramus23878 wrote:
fOn 2010-07-20, Wes wrote:
Ignoramus23878 wrote:

Depending on the control, you may need trailing decimal points after
whole numbers.
EMC is cool with numbers.

That is good, I put something in like z22 in once on a AB8400 control. Watched the
waterjet nozzle drive down into a visor hole in the waterjet buck. I managed to estop it
in time to avoid damage. Z22 = Z .022 on that control. Whoops.


This is scary and outright stupid, kind of shocking really.

On my system, G1 x2 means go to X=2.

i

I'm guessing his machine was actually controlled by an A-B 7320, their
last control that suppressed decimal points. That is an accepted option
to the RS274-D standard that defines "G code". I still have my 7320,
but made the change to EMC about 12 years ago. I'm pretty sure the 8400
supported decomal points, but maybe they turned that off for
compatibility with other machines. But, it did lead to unpleasant
surprises.

Jon
  #20   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 21
Default FOLLOWUP on "macro system for G code"

On 2010-07-21, Jon Elson wrote:
Ignoramus23878 wrote:
fOn 2010-07-20, Wes wrote:
Ignoramus23878 wrote:

Depending on the control, you may need trailing decimal points after
whole numbers.
EMC is cool with numbers.

That is good, I put something in like z22 in once on a AB8400 control. Watched the
waterjet nozzle drive down into a visor hole in the waterjet buck. I managed to estop it
in time to avoid damage. Z22 = Z .022 on that control. Whoops.


This is scary and outright stupid, kind of shocking really.

On my system, G1 x2 means go to X=2.

i

I'm guessing his machine was actually controlled by an A-B 7320, their
last control that suppressed decimal points. That is an accepted option
to the RS274-D standard that defines "G code". I still have my 7320,
but made the change to EMC about 12 years ago. I'm pretty sure the 8400
supported decomal points, but maybe they turned that off for
compatibility with other machines. But, it did lead to unpleasant
surprises.


You used EMC 12 years ago, OH MY GOD!

i


  #21   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 2,104
Default FOLLOWUP on "macro system for G code"

On Jul 19, 10:21*pm, " wrote:


Gee, I haven't written a MACRO since the IBM 1440 and 1401 autocoder
days. Are you writing MACROs or function prototypes?

Paul


I use macros all the time in AVR programming. Functions too, but the
macros get handled by the preprocessor and turn readable code into bit-
shifts and masks.
  #22   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 2,104
Default FOLLOWUP on "macro system for G code"

On Jul 19, 7:47*pm, Ignoramus21191 ignoramus21...@NOSPAM.
21191.invalid wrote:
My thoughts are solidifying a little bit regarding a "G code macro
system". I think that I will roll my own, since I am a computer
programmer.

I started writing perl code to perform standard milling tasks. For
example, I wrote a function to print G code that would move to a given
location, both for G00 as well as for G01 (trivial).

Then I wrote a perl function that would print G code to drill a hole,
with optional pecking (drill to pecking depth, quickly withdraw,
quickly return to drilling depth, and repeat until proper depth is
reached).


I think you're going down the right path having prepackaged functions
will probably go a long way towards fewer busted tools.

This reminds me of a project that I did years ago that's actually
close to being the opposite of what you're doing. My job was to take
Gerber code (a subset of 274D) that was meant for photoplotters and
convert it to outlines of printed circuit board traces to be plotted
on an HP pen plotter.

Once I got the basic shapes done, the rest was pretty straightforward
and saved a LOT of plotting time. Of course, now I just print to the
36" inkjet...
  #23   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1,344
Default FOLLOWUP on "macro system for G code"

"DoN. Nichols" wrote:

Back when working light without overbyte mattered. Life is so much easier now.


Now there is a quote from the early days of _Dr. Dobb's
Journal_. :-)


Back when I subscribed.

Wes
  #24   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 1,344
Default FOLLOWUP on "macro system for G code"

Ignoramus9140 wrote:

I'm guessing his machine was actually controlled by an A-B 7320, their
last control that suppressed decimal points. That is an accepted option
to the RS274-D standard that defines "G code". I still have my 7320,
but made the change to EMC about 12 years ago. I'm pretty sure the 8400
supported decomal points, but maybe they turned that off for
compatibility with other machines. But, it did lead to unpleasant
surprises.


You used EMC 12 years ago, OH MY GOD!

i


http://www.isd.mel.nist.gov/document...rd/4191_05.pdf

EMC has a long history. When I could get to the internet in 97 or so, it was out there.

Wes
  #25   Report Post  
Posted to rec.crafts.metalworking
external usenet poster
 
Posts: 21
Default FOLLOWUP on "macro system for G code"

On 2010-07-21, Wes wrote:
Ignoramus9140 wrote:

I'm guessing his machine was actually controlled by an A-B 7320, their
last control that suppressed decimal points. That is an accepted option
to the RS274-D standard that defines "G code". I still have my 7320,
but made the change to EMC about 12 years ago. I'm pretty sure the 8400
supported decomal points, but maybe they turned that off for
compatibility with other machines. But, it did lead to unpleasant
surprises.


You used EMC 12 years ago, OH MY GOD!

i


http://www.isd.mel.nist.gov/document...rd/4191_05.pdf

EMC has a long history. When I could get to the internet in 97 or so, it was out there.


Thi sis a very fascinating story. With this CNC conversion, I am
following the footsteps of some very great, visionary people. I wrote
my first GPLed program back in 1995-1996.

i
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A followup to "AB Landola semi-acoustic guitar electrics ,c 1960s" N_Cook Electronics Repair 4 August 21st 09 10:56 AM
[OT] Is it "post code" or "postcode" ? Jim UK diy 36 August 20th 06 10:37 PM


All times are GMT +1. The time now is 10:05 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 DIYbanter.
The comments are property of their posters.
 

About Us

"It's about DIY & home improvement"