Go to Post Spelling mistakes make me sad...Almost as sad as not being able to go to Atlanta this year.. Almost. - Elgin Clock [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-12-2009, 22:50
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
G Code with a Mill

Hi-

Our mill has arrived, but before we start to use it, I figured id try and learn the code for it.

I was able to make some cool triangle things in the software for the mill (http://microkinetics.com/mmpfw/), but I am having a HUGE difficulty with circles.

I have been trying for about 2 days, searched Google, and CD, but the program is always giving me a straight line, or a very sharp curve...

I am trying to learn to make simple circles, or even half circles.
I attached a photo with what is going on, any help is appreciated?
(The green is what the software is doing, the red is a crude sketch of what I want to happen)


And the code...(and what I think it should do?)
G90 //Set it to absolute mode, X+Y begin at 0, Z at 1.


G01 X5 Y5 //Put to center of circle, 5,5
G01 X1 Y5 //Go to starting point of circle, 4 away from center.
G01 Z-1 //lower the cutter
G02 X9 Y5 I5 J5 //Should make a semi-circle going out to 9,5 with a center of 5,5?

Note: In case someone says it... No, I am NOT doing this on any material, only the software, so I'm not breaking things.
Attached Thumbnails
Click image for larger version

Name:	millfailure.JPG
Views:	234
Size:	96.9 KB
ID:	8211  

Last edited by nighterfighter : 20-12-2009 at 22:51. Reason: Added the note
  #2   Spotlight this post!  
Unread 20-12-2009, 23:52
sanddrag sanddrag is offline
On to my 16th year in FRC
FRC #0696 (Circuit Breakers)
Team Role: Teacher
 
Join Date: Jul 2002
Rookie Year: 2002
Location: Glendale, CA
Posts: 8,516
sanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond repute
Re: G Code with a Mill

First, welcome to the world of CNC! It is SO much fun. There are a few problems in your code; let me try to help.

There is no need to move to the center of the circle before making the circular interpolation. The line that reads "G01 X5 Y5 //Put to center of circle, 5,5" can be eliminated.

Your next line to position the machine at the start of the arc is fine, however usually this would be a "rapid" G0 (or G00) move through air rather than a G01 "feed" move that is usually used for cutting the material.

Your G02 (clockwise circular interpolation) line should read:

G02 X9. Y5. I4. J0

The I and J coordinates are the incremental distances from the starting point to the center of the arc, not the coordinates of the center itself. The coordinates of the center itself never actually appear in the code. So if you are starting at 1,5 the center (at 5,5) is located at an incremental/additional 4 in the X (I), and 0 in the Y (J) directions (since you are sitting directly to the left of your intended center).

The code revised as listed above will yield a semi-circle (half circle). If you wanted a full circle, you would leave out the X and Y coordinates, and the end point would be the same as the start point, resulting in a full circle.

Also, not sure about yours, but many machines are very particular about leaving decimal points off of a number. For example, on a HAAS machine, "F4" does not mean the same thing as "F4." Oh, and that's the the other thing. You are missing feed rates all around. The units of feed rates are in inches per minute. To start out, I'd keep the feeds under 10 IPM.

Also, in your first line (the G90 absolute line) I would add G0 X0 Y0 Z1 to make it do what you say in the comment.

Finally, many CAM programs such as MasterCAM really make coding for the CNC a piece of cake. You should investigate these.

If you wish to improve your understanding of G-code and the machine's interpretation of it, you will find this manual very helpful: http://coestudentshop.engr.wisc.edu/...llWorkbook.pdf
__________________
Teacher/Engineer/Machinist - Team 696 Circuit Breakers, 2011 - Present
Mentor/Engineer/Machinist, Team 968 RAWC, 2007-2010
Technical Mentor, Team 696 Circuit Breakers, 2005-2007
Student Mechanical Leader and Driver, Team 696 Circuit Breakers, 2002-2004

Last edited by sanddrag : 21-12-2009 at 11:47.
  #3   Spotlight this post!  
Unread 21-12-2009, 00:03
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: G Code with a Mill

Thanks!

I was actually talking with chris L, and he was helping me out!

Thanks for your post also, it also clears things up.
So if I am going to use I and J (which chris has taught me how to use R, seems easier) I need to do incremental mode?
  #4   Spotlight this post!  
Unread 21-12-2009, 00:14
Rion Atkinson's Avatar
Rion Atkinson Rion Atkinson is offline
The CAD Guy
no team
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Oklahoma City
Posts: 386
Rion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond repute
Re: G Code with a Mill

Quote:
Originally Posted by sanddrag View Post
The I and J coordinates are the incremental distances from the starting point to the center of the arc, not the coordinates of the center itself. The coordinates of the center itself never actually appear in the code. So if you are starting at 1,5 the center (at 5,5) is located at an incremental/additional 4 in the X (I), and 0 in the Y (J) directions (since you are sitting directly to the left of your intended center).

Also, not sure about yours, but many machines are very particular about leaving decimal points off of a number. For example, on a HAAS machine, "F4" does not mean the same thing as "F4." Oh, and that's the the other thing. You are missing feed rates all around. The units of feed rates are in inches per minute. To start out, I'd keep the feeds under 10 IPM.

Finally, in your first line (the G90 absolute line) I would add G0 X0 Y0 Z1 to make it do what you say in the comment.
Is there a way to change that in the settings of the program? It know the program (And machine itself) I use in my CIM class does not work via increments. So to me his code was just fine. Had he plugged it into the program in my class it would have worked.

Do you have any idea as to what would cause this?

Also. The feed rates depend entirely on what you are cutting. I cut butter board around F15 and plunge at F5 just to be safe. I could probably cut faster. But as a side note. Just as with driving you slow down for turns. Slow your feed rate down when you are cutting arcs.

-Rion
  #5   Spotlight this post!  
Unread 21-12-2009, 00:35
sanddrag sanddrag is offline
On to my 16th year in FRC
FRC #0696 (Circuit Breakers)
Team Role: Teacher
 
Join Date: Jul 2002
Rookie Year: 2002
Location: Glendale, CA
Posts: 8,516
sanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond reputesanddrag has a reputation beyond repute
Re: G Code with a Mill

Quote:
Originally Posted by Formerly Famous View Post
Is there a way to change that in the settings of the program? It know the program (And machine itself) I use in my CIM class does not work via increments. So to me his code was just fine. Had he plugged it into the program in my class it would have worked.

Do you have any idea as to what would cause this?
No idea. The standard way G-code is interpreted is how I wrote above. Some manufacturers of machine controllers may choose to differ.

Also, it should be noted that an "R" word in the G02 line is not capable of producing a 360 degree arc. For a full circle, I and J coordinates must be used.
__________________
Teacher/Engineer/Machinist - Team 696 Circuit Breakers, 2011 - Present
Mentor/Engineer/Machinist, Team 968 RAWC, 2007-2010
Technical Mentor, Team 696 Circuit Breakers, 2005-2007
Student Mechanical Leader and Driver, Team 696 Circuit Breakers, 2002-2004
  #6   Spotlight this post!  
Unread 21-12-2009, 04:25
Cory's Avatar
Cory Cory is offline
Registered User
AKA: Cory McBride
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: May 2002
Rookie Year: 2001
Location: Redwood City, CA
Posts: 6,812
Cory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond reputeCory has a reputation beyond repute
Send a message via AIM to Cory
Re: G Code with a Mill

Quote:
Originally Posted by Formerly Famous View Post
Is there a way to change that in the settings of the program? It know the program (And machine itself) I use in my CIM class does not work via increments. So to me his code was just fine. Had he plugged it into the program in my class it would have worked.

Do you have any idea as to what would cause this?

Also. The feed rates depend entirely on what you are cutting. I cut butter board around F15 and plunge at F5 just to be safe. I could probably cut faster. But as a side note. Just as with driving you slow down for turns. Slow your feed rate down when you are cutting arcs.

-Rion
To clarify, here is an excerpt from the Haas user manual. Note that this is not Haas specific-any Fanuc based controller will follow these same rules. I am certain that his code would not run correctly on your program, as I and J are always incremental distances to the arc's center.


Quote:
Using I, J, K addresses
I, J and K address are used to locate the arc center in relation to the start point. In other words, the I, J, K
addresses are the distances from the starting point to the center of the circle. Only the I, J or K specific to the
selected plane are allowed (G17 uses IJ, G18 uses IK and G19 uses JK). The X, Y, and Z commands specify
the end point of the arc. If the X, Y, or Z location for the selected plane is not specified, the endpoint of the arc
is the same as the starting point for that axis.
To cut a full circle the I, J, K addresses must be used; using an R address will not work. To cut a full circle, do
not specify an ending point (X, Y and Z); program I, J or K to define the center of the circle. For example: G02
I3.0 J4.0 (Assumes G17; XY plane)
The Haas user manual is a great resource for manual programming. Even though it's put out by Haas, it gives specific examples and sample programs. Like I said earlier, any Fanuc based control will use the same formatting (or very, very similar) as the Haas for all basic g-codes (G00/G01/G02/G03, G43, G41/G42). It's particularly useful for examples involving cutter compensation.

It can be found here: http://www.haascnc.com/pdf/96-8000.pdf
__________________
2001-2004: Team 100
2006-Present: Team 254

Last edited by Cory : 21-12-2009 at 04:30.
  #7   Spotlight this post!  
Unread 21-12-2009, 12:04
Rion Atkinson's Avatar
Rion Atkinson Rion Atkinson is offline
The CAD Guy
no team
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Oklahoma City
Posts: 386
Rion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond repute
Re: G Code with a Mill

Quote:
Originally Posted by Cory View Post
To clarify, here is an excerpt from the Haas user manual. Note that this is not Haas specific-any Fanuc based controller will follow these same rules. I am certain that his code would not run correctly on your program, as I and J are always incremental distances to the arc's center.
You said that his program would most likely not work on mine. But the way I have been writing programs says that it would.

Here is a program I have written the does indeed work.

Quote:
;Rion Atkinson
;12-1-09
;Ornament Project
G90 M03 S250 ; Turn on spindle
G00 X0 Y0 Z1 ; Move to starting point
G00 X1.0 Y0.3 ; Move rapid above point A
G01 Z-0.125 F5 ; Plunge to point A
G01 X0.9 Y0.5 F20 ; Cut to point B
G01 X1.9 Y1.4 ; Cut to point C
G02 X2.3 Y0.6 I2.1 J1.0 ; Cut Clockwise to point D
G01 X2.2 Y0.8 ; Cut to point E
G03 X2.0 Y1.2 I2.1 J1.0 ; Cut Counter-Clockwise to point F
G01 X1.0 Y0.3 ; Cut to point A
G01 Z1 ; Move up out of material
G00 X2.0 Y0.3 ; Move rapid above point G
G01 Z-0.125 F5 ; Plunge to point G
G01 X2.1 Y0.5 F20 ; Cut to point H
G01 X1.1 Y1.4 ; Cut to Point I
G03 X0.7 Y0.6 I0.9 J1.0 ; Cut CC to point J
G01 X0.8 Y0.8 ; Cut to point G
G01 Z1 ; Raise up out of material
G00 X1.5 Y1.2 ; Move rapid above point M
G01 Z-0.125 F5 ; Plunge into material
G02 X1.5 Y1.2 I1.5 J1.55 ; Cut Clockwise to point M
G01 Z1 ; Raise up out of material
G00 X2.3 Y1.4 ; Move rapid above point N
G01 Z-0.125 F5 ; Plunge into material
G03 X2.3 Y1.4 I2.5 J1.6 F20 ; Cut CC to point N
G01 Z1 ; Raise up out of material
G00 X0.8 Y1.5 ; Move Above point O
G01 Z-0.125 F5 ; Plunge to point O
G02 X0.8 Y1.5 I0.6 J1.6 ; Cut Clockwise to point O
G01 Z1 ; Raise out of material
G00 X2 Y5 ; Move rapid to off loading point

(Sorry for no line numbers. I had to write this out of a piece of paper so I left them out.

It cut this out of butter board.


http://picasaweb.google.com/lh/photo...eat=directlink
  #8   Spotlight this post!  
Unread 22-12-2009, 18:11
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: G Code with a Mill

I got bored, so I decided to write this up, hopefully once our mill gets working, I can try it on a wax block.
http://img707.imageshack.us/img707/3061/diamonds.jpg

You can't see it in the picture, but the cuts are different depths...The inner-most circle is the highest, and then each one outside it descends by .25".

I have a quick question about it, will the cuts be too close, and overlap each other?
  #9   Spotlight this post!  
Unread 22-12-2009, 18:14
Rion Atkinson's Avatar
Rion Atkinson Rion Atkinson is offline
The CAD Guy
no team
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Oklahoma City
Posts: 386
Rion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond repute
Re: G Code with a Mill

Quote:
Originally Posted by nighterfighter View Post
I got bored, so I decided to write this up, hopefully once our mill gets working, I can try it on a wax block.
http://img707.imageshack.us/img707/3061/diamonds.jpg

You can't see it in the picture, but the cuts are different depths...The inner-most circle is the highest, and then each one outside it descends by .25".

I have a quick question about it, will the cuts be too close, and overlap each other?
That depends. What is the width of the bit that you plan to use to cut this?
__________________
‎‎"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones. -Albert Einstein
Start Something

Email - rionatkinson@gmail.com
Skype - Rion.Atkinson
  #10   Spotlight this post!  
Unread 22-12-2009, 18:18
nighterfighter nighterfighter is offline
1771 Alum, 1771 Mentor
AKA: Matt B
FRC #1771 (1771)
Team Role: Mentor
 
Join Date: Sep 2009
Rookie Year: 2007
Location: Suwanee/Kennesaw, GA
Posts: 835
nighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant futurenighterfighter has a brilliant future
Re: G Code with a Mill

I'm not sure what size we have. I used the smallest one the software had, which is 0.1000"
  #11   Spotlight this post!  
Unread 22-12-2009, 18:22
Rion Atkinson's Avatar
Rion Atkinson Rion Atkinson is offline
The CAD Guy
no team
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Oklahoma City
Posts: 386
Rion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond reputeRion Atkinson has a reputation beyond repute
Re: G Code with a Mill

Quote:
Originally Posted by nighterfighter View Post
I'm not sure what size we have. I used the smallest one the software had, which is 0.1000"
Ok. Well. If that is the width of the bit you can use then the picture shows exactly how it will turn out.
__________________
‎‎"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones. -Albert Einstein
Start Something

Email - rionatkinson@gmail.com
Skype - Rion.Atkinson
  #12   Spotlight this post!  
Unread 23-12-2009, 21:04
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: G Code with a Mill

If the lines are more than 0.100 apart, you'll end up with grooves and not a surface.

One might use a 0.250 bit, separate the lines by .250 (maybe .249) and drop down .250.

Just remember that you need to consider what the bit can cut: At that outermost line, you've dropped down by an inch, right? Can your bit cut a whole inch at a time? If not, how might you address that issue?

This is one reason it is often better to learn how to use a manual mill before getting into a CNC mill. Understanding the milling process is critical.
__________________

I am N2IRZ - What's your callsign?
  #13   Spotlight this post!  
Unread 27-12-2009, 18:07
Ken Ginger's Avatar
Ken Ginger Ken Ginger is offline
Registered User
FRC #1189 (GPGEARHEADS)
Team Role: Coach
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Grosse Pointe Michigan
Posts: 3
Ken Ginger will become famous soon enough
Re: G Code with a Mill

Look at the following site. http://www.machsupport.com/

Their wizards are very helpful for standard routines. They may offer a break to FIRST teams.
This is the control package team 1189 uses. Our CAD program, Key Creator includes a built in NC function that creates cutter paths and posts them to a wide choice of post processors.
  #14   Spotlight this post!  
Unread 11-01-2010, 00:13
VEI Dude's Avatar
VEI Dude VEI Dude is offline
Mentor 4024, 4013
AKA: Neil the Real Deal
FRC #4013 (Jokers & Clockwork Mania)
Team Role: Mentor
 
Join Date: Sep 2008
Rookie Year: 2008
Location: Orlando, FL
Posts: 54
VEI Dude has a spectacular aura aboutVEI Dude has a spectacular aura about
Re: G Code with a Mill

This (free) software may be helpful. It doesn't have a lot of features, but is very simple to use, so you can try it with different-sized endmills... http://www.cncsimulator.com/

Cheers,
-Neil.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drill/Mill or Lathe/Mill attachment for small shop area Coach Norm General Forum 22 16-09-2009 15:59
[FTC]: Problem with Code or Problem with Bluetooth? VeedotJaydot FIRST Tech Challenge 3 27-01-2009 18:22
pic: Me with our mill Lowfategg Extra Discussion 1 10-01-2009 15:49
problems using gyro/adc code with camera default code tanstaafl Programming 7 22-01-2006 23:09


All times are GMT -5. The time now is 02:58.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi