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 01-08-2009, 07:34 AM
 
Join Date: Jan 2009
Location: Canada
Posts: 6
andywids is on a distinguished road
Question New to CNC, G52 issue

I am new to the world of CNC and have been given a simple bolt circle to drill on a Hwacheon Ecomil 65v with Fanuc 18m controller. The G code generated from software is in reference to the Absolute reference frame. As a result of using this reference frame, when running the program, I get an overtravel error from the machine when travelling to the second bolt hole. I would like to move the tool to say, the center of the table (actual location is arbitrary) where I can place my part sufficiently far from the table end and have the program run in the exact same manner, only from the starting position I specified. The idea is to minimize the required changes to the program generated (obviously). I tried G91 but as an incremental command, it did not work properly for this application. I believe using G52 would solve this issue but I'm not sure where or how to apply it in the program. Any help would be greatly appreciated.

The program is as follows:
%
N1 G54
N2 G00 G49 G40 G80 G90 G17
N3 G91 G28 Z0. M05
N4 G91 X0. Y0.
N8 G90 G00 X0.0 Y4.0 M03
N9 G43 H1 Z0.0 M08
N10 X2.3511 Y3.2361 (overtravel error occurs here)
N11 X3.8042 Y1.2361
N12 Y-1.2361
N13 X2.3511 Y-3.2361
N14 X0.0 Y-4.0
N15 X-2.3511 Y-3.2361
N16 X-3.8042 Y-1.2361
N17 Y1.2361
N18 X-23511 Y3.2361
N19 G00 M09
N20 G91 G28 Z0. M05
N21 G91 G28 X0. Y0.
N22 M30
%

Andrew
Reply With Quote

  #2   Ban this user!
Old 01-08-2009, 08:09 AM
 
Join Date: Jan 2005
Location: USA
Posts: 2,348
mactec54 is on a distinguished road
Buy me a Beer?

Hi anywids

When you turn the machine on it then needs to do the home routine Once the machine has been homed then you need to do your part X0 Y0 this is your G54 only use G90 as
no G91 needed in this program at all you can take out the G91s & G28

The start of your program can look like this

N1G17G40G80
G0Z0
G0X0Y0
T1M6
M8
G54
S2800M3
G90G0X0Y4.0
G43Z.2H1
G0 or a G1X2.3511Y3.2361F20. G0 being a rapid move G1 a feed move
G1Z-.2F12.


End of program
G0Z0 or what ever number you want it to be above the work
M9
M5
G0X0Y4.
M30
__________________
Mactec54

Last edited by mactec54; 01-09-2009 at 08:50 AM.
Reply With Quote

  #3  
Old 01-08-2009, 09:17 AM
HuFlungDung's Avatar
Moderator
 
Join Date: Mar 2003
Location: Canada
Posts: 4,825
HuFlungDung is on a distinguished road

Andrew,
As Mactec54 alluded to, you need to home the machine and then position the table so that the spindle center is on the X0Y0 of the part (as programmed). At this point, you would set the G54 X and Y values. Now hopefully, the part is fixtured such that there is sufficient travel in all directions so that all the hole centers can be reached without going into overtravel.

You should not need to invoke G52 to solve this problem, IMO. G52 is more for usage within a subroutine, to shift a pattern programmed in absolute, repeatedly with respect to a given workshift datum (G54 or G55, etc X0Y0)
__________________
First you get good, then you get fast. Then grouchiness sets in.

