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-26-2008, 07:29 PM
 
Join Date: Jul 2008
Location: canada
Posts: 7
ganderboy is on a distinguished road
Cant make this code run properly

Heres a bit of code thats making my machine do REALLY funny things.

G00 Z.02
G00 X.625
G01 Z-.500 F.002
G01 G41 Z-.7183 F.002
G02 X.8125 Z-.8120 R.0938 F.002
G01 X.8500
G03 X1.3500 Z-1.0620 R.250 F.002
G01 G40 Z-.1550 F.002
G28 U0. W0.

This is supposed to make a part with the following basic specs.
.625 dia shank with a length up to a shoulder of .8120 (this shoulder has an inside radius of .0938 )
The part then goes up to 1.350 in diameter with an outside corner radius of .250.

my starting point for the .0938 radius is x.625 z-.7183
end points for the radius are x.8125 and z-.8120 and of coarse an R value of .0938

the start points for the .250 radius is x.8500 z-.8120
end points for the G03 move are x1.3500 z-1.0620 and of coarse an R value of .250
I then send the tool with a G01 commmand to turn the 1.3500 diameter to a length of 1.550 (z-1.550) and then G28 it home.

What is actually happening is:

When the tool get to its z-.500 point it then starts traversing on the x and z (plunging into the .625 diameter up until it gets to the shoulder)
It should cut a .625 diameter and then G02 a .0938 inside Rad , but it instead tapers down on the .625 dia to a .500 dia and THEN it G02's the proper inside diameter??????
I dont fricken get it. What am I missing here. When I run the graphic simulation..... it shows the proper part geometry being cut, but not when I run the program.???

On top of this, when it gets to its start point for the G03 radius move that will cut the .250 radius and end at the part major diameter of 1.3500 it does funny stuff as well.
The tool goes to x.8500 on a G01 command and then should start its G03 move ( G03 x1.350 z-1.0620 R.250 F.002) It starts cutting a radius of .250, but doesnt cut a full
radius ending at a 1.3500 diameter ( and its programmed end points for the radius). Instead it cuts a partial radius and the starts cutting on a tapered path ending at z-1.550. So the part ends up wrong, and it doesnt perform its G01 move at all.

The really interesting thing is that, like I said earlier when I run the graphic simulation, it shows the proper part geometry.
Can you see whats wrong with my code? Does it makes sense to you? Does the code look correct to you for the profile that I want to cut?

I didnt want to call you and bother you on your day off, but if you check you email and get this.... let me know what your thougths are.

Thanks
Dennis
Reply With Quote

  #2   Ban this user!
Old 10-26-2008, 07:43 PM
 
Join Date: Jul 2005
Location: Canada
Posts: 11,565
Geof will become famous soon enough

Are you sure G41 is correct?

Doesn't that tell the machine to compensate to the left of the programmed path?

What happens if you change it to G42.?
__________________
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 10-26-2008, 08:47 PM
 
Join Date: Jun 2007
Location: us
Posts: 10
mccord3576 is on a distinguished road

The fourth line of your code is:

G01 G41 Z-.7183 F.002

G41 is for cutter radius compensation. It should be started with a X or Y move at least half the cutter diameter long. You may want to use a G43 for cutter length compensation here.
Reply With Quote

  #4   Ban this user!
Old 10-26-2008, 08:56 PM
 
Join Date: Jul 2008
Location: canada
Posts: 7
ganderboy is on a distinguished road
I did that

I did that move one line earlier.

My destination point for the beginning of my G02 move is z-.7183.
I went to z-.500 first in the previous line of code, and then proceeded to move to z-.7183 ( the move at least half of my cutter diameter), as needed for fanuc programming.

I tried the G42 aswell, but it didnt work properly either.

Still stumped
Dennis
Reply With Quote

  #5   Ban this user!
Old 10-26-2008, 09:01 PM
 
Join Date: Feb 2006
Location: United States
Posts: 273
dpuch is on a distinguished road

You didn't specify what control or machine, I'll assume Fanuc and a lathe based on what you posted.

As stated it almost certainly has to do with the G41 turning on cutter comp. There is not any D value specified. The chances that it is activating the correct offset is very low, and I think depends on your control parameters. A much better bet is to specify the D value to be sure.

There are other possibilities why the offset is incorrect. Is it a theoretical point offset, or center point of the radius offset, and what orientation is the point? Read up on your machines cutter comp.
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 10-26-2008, 09:24 PM
 
Join Date: Jul 2008
Location: canada
Posts: 7
ganderboy is on a distinguished road
D code ?

Hi Dpuch

The machine is an Emco PC turn 120 lathe with a Fanuc O-TC series control.

Im not aware of a D code for programming G02 or G03 moves with FANUC??

