Post your drawing.
Need to insert G91 after first positioning.
Z movement to be included.
In the G42 G00 block, the coordinates of one corner of the square should be specified.
I am very new to G-code! I have circles down, but need to do a square now. What I have is:
The stock is a square tube 5x3x37" and I need three square holes in the 3" side. One half inch in from the end, 11” long and 2.5" wide. This is what I came up with. Oh yea the mill is only 2d so all I have is X and Y.
My ref will be set to X 0 Y 0 at the outside left corner.
g0 x .5 y .25
g42 g0 x 0.09375 y 0.09375 Off set for 3/16” bit
g1 y 2.5
g1 x 11
g1 y -2.5
g1 x -11
g40
Will this work or am I missing something?
Last edited by tbitt1; 02-08-2011 at 12:53 PM. Reason: Updated measurements
Post your drawing.
Need to insert G91 after first positioning.
Z movement to be included.
In the G42 G00 block, the coordinates of one corner of the square should be specified.
Just my opinion, but for simple things it easier to do without cutter offset.
Then you don't have to worry about some hard to control approach mystery.
Not knocking G41 stuff, but KISS. Keep It Simple Stupid.
Are you trying to plunge a hole.
How is it going to start? You control the Z? Then you need to pause to do it with M0.
Super X3. 3600rpm. Sheridan 6"x24" Lathe + more. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.
If I do not do the G41 offset, will the hole be the correct size? Or do I account for the bit size in my measurements? I do not have powered Z so I step thru the program and plunge the Z. I got a chance to step thru it last night, it look good, but like I said I have only been it this for about a week. If their is a better way, I am all ears.
Just put the offset in in your toolpath, off by the radius.
Put a M0 whenever you need it to pause to move the Z manually.
Hit cycle start to continue until next M0, or just single step, and never walk away. Problem with G41 is thew is a preparatory move, which is no problem on the outside of something, but inside, To overcome this, I do the weird moves above the job, then ramp down after the dirty bit.
When there is nowhere to go but cut, you really don't want those weird moves.
Or you can use liberal M1s and turn optional stop on and off as required to stop. I use F4 key as a hot key to toggle optional stop. That is emergency pause, for my wife.![]()
Last edited by neilw20; 02-09-2011 at 06:52 AM. Reason: typos and dumb grammar
Super X3. 3600rpm. Sheridan 6"x24" Lathe + more. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.
ima listening....
its quite easy what neil is saying. reduce your hole dimensions by the tool diameter. thats a radius to each side. then a simple code along the lines of
go1 x0 y0
x10y0
x10y10
x0y10
x0y0.
a very basic square.
its rough. it has no feed controls, no offsets... nothing to confuse you...
chuck in f100 say... and the m0 every second line...
but its kiss and as long as your setup is right... rethink your reference... it works.
You can round those to 4 decimal places.
Do you really think your machine can resolve 0.00001 ??
Add some comments so that the prompt line makes sense (next week)
You must select a feed for G1 to work
This will work OK.Code:G0 X0 Y0 G1 y2.4063 F10 (You must have a FEED or G1 will complain) m0 (Turn ON spindle, and MOVE Z DOWN) X10.9063 M0 Y-2.4062 M0 X-10.9062 M0 (RETRACT Z NOW) G0 (maybe not a good idea in your case) M30 (End of program)
Spaces for clarity, but keep the numbers with their respective letters for readability.
G0 and G1 are modal, so don't keep repeating yourself.
Less stuff means improved readability
Last edited by neilw20; 02-09-2011 at 03:14 PM. Reason: Extra thoughts
Super X3. 3600rpm. Sheridan 6"x24" Lathe + more. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.
Neil,
Great, Thank you very much!
is that code absolute or incremental?
not to be picky but i see a square of 5 by 20 inches here... 0,0 being the centre.
at least the way i use my machine...
a quick pic.
white square. your material.
grey square, hole. the corners shall be radius, of course.
red square is the tool path.
green circle is cutter at 0,0 (already subtracting tool radius)
opposite corner would be X5 Y2.5 minus, again, tool radius. two radii make a diameter
the way i work, (aasuming this to be a 5" by something hole...)the purple circle is at approx X2.5 Y2.41967283 whatever it was (), with the tool heading TOWARDS X0 Ywhatever it was...
OR,, the cutter is moving AWAY FROM X0 Y whatever it is... (in the X axis only!)
get the idea?
then you must consider...to hold X at 0, and move Y first? or to hold Y at 0, and move X?
(ie;
X0 Y0
X0 Y10
X10 Y10
versus
X0 Y0
X10 Y0
X10 Y10...)
which way you go depends on machine capabilities. cutter turns clockwise from above. to travel X first results in CLIMB MILLING, Y first is conventional milling. when doing an inside cut.
move Y first if you have backlash, so the hole is cut in a CLOCKWISE direction... yes, it is important!
confusing?
this is basic!
the G-Code is in incremental or Relative.
Not incremental.
This code described here is absolute.
Super X3. 3600rpm. Sheridan 6"x24" Lathe + more. Three ways to fix things: The right way, the other way, and maybe your way, which is possibly a faster wrong way.