(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-08-2009, 10:10 AM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

Andrew,

Your machine has a minimum of 6 Work Coordinate Systems (G54 - G59) and possibly more. When you first turn it on, G54 is active.

In the Work offsets page, you store the distance from Machine Zero to Part Zero (usually negative values for X and Y). Then, when you want to machine a feature on that part, you activate the Work Coordinate System for that part (usually in with the first XY move), i.e.: G0 G54 G90 X0 Y4.

In general, it looks like your program will work with a few changes:

1. Delete N4 (it doesn't do anything)

2. N9 appears to rapid the tool down to the top of the part. In my experience, most programmers use Z0.1 in the G43 block to rapid down to a safe point above the top of the part.

3. Between N9 and N10 you need a canned cycle to actually drill (or peck, or or tap) the hole. To drill 1/2" deep at 10IPM, for example, program G81 Z-0.5 F10. This will drill at the current XY position and return to Z0.1. N10 will move XY to the next hole location and the cycle will repeat.

4. N22: You might want to insert a G90 in this block, but it's not mandatory. I've just never liked leaving a machine in incremental mode.

Good luck.
Reply With Quote

  #5   Ban this user!
Old 01-08-2009, 11:26 AM
 
Join Date: Jan 2009
Location: Canada
Posts: 6
andywids is on a distinguished road

Gentlemen,
Thank you VERY much for your help, between all three replies I have managed to work my way through the problem and have had excellent results. It's a basic problem but I touched the CNC for the first time 2 days ago and I'm supposed to figure out as much as I can in a few days so this was a great help. Thanks again,
Andrew
Reply With Quote

Sponsored Links
  #6   Ban this user!
Old 01-08-2009, 02:33 PM
 
Join Date: Feb 2007
Location: USA
Posts: 531
skullworks is on a distinguished road
DANGER Will Robinson!!!!

Originally Posted by mactec54 View Post
Hi anywids

When you turn the machine on it then needs to do the home routine Once the machine has been homed then you need to do your part X0 Y0 this is your G54 only use G90 as
no G91 needed in this program at all you can take out the G91s & G28

The start of your program can look like this

N1G17G40G80
G0Z0
G0X0Y0
T1M6
M8
G54
S2800M3
G90G0X0Y4.0
G43Z.2H1
G1Z-.2
G0 or a G1X2.3511Y3.2361F20. G0 being a rapid move G1 a feed move



End of program
G0Z0 or what ever number you want it to be above the work
M9
M5
G0X0Y4.
M30


FYI - Actually this is WRONG.

While some machine tool builders include Z movement as part of the M6 function, most don't.

If we look at this:

N1G17G40G80 - (ok)
G0Z0 - ( Machine rapids to Z0 using last Hxx if G90 is active - since there was no G49, or makes no move if G91 is active.)
G0X0Y0 - (makes no move if G91 is active, or may move with tool down in G90)
T1M6 (Alarm likely)

Everything depends on what the machines power on parameters are set to, and what gets reset or cleared after a M2 or M30. Also which values change when a reset is pressed.

Just because your Iron works one way does not mean others act the same.

On my Okuma the parameters are set so that:

X1 = X1.0

But on all the Fanuc machines...

X1 = X0.0001 because any number without a defined decimal place will be divided by 1000.

RS274D aka G & M code word address programing has as many flavors as machine tool builders.

Using a G28G91Z0 or a G30 Position prior to a tool change is the only way it will change tools on many machines.

Example a Kitamura HX400 Horizontal requires a G30G91X0Y0 and Z is not required ( but better safe than sorry ).
Reply With Quote

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

Hi skullworks

This Gcode was just a rough guide to get andywids something to try & play with
What is there will work fine for Fanuc 18 I have these controls so I know it works

You need to read what he had written before making comments that there would be a problem with the Gcode That I put in the post this is not my normal way to do it either but was done this way so he would not crash & he would have something to play with & try to learn how to do it

No body is talking about the machines you are so get on the same page

There was no call for a G91 so were is the problem & only a inexperienced programer would use a G91 there is no need for it to be used you don't mix & match code when he is trying to lean

A M6 is a standard tool change call so no problem as you say
__________________
Mactec54
Reply With Quote

  #8   Ban this user!
Old 01-08-2009, 09:05 PM
 
Join Date: Feb 2007
Location: USA
Posts: 531
skullworks is on a distinguished road

So Mactec54 - you have a Hwacheon Ecomil 65v with Fanuc 18m controller of the same year and same options that you were able to test this code on?

It WILL NOT work on just any Fanuc 18M.

I have a Mori Seiki SV50 with a Fanuc 18M and I assure you it all comes down to how the machine was configured by the machine tool builder. The same machine was also offered in a 16m with a High speed RISC processor and the code formats for that option are very different also.

BTW the guys who write those thick yellow manuals with FANUC on the cover must not have much experience because they use G91.

Also you might review how most CAD/CAM post processors are setup as default. There is a reason for this. The software companies want to CTA and error on the side of safe functionality.
Reply With Quote

  #9   Ban this user!
Old 01-08-2009, 10:40 PM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

Mactec54,

I'm sure there are hundreds if not thousands of experienced programmers who still use G91. There are still CNC machines that don't use macros to do tool changes, so theres still a lot of folks who use G91 G28 Z0 to get Z home for the tool change.

By the way, your example moved X and Y after feeding Z to -.2 (which didn't have an active F command, either).
Reply With Quote

  #10   Ban this user!
Old 01-09-2009, 07:28 AM
 
Join Date: Jan 2005
Location: USA
Posts: 2,348
mactec54 is on a distinguished road
Buy me a Beer?

Hi dcoupar

That is correct there are lots that still use it G91G28Z0 before a tool change but you will find that this is not needed try it & you will see it is a waste of machine time

Now if the machine tool change position is at Z0 then it does not matter if it is there

If your tool change position is say 6" below the Z0 then you can see what is happening

The Zaxes goes rapid to Z0 then it's next move is move to tool change 6" back down so for every tool change you have wasted 12" of machine time wear & tear on ballscrews slides etc

The bigger the machine the more time you waste in travels that you don't need to

Thanks I changed the above code to have the Z feed after the rapid or feed move move,It was not really a rapid move it was a feed move I added the G0 after to show andy that it could be anything he wanted it to be

But if you check, it would of been fine because it has a Feed call so won't go any faster than the feed of F20.
__________________
Mactec54
Reply With Quote

Sponsored Links
  #11   Ban this user!
Old 01-09-2009, 10:06 AM
dcoupar's Avatar  
Join Date: Mar 2003
Location: USA
Posts: 2,312
dcoupar is on a distinguished road

Hello Mactec54.

You've obviously never had the "pleasure" of programming a CNC mill that didn't automatically move Z (and/or X, Y, W, etc.) to the correct toolchange position. You HAD to program either G91 G28 Z0 or G90 G49 Z0 prior to the M06 command or you would get an alarm.

For you to categorically state that using G91 G28 Z0 is "not needed" and "a waste of machine time" may be true in your situation, but certainly not in every situation.
Reply With Quote

  #12   Ban this user!
Old 01-09-2009, 12:29 PM
 
Join Date: Jan 2005
Location: USA
Posts: 2,348
mactec54 is on a distinguished road
Buy me a Beer?

Hi dcoupar

That is correct But I have always found a way around not having to do what you are saying you have to do no matter what control you are using there are always a different
way of doing it to make it more efficient ( You just have to try a different way) I think I could say I have been Progamming for a while 1960 was when I first started my 7 year old is already doing advanced programing up to 4 axes at the moment & does contract programing for a large International company $$$ for his toys
__________________
Mactec54
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
Fagor DNC Issue taspence Haas Mills 2 01-10-2012 05:49 PM
another turret issue Paul in OK Daewoo/Doosan 0 05-24-2007 11:21 AM
Help - Can you identify this issue? Alex_Cole Servo Motors and Drives 4 05-10-2007 07:04 PM
Help with selector switch wiring issue (***actually a motor issue***) BEDFORD Industrial Hobbies (Support forum) 7 04-07-2006 03:19 PM
THC Issue Aldoseri CamSoft Products 3 01-31-2006 04:33 AM




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