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 10-17-2011, 02:59 PM
 
Join Date: May 2007
Location: USA
Posts: 67
rdoty is on a distinguished road
Basic G-code questions

I'm fairly new to programming with G code and have a couple of things I need clarified.
Using part of a program as an example:

14 M6 T16
15 S2500 M3
16 G0 G90 X0.75 Y-0.50 E1
17 H16 Z0.3 M8
18 G81 G99 R0+.5 Z-0.5 F8. X0.75 Y-0.5 E1
19 X2.75
20 X4.75
21 M5 M9
22 G90 G49 G0
23 M6 T14
etc

Q1..Do lines 14 & 15 have to be separate lines?
Q2..Are X, Y and E redundant on line 18 or can I delete them on line 16?
Q3..Can someone explain R0? In the Fadal manual it infers that R means "retract" (except when it means "radius") but couldn't I just do that with a separate Z move? Can I just set it at "0" and ignore it?
Reply With Quote

  #2   Ban this user!
Old 10-17-2011, 03:42 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by rdoty View Post
I'm fairly new to programming with G code and have a couple of things I need clarified.
Using part of a program as an example:

14 M6 T16
15 S2500 M3
16 G0 G90 X0.75 Y-0.50 E1
17 H16 Z0.3 M8
18 G81 G99 R0+.5 Z-0.5 F8. X0.75 Y-0.5 E1
19 X2.75
20 X4.75
21 M5 M9
22 G90 G49 G0
23 M6 T14
etc

Q1..Do lines 14 & 15 have to be separate lines?
Q2..Are X, Y and E redundant on line 18 or can I delete them on line 16?
Q3..Can someone explain R0? In the Fadal manual it infers that R means "retract" (except when it means "radius") but couldn't I just do that with a separate Z move? Can I just set it at "0" and ignore it?
Q1..No

Q3 next.
Although not 100% familiar Fadal control, I believe they follow normal convention with drilling and boring cycles.

In drilling and boring cycles, R is used to set a Retract plane to start cutting from and to return the tool to (depending on another G code in association with the cycle).

Lets say that in amongst a number of holes to be drilled there existed a feature Z2.0 high above the surface to be drilled at Z0.0. In this case you would start the drilling operation from say Z2.5 (the initial plane), but you wouldn't want the cycle to be drilling through 2.5 of fresh air for each hole. In this case you could have an R value of say R0.1, which would have the tool move in Rapid Traverse speed to the R plane and commence cut feed from that point. If the Fadal structure is the same as Fanuc, commanding G99 before the drill cycle, or on any coordinate line following, the tool would retract to the R plane at the completion of the G81 cycle before moving to the next hole location. Using G98 instead of G99 will cause the tool to retarct to the Initial level, in this case Z2.5, before moving to the next hole. Accordingly, G98/G99 can be prudently used to move clear and over obstacles during the drilling operation.

Q2.. The addresses in line 16 are modal, meaning they stay active until replaced by other like commands. The Initial level referred to in my reply to Q3 is established by moving the tool to a desired Z level prior to calling the drilling cycle, G81 in your example. Accordingly, moving the tool to the XY location of the first hole and then positioning the tool in Z is good practice. The XY in your G81 cycle is not required because the tool is already at that location prior to the cycle being called, however, including it in the cycle will not cause a problem.

Regards,

Bill

Last edited by angelw; 10-17-2011 at 03:57 PM.
Reply With Quote

  #3   Ban this user!
Old 10-17-2011, 04:30 PM
 
Join Date: Sep 2009
Location: usa
Posts: 22
chuck5121 is on a distinguished road

q1 yes, i always put these on separate lines
q2 no this is not redundant , it pre positions the head
q3 R is retract my fadals don't do well with r for radius but work better with I and J for radius

I work with Fadals (older machines) every day e-mail any time
Reply With Quote

  #4   Ban this user!
Old 10-17-2011, 04:31 PM
 
Join Date: May 2004
Location: United States
Age: 48
Posts: 2,217
txcncman is on a distinguished road

You have not given enough information to really answer your questions correctly. What machine/control are your programming for?

Most machine controls will NOT accept more than one M-code per line.

The X, Y values mentioned are not redundant (they are not even equal to the ones on line 16).

You are implementing a Canned Drilling Cycle with G81. The word addresses (letters) used there are needed for this particular cycle.
__________________
http://www.kirkcon.com/
Reply With Quote

  #5   Ban this user!
Old 10-17-2011, 04:34 PM
 
