DIYbanter

DIYbanter (https://www.diybanter.com/)
-   Metalworking (https://www.diybanter.com/metalworking/)
-   -   Some kind of macro system for G-codes, for linux (https://www.diybanter.com/metalworking/306711-some-kind-macro-system-g-codes-linux.html)

Ignoramus21191 July 19th 10 01:54 PM

Some kind of macro system for G-codes, for linux
 
Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc. I would love to use a preprocessor like macro systems for
assemblers, or C preprocessor type thing that would be eared towards
CNC machining.

I can probably do something homegrown, but would prefer to find
something that is well thought out.

Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

i

kelly July 19th 10 02:33 PM

Some kind of macro system for G-codes, for linux
 

"Ignoramus21191" wrote in message
...
Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc. I would love to use a preprocessor like macro systems for
assemblers, or C preprocessor type thing that would be eared towards
CNC machining.

I can probably do something homegrown, but would prefer to find
something that is well thought out.

Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

i



I only have next to no CNC knowledge, but aren't "canned" G codes used to do
this sort of thing?




John R. Carroll July 19th 10 02:38 PM

Some kind of macro system for G-codes, for linux
 

"Ignoramus21191" wrote in message
...
Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc. I would love to use a preprocessor like macro systems for
assemblers, or C preprocessor type thing that would be eared towards
CNC machining.

I can probably do something homegrown, but would prefer to find
something that is well thought out.

Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.


This might be useful as a reference.
http://www.ebair.com/g-macro.htm

JC



tnik July 19th 10 02:45 PM

Some kind of macro system for G-codes, for linux
 
On 7/19/2010 8:54 AM, Ignoramus21191 wrote:
Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc. I would love to use a preprocessor like macro systems for
assemblers, or C preprocessor type thing that would be eared towards
CNC machining.

I can probably do something homegrown, but would prefer to find
something that is well thought out.

Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

i


Maybe find a free CAM software?

http://www.freebyte.com/cad/cadcam.htm

Cross-Slide July 19th 10 02:49 PM

Some kind of macro system for G-codes, for linux
 
On Jul 19, 7:54*am, Ignoramus21191 ignoramus21...@NOSPAM.
21191.invalid wrote:
Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc. I would love to use a preprocessor like macro systems for
assemblers, or C preprocessor type thing that would be eared towards
CNC machining.

I can probably do something homegrown, but would prefer to find
something that is well thought out.

Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

i


Take a look he

http://www.practicalmachinist.com/vb...entals-167395/

Pete C. July 19th 10 03:01 PM

Some kind of macro system for G-codes, for linux
 

Ignoramus21191 wrote:

Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc. I would love to use a preprocessor like macro systems for
assemblers, or C preprocessor type thing that would be eared towards
CNC machining.

I can probably do something homegrown, but would prefer to find
something that is well thought out.

Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

i


In Mach3 there are "wizards" to generate G-code for simple tasks like
the noted pocketing, bolt holes, etc. that give you a simple graphical
screen with the diagram of the operation and places to enter the various
parameters. The G-code generated by these wizards would run under EMC2
just as well as Mach3.

Really, you need to select a CAD package and a CAM package and work at
getting proficient with them. Pretty much nobody hand codes G-code these
days for anything but the simplest task, and stuff like the wizards are
also very limited though you can take the code they generate and
incorporate it into a larger program.

A proper CAD-CAM setup is vastly preferable since it allows you to
visualize the part, check everything from various angles, include
fixturing in your visualization, etc. and the CAM side handles such
headaches as cutter compensation. I use TurboCAD and SheetCAM for my CNC
work and they do a good job. SheetCAM is 2.5D, but you can generally
work around that easily enough for the typical HSM complexity project.
There is a CAM product to go with TurboCAD, but I haven't used it so I
don't know how good or bad it is.

Ignoramus21191 July 19th 10 03:08 PM

Some kind of macro system for G-codes, for linux
 
On 2010-07-19, Pete C. wrote:

Ignoramus21191 wrote:

Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc. I would love to use a preprocessor like macro systems for
assemblers, or C preprocessor type thing that would be eared towards
CNC machining.

I can probably do something homegrown, but would prefer to find
something that is well thought out.

Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

i


In Mach3 there are "wizards" to generate G-code for simple tasks like
the noted pocketing, bolt holes, etc. that give you a simple graphical
screen with the diagram of the operation and places to enter the various
parameters. The G-code generated by these wizards would run under EMC2
just as well as Mach3.

Really, you need to select a CAD package and a CAM package and work at
getting proficient with them. Pretty much nobody hand codes G-code these
days for anything but the simplest task, and stuff like the wizards are
also very limited though you can take the code they generate and
incorporate it into a larger program.

A proper CAD-CAM setup is vastly preferable since it allows you to
visualize the part, check everything from various angles, include
fixturing in your visualization, etc. and the CAM side handles such
headaches as cutter compensation. I use TurboCAD and SheetCAM for my CNC
work and they do a good job. SheetCAM is 2.5D, but you can generally
work around that easily enough for the typical HSM complexity project.
There is a CAM product to go with TurboCAD, but I haven't used it so I
don't know how good or bad it is.


Pete, I will definitely look in that direction. I am very firmly a
text-file and command line type of person at this stage of my life,
that's why I asked about a text file. That said, I agree that having a
GUI is often (if not always) a great plus and advantage.

i

Pete C. July 19th 10 03:38 PM

Some kind of macro system for G-codes, for linux
 

Ignoramus21191 wrote:

On 2010-07-19, Pete C. wrote:

Ignoramus21191 wrote:

Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc. I would love to use a preprocessor like macro systems for
assemblers, or C preprocessor type thing that would be eared towards
CNC machining.

I can probably do something homegrown, but would prefer to find
something that is well thought out.

Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

i


In Mach3 there are "wizards" to generate G-code for simple tasks like
the noted pocketing, bolt holes, etc. that give you a simple graphical
screen with the diagram of the operation and places to enter the various
parameters. The G-code generated by these wizards would run under EMC2
just as well as Mach3.

Really, you need to select a CAD package and a CAM package and work at
getting proficient with them. Pretty much nobody hand codes G-code these
days for anything but the simplest task, and stuff like the wizards are
also very limited though you can take the code they generate and
incorporate it into a larger program.

A proper CAD-CAM setup is vastly preferable since it allows you to
visualize the part, check everything from various angles, include
fixturing in your visualization, etc. and the CAM side handles such
headaches as cutter compensation. I use TurboCAD and SheetCAM for my CNC
work and they do a good job. SheetCAM is 2.5D, but you can generally
work around that easily enough for the typical HSM complexity project.
There is a CAM product to go with TurboCAD, but I haven't used it so I
don't know how good or bad it is.


Pete, I will definitely look in that direction. I am very firmly a
text-file and command line type of person at this stage of my life,
that's why I asked about a text file. That said, I agree that having a
GUI is often (if not always) a great plus and advantage.

i


Really, a GUI isn't an advantage here. For the wizards, it's nothing
more than a diagram that makes it easier to visualize what each
parameter you set does. The parameters could just as easily be a text
list. CAD CAM is an entirely different thing from a GUI.

Karl Townsend July 19th 10 04:23 PM

Some kind of macro system for G-codes, for linux
 


Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.


I'm a text kind a guy too, and don't go to CAM until it is REALLY complex.
Almost no parts that I do fit this category. I admit, I'm not fast with CAM,
so I don't use it much, which keeps me slow.

I've rolled my own master Gcode files for drilling, tapping, slotting,
facing, pocketing, etc. They all use looping and incrementing of values.
Anytime I need a pocket, for example, I just bring up my master and edit it.
I can make a hand sketch of a part and have the machine making chips in a
couple minutes - way faster than you can even sit down to CAM something.
Then I sketch the next phase of the part and write the next gcode while its
running.

I think you're better off doing these yourself. Everybody's programming
style is different and you need comment the code so you can quickly change
it for the next similar part. Gcode is really simple once you've done a
few.

Karl




Ignoramus21191 July 19th 10 04:26 PM

Some kind of macro system for G-codes, for linux
 
On 2010-07-19, Karl Townsend wrote:


Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.


I'm a text kind a guy too, and don't go to CAM until it is REALLY complex.
Almost no parts that I do fit this category. I admit, I'm not fast with CAM,
so I don't use it much, which keeps me slow.

I've rolled my own master Gcode files for drilling, tapping, slotting,
facing, pocketing, etc. They all use looping and incrementing of values.
Anytime I need a pocket, for example, I just bring up my master and edit it.
I can make a hand sketch of a part and have the machine making chips in a
couple minutes - way faster than you can even sit down to CAM something.
Then I sketch the next phase of the part and write the next gcode while its
running.

I think you're better off doing these yourself. Everybody's programming
style is different and you need comment the code so you can quickly change
it for the next similar part. Gcode is really simple once you've done a
few.


Karl, thanks for understanding. I am kind of going this way now
myself. I am sketching out some perl modules for doing that sort of
thing (defining macros etc). I will not go in real depth until I get a
better hang of using g-code in real life. If I do write perl modules,
I will release them as open source software.

i

Spehro Pefhany July 19th 10 04:57 PM

Some kind of macro system for G-codes, for linux
 
On Mon, 19 Jul 2010 10:26:38 -0500, Ignoramus21191
wrote:

On 2010-07-19, Karl Townsend wrote:


Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.


I'm a text kind a guy too, and don't go to CAM until it is REALLY complex.
Almost no parts that I do fit this category. I admit, I'm not fast with CAM,
so I don't use it much, which keeps me slow.

I've rolled my own master Gcode files for drilling, tapping, slotting,
facing, pocketing, etc. They all use looping and incrementing of values.
Anytime I need a pocket, for example, I just bring up my master and edit it.
I can make a hand sketch of a part and have the machine making chips in a
couple minutes - way faster than you can even sit down to CAM something.
Then I sketch the next phase of the part and write the next gcode while its
running.

I think you're better off doing these yourself. Everybody's programming
style is different and you need comment the code so you can quickly change
it for the next similar part. Gcode is really simple once you've done a
few.


Karl, thanks for understanding. I am kind of going this way now
myself. I am sketching out some perl modules for doing that sort of
thing (defining macros etc). I will not go in real depth until I get a
better hang of using g-code in real life. If I do write perl modules,
I will release them as open source software.

i


The G-codes are dead simple to use for anyone who understands computer
programming and knows a bit of trig. The harder part for me is knowing
what exactly to ask the machine to do... how many times should the
drill be pulled out to clear chips etc.

I'm thinking it might be useful exercise to rewire my laser engraver
with stepper controllers and a computer to use Mach 3, since it came
with proprietary raster type software. Thanks for the inspiration,
Iggy.



Pete C. July 19th 10 05:13 PM

Some kind of macro system for G-codes, for linux
 

Spehro Pefhany wrote:

On Mon, 19 Jul 2010 10:26:38 -0500, Ignoramus21191
wrote:

On 2010-07-19, Karl Townsend wrote:


Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

I'm a text kind a guy too, and don't go to CAM until it is REALLY complex.
Almost no parts that I do fit this category. I admit, I'm not fast with CAM,
so I don't use it much, which keeps me slow.

I've rolled my own master Gcode files for drilling, tapping, slotting,
facing, pocketing, etc. They all use looping and incrementing of values.
Anytime I need a pocket, for example, I just bring up my master and edit it.
I can make a hand sketch of a part and have the machine making chips in a
couple minutes - way faster than you can even sit down to CAM something.
Then I sketch the next phase of the part and write the next gcode while its
running.

I think you're better off doing these yourself. Everybody's programming
style is different and you need comment the code so you can quickly change
it for the next similar part. Gcode is really simple once you've done a
few.


Karl, thanks for understanding. I am kind of going this way now
myself. I am sketching out some perl modules for doing that sort of
thing (defining macros etc). I will not go in real depth until I get a
better hang of using g-code in real life. If I do write perl modules,
I will release them as open source software.

i


The G-codes are dead simple to use for anyone who understands computer
programming and knows a bit of trig. The harder part for me is knowing
what exactly to ask the machine to do... how many times should the
drill be pulled out to clear chips etc.

I'm thinking it might be useful exercise to rewire my laser engraver
with stepper controllers and a computer to use Mach 3, since it came
with proprietary raster type software. Thanks for the inspiration,
Iggy.


If you're looking at the Mach3 route, let me recommend the components /
packages from http://candcnc.com Tom can sell you a customized package
with the components you need for your application. Presumably you'd need
an MP3000 type package with only two stepper drives, and some I/O. I'm
using the "Dragon Cut" 4 axis version to run both my plasma table and
mini mill (not at the same time, I swap cables between machines).

Ignoramus21191 July 19th 10 06:20 PM

Some kind of macro system for G-codes, for linux
 
On 2010-07-19, Spehro Pefhany wrote:
On Mon, 19 Jul 2010 10:26:38 -0500, Ignoramus21191
wrote:

On 2010-07-19, Karl Townsend wrote:


Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

I'm a text kind a guy too, and don't go to CAM until it is REALLY complex.
Almost no parts that I do fit this category. I admit, I'm not fast with CAM,
so I don't use it much, which keeps me slow.

I've rolled my own master Gcode files for drilling, tapping, slotting,
facing, pocketing, etc. They all use looping and incrementing of values.
Anytime I need a pocket, for example, I just bring up my master and edit it.
I can make a hand sketch of a part and have the machine making chips in a
couple minutes - way faster than you can even sit down to CAM something.
Then I sketch the next phase of the part and write the next gcode while its
running.

I think you're better off doing these yourself. Everybody's programming
style is different and you need comment the code so you can quickly change
it for the next similar part. Gcode is really simple once you've done a
few.


Karl, thanks for understanding. I am kind of going this way now
myself. I am sketching out some perl modules for doing that sort of
thing (defining macros etc). I will not go in real depth until I get a
better hang of using g-code in real life. If I do write perl modules,
I will release them as open source software.

i


The G-codes are dead simple to use for anyone who understands computer
programming and knows a bit of trig. The harder part for me is knowing
what exactly to ask the machine to do... how many times should the
drill be pulled out to clear chips etc.


The hard part is to be able to write G codes in a way that

1) they can be understood by reading
2) They can be easily changed, redesigned etc.

Programming languages evolved over decades to make programs readable,
changeable, modular, etc.

That's why I want to use one to generate G codes.

I'm thinking it might be useful exercise to rewire my laser engraver
with stepper controllers and a computer to use Mach 3, since it came
with proprietary raster type software. Thanks for the inspiration,


I really like having a general purpose computer on my mill. I play
music on it and can use XEmacs to edit my command files.

i

Pete C. July 19th 10 06:30 PM

Some kind of macro system for G-codes, for linux
 

Ignoramus21191 wrote:

On 2010-07-19, Spehro Pefhany wrote:
On Mon, 19 Jul 2010 10:26:38 -0500, Ignoramus21191
wrote:

On 2010-07-19, Karl Townsend wrote:


Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

I'm a text kind a guy too, and don't go to CAM until it is REALLY complex.
Almost no parts that I do fit this category. I admit, I'm not fast with CAM,
so I don't use it much, which keeps me slow.

I've rolled my own master Gcode files for drilling, tapping, slotting,
facing, pocketing, etc. They all use looping and incrementing of values.
Anytime I need a pocket, for example, I just bring up my master and edit it.
I can make a hand sketch of a part and have the machine making chips in a
couple minutes - way faster than you can even sit down to CAM something.
Then I sketch the next phase of the part and write the next gcode while its
running.

I think you're better off doing these yourself. Everybody's programming
style is different and you need comment the code so you can quickly change
it for the next similar part. Gcode is really simple once you've done a
few.

Karl, thanks for understanding. I am kind of going this way now
myself. I am sketching out some perl modules for doing that sort of
thing (defining macros etc). I will not go in real depth until I get a
better hang of using g-code in real life. If I do write perl modules,
I will release them as open source software.

i


The G-codes are dead simple to use for anyone who understands computer
programming and knows a bit of trig. The harder part for me is knowing
what exactly to ask the machine to do... how many times should the
drill be pulled out to clear chips etc.


The hard part is to be able to write G codes in a way that

1) they can be understood by reading
2) They can be easily changed, redesigned etc.

