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! > MetalWorking Machines > Haas Mills


Haas Mills Discuss Haas machinery here!


This forum is sponsored by:

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Ban this user!
Old 04-14-2009, 06:49 PM
 
Join Date: Nov 2003
Location: USA
Posts: 231
Haas_Apps is on a distinguished road
Talking Better G-code

A recent discussion here at the Haas factory has brought up the topic of program structure and efficiency. Most people write a program with the following structure:

%
O123456
G20
G0 G17 G40 G49 G80 G90
T1 M6
G0 G90 G54 X1.75 Y0. S10000 M3
G43 H1 Z2. T2
M8
< program>
M5
M9
G91 G28 Z0.
M01
T2 M6
G0 G90 G54 X1. Y0. S60000 M3
G43 H2 Z2. T1
M8
< program>
M5
M9
G91 G28 Z0.
G28 Y0.
M30
%


A faster approach would be as follows:

%
O123456
G20
G0 G17 G40 G49 G80 G90
T1 M6
S10000 M3
G43 H1
G0 G90 G54 X1.75 Y0. Z2.
M8
< program>
T2 M6
M01
S6000 M3
G43 H2
G0 G90 G54 X0. Y0. Z2.
T1
M8
< program>
M9
G91 G28 Z0.
G28 Y0.
M30
%

Any thoughts?
Reply With Quote

  #2   Ban this user!
Old 04-14-2009, 07:52 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Only puzzled ones.

Second one is faster in what way? Faster to write faster to run? Apart from the fact that your first one will not run unless you have come out with a 60,000rpm spindle.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

  #3   Ban this user!
Old 04-14-2009, 07:56 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Unless of course you are taking advantage of Spindle No Wait
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

  #4   Ban this user!
Old 04-14-2009, 08:56 PM
 
Join Date: Jan 2005
Location: USA
Posts: 2,348
mactec54 is on a distinguished road
Buy me a Beer?

Hi Haas Apps

Both of the sample Gcode are not very good Pm me with your contact & I will show you a better/shorter way
__________________
Mactec54
Reply With Quote

  #5   Ban this user!
Old 04-15-2009, 10:30 AM
 
Join Date: Nov 2003
Location: USA
Posts: 231
Haas_Apps is on a distinguished road

Okay, their are a few reasons this will be faster to run. And no Geof we did not introduce a 60K spindle - just my fat fingers stumbling across the keyboard. Okay now for the explianation. On the Haas control all M codes are executed last. So if I command any motion and the spindle to turn on the same line, the spindle will turn on at the end of the motion. Also, like Geof said, Spindle No Wait, will allow rapid motion while the spinlde is accelerating to commanded speed. If it is not at speed when it encounters a feed motion the machine will wait until the commanded speed is achieved. Commandin all three axis to rapid to your starting point is obviously faster then doing XY motion then Z motion. By not commanding any motion prior to a tool change the machine will turn the spindle off and move to the tool change position all at the same time. In the first example the spindle is commanded off and the machine will wait and then go to the home postion.


Mactec54 please feel free to send me your examples at wreilly@HaasCNC.com. I am sure that I can make the code much shorter, but my intention was to reduce cycle time.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 04-15-2009, 12:07 PM
 
Join Date: Jan 2005
Location: USA
Posts: 2,348
mactec54 is on a distinguished road
Buy me a Beer?

Hi Haas Apps

After reading your post it does make it a little better cycle time you may save a half a second on what you have done above but having less Gcode is better than having a shorter cycle time If you have like a M9 that turns off the juice & the spindle that would save having to have a M5 at the end of a single tool program

Even if you saved one second per part because how you start the cycle & end the cycle that is not enough to make a difference over a day or even a week

But if you have to write less Gcode (if you do it by hand ) this could save more time than you would save at the machine

My 8 year old son & I have been working on optimizing programs for some time I have done some of these programs on the Zone before & for the start & end of the program I already have our programs with less G code than what you have done above

Geof writes most of his G code by hand so in many cases is already making his programs with minimal Gcode
__________________
Mactec54
Reply With Quote

  #7   Ban this user!
Old 04-15-2009, 12:27 PM
Donkey Hotey's Avatar  
Join Date: Nov 2007
Location: USA
Posts: 1,636
Donkey Hotey is on a distinguished road

Originally Posted by mactec54 View Post
...My 8 year old son & I have been working on optimizing programs for some time ...
This thread started off a little slow, but we seem to be moving along nicely.
__________________
Greg
Reply With Quote

  #8  
