CNCzone.com-The Largest Machinist Community on the net!



Home Page Mark Forums Read Today's Posts My Replies Classifieds Reviews Photo Gallery Web Links Share Files Advertise With Us Ad List
Go Back   CNCzone.com-The Largest Machinist Community on the net! > Machine Controllers Software and Solutions > G-Code Programing


G-Code Programing Discuss G-code programing and problems here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 01-02-2006, 12:47 PM
 
Join Date: Sep 2005
Location: USA
Posts: 91
jhwatts is on a distinguished road
G-Code Examples

Could some body post a few example G-Code programs for simple operations such as peck dril, circle mill, pocket mill, linear mill x directions, linear mill x then y direction, and anything else somebody can think of. If I had few simple examples I could just copy and paste it would help me get started.
Reply With Quote

  #2   Ban this user!
Old 01-02-2006, 01:10 PM
 
Join Date: Apr 2005
Location: US
Posts: 411
Kevin Taylor is on a distinguished road

I asume your milling the machinest handbook has most of the standard Gcodes listed with a bref explanation of there actions pocket's and drill cycles are comenly called caned cycles that are machine spefic in some cases Look through the Gcode forum there is a post with a compleat list of G codes with explantion's Good luck Kevin
Reply With Quote

  #3   Ban this user!
Old 01-02-2006, 04:57 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,563
Geof will become famous soon enough

The two programs I have attached make the part in the picture starting from a piece of bar stock 2-1/4" x 4-1/4" x 5/8" held in a vise for the first program and bolted to a fixture held in the vise for the second program. They use spot drill and peck drill canned cycles, circular interpolation, tool compensation, repeat rigid tapping. Tool diameters for tool compensation are entered on lines N4 and N5. In both programs the work origin is placed at the center of the part; this is just for simplicity, these are hand coded and this way the toolpaths are symmetric.

FIRST PROGRAM:
Tool 1 spot drills for the holes; the canned cycle is initiated before calling the subroutine N1000 which has coordinates for the holes that will be counterbored. Then subroutine N1100 is used for the holes that will be tapped and the first line in this case has a Z value to reduce the spot drill depth. Finally subroutine N1200 is used to cut a groove around the perimeter so that when the profile is machined a chamfer will remain. This operation uses tool compensation with a tool diameter of 0.2 even though the spot drill is 1/2". This is so the cut line is part way down the cutting edge and the tool overlaps the perimeter to leave the chamfer.

Tool 2 peck drills the holes that will be counterbored using subroutine N2000.

Tool 3 interpolates the counterbore using subroutine N3000 for the hole coordinates and N3100 for the helical interpolation. Notice because the Y work zero is on the centerline of the part the tool compensation can be applied in an absolute move. The helical interpolation uses incremental moves for two circuits in a counterclockwise direction then goes back to absolute to clean up the bottom of the counterbore.

Tool 4 peck drills the holes that will be tapped using subroutine N4000.

Tool 5 Taps the holes using subroutine N5000 for the hole coordinates and N5100 for the repeat rigid tapping.

SECOND PROGRAM:
Tool 1 spot drills all the holes using subroutine N1000 and then cuts the chamfer groove around the perimeter using N1100.

Tool 2 machines around the perimeter.

In these programs there is some redundancy in the subroutines because the same coordinates are repeated in different subroutines.

The entire program could also be written without subroutines. The reason for subroutines is that less editing is needed to change the program to use four or eight work zeroes for production work.
Attached Thumbnails
Click image for larger version

Name:	Adapt 001.jpg‎
Views:	600
Size:	43.9 KB
ID:	13432  
Attached Files
File Type: txt ADAPT1.TXT‎ (2.8 KB, 3201 views)
File Type: txt ADAPT2.TXT‎ (1.5 KB, 1314 views)
Reply With Quote

  #4   Ban this user!
Old 12-05-2007, 08:12 AM
 
Join Date: Sep 2007
Location: United States
Posts: 7
HTMDGEARY is on a distinguished road

Anybody got a Gcode sample for circle milling a 3" dia hole on a cincinnati milacron. We just bought a used one and need some help.
Thanks,
dg
Reply With Quote

  #5   Ban this user!
Old 01-31-2008, 08:39 PM
 
Join Date: May 2007
Location: USA
Posts: 913
g-codeguy is on a distinguished road

Originally Posted by HTMDGEARY View Post
Anybody got a Gcode sample for circle milling a 3" dia hole on a cincinnati milacron. We just bought a used one and need some help.
Thanks,
dg
Not trying to be a smart a$$, but I think you would have gotten a quick answer if you had asked this question in a separate thread. Plenty of people on here that have the knowledge and willingness to answer it.

