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 03-27-2008, 07:37 PM
 
Join Date: Jul 2003
Location: Colorado
Posts: 71
Tazzer is on a distinguished road
Basic G-Code Question

OK I just started a new job after I have been programming for the past few years and there is a lot a debate going on right now on the proper use of starting a program, the end of a tool op and calling up a new tool. I have two example I believe they are doing the same exact thing however the other programmers say no. We are running these programs on HAAS VMC's. Hince the major changes are G90 and G91

So this is how I start a program minus the % and O0000
Code:
G0 G17 G40 G49 G80 G90
T2 M6
G0 G54 X1. Y1. S3600 M3
G43 H2 Z.1
/M8
Then at the end of a op

Code:
G0 Z1.
M9
G28 Z0 
M1
Then start of next op
Code:
T3 M6
G0 G54 X2.7277 Y6.0404 S500 M3 
G43 H3 Z0.1
/M8



Now this is how they think it should be done, however I believe it is the same thing just adding more code!!!

Code:
G0 G17 G40 G49 G80 G90
T2 M6
G0 G90 G54 X1. Y1. S3600 M3
G43 H2 Z.1
/M8
Then at the end of a op

Code:
G0 Z1.
M9
G28 G91 Z0 
M1
Then start of next op
Code:
T3 M6 
G0 G54 G90 X2.7277 Y6.0404 S500 M3 
G43 H3 Z0.1
/M8
Reply With Quote

  #2   Ban this user!
Old 03-27-2008, 07:59 PM
Vin007's Avatar  
Join Date: Jun 2007
Location: U.S.A.
Posts: 8
Vin007 is on a distinguished road
Cool Programers choice.

Hi, Tazzer,
I work in a shop with 7 different CNC mills and the one rule that holds true in programing is that the lead guy sets the standard. What you have are both valid on the HAAS, but to limit confusion in our shop we follow the style of our lead. This cuts down on confusion for us and lets us known what to look for in a program.

Vin007
Machine it like you stole it!
Reply With Quote

  #3   Ban this user!
Old 03-27-2008, 08:07 PM
 
Join Date: Jul 2003
Location: Colorado
Posts: 71
Tazzer is on a distinguished road

Thanks Vin007

Thanks for your input. Thats are problem right now, there is no true lead and everyone is doing things there way with no real direction.

Anyway I just wanted to know if I was wrong or not.

Clint
Reply With Quote

  #4   Ban this user!
Old 03-27-2008, 08:15 PM
 
Join Date: Jan 2007
Location: USA
Posts: 355
Eurisko is on a distinguished road

We use primarily Fanuc controls. The G91 G28 Z0 command is the norm.

Read post #1 of this link for an explanation:

Using Fanuc's G28
__________________
Diplomacy is the art of saying "Nice doggie" until you can find a rock. - Will Rogers
Reply With Quote

  #5   Ban this user!
Old 03-27-2008, 08:16 PM
beege's Avatar  
Join Date: Feb 2008
Location: USA
Posts: 518
beege is on a distinguished road

Redundant code is safer than non-existent code. G90 on every line is not harmful, nor is G17 (unless you need something else). I don't program on HAAS, but won't "G28 Z0" rapid to fixture Z0 before going to the reference point, since you are still in G90? G28 G91 Z0 shouldn't move anywhere before going to the reference point. If you have machines with different controls, it makes sense to keep the rules as consistent as possible.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 03-27-2008, 09:06 PM
gar gar is offline
 
Join Date: Mar 2005
Location: USA
Posts: 1,498
gar is on a distinguished road

080327-2036 EST USA

Tazzer:

The extra G90 is not needed at the start. What about a D to go along with H?

If I am not changing the tool I would go to an adequate Z clearance relative to G54, and then proceed.

The tool change function knows where the tool change Z location is and it does not do any X Y move. No need for G28 G91 Z0.

At program end I do something like

M09
M05
G53 G0 Z0 (non-modal) (to tool change position to be vertically out of the way)
G53 X-30. Y0 (move table to a desired unload position - do not care what G5x was used)
M30

I have a whole different method for tool change that uses an external subroutine and tool diameters are controlled within the program. The subroutine is:

O6901
G10 G90 L12 P#7 R#18
G80 M09
G90 M06 T#20
G#8 M08
S#19 M03
G43 H#20 D#7
M99

The tool change calling line is like this:
G65 P6901 E54 R0.625 S5000 T02 D02
The 0.625 could be replaced by #500 for example and at the start of the program
#500 = 0.625 or whatever for this tool.

I can easily read the tool change calling line in comparison with all the garbage in the subroutine.

How you would modify this approach would depend upon on how you want to structure a program.


.
Reply With Quote

  #7   Ban this user!
Old 03-28-2008, 09:42 AM
 
Join Date: Jan 2008
Location: USA
Posts: 30
CAD/CAM Man is on a distinguished road

Originally Posted by beege View Post
Redundant code is safer than non-existent code. G90 on every line is not harmful, nor is G17 (unless you need something else). I don't program on HAAS, but won't "G28 Z0" rapid to fixture Z0 before going to the reference point, since you are still in G90? G28 G91 Z0 shouldn't move anywhere before going to the reference point. If you have machines with different controls, it makes sense to keep the rules as consistent as possible.
Agreed. Any of us who have been around word address programing (g-code) for any length of time should agree with this statement. There was a time before the tool change macros evolved enough to take the z axis to the tool change position, when if the macro was initiated without the tool being home, the tool changer would crash into the head of the machine. Hell, I was around when the code had to be entered in a specific order. Let's not even start about the old paper tapes. In short, I think it is better to have the extra code in the program and not need it, then to need the extra code and not have it.
__________________
It is the poor craftsman that blames the tool
Reply With Quote

  #8   Ban this user!