As far as I understand, you tell the machine to goto where the arc is to start from.... for example in my case x.625 z-.7183 ( with a move of at lease half of the cutter dia in advance, which I've done), and then you specify the x and z destinations with an R value for Radius and an F value for the feed rate.

I also posted this request for help on practical machinist and Im just about to try some code that someone sent me.... as follows.
It looks to me like this code will work.... your thoughts?

G00 G42 Z.02 X.625
G01 Z-.7183 F.002
G02 X.8125 Z-.8120 R.0938 F.002
G01 X.8500
G03 X1.3500 Z-1.0620 R.250 F.002
G01 X1.355 Z-1.1
G01 G40 X1.5 Z-.1550 F.002
G28 U0. W0.

I appreciate anyones help as Im a greenhorn with NC programming as I just recently purchased the machine for my shop.

Thanks again
Dennis
Reply With Quote

  #7   Ban this user!
Old 10-27-2008, 06:30 AM
 
Join Date: Jun 2007
Location: us
Posts: 10
mccord3576 is on a distinguished road

Sorry I didn't realize you were operating a lathe. I can't help, I am all VMC. But I will recommend a book,"CNC Programming Handbook" by Peter Smid. It is very easy to read and an excellent reference.
Reply With Quote

  #8   Ban this user!
Old 10-27-2008, 11:25 AM
cnc-king's Avatar  
Join Date: Jul 2003
Location: united states
Posts: 232
cnc-king is on a distinguished road

Originally Posted by ganderboy View Post
Heres a bit of code thats making my machine do REALLY funny things.

G00 Z.02
G00 X.625
G01 Z-.500 F.002
G01 G41 Z-.7183 F.002
G02 X.8125 Z-.8120 R.0938 F.002
G01 X.8500
G03 X1.3500 Z-1.0620 R.250 F.002
G01 G40 Z-.1550 F.002
G28 U0. W0.

This is supposed to make a part with the following basic specs.
.625 dia shank with a length up to a shoulder of .8120 (this shoulder has an inside radius of .0938 )
The part then goes up to 1.350 in diameter with an outside corner radius of .250.

my starting point for the .0938 radius is x.625 z-.7183
end points for the radius are x.8125 and z-.8120 and of coarse an R value of .0938

the start points for the .250 radius is x.8500 z-.8120
end points for the G03 move are x1.3500 z-1.0620 and of coarse an R value of .250
I then send the tool with a G01 commmand to turn the 1.3500 diameter to a length of 1.550 (z-1.550) and then G28 it home.

What is actually happening is:

When the tool get to its z-.500 point it then starts traversing on the x and z (plunging into the .625 diameter up until it gets to the shoulder)
It should cut a .625 diameter and then G02 a .0938 inside Rad , but it instead tapers down on the .625 dia to a .500 dia and THEN it G02's the proper inside diameter??????
I dont fricken get it. What am I missing here. When I run the graphic simulation..... it shows the proper part geometry being cut, but not when I run the program.???

On top of this, when it gets to its start point for the G03 radius move that will cut the .250 radius and end at the part major diameter of 1.3500 it does funny stuff as well.
The tool goes to x.8500 on a G01 command and then should start its G03 move ( G03 x1.350 z-1.0620 R.250 F.002) It starts cutting a radius of .250, but doesnt cut a full
radius ending at a 1.3500 diameter ( and its programmed end points for the radius). Instead it cuts a partial radius and the starts cutting on a tapered path ending at z-1.550. So the part ends up wrong, and it doesnt perform its G01 move at all.

The really interesting thing is that, like I said earlier when I run the graphic simulation, it shows the proper part geometry.
Can you see whats wrong with my code? Does it makes sense to you? Does the code look correct to you for the profile that I want to cut?

I didnt want to call you and bother you on your day off, but if you check you email and get this.... let me know what your thougths are.

Thanks
Dennis
the problem you are having is you cant turn cutter comp on in the same direction you are cutting, the machine will not activate it until the tool changes direction either X or Z. the tool has to move in a perpendicular or angular move. the machine is compensating for the TNR on the insert, that is why you will be seeing goofy moves. based on your lines of code your tool quadrant should be set to 3 if you are cutting an outside diameter and you should be using G42 if you want to activate cutter comp
__________________
If you can ENVISION it I can make it
Reply With Quote

  #9   Ban this user!
Old 10-27-2008, 11:39 AM
 
Join Date: Dec 2004
Location: usa
Posts: 1,665
TOTALLYRC is on a distinguished road

Just a thought as I am still learning the fine art of G-code. He has a feed rate of
F.002 I didn't think you could have a feed rate start out with a decimal point.

Mike

Unless he is programing feed of advance per rev?????
__________________
Warning: DIY CNC may cause extreme hair loss due to you pulling your hair out.
Reply With Quote

  #10   Ban this user!
Old 10-27-2008, 01:54 PM
 
Join Date: Feb 2006
Location: United States
Posts: 273
dpuch is on a distinguished road

Originally Posted by ganderboy View Post
Hi Dpuch

The machine is an Emco PC turn 120 lathe with a Fanuc O-TC series control.

Im not aware of a D code for programming G02 or G03 moves with FANUC??
The D code is for the G41 or G42 cutter comp, and I'm pretty sure your problem has to do with the tool offset/cuttercomp. It is possible on the lathe that the D code is not needed, especially if your tool calls are 4 digit (pocket and offset)
I am less familiar with the lathes and how they setup g-code defaults for it.

My feeling is that you need to read up on your machines tool offset features. It may be treated much like milling offsets, or have lathe specific features. The difference may drastically change the outcome of an offset cut.
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 10-28-2008, 01:09 AM
 
Join Date: Oct 2008
Location: USA
Posts: 3
honda27 is on a distinguished road

Im almost positive its your cutter comp screwing up. I never use cutter comp on a lathe, has burnt me too many times in the past. And its very easy to figure out yourself.
Reply With Quote

  #12   Ban this user!
Old 10-30-2008, 04:36 AM
SanDiegoCNC's Avatar  
Join Date: Jan 2005
Location: USA
Posts: 148
SanDiegoCNC has a little shameless behaviour in the past

Your program...

G00 Z.02
G00 X.625
G01 Z-.500 F.002
G01 G41 Z-.7183 F.002
G02 X.8125 Z-.8120 R.0938 F.002
G01 X.8500
G03 X1.3500 Z-1.0620 R.250 F.002
G01 G40 Z-.1550 F.002
G28 U0. W0.



How I would write it...

G20
(MATERIAL = 1.375 DIA)
(CNGP-43.0 RADIUS IS 0.004)
M01
T0101 (ROUGH OD TURN)
G50 S2600
G97 S2400 M03
G00 G54 X1.500 Z1.0
G99 G00 X1.375 Z1.0
G01 X1.350 Z0.05 F0.02
M08
G71 P30 Q40 U0.004 W0.004 D0.020 F0.005
N30 G00 X-0.035
G01 X-0.02 Z0.
G01 X0. Z0.
G01 X0.625 Z0.
G01 X0.625 Z-0.7182
G02 X0.8126 Z-0.812 R0.0938 F0.002
G01 X0.850 Z-0.812
G03 X1.350 Z-1.0626 R0.250 F0.002
G01 X1.350 Z-1.550
N40 G01 X1.350
G00 X2.0 Z1.0 M09
G30 U0 W0
M01
T0101 (FINISH PASS OD TURN)
G50 S2600
G97 S2400 M03
G00 G54 X1.500 Z1.0
G99 G00 X1.375 Z1.0
G01 X1.350 Z0.05 F0.02
M08
G70 P30 Q40 F0.003
G00 X2.0 Z1.0 M09
G30 U0 W0
M30



Here's a brief explanation about my program. I'm using canned cycles. Why you ask? Simple... by using canned cycles, I can rerun the program on only the finish OD pass without cutting a lot of air. This is important if you have to take a little bit off to bring it into tolerance. Just start from the finish tool point of the program and that's it.



The G71 line is thus explained...

G71 P30 Q40 U0.004 W0.004 D0.020 F0.005

G71 = LINEAR TRAVEL DIRECTION
P30 = BEGINNING OF THE PART PROFILE
Q40 = END OF THE PART PROFILE
U = AMOUNT TO BE LEFT IN 'X'
W = AMOUNT TO BE LEFT IN 'Z'
D = THE DEPTH OF CUT IN THOUSANDTHS
F = THE OVERALL FEEDRATE OF THE LAP CYCLE

Here's the most likely question you're going to ask. 'Why is there a feedrate within the lap if there's one at the beginning?' Answer: Because I can override that feedrate with another so long as I call it out on the line where I want it to be performed. I do this on any radius especially when I want a nice, clean surface, free of tool marks.

The G70 line on the finish tool pass just calls up the same part profile contained in the 'P' and 'Q' lines from directly above.

***NOTE***
Never use the same 'P' or 'Q' values in the program. Always give them different assignments. Example: P10 Q20, P30 Q40, P50 Q60, etc. If you fail to take this caution, you may run another part profile and it could result in a crash and severe machine damage.
***NOTE***



Have fun! Any questions... feel free to ask.




Patrick
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
Need Help!- How can make New M code in ladder Osmanselim G-Code Programing 4 09-05-2008 03:54 PM
Need Instruction On Properly Lifting A KMB-1 jalessi HURCO 0 07-31-2008 02:28 AM
How to Properly Knurl this Part Crashmaster General Metalwork Discussion 26 06-11-2007 02:23 PM
Can you make G-Code With Corel Biggermens General CAM Discussion 6 10-29-2005 10:15 PM
Trying to make this work- G code WOODKNACK TurboCNC 17 06-10-2003 12:00 PM




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