I'm sure it is simple, but I don't do mills, so I can't help you. Would if I could. All I know is that some machines require the arc to be broken into at least two parts, and that even on machines that can do a 360 degree arc with a single block call, it usually requires it be done using a specific address (R- instead of R?), but like I said "I don't do mills."
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 01-31-2008, 09:53 PM
 
Join Date: Jan 2008
Location: USA
Posts: 85
dapoling is on a distinguished road

Originally Posted by jhwatts View Post
Could some body post a few example G-Code programs for simple operations such as peck dril, circle mill, pocket mill, linear mill x directions, linear mill x then y direction, and anything else somebody can think of. If I had few simple examples I could just copy and paste it would help me get started.
Does your company want you to program center of cutter path or part edge?

This is programmed in long hand sort of speak with out using subroutines M97 or a M98 as demonstrated by Geof post which will stop allot of repetition and in most cases more versatile.
I showed this for those that do not have a grasp on G and M Code Programming as of yet.

%
O1000 (Example: Part edge 3" bore full depth)
M6T1
G0G90G54X5.Y0S3000M3
G43H1Z2./M8
Z.1
G1Z0F50.
G91G41D1X1.5F18. (Having G91 started here will allow you to start at any location in X and Y)
G3I-1.5Z-.104L5
I-1.5
G1G40X-1.5
G0G90Z2.
X-5.Y0.(ADDITIONAL LOCATIONS)
Z.1
G1Z0F50.
G91G41D1X1.5F18.
G3I-1.5Z-.104L5
I-1.5
G1G40X-1.5
G0G90Z2.
G91G28Y0Z0
G90
M30
%

%
O2000 (Example: Center of .500 Tool Path 3" bore full depth)
M6T1
G0G90G54X5.Y0S3000M3
G43H1Z2./M8
Z.1
G1Z0F50.
G91G41D1X1.25F18.
G3I-1.25Z-.104L5
I-1.25
G1G40X-1.25
G0G90Z2.
X-5.Y0(ADDITIONAL LOCATIONS)
Z.1
G1Z0F50.
G91G41D1X1.25F18.
G3I-1.25Z-.104L5
I-1.25
G1G40X-1.25
G0G90Z2.
G91G28Y0Z0
G90
M30
%
__________________
My Response to "It's Close Enough", "Is Your Tool Box and The Door Close Enough?"

Last edited by dapoling; 01-31-2008 at 11:22 PM.
Reply With Quote

  #7   Ban this user!
Old 02-13-2008, 04:27 PM
 
Join Date: Feb 2008
Location: England
Posts: 4
fastnovacrash is on a distinguished road

Originally Posted by g-codeguy View Post
I'm sure it is simple, but I don't do mills, so I can't help you. Would if I could. All I know is that some machines require the arc to be broken into at least two parts, and that even on machines that can do a 360 degree arc with a single block call, it usually requires it be done using a specific address (R- instead of R?), but like I said "I don't do mills."
Hi, Just thought I would clear this up otherwise anyone starting out with Gcode could end up with alarms all over the place and not a clue why.

Basically when using circular interpolation (G02/G03) you cannot create a full 360o using only “R” for the radius. Using “R” on its own will allow you to do anything up to 180o, some if not most machines also allow you to use “R-“ with which you can do from 180.001o all the way up to 359.999o, but never a full circle, you may think oh well what difference is 0.001o going to make but trust me, it will leave a mark, and you will have to work out where the end point is.

Also note that G02 is clockwise and G03 is anti clockwise, when working out which way is clockwise or anti clockwise always take it from the direction of looking towards negative, this may SEEM obvious but you wait until your doing 3D milling, then things get a little interesting!

So an example of circular interpolation using “R”:

G00 X10 Y0 Z1.5 (making a few assumptions this will Rapid you to 1.5mm above the start point of your arc/circle)

G01 Z-1 (again assuming depth of cut is 1mm)

G02 X-10 R10 (this will do an arc of 180o with a radius of 10mm in clockwise direction)

That is (I think) about as basic as circular interpolation gets.

Now say you want to do a FULL 360o, things get a little more interesting here as “R” cannot be used, in stead we must use “I, J and K” these are incremental values for the X, Y and Z planes,
I = X
J = Y
K = Z

I, J and K are used to input the INCREMENTAL distance from the centre point of the arc to the start point of the arc, REMEMBER that is incrementally from the centre point to the start point, you would be amazed how many people cant get that bit right. This is completely irrelevant whether you are in G90 or G91.

Here is an example of the same 180o arc but with I J and K:

G00 X10 Y0 Z1.5
G01 Z-1
G02 X-10 I10 (you do not need to enter J and K as the value of these is zero)

Now for 270o

G00 X10 Y0 Z1.5
G01 Z-1
G02 Y-10 I10

I think you get the idea.

So just to sum things up, if using R, then on the line with the G02/G03 X, Y and Z specify the end point of the arc and R the radius

If using I, J and K then X, Y and Z again specify the end point of the arc and I, J and K specify the distance from the centre of the arc to the start point of the arc.

And thus concludes lesion one on circular interpolation.

I have tried to make things as simple as they get here, I’m really sorry if it was a little to simple but I don’t know how much you know already.

I could have just put an example on here and let you copy and paste it all you like but then I thought your not really going to learn anything from that are you, you would be much better off if I tell you how to work it out for yourself.

Hay why aren’t there some tutorials for things like this on the site any ware.

If you want any more help with Gcode then let me know.
Reply With Quote

  #8   Ban this user!
Old 02-16-2008, 05:33 PM
 
Join Date: Feb 2008
Location: Scotland
Age: 34
Posts: 41
MazakMikeO is on a distinguished road

Yes, it's all well and good copying and pasting, but as fastnovacrash said, it's better to learn why your doing something.


G43 Z50.0 H1 M08
Z2.0
G81 G98/G99 Z-10.0 R2.0 F20.0
G82 G98/G99 Z-10.0 R2.0 P1000 F20.0
G83 G98/G99 Z-10.0 R2.0 Q2.0 F20.0
G73 G98/G99 Z-10.0 R2.0 Q2.0 F20.0
G80

The above are examples of drilling canned cycles.

G81 feeds to the Z position from the R position (which is where the Z axis returns to using G98 command. It returns to the previous Z position if you use G99) at the specified feed.

G82 is the same but the P value is a dwell in seconds when it reaches the Z position.

G83 has a Q value which is the depth of peck in mm. The machine then pulls back to the R point after each peck then returns to where it last cut minus a standoff distance set by parameters.

G73 is the same as G83 but does not pull back to the R point after each peck. It only standsoff by distance set in the parameters.

G80 cancels the canned cycles.
Reply With Quote

  #9   Ban this user!
Old 05-01-2008, 09:26 AM
 
Join Date: Mar 2005
Location: usa
Posts: 21
JamesJmcGEE is on a distinguished road

Could someone post me a circle of a 1.5" circle to go with the above 3" So I can learn it my (odd) way?.... (I need a 2" and with the 3" and the 1.5" I will learn faster how to make what I need instead of asking all the time)
Thanks
J
My tool is 1/8 (.125) dia.
Reply With Quote

  #10   Ban this user!
Old 05-01-2008, 10:14 AM
tauntdesigns's Avatar  
Join Date: Nov 2005
Location: USA
Posts: 519
tauntdesigns is on a distinguished road

the finish pass for 1.5 dia. using .125 dia. cutter. The center of the hole is x0,y0.

First I take the hole dia. and subtract tool dia. 1.5 - .125 = 1.475 divide that by 2
1.475 / 2 = .7375 If I want to ramp onto the finish pass I would also need to know the distance to the center of the ramp on arc. .7375 / 2 = .3687

(climb cut)
G0x0y0 (start point)
z1.
g1z.05f20.
g3x-.7375y0i-.3687j0f5. (ramp on)
g3x-.7375y0i.7375j0 ( full 360 deg cut)
g3x0y0i.3687j0 (ramp off)
g1z1.f20.

g2/g3 line: x and y are finish points, i and j are the incremental distance from the start point to the center of the arc.

To do a round boss/island 1.5 dia with .125 cutter. center of boss is x0,y0
divide 1.5 by 2 and devide .125 by 2 and add those together .750 + .0625 = .8125

Ramp on and ramp off with a start position .5 away from the outside of boss .8125 + .5 = 1.3125

G0x1.325y0
z1.
g1z.2f20
z-.05f10.
g3x.8125y0i-.25jof5.
g2x.8125y0i-.8125j0
g3x1.3125y0i.25j0
g1z1.f20.

later, jack
__________________
Walking is highly over-rated
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 05-01-2008, 10:54 AM
BlueChip's Avatar  
Join Date: Jun 2003
Location: Massachusetts
Posts: 130
BlueChip is on a distinguished road
Circle Milling

Here's a link for a small free circle milling app that might be useful :
http://www.kentechinc.com/tip7.html

Good Luck.
Reply With Quote

Reply




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -5. The time now is 08:06 PM.





Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO
Template-Modifications by TMS

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361