Programming languages evolved over decades to make programs readable,
changeable, modular, etc.

That's why I want to use one to generate G codes.


You really need to spend some time with a CAD CAM system before you put
too much effort into doing G-code generation in an unusual way. CAD
systems design parts, not tool paths, and they do that job very well.
CAM systems take that part information, apply tooling information,
cutter compensation, feed rates, etc. and produce the G-code for the CNC
controller to run. A *lot* of people have been generating G-code for
decades, and just about none of them are doing it the way you're talking
about. There is a lesson to be learned in that.

Winston July 19th 10 07:56 PM

Some kind of macro system for G-codes, for linux
 
On 7/19/2010 5:54 AM, Ignoramus21191 wrote:
Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc.


I am *way* lazier than any of you guys, so I sketch
my parts in CAD, generate offsets and export the resulting
DXFs to a program that generates G code for me (even for
simple parts like brackets and plates).

I hand edit the G code to include peck cycles and to
park the cutter in a convenient location at the end
of the program.

It works great!

I've not used any of these programs but I am sure you
could get one or more to provide a solid base for
your G code:

http://wiki.linuxcnc.org/emcinfo.pl?Cam

--Winston

Jon Elson[_3_] July 19th 10 08:26 PM

Some kind of macro system for G-codes, for linux
 
