Machsupport Forum
G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: Planobilly on November 02, 2017, 04:47:21 PM
-
Hi,
I am trying to learn G Code. I want to cut two circles side by side on the X axis.
Here is simple code without lowering the Z axis. I am not having any issue cutting single circles.
%
(1 inch circle)
G01 G20 G40 G49 G90 X0 Y0 Z0 F2 (SLOW FEED RATE BECAUSE I AM JUST LEARNING...LOL)
G02 X0 Y0 I-.5 J0
G01 G90 X0 Y0 Z0 F2
M30
%
How do I get the machine to move over 2 inches from the outside of the first circle and cut a second one? Both lined up on the X axis.
Thanks,
Billy
-
There are a lot of ways to learn gcode.
I would suggest that a person wanting to learn how to write gcode purchase the book
"CNC Programming Handbook" by Peter Smid. It will give you a firm foundation in basics
and it provides an understanding of gcode. Skip all the other bull,,,, and learn properly
right from the start.
Now on to your question......
Use a different work offset to locate the second circle. IE; G54 for the first circle and G55 for the second. It's just one way of doing it.
RICH
-
Thanks Rich,
I will give the book a try. Also thanks for the G55 idea. On several occasions, I needed to cut a series of circles in various places on an electronics chassis. I got it done by manually moving things around. Not the best approach....lol
It has become obvious to me that some form of training is needed. I hope Peter's book will do well for me.
Billy
-
%
(1 inch circle)
G20 G40 G49 G90
G01 X0 Y0 Z0 F2 (SLOW FEED RATE BECAUSE I AM JUST LEARNING...LOL)
G02 X0 Y0 I-.5 J0
G01 Z1
G00 X2
G01 Z0
G02 X2 Y0 I-.5 J0
G01 Z1
M30
%
-
(https://i.imgur.com/FERDFJb.jpg)
This is what was produced when I loaded the gcode. Perhaps I have something set up wrong in the program.
Billy
-
It depends on whether you are using Absolute or Incremental IJ mode.
99.9% of CAM programs use Incremental IJ. Mach3 defaults to Absolute IJ mode.
Try this:
%
(1 inch circle)
G91.1
G20 G40 G49 G90
G01 X0 Y0 Z0 F2 (SLOW FEED RATE BECAUSE I AM JUST LEARNING...LOL)
G02 X0 Y0 I-.5 J0
G01 Z1
G00 X2
G01 Z0
G02 X2 Y0 I-.5 J0
G01 Z1
M30
%
-
Thanks Gerry,
This program worked. I think this was the reason I came up with two overlapping circles when I tried to program this.
I would have needed to read the 40 pound book for a month to figure out the G91.1 business...lol
Thanks again,
Billy