Old 03-31-2008, 12:47 PM
 
Join Date: Nov 2007
Location: Canada
Posts: 54
lshingleton is on a distinguished road

On a Fanuc controlled machine it is a good practise to put the m6 in a macro progam like this and create a home postion on to

M6--Calls--set up in the parameters--6071 i believe
O9001
G00G90G40G80G49
G00G91G30Z0.0M19
G00G91G30X0.0Y0.0M9
G90
M6
M99


O0001 (MAIN IS LIKE THIS)
M200---(Home Position macro)
N1----M98 p101(sub first tool)
N2----M98 P102(sub second tool)
and so on --now you can move your tool operation around easy

O101(First sub)
T1M6
G00G54P1X0.0Y0.0G43Z0.0H1Z100.0M03 S1000
G00Z1.0T2M8
()
()
G200
M99
Reply With Quote

  #9   Ban this user!
Old 03-31-2008, 05:07 PM
CNCRim's Avatar  
Join Date: Feb 2006
Location: usa
Posts: 947
CNCRim is on a distinguished road

Tazzer,

Everyone has some idea how this and that should be done... but the ultimate right way is the machine except the code and doesn't make any fun move/rapide crack move, part all come out good..... who care what is the code look like or should be like.
__________________
The best way to learn is trial error.
Reply With Quote

  #10   Ban this user!
Old 04-04-2008, 09:57 AM
 
Join Date: Aug 2007
Location: US
Age: 33
Posts: 14
Jason812 is on a distinguished road

Tazzer,

Here's the way I program parts (Fanuc controllers). Just remember that there are numerous ways to program the same part. You will be more successful if you do everything the same every time. If you do everything the same every time, it will be easier to spot mistakes and easier for the operators to know what they're looking at. It sounds like you are in the postition to set the direction so be consistent and people will follow suit. This was the same position I was in when I started at my current company two years ago. I just made sure that I was consistent with every program and eventually everybody jumped on board with my way of doing things.

I've been told that no programmer will like the way another programmer programs machines.

N3 T14
M06
(*T14=<D0266C>=17/64 DRILL .266 CARB 8)
(MIN LENGTH=STD.)
G0 G40 G80 G90 M08
G54.1 P9 X.31 Y-.5 S1500 M03
G43 Z.5 H14 T15

G80 M09
G91 G28 Z.0
M01

Last edited by Jason812; 04-04-2008 at 09:58 AM. Reason: grammer
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 05-16-2008, 07:57 AM
thamain1's Avatar  
Join Date: Aug 2006
Location: USA
Age: 39
Posts: 8
thamain1 is on a distinguished road

Originally Posted by newtexas2006 View Post
Tazzer,

Everyone has some idea how this and that should be done... but the ultimate right way is the machine except the code and doesn't make any fun move/rapide crack move, part all come out good..... who care what is the code look like or should be like.
One thing as far as form goes is that too much programming and redundancy leads to "bottlenecking" in the controller. The more you push in the longer the controller takes to "read" it. In a high demand job shop, espc. high speed shops, every milli second counts. We use the least amount of programming inputs as possible, use the lead man's basic form and find ways to "prefetch", tools etc., when it permits. If it's Modal and you can leave it on then don't repeat it. At our shop the saying is "Better (quality) and Faster (time is money)"
Reply With Quote

  #12   Ban this user!
Old 05-18-2008, 09:21 PM
 
Join Date: May 2007
Location: USA
Posts: 913
g-codeguy is on a distinguished road

Originally Posted by Jason812 View Post
I've been told that no programmer will like the way another programmer programs machines.
Ain't that the truth! LOL. Some of us try to keep an open mind...realizing that our way isn't the only way. I have occasionally made a a minor change to how I program because I thought someone else's way was better. I program my way because I also set up and ran lathes for many years. While learning I often rewrote a program several times if I was having problems with chatter, tool life, finish, etc. After a while I finally learned what usually works.

I don't believe in hard and fast rules. There will always be the exception.

As far as redundancy goes, I try to avoid it. I like my programs to be as clean as possible. Unfortunately the occasional one is unavoidable given the quality of our operators. Have to do my best to protect the operators from themselves ya know.

I like operations that get used on almost every job, such as barstop and cut-off, to be in subprograms. I've put these, and a few other subs, in the G or M-call 9000 series programs. Can't be accidentally deleted. Maybe one other guy in the shop, beside the programmers, know how to edit one. Plus it means less typing for me.

If I programmmed mills, I believe I would be doing something along the line of how "lshingleton" programs.

We are a small shop. Mills and lathes are done by different people. Lathe guy never works on a mill. And vice versa, tho I have given speed and feed recommendations on occasion to the mill foreman (who also does some programming).

If you have several programmers, and they all work interchangeably on the lathes and/or mills, then I can see why it is necessary to set a format for all to follow. Even tho it may not affect any of you as programmers, I can pretty much guarantee that the people on the floor will be confused if you don't.

Going back to Jason's quote. We have 2 lathe programmers. One programs using Mastercam only. Other doesn't. First one doesn't like to touch the second one's programs because he uses macros, variables, and subs in almost every program. This has led to the plant manager ruling that Mastercam will be used for all new programs, and that any repeat job not done in Mastercam be re-done in Mastercam also.

Why? Consistency.
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
Basic pocketing question MachineManiac Mastercam 32 12-22-2007 03:23 PM
Very Basic Question H2ODiver General CAM Discussion 4 07-27-2007 08:51 AM
visual basic question keebler303 Visual Basic 5 09-05-2006 02:11 PM
Basic Machining Question asperjack General Metalwork Discussion 1 05-25-2006 10:19 AM
REALLY basic Question Dongle Mechanical Calculations/Engineering Design 25 03-14-2006 03:47 PM




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