Ignoramus21191 wrote:
Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc. I would love to use a preprocessor like macro systems for
assemblers, or C preprocessor type thing that would be eared towards
CNC machining.

EMC2 does have such a feature, but I don't know it at all. There should
be a pull-down menu that brings up dialogs for toolpaths. I know that
bolt circles and grids are in there, and I think rect. and circular
pockets, too. Oh, this is available from the Axis GUI, i think you can
get to it from TkEMC also, but much harder.

I also have a bunch of C programs for this kind of stuff, some of them
are on my web page at http://pico-systems.com/gcode.html

I have some new ones I have not put on there, yet, such as a rectangular
cutout with ramp-down.

Jon

Jon Elson[_3_] July 19th 10 08:31 PM

Some kind of macro system for G-codes, for linux
 
Ignoramus21191 wrote:

I really like having a general purpose computer on my mill. I play
music on it and can use XEmacs to edit my command files.

Huh? I sure can't hear music when my mill is running, unless I stuff
some ear buds inside my hearing protectors.

I use grpn for an HP-like calculator, emacs and sftp to move files
across the network.

Jon

Ignoramus21191 July 19th 10 08:33 PM

Some kind of macro system for G-codes, for linux
 
On 2010-07-19, Pete C. wrote:

Ignoramus21191 wrote:

