Author Topic: Simple G Code question  (Read 1658 times)

0 Members and 1 Guest are viewing this topic.

Offline Planobilly

  • Active Member
  • Posts: 36
    • View Profile
Simple G Code question
« 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

Offline RICH

  • Global Moderator
  • *
  • Posts: 7,305
    • View Profile
Re: Simple G Code question
« Reply #1 on: November 02, 2017, 08:57:24 PM »
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

Offline Planobilly

  • Active Member
  • Posts: 36
    • View Profile
Re: Simple G Code question
« Reply #2 on: November 03, 2017, 10:34:20 AM »
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   

Offline ger21

  • Global Moderator
  • *
  • Posts: 6,156
    • View Profile
    • The CNC Woodworker
Re: Simple G Code question
« Reply #3 on: November 03, 2017, 11:51:18 AM »
%
(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
%
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline Planobilly

  • Active Member
  • Posts: 36
    • View Profile
Re: Simple G Code question
« Reply #4 on: November 03, 2017, 12:16:24 PM »


This is what was produced when I loaded the gcode. Perhaps I have something set up wrong in the program.

Billy
« Last Edit: November 03, 2017, 12:20:38 PM by Planobilly »

Offline ger21

  • Global Moderator
  • *
  • Posts: 6,156
    • View Profile
    • The CNC Woodworker
Re: Simple G Code question
« Reply #5 on: November 03, 2017, 01:13:02 PM »
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
%
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline Planobilly

  • Active Member
  • Posts: 36
    • View Profile
Re: Simple G Code question
« Reply #6 on: November 03, 2017, 11:21:14 PM »
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