Old 04-15-2009, 12:43 PM
tobyaxis's Avatar
Moderator
 
Join Date: Jan 2006
Location: USA
Posts: 4,396
tobyaxis is on a distinguished road

Originally Posted by Donkey Hotey View Post
This thread started off a little slow, but we seem to be moving along nicely.
And we can move it along a little more

I agree that this is faster but the only danger is that a 3 axis move for new programmers is not a good idea.

Just a little food for thought.
__________________
Toby D.
"Imagination and Memory are but one thing, but for divers considerations have divers names"
Schwarzwald

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

www.refractotech.com
Reply With Quote

  #9   Ban this user!
Old 04-15-2009, 01:04 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Aw Heck; you mean I can't have a 60,000rpm SuperUperDuperMiniMill.

Short cycle time and machine safety are my overriding concerns. My typical program would be this:

G10 G17 G20 G40 G49 G80 G90
T1 M06
G43 H01
M03 S10,000
{G54} G00 X0. Y0. {Z1.} For a program working with a limited clearance
{Z1.} fixture the Z move is put on this next line.
Z0.1 M08
etc
etc
G00 Z1. M09
T2 M06
etc
etc
G53 G49 G00 Z0. {T1 M06}
M30

Spindle No Wait is turned on.

When you have the safety line, which is largely redundant but nothings beats belts and braces, you don't need to repeat G20 or G90 eleswhere; you don't really need to repeat G00 for the first move but I do it just as a reminder that it is a rapid.

Following the M03 command with a Rapid moves means the machine moves into position as the spindle accelerates to speed. It also means if you have pulled a boner and crash the machine the spindle hits spinning; the spindle bearings can absorb far more impact when they are spinning than when they are stationary, also when the spindle hits spinning things do not stop as fast because melting takes place at the point of contact

I avoid using G28 with or without G91. If you forget the G91 before the G28 you might bury the tool in a fixture, if you forget G90 after the G91 things can also get interesting.

I rarely use M05 because when a tool change is called the machine does the whole sequence for me.

I turn M08 on just before cutting and M09 of so I can see things and the flow is less during the tool change; also with it off if I happen to open the door just after the tool change I don't get a bath.

Spindle No Wait can make quite a difference in the cycle time when a lot of tools are involved; I timed it at about 1 to 1-1/2 seconds per tool change.

However, the best way to reduce cycle time per part is stick more parts in the machine; this divides tool change times by the number of parts and can make a big difference. The next step up is to use indexing fixtures so a single loading operation finishes parts on three or four sides; this can make a huge difference.
__________________
An open mind is a virtue...so long as all the common sense has not leaked out.
Reply With Quote

  #10   Ban this user!
Old 04-15-2009, 03:20 PM
 
Join Date: Nov 2003
Location: USA
Posts: 231
Haas_Apps is on a distinguished road

Many good points. But lets just say that you have a program that has 4 tools and depending on the machine you save about 1 second per tool. If you have a production run of 1000 parts.You would save about one hour.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 04-15-2009, 04:02 PM
extanker59's Avatar  
Join Date: Mar 2008
Location: USA
Age: 53
Posts: 426
extanker59 is on a distinguished road

Originally Posted by mactec54 View Post
Hi Haas Apps

Both of the sample Gcode are not very good Pm me with your contact & I will show you a better/shorter way
Hi mactech54,
Can you share your better/shorter way with all of us? I'm always on the lookout for improvements. I'm sure most of us are here or we wouldn't be here.
Reply With Quote

  #12   Ban this user!
Old 04-15-2009, 04:06 PM
extanker59's Avatar  
Join Date: Mar 2008
Location: USA
Age: 53
Posts: 426
extanker59 is on a distinguished road

Sorry for ignoring you Haas Apps, very interesting. I can see that the next time I redo my post, I'll have to change some things. Thanks for the info.
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
Newbie- Takeout Unused G Code commands in Mastercams Generated G Code shneek Mastercam 8 12-15-2010 02:32 PM
learning g code or cad-cam code output? slow_rider G-Code Programing 3 02-27-2010 08:48 PM
Need Help!- G-Code viewing source code Hussam Visual Basic 3 03-15-2009 12:15 PM
G-code for beginners - want to learn G-code FPV_GTp G-Code Programing 7 11-17-2008 11:25 PM
looking for g code 3d from bobcadcam or simmilar for indexer lpt v5 with g code soft troyswood Ability Systems - LPT Indexer and G-Code 2 12-24-2006 09:21 PM




All times are GMT -5. The time now is 11:56 AM.





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