On 2010-07-19, Spehro Pefhany wrote:
On Mon, 19 Jul 2010 10:26:38 -0500, Ignoramus21191
wrote:

On 2010-07-19, Karl Townsend wrote:


Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

I'm a text kind a guy too, and don't go to CAM until it is REALLY complex.
Almost no parts that I do fit this category. I admit, I'm not fast with CAM,
so I don't use it much, which keeps me slow.

I've rolled my own master Gcode files for drilling, tapping, slotting,
facing, pocketing, etc. They all use looping and incrementing of values.
Anytime I need a pocket, for example, I just bring up my master and edit it.
I can make a hand sketch of a part and have the machine making chips in a
couple minutes - way faster than you can even sit down to CAM something.
Then I sketch the next phase of the part and write the next gcode while its
running.

I think you're better off doing these yourself. Everybody's programming
style is different and you need comment the code so you can quickly change
it for the next similar part. Gcode is really simple once you've done a
few.

Karl, thanks for understanding. I am kind of going this way now
myself. I am sketching out some perl modules for doing that sort of
thing (defining macros etc). I will not go in real depth until I get a
better hang of using g-code in real life. If I do write perl modules,
I will release them as open source software.

i

The G-codes are dead simple to use for anyone who understands computer
programming and knows a bit of trig. The harder part for me is knowing
what exactly to ask the machine to do... how many times should the
drill be pulled out to clear chips etc.


The hard part is to be able to write G codes in a way that

1) they can be understood by reading
2) They can be easily changed, redesigned etc.

Programming languages evolved over decades to make programs readable,
changeable, modular, etc.

That's why I want to use one to generate G codes.


You really need to spend some time with a CAD CAM system before you put
too much effort into doing G-code generation in an unusual way. CAD
systems design parts, not tool paths, and they do that job very well.
CAM systems take that part information, apply tooling information,
cutter compensation, feed rates, etc. and produce the G-code for the CNC
controller to run. A *lot* of people have been generating G-code for
decades, and just about none of them are doing it the way you're talking
about. There is a lesson to be learned in that.


Is there some CAD/CAM system that does not cost an arm and a leg and
that is not too proprietary?

i

Ignoramus21191 July 19th 10 08:34 PM

Some kind of macro system for G-codes, for linux
 
On 2010-07-19, Jon Elson wrote:
Ignoramus21191 wrote:

I really like having a general purpose computer on my mill. I play
music on it and can use XEmacs to edit my command files.

Huh? I sure can't hear music when my mill is running, unless I stuff
some ear buds inside my hearing protectors.

I use grpn for an HP-like calculator, emacs and sftp to move files
across the network.


I have decent speakers (nothing special, just some Harman Kardon
speakers I got somewhere). They can be pretty loud.

i

Pete C. July 19th 10 08:39 PM

Some kind of macro system for G-codes, for linux
 

Winston wrote:

