CAD CAM EDM DRO - Yahoo Group Archive

Re: [CAD_CAM_EDM_DRO] G code Examples

Posted by Jon Elson
on 2001-01-23 23:19:16 UTC
John Murphy wrote:

> Along those lines, I'm working on generating some G code for my newly
> finished mill running EMC. I'm trying to first understand how
> the different codes are working (before I let a tool do
> everything) and trying to understand what operational methods people
> typically employ (locating origins, incremental versus absolute
> positions, etc.)

I generally use an edge finder, position until it deflects when approaching
the left side with the X axis, and go to MDI and enter G92 X-.1, because
the .2" diameter of the edge finder has the spindle located .1" to the left
of the actual edge of the part. Then I go back to manual, and approach
the bottom of the part with the Y axis, and enter G92 Y-.1 when I get to
the point where the tip deflects. My usual method of Z origin for one-offs
is to touch the tip of the tool to the part, often with a piece of paper between
the tool and the part, and then enter G92 Z.005 to compensate for the
thickness of the paper. So, the top of the part becomes Z=0, and the
rest of the part is in Z- coordinates. Some people find this ghastly, and
insist you need to make Z=0 the BOTTOM of the part, by doing the
same 'touch-off' on the fixture holding the part. Then, the part is entirely
in Z+ coordinates. Sometimes I do this
when actually using a fixture, but often I'm holding the part directly in
the vise. I had some round parts that had a fixture with a bored hole or
boss at the center, and used a dial test indicator to bring that circular feature
under the spindle and set X=0 Y=0 with a G92 X0 Y0.

I rarely use incremental coordinates, as it is easy to get lost. Since EMC has
user variables that can be used as offsets, plus the 9 additional coordinate
references (G51 through G59, I think) there is no reason to use incremental
coordinates.

> some tutorials I've found on the net, but I'd like to see some examples
> that employ cutter compensation (as found in EMC), tool changes (manual
> changes
> with a message/key prompt as is often done in EMC, and multiple

Tool changes are not so simple, as you CAN NOT go to manual in the
middle of a program! This is a serious bug, probably the most serious
shortcoming in EMC, and the people at NIST refuse to fix it! That is unfortunate,
but they are not machinists, and just can't see how difficult this makes things!
If you go to manual, the place in the program is lost, and you have to either
start over at the beginning, or use the editor to set the "run mark" to get back
to where you were when you interrupted it. It has a VERY nice way of
getting everything back in the state it was at that point when you do use the
run mark to start a program in the middle, it just is cumbersome to do it.
So, if you need to change a tool, you have to have the program retract
the spindle, move the part out of the way, etc. so that you can physically
remove the tool and put the new one in. You can't touch of the new tool to
set the Z offset, so the offset has to be in the program.

I have written some short things which describe how tool length offset and
cutter diameter compensation works, at http://206.19.206.56/rs274.htm
including a program for a part I made. One of my tricks for using this
is I have a platen that mounts in the vise to hold a sheet of paper. I tape
paper to the platen. I made a pen that fits in a 1/2" collet, using a ballpoint
pen cartridge, with a spring to load the pen point forward. I can use this
to draw the tool path. What I do is set the tool diameter to zero in the tool
table, and then run the program. The program contains actual part outline
coordinates, so the actual part outline is drawn by the pen. I then set the
tool diameter in the tool table to the actual diameter of the tool to be used, and
run the program again. It now draws the path the center of the tool will take.
If I have done things right, the tool path is on the correct side of the part, and
doesn't do anything wierd. The picture on that section is a scanned image
of one of those pen drawings.

I have made a tool that allows me to accurately measure tool length offsets
so that I can put them in the tool table, see
http://ascc.artsci.wustl.edu/~jmelson/preset.html

>
> operations with
> rapids, tool changes, etc in the programs.

I don't have any programs like that on this particular machine. I will try to get
one off the CNC machine so you can see what it looks like. But mostly,
you have a couple lines that look like :
N1230 Z2.5 [move the Z axis to top for tool change ]
N1240 X-2 Y-1 [move part away so tool can clear ]
N1250 (mount .125" drill) [operator message]
N1260 M01 [program temporary stop for tool change]
N1270 G43 H4 [specifies tool length offset using tool length specified for tool # 4 in tool table ]
N1280 F25 X3 Y4
N1290 F7 Z-1.25 [ tool length offset actually becomes effective here -
tool moves from wherever it was without offset to position it should be
in with offset enabled when first move of Z is specified.]

> My mill is configured to "home" at the center of the X and Y Axis, with
> Z almost
> all the way up, and Z-10 around 1 1/2" from the table. I would think I
> might
> use some type of relative coordinate system (ignoring the positions EMC
> reports after homing) to allow me to locate the tool and touch off where
> I want the operation to start, then have the cut proceed from there.

That's what the G92 does. It sets up a relative offset from machine
home. When you shut EMC down, it saves the offset. When you restart
EMC, the old offset is reloaded, and when you do the home operation,
the offset is now referenced back from the home position, and should be
the same location.

> Another part I'd like to make involves a large half circle flat plate,
> which I would cut a contour to create the perimiter of the half circle.
> If my origin was
> the center of the circle, and the radius was almost the limit of a
> direction of
> travel, then I might have to start my operation near the -limit of the
> travel, i.e.:
>
> +y
> | ********
> | * *
> | * *
> | * *
> | * *
> -x------*----------------*------ +x
> | * *
> | * *
> | * *
> | **********@*********
> |
> -y
>
> My machine is configured so the head moves similar to most CAD
> coordinate
> systems, where moving the tool up and right with respect to the part
> is increasing both Y and X.

This may be BACKWARDS. It is a fundamental part of machine tool definitions
that the PART is the basis for the coordinate system, and in many cases
the machine has to move in the opposite direction so that the tool moves
in the correct relation to the part. If your part is stationary, and only the
cutting head moves, then it will be correct.

> My current part drawing has the origin of
> the
> drawing at the "@" sign. In order to cut this part, my initial start
> position
> would need to be close to -y. How is this properly set up, with respect
> to
> configuring my origin in my cad software, and configuring G code to
> cut this (absolute versus incremental coordines in my moves, and
> relative/absolute values in EMC)

You move so that the cutting tool is at the center of the circle to be
cut, and enter G92 X0 Y0 in the MDI mode. That's IT!

Jon

Discussion Thread

Jon Elson 2001-01-23 23:19:16 UTC Re: [CAD_CAM_EDM_DRO] G code Examples Smoke 2001-01-24 02:24:27 UTC Re: [CAD_CAM_EDM_DRO] G code Examples Alan Marconett KM6VV 2001-01-24 17:55:54 UTC Re: [CAD_CAM_EDM_DRO] G code Examples Jon Elson 2001-01-24 22:35:09 UTC Re: [CAD_CAM_EDM_DRO] G code Examples Jon Elson 2001-01-24 22:41:39 UTC Re: [CAD_CAM_EDM_DRO] G code Examples Alan Marconett KM6VV 2001-01-25 00:33:03 UTC Re: [CAD_CAM_EDM_DRO] G code Examples Ray 2001-01-25 07:53:26 UTC Re: Re: G code Examples Alan Marconett KM6VV 2001-01-25 11:55:32 UTC Re: G code Examples Jon Elson 2001-01-25 15:50:45 UTC Re: [CAD_CAM_EDM_DRO] G code Examples