Join Date: May 2004
Location: United States
Age: 48
Posts: 2,217
txcncman is on a distinguished road

I highly recommend you just follow the instructions for programming in your machine manuals and not try to invent your own machining style. You obviously are not ready to experiment yet.
__________________
http://www.kirkcon.com/
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 10-17-2011, 05:54 PM
 
Join Date: May 2007
Location: USA
Posts: 67
rdoty is on a distinguished road

Thanks guys, that helps.

And, txcncman, I'm not trying to create my own style. If you've ever read a Fadal manual they do a horrible job of clarifying these kind of details and the only way to know what is acceptable is to ask the experts. FYI I'm a one-man-band and semi-retired so I don't have the luxury of having a mentor. My other CNC has conversational and it completely spoiled me but I'm gradually getting the hang of G code. Now, what the hell's that grinding noise....?
Reply With Quote

  #7   Ban this user!
Old 10-17-2011, 06:05 PM
 
Join Date: May 2004
Location: United States
Age: 48
Posts: 2,217
txcncman is on a distinguished road

Yes. I have been trying to decipher Fanuc manuals for 16 years. So, when the Fanuc manual says "do it this way", that is the way you should do it. If you are semi-retired, you should have time to read lots of books. Try Computer Numerical Control Concepts and Programming 4rh Edition by Warren S Seames and CNC Programming Handbook 3rd Edition by Peter Smid. Also try the Haas mill manual. Even though it is not Fanuc, many of the codes are similar. and unlike the Fanuc manuals, the Haas manual is almost understandable. You can download at: http://haascnc.com/pdf/96-8000.pdf
__________________
http://www.kirkcon.com/
Reply With Quote

  #8   Ban this user!
Old 10-17-2011, 08:12 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Originally Posted by txcncman View Post
If you are semi-retired, you should have time to read lots of books.
Or he could simply ask the question here in the forum as he did.

Stevo
Reply With Quote

  #9   Ban this user!
Old 10-17-2011, 08:37 PM
 
Join Date: May 2004
Location: United States
Age: 48
Posts: 2,217
txcncman is on a distinguished road

Originally Posted by stevo1 View Post
Or he could simply ask the question here in the forum as he did.

Stevo
Yeah. You are right. I will quit answering questions like this and let them learn the long hard way instead of the short easy way. (8 weeks of mistakes and crashes versus 8 hours of reading?)
__________________
http://www.kirkcon.com/
Reply With Quote

  #10   Ban this user!
Old 10-17-2011, 10:11 PM
 
Join Date: Jun 2008
Location: United States
Posts: 1,507
stevo1 is on a distinguished road

Deleted post as it is not pertinent to the topic at hand. My apologize!!!

Stevo

Last edited by stevo1; 10-18-2011 at 07:13 AM. Reason: Off topic
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 10-17-2011, 10:58 PM
 
Join Date: Sep 2010
Location: Australia
Posts: 733
angelw is on a distinguished road

Originally Posted by chuck5121 View Post
q1 yes, i always put these on separate lines
Yes, you're quite correct. I read the post quicky before answering and related it to line 15 and 16. There are a number of reasons for "why not", but the one that applies to most controls is the number of M functions allowed in the one block and then their function.

Regards,

Bill
Reply With Quote

  #12   Ban this user!
Old 10-18-2011, 10:32 AM
 
Join Date: Sep 2011
Location: USA
Posts: 56
texaspyro is on a distinguished road

Although the order of the codes on a line is not supposed to matter... sometimes it does (despite what the manual may say!).

It is best to code T1 M6 instead of M6 T1.

The T code selects the tool and the M code loads it (or prompts the operator to load it). On some machines, M6 T1 will attempt a tool change (to whatever tool was previously selected by the last T code seen), then select tool 1 to be loaded by the next M6 code seen.

For the ultimate in clarity, Put the T1 on one line. And the M6 on the next line (although you will even find a few machines that don't like that... they want T and M to be on the same line). Gotta love that industry wide non-standardazation of gcode.
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to understanding basic g code? eloid DIY-CNC Router Table Machines 5 12-19-2011 09:22 AM
CNC basic questions A2fan DIY-CNC Router Table Machines 0 05-19-2010 03:25 PM
Basic questions - sorry underdog Phase Converters and VFD 3 06-26-2009 05:17 AM
Some basic New Guy questions seths442s General Metal Working Machines 1 10-10-2008 01:20 AM
Basic G-Code Question Tazzer G-Code Programing 11 05-18-2008 09:21 PM




All times are GMT -5. The time now is 08:01 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