On 7/19/2010 5:54 AM, Ignoramus21191 wrote:
Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc.


I am *way* lazier than any of you guys, so I sketch
my parts in CAD, generate offsets and export the resulting
DXFs to a program that generates G code for me (even for
simple parts like brackets and plates).


I'm with you. I needed to cut a dozen 2.5" x 4.5" rectangles from 3/8"
plate last week. I had an irregularly shaped scrap of 3/8" plate and it
took a minimal amount of time to enter the profile of that plate into my
CAD software, create one 2.5" x 4.5" rectangle, and then cut and paste
and arrange the most efficient cut pattern to fit the parts into the
most irregular portion of the plate, leaving the most useable remaining
part for future uses. A few more minutes in the CAM software to optimize
the cut path to maintain electrical connectivity to the ground clamp
until the last part, and then off to the shop to load and cut the
material.

Jon Elson[_3_] July 19th 10 08:40 PM

Some kind of macro system for G-codes, for linux
 
Pete C. wrote:

You really need to spend some time with a CAD CAM system before you put
too much effort into doing G-code generation in an unusual way. CAD
systems design parts, not tool paths, and they do that job very well.
CAM systems take that part information, apply tooling information,
cutter compensation, feed rates, etc. and produce the G-code for the CNC
controller to run. A *lot* of people have been generating G-code for
decades, and just about none of them are doing it the way you're talking
about. There is a lesson to be learned in that.


Well, I'm not so sure. I have Bobcad/CAM, and have learned how to use
it. The CAM function works quite well, and for complex geometry, I do
use it. But, it is just too cumbersome to draw something with some bolt
holes and a square pocket so I can generate the G-code. I wrote about a
dozen small programs that I use ALL the time, for nearly 100% of my
work. Yes, I am quite aware that I actually fit my design to employ
these programs, in the manner of everything looks like a nail to a guy
with a hammer. But, for the stuff I do, it really works out well.
On the other hand, I make lots of control panel-type things, not 18-cyl
model radial engine parts. So, square and round pockets and patterns of
holes are what I see most often.

If I have a panel with a number of round holes of different sizes, i use
an end mill smaller than the smallest hole, and orbit them all with one
tool. I have a program that writes G-code to do generalized holes,
either by milling away the entire hole (for the small ones) or by
"trepanning" or cutting around the edge to let the slug drop out and
then making a finish pass to clean up the edge. I have rectangular
programs to do the same both ways. I have a program that takes a file
of X-Y coordinates and puts out programs to stop, drill and tap the hole
pattern. So, I string a bunch of these programs together with a text
editor, and it is ready, sometimes a pretty complex program can be set
up in less than 5 minutes. No way could I do it that quick with CAD.

See http://pico-systems.com/gcode.html for some of these progs.

Jon

Pete C. July 19th 10 08:50 PM

Some kind of macro system for G-codes, for linux
 

Ignoramus21191 wrote:

On 2010-07-19, Pete C. wrote:

Ignoramus21191 wrote:

On 2010-07-19, Spehro Pefhany wrote:
On Mon, 19 Jul 2010 10:26:38 -0500, Ignoramus21191
wrote:

On 2010-07-19, Karl Townsend wrote:


Writing text files with commands does fit my personality, but I woud
prefer to be able to create my own higher level commands.

I'm a text kind a guy too, and don't go to CAM until it is REALLY complex.
Almost no parts that I do fit this category. I admit, I'm not fast with CAM,
so I don't use it much, which keeps me slow.

I've rolled my own master Gcode files for drilling, tapping, slotting,
facing, pocketing, etc. They all use looping and incrementing of values.
Anytime I need a pocket, for example, I just bring up my master and edit it.
I can make a hand sketch of a part and have the machine making chips in a
couple minutes - way faster than you can even sit down to CAM something.
Then I sketch the next phase of the part and write the next gcode while its
running.

I think you're better off doing these yourself. Everybody's programming
style is different and you need comment the code so you can quickly change
it for the next similar part. Gcode is really simple once you've done a
few.

Karl, thanks for understanding. I am kind of going this way now
myself. I am sketching out some perl modules for doing that sort of
thing (defining macros etc). I will not go in real depth until I get a
better hang of using g-code in real life. If I do write perl modules,
I will release them as open source software.

i

The G-codes are dead simple to use for anyone who understands computer
programming and knows a bit of trig. The harder part for me is knowing
what exactly to ask the machine to do... how many times should the
drill be pulled out to clear chips etc.

The hard part is to be able to write G codes in a way that

1) they can be understood by reading
2) They can be easily changed, redesigned etc.

Programming languages evolved over decades to make programs readable,
changeable, modular, etc.

That's why I want to use one to generate G codes.


You really need to spend some time with a CAD CAM system before you put
too much effort into doing G-code generation in an unusual way. CAD
systems design parts, not tool paths, and they do that job very well.
CAM systems take that part information, apply tooling information,
cutter compensation, feed rates, etc. and produce the G-code for the CNC
controller to run. A *lot* of people have been generating G-code for
decades, and just about none of them are doing it the way you're talking
about. There is a lesson to be learned in that.


Is there some CAD/CAM system that does not cost an arm and a leg and
that is not too proprietary?

i


Absolutely. I've seen references to Linux freeware CAD/CAM, and the
software I use - TurboCAD and SheetCAM - Runs around $300 if you stick
to the standard version of TurboCAD.

Pete C. July 19th 10 08:56 PM

Some kind of macro system for G-codes, for linux
 

