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  
Old 01-25-2006, 08:50 PM
LetterCAM.com
 
Join Date: Oct 2005
Location: USA
Posts: 186
WarrenW is on a distinguished road
Simple GCode Reference / Commands?

Hi,

I am looking for a web site that shows the gcode commands for all of the basic actions. I just need to write gcode to do the following:

- Go to the starting X/Y position
- Set the plunge rate
- Set the feed rate
- Move the Z to a certain depth
- Then move at X/Y points (set of lines shaping an object)

Thats all I need to do. Do I have to specify the units (inches/mm) in the gcode?

Thanks,

Warren
Reply With Quote

  #2  
Old 01-25-2006, 08:54 PM
wms's Avatar
wms wms is offline
Moderator
 
Join Date: Mar 2003
Location: United States
Posts: 939
wms is on a distinguished road

http://www.linuxcnc.org/handbook/gcode/g-code.html
__________________
(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #3  
Old 01-25-2006, 09:06 PM
ger21's Avatar
Community Moderator
 
Join Date: Mar 2003
Location: Shelby Twp, MI....USA
Posts: 20,454
ger21 is on a distinguished road
Buy me a Beer?

- Go to the starting X/Y position

G0 Xx.xx Yx.xx (rapid move)

- Set the plunge rate

Fx.xx

- Move the Z to a certain depth

G1 Z-x.xx

- Set the feed rate

Fx.xx

- Then move at X/Y points (set of lines shaping an object)

G1 Xx.xx Yx.xx (straight move)

or

G2 Xx.xx Yx.xx Ix.xx Jx.xx (clockwise arc)

or

G3 Xx.x Yx.xx Ix.xx Jx.xx (ccw arc)

x.xx represents a coordinate. Notice that I changed the order. The plunge rate IS the feedrate, during the plunging move. Just set the feedrate for the current move prior to making it, or on the same line as the move.
__________________
Gerry

Mach3 2010 Screenset
http://home.comcast.net/~cncwoodworker/2010.html

(Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)
Reply With Quote

  #4   Ban this user!
Old 01-27-2006, 08:00 PM
 
Join Date: Jul 2005
Location: USA
Posts: 34
stupidog is on a distinguished road

Try this link, it's pretty handy - http://www.cncezpro.com/gcodes.cfm.
Reply With Quote

  #5   Ban this user!
Old 05-04-2008, 01:21 PM
 
Join Date: Mar 2005
Location: usa
Posts: 21
JamesJmcGEE is on a distinguished road

Is there a g-code you can enter at the first part of the file to set the overall feedrate limt? I'm using mach 3 and have no spindle monitor/control but dont want to feed no more than 6.0 for the whole project. Im currently typing "g1 (x/y/z)?.? f6.0" on every line and that is getting old quick at my typing rate of 6 words a minute
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 05-04-2008, 01:30 PM
 
Join Date: May 2007
Location: USA
Posts: 913
g-codeguy is on a distinguished road

Feedrate is modal on most machines. You should only need to type it in once. Just cut 30 seconds per line off your typing.
Reply With Quote

  #7  
Old 05-04-2008, 01:39 PM
Al_The_Man's Avatar
Community Moderator
 
Join Date: Dec 2003
Location: Canada
Posts: 16,539
Al_The_Man is on a distinguished road
Buy me a Beer?

Originally Posted by WarrenW View Post
Do I have to specify the units (inches/mm) in the gcode?

Thanks,

Warren
G20 is Inch input, G21 is Metric, some systems use G70/G71.
Al.
__________________
CNC, Mechatronics Integration and Machine Design.
“Logic will get you from A to B. Imagination will take you everywhere.”
Albert E.
Reply With Quote

  #8   Ban this user!
Old 05-04-2008, 02:01 PM
 
Join Date: May 2008
Location: Portugal
Posts: 9
davide.castro is on a distinguished road

Hello,
I'm looking a parameter or G code (fanuc OM c )to do that: if the program a have 3 points that made a line and if I start the program the machine almost stop in the points and i dont wont that.
Davide.
Reply With Quote

  #9   Ban this user!
Old 05-04-2008, 02:36 PM
 
Join Date: Mar 2005
Location: usa
Posts: 21
JamesJmcGEE is on a distinguished road

Originally Posted by g-codeguy View Post
Feedrate is modal on most machines. You should only need to type it in once. Just cut 30 seconds per line off your typing.
ok.... I'm not very up on that could you explain a little more?
Im thinking that means leave my first line and then the rest I dont need to write it anymore as in:
G1 z-.05 f6.0 (slow)
g1 x 2.5 (slow)
g1 y 2.5 (slow)
g0 z.25 (then rapid move)
g0 x0. (rapid move)
g0 y0. (rapid move)
g1 z-.075 (slow again)
g1 x 2.5 (slow again)
g1 y 2.5 (slow again)

Is that correct?
Thanks!
J
Reply With Quote

  #10   Ban this user!
Old 05-04-2008, 03:39 PM
 
Join Date: May 2007
Location: USA
Posts: 913
g-codeguy is on a distinguished road

James: Yes & No.

This is all that is needed.

G1 Z-.05 F6. (slow)
X 2.5 (slow)
Y 2.5 (slow)
G0 Z.25 (then rapid move)
X0Y0 (rapid move)
G1 Z-.075 (slow again)
X 2.5 (slow again)
Y 2.5 (slow again)

Yes. modal means the F6. stays in affect until you use an F with a different feedrate. In your example the one F6. is all that is necessary.

No, model means a G-code stays in affect until another complimentary G-code is used. G0, G1, G2, & G3 cancel each other out. If you made a 360 degree circle programming it in quadrants using G2, then all that would be necessary is the first G2. The other 3 blocks needn't have the G2. You can use it, but it isn't necessary. You would need a G1 or G0 to cancel the G2 after completing the circle. Programming straight lines only requires the first G1.

The X0 Y0 needn't be on separate blocks unless they need to be programmed that way to clear a clamp, or if Z0 wasn't the face of the part, and a section was high enough that Z.25 wouldn't clear it when moving to X0Y0.

Same thing for metric versus inches. This should be set by a parameter in the control. You don't need to program another unless changing from one to the other.

Same thing for IPM versus IPR. Parameter in machine controls the one used on start-up. Only need another G-code to change it if going from one to the other.

Same thing for G96/G97. One cancels the other. You can change from G97S1000M3 to a spindle speed of 500 in the same operation by simply programming S500. The G97M3 aren't needed. They are modal. Works the same way for G96.

Not to say that this is how it works on every machine. I am a long ways from having run every machine with every type of control. There could be some flaky ones that require a G1 or G0 on every block, etc. I've never seen one. Doesn't mean they don't exist.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 05-04-2008, 03:42 PM
 
Join Date: May 2007
Location: USA
Posts: 913
g-codeguy is on a distinguished road

Originally Posted by davide.castro View Post
Hello,
I'm looking a parameter or G code (fanuc OM c )to do that: if the program a have 3 points that made a line and if I start the program the machine almost stop in the points and i dont wont that.
Davide.
Sorry, but I don't understand what you are wanting to know. Would you explain further? Be glad to help if I can.
Reply With Quote

  #12   Ban this user!
Old 05-04-2008, 04:27 PM
 
Join Date: Mar 2005
Location: usa
Posts: 21
JamesJmcGEE is on a distinguished road

Originally Posted by g-codeguy View Post
James: Yes & No.

This is all that is needed.

G1 Z-.05 F6. (slow)
X 2.5 (slow)
Y 2.5 (slow)
G0 Z.25 (then rapid move)
X0Y0 (rapid move)
G1 Z-.075 (slow again)
X 2.5 (slow again)
Y 2.5 (slow again)

Yes. modal means the F6. stays in affect until you use an F with a different feedrate. In your example the one F6. is all that is necessary.

No, model means a G-code stays in affect until another complimentary G-code is used. G0, G1, G2, & G3 cancel each other out. If you made a 360 degree circle programming it in quadrants using G2, then all that would be necessary is the first G2. The other 3 blocks needn't have the G2. You can use it, but it isn't necessary. You would need a G1 or G0 to cancel the G2 after completing the circle. Programming straight lines only requires the first G1.

The X0 Y0 needn't be on separate blocks unless they need to be programmed that way to clear a clamp, or if Z0 wasn't the face of the part, and a section was high enough that Z.25 wouldn't clear it when moving to X0Y0.

Same thing for metric versus inches. This should be set by a parameter in the control. You don't need to program another unless changing from one to the other.

Same thing for IPM versus IPR. Parameter in machine controls the one used on start-up. Only need another G-code to change it if going from one to the other.

Same thing for G96/G97. One cancels the other. You can change from G97S1000M3 to a spindle speed of 500 in the same operation by simply programming S500. The G97M3 aren't needed. They are modal. Works the same way for G96.

Not to say that this is how it works on every machine. I am a long ways from having run every machine with every type of control. There could be some flaky ones that require a G1 or G0 on every block, etc. I've never seen one. Doesn't mean they don't exist.

Thanks a million! You saved me a whole lot of time and trouble!
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:07 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