Jon Elson wrote:

Pete C. wrote:

You really need to spend some time with a CAD CAM system before you put
too much effort into doing G-code generation in an unusual way. CAD
systems design parts, not tool paths, and they do that job very well.
CAM systems take that part information, apply tooling information,
cutter compensation, feed rates, etc. and produce the G-code for the CNC
controller to run. A *lot* of people have been generating G-code for
decades, and just about none of them are doing it the way you're talking
about. There is a lesson to be learned in that.


Well, I'm not so sure. I have Bobcad/CAM, and have learned how to use
it. The CAM function works quite well, and for complex geometry, I do
use it. But, it is just too cumbersome to draw something with some bolt
holes and a square pocket so I can generate the G-code. I wrote about a
dozen small programs that I use ALL the time, for nearly 100% of my
work. Yes, I am quite aware that I actually fit my design to employ
these programs, in the manner of everything looks like a nail to a guy
with a hammer. But, for the stuff I do, it really works out well.
On the other hand, I make lots of control panel-type things, not 18-cyl
model radial engine parts. So, square and round pockets and patterns of
holes are what I see most often.

If I have a panel with a number of round holes of different sizes, i use
an end mill smaller than the smallest hole, and orbit them all with one
tool. I have a program that writes G-code to do generalized holes,
either by milling away the entire hole (for the small ones) or by
"trepanning" or cutting around the edge to let the slug drop out and
then making a finish pass to clean up the edge. I have rectangular
programs to do the same both ways. I have a program that takes a file
of X-Y coordinates and puts out programs to stop, drill and tap the hole
pattern. So, I string a bunch of these programs together with a text
editor, and it is ready, sometimes a pretty complex program can be set
up in less than 5 minutes. No way could I do it that quick with CAD.

See http://pico-systems.com/gcode.html for some of these progs.

Jon


2.5D work like milling control panels is exceptionally easy with CAD/CAM
like the TurboCAD / SheetCAM combo I use. You can easily make a library
of standard cutouts you use regularly (like D-Sub connector holes) and
then it's nothing more than selecting and pasting them in the correct
spot on the panel. In the CAM software you just tell it the correct end
mill size and tell it to use inside compensation on all the cutouts.

You can also do really slick stuff like taking a DXF of your PC board,
and placing it into the model of your case, so when you place your panel
cutouts for the case you can align the items perfectly with the PCB
component locations, check clearances to see if the fuse holder will hit
the filter cap, etc. Then you just export the panel hole info to your
CAM and generate your G-code.

David Billington July 19th 10 08:56 PM

Some kind of macro system for G-codes, for linux
 
Jon Elson wrote:
Ignoramus21191 wrote:

I really like having a general purpose computer on my mill. I play
music on it and can use XEmacs to edit my command files.

Huh? I sure can't hear music when my mill is running, unless I stuff
some ear buds inside my hearing protectors.

I use grpn for an HP-like calculator, emacs and sftp to move files
across the network.

Jon

Thanks for mentioning grpn, I'd not heard of it before so will have to
download it for use along side my 2 HP11Cs. Shame it doesn't appear to
be available for Windows as I would replace the Windows calculator with
it. Been using RPN since about 1976 so anything else "normal" is a pain.

Winston July 19th 10 09:08 PM

Some kind of macro system for G-codes, for linux
 
On 7/19/2010 12:39 PM, Pete C. wrote:

Winston wrote:

On 7/19/2010 5:54 AM, Ignoramus21191 wrote:
Is there some Linux based macro system for generating G codes. Say, I
wanted to mill out a rectangular pocket, or drill a bolt hole pattern
etc.


I am *way* lazier than any of you guys, so I sketch
my parts in CAD, generate offsets and export the resulting
DXFs to a program that generates G code for me (even for
simple parts like brackets and plates).


I'm with you. I needed to cut a dozen 2.5" x 4.5" rectangles from 3/8"
plate last week. I had an irregularly shaped scrap of 3/8" plate and it
took a minimal amount of time to enter the profile of that plate into my
CAD software, create one 2.5" x 4.5" rectangle, and then cut and paste
and arrange the most efficient cut pattern to fit the parts into the
most irregular portion of the plate, leaving the most useable remaining
part for future uses. A few more minutes in the CAM software to optimize
the cut path to maintain electrical connectivity to the ground clamp
until the last part, and then off to the shop to load and cut the
material.


Yes. I *always* sketch an outline of the raw material
as a layer on the drawing. It takes a few seconds on average.

rect
enter
0,0
enter
15,3
enter


It severely limits surprises. I hate surprises. :)

--Winston

Bob La Londe July 19th 10 09:09 PM

Some kind of macro system for G-codes, for linux
 
I put out a macro for Excel to generate G-code a while back


="N"&F4&" G01 X"&B4&" Y"&C4&" Z"&D4&" F"&E4

Put this in cell A.

Put X,Y,Z,F,Line Number in B,C,D,E,F

User math functions to increment values as needed for each. Cut and paste
from cell to cell(s).

Modify macro to suit your needs.

Cut and past column A into a text document and save with g-code extension
you use when finished.

I have not figured out how to do this macro for Open Office Calc or Quattro
Pro. If you do please publish it back.











Winston July 19th 10 09:15 PM

Some kind of macro system for G-codes, for linux
 
On 7/19/2010 12:56 PM, Pete C. wrote:

(...)

You can also do really slick stuff like taking a DXF of your PC board,
and placing it into the model of your case, so when you place your panel
cutouts for the case you can align the items perfectly with the PCB
component locations, check clearances to see if the fuse holder will hit
the filter cap, etc. Then you just export the panel hole info to your
CAM and generate your G-code.


And you don't even need to start with a DXF of your PCB.

I normally slap the PCB upside down with a scale
on my scanner. I create a bitmap and set that as
a background image in my CAD program.

'Tis trivial to spot the mounting holes and check
clearances inside the case model.

--Winston


Spehro Pefhany July 19th 10 09:37 PM

Some kind of macro system for G-codes, for linux
 
On Mon, 19 Jul 2010 13:15:32 -0700, Winston
wrote:

On 7/19/2010 12:56 PM, Pete C. wrote:

(...)

You can also do really slick stuff like taking a DXF of your PC board,
and placing it into the model of your case, so when you place your panel
cutouts for the case you can align the items perfectly with the PCB
component locations, check clearances to see if the fuse holder will hit
the filter cap, etc. Then you just export the panel hole info to your
CAM and generate your G-code.


And you don't even need to start with a DXF of your PCB.

I normally slap the PCB upside down with a scale
on my scanner. I create a bitmap and set that as
a background image in my CAD program.

'Tis trivial to spot the mounting holes and check
clearances inside the case model.

--Winston


Geeze, you guys. Here I am creating .STP models for every component
that is big or has anything to do with the enclosure, attaching them
to the footprints, creating the PCB, exporting the 3D model of the PCB
then inserting it into the housing model as an assembly. OTOH, I can
do it all before ordering the PCB prototypes or enclosures (with some
added risk, of course, in case the model doesn't match the enclosure,
for example).

It's nice to be able to create a drawing (really a 2D projection of a
live 3D model of a blank PCB, in the housing model), export that as a
DXF and then cookie-cut the PCB outline from that.



Winston July 19th 10 09:54 PM

Some kind of macro system for G-codes, for linux
 
On 7/19/2010 1:37 PM, Spehro Pefhany wrote:
(...)

Geeze, you guys. Here I am creating .STP models for every component
that is big or has anything to do with the enclosure, attaching them
to the footprints, creating the PCB, exporting the 3D model of the PCB
then inserting it into the housing model as an assembly. OTOH, I can
do it all before ordering the PCB prototypes or enclosures (with some
added risk, of course, in case the model doesn't match the enclosure,
for example).

It's nice to be able to create a drawing (really a 2D projection of a
live 3D model of a blank PCB, in the housing model), export that as a
DXF and then cookie-cut the PCB outline from that.



I used a method nearly identical to yours when I designed
a ~30 pin breakout board that had to fit inside a pocket present
on different assemblies. (The only difference was that I used
simplified versions of CAD models imported from the parts vendors
instead of capturing them as .STL files.)

Without the PCB model, checking vertical clearance and 'folding'
the cables would have been a trial-and-error headache.

I use the 'cheap and cheerful' method when it gives me all the
required information very quickly and I don't have to do a 'dog
and pony' to show how everything is supposed to fit together.

--Winston

cavelamb July 19th 10 10:02 PM

Some kind of macro system for G-codes, for linux
 
Winston wrote:
On 7/19/2010 1:37 PM, Spehro Pefhany wrote:
(...)

Geeze, you guys. Here I am creating .STP models for every component
that is big or has anything to do with the enclosure, attaching them
to the footprints, creating the PCB, exporting the 3D model of the PCB
then inserting it into the housing model as an assembly. OTOH, I can
do it all before ordering the PCB prototypes or enclosures (with some
added risk, of course, in case the model doesn't match the enclosure,
for example).

It's nice to be able to create a drawing (really a 2D projection of a
live 3D model of a blank PCB, in the housing model), export that as a
DXF and then cookie-cut the PCB outline from that.



I used a method nearly identical to yours when I designed
a ~30 pin breakout board that had to fit inside a pocket present
on different assemblies. (The only difference was that I used
simplified versions of CAD models imported from the parts vendors
instead of capturing them as .STL files.)

Without the PCB model, checking vertical clearance and 'folding'
the cables would have been a trial-and-error headache.

I use the 'cheap and cheerful' method when it gives me all the
required information very quickly and I don't have to do a 'dog
and pony' to show how everything is supposed to fit together.

--Winston



You guys...

Back when I was doing this ALL circuit boards were done with tape...


--

Richard Lamb



Winston July 19th 10 10:53 PM

Some kind of macro system for G-codes, for linux
 
On 7/19/2010 2:02 PM, cavelamb wrote:

(...)

You guys...

Back when I was doing this ALL circuit boards were done with tape...


Using pre-sensitized boards or 'direct etch'?

http://www.somerset.net/arm/reprints...cb_layout.html

--Winston Flintstone

cavelamb July 19th 10 11:10 PM

Some kind of macro system for G-codes, for linux
 
Winston wrote:
On 7/19/2010 2:02 PM, cavelamb wrote:

(...)

You guys...

Back when I was doing this ALL circuit boards were done with tape...


Using pre-sensitized boards or 'direct etch'?

http://www.somerset.net/arm/reprints...cb_layout.html


--Winston Flintstone



No...

We did those little jobs with bare copper and a Marks-A-Lot.
(Don't laugh, it works!)

I still have a couple here some where.
A "Short-Finder" (regenerative Op-Amp)
and a few postage stamp sized toys for model airplanes.

--

Richard Lamb



Pete C. July 19th 10 11:15 PM

Some kind of macro system for G-codes, for linux
 

Winston wrote:

On 7/19/2010 2:02 PM, cavelamb wrote:

(...)

You guys...

Back when I was doing this ALL circuit boards were done with tape...


Using pre-sensitized boards or 'direct etch'?

http://www.somerset.net/arm/reprints...cb_layout.html

--Winston Flintstone


Probably mylar if it was to be used for production.

Jim Wilkins July 19th 10 11:50 PM

Some kind of macro system for G-codes, for linux
 
On Jul 19, 10:08*am, Ignoramus21191 ignoramus21...@NOSPAM.
21191.invalid wrote:
...
Pete, I will definitely look in that direction. I am very firmly a
text-file and command line type of person at this stage of my life,
that's why I asked about a text file. That said, I agree that having a
GUI is often (if not always) a great plus and advantage.
i


I've written a couple of macro interpreters that fed into a program's
input parser. They are easy if the keyboard input is also handled as a
sequential string you can test once per loop pass rather than having
to wait for a key. The parser checks for the ESCape key, then nonzero
length in the macro string buffer, then any other user entry. The way
I wrote it the Null character 000 also indicated an empty buffer. I
blinked the cursor by testing whether the system time was odd or
even.

The same program can then interpret individual command lines from the
keyboard or sequences of them from a file, and pauses when you hit
ESCape.

This gives the keyboard buffer and the bits that show the Alt, Shift,
Ctrl keys etc.
http://pagesperso-orange.fr/pierreli...Data_Area.html

When you prompt to Press Any Key and the joker hits Shift, you could
fake a BSOD briefly. I randomly redefined the RGB values for Black a
few times which made the screen flash alarmingly.

jsw

dan July 19th 10 11:56 PM

Some kind of macro system for G-codes, for linux
 
What's that Lassie? You say that Pete C. fell down the old
rec.crafts.metalworking mine and will die if we don't mount a rescue
by Mon, 19 Jul 2010 09:01:30 -0500:

Pretty much nobody hand codes G-code these
days for anything but the simplest task, and stuff like the wizards are
also very limited though you can take the code they generate and
incorporate it into a larger program.


I hand wright all my code for a six axis lathe at work.
(faster than any software we've found)
Co-workers do the same for twin spindle/ twin turret lathes too.

The milling guys do let the CAD/CAM program generate g-code, but they
have to clean it up a lot.

--

Dan H.
northshore MA.

Jim Wilkins July 20th 10 12:04 AM

Some kind of macro system for G-codes, for linux
 
On Jul 19, 4:15*pm, Winston wrote:
...

I normally slap the PCB upside down with a scale
on my scanner. *I create a bitmap and set that as
a background image in my CAD program.

'Tis trivial to spot the mounting holes and check
clearances inside the case model.

--Winston


I used the line-drawing capability of my PCB CAD program (PADS) to
draw the enclosures, which were for digital radios. At the time I
couldn't export the drawing directly to the Hurco so they were
dimensioned for manual machining. By drawing both at once I could make
the SMA launchers line up perfectly with the traces, which is
important at 1GHz.

jsw

Jim Wilkins July 20th 10 12:14 AM

Some kind of macro system for G-codes, for linux
 
On Jul 19, 6:10*pm, cavelamb wrote:
...
We did those little jobs with bare copper and a Marks-A-Lot.
(Don't laugh, it works!)

Richard Lamb


I found that easier if I drilled the board first from the pencil
layout, then I could locate a pad on the other side from the hole. I
had to drag solder down all the traces to bridge hairline cracks, but
the board worked fine. It was a Super Tiger audio amp tweaked for DC
to ~1MHz.

jsw

Winston July 20th 10 12:29 AM

Some kind of macro system for G-codes, for linux
 
On 7/19/2010 3:10 PM, cavelamb wrote:

(...)

We did those little jobs with bare copper and a Marks-A-Lot.
(Don't laugh, it works!)


Me laugh? Not a chance.

I vaguely remember instructions from some ARRL publication
that required one to score and *physically pry up* copper
laminate to create a (very simple) PCB. Compared to that,
Marks-A-Lot is Star Trek technology. :)

--Winston

Winston July 20th 10 12:32 AM

Some kind of macro system for G-codes, for linux
 
On 7/19/2010 3:15 PM, Pete C. wrote:

Winston wrote:

On 7/19/2010 2:02 PM, cavelamb wrote:

(...)

You guys...

Back when I was doing this ALL circuit boards were done with tape...


Using pre-sensitized boards or 'direct etch'?

http://www.somerset.net/arm/reprints...cb_layout.html

--Winston Flintstone


Probably mylar if it was to be used for production.


Shorter runs, too.

I remember making a PCB video decoder using a
taped mylar positive. Made exactly one board.

It made me appreciate board fab houses *a lot*.

--Winston

Lloyd E. Sponenburgh[_3_] July 20th 10 12:44 AM

Some kind of macro system for G-codes, for linux
 
Winston fired this volley in
:

I vaguely remember instructions from some ARRL publication
that required one to score and *physically pry up* copper
laminate to create a (very simple) PCB. Compared to that,
Marks-A-Lot is Star Trek technology. :)


Yup... and there was another technique (not well suited to RF above about
20MHz) that involved only removing the essential copper to isolate trace
"lands". Not making traces, just removing a thin line wherever
necessary.

We did that by laminating the entire board with sticky tape, and razor
cutting the removal lines; then etching.


In fact, it worked fine on audio gear -- not pretty, but workable.

LLoyd


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2014 DIYbanter