585,722 active members*
4,039 visitors online*
Register for free
Login
Results 1 to 15 of 15
  1. #1
    Join Date
    Jan 2009
    Posts
    6

    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

  2. #2
    Join Date
    Jan 2005
    Posts
    15362
    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

  3. #3
    Join Date
    Mar 2003
    Posts
    4826
    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)

  4. #4
    Join Date
    Mar 2003
    Posts
    2932
    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.

  5. #5
    Join Date
    Jan 2009
    Posts
    6
    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

  6. #6
    Join Date
    Feb 2007
    Posts
    592

    DANGER Will Robinson!!!!

    Quote 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 ).

  7. #7
    Join Date
    Jan 2005
    Posts
    15362
    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

  8. #8
    Join Date
    Feb 2007
    Posts
    592
    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.

  9. #9
    Join Date
    Mar 2003
    Posts
    2932
    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).

  10. #10
    Join Date
    Jan 2005
    Posts
    15362
    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

  11. #11
    Join Date
    Mar 2003
    Posts
    2932
    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.

  12. #12
    Join Date
    Jan 2005
    Posts
    15362
    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

  13. #13
    Join Date
    Mar 2003
    Posts
    2932
    Well, if you can find a more efficient way to get Z to tool change position (in this case, home) than a rapid move, you're a better man than I.

  14. #14
    Join Date
    Jan 2005
    Posts
    15362
    Hi dcoupar

    Now you are getting funny I already said 2 or 3 post's ago this is what I said

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

    I think this is very clear is it not
    Mactec54

  15. #15
    Join Date
    Mar 2003
    Posts
    2932
    No, it's not clear. I surrender. Ciao.

Similar Threads

  1. Fagor DNC Issue
    By taspence in forum Haas Mills
    Replies: 2
    Last Post: 01-11-2012, 12:49 AM
  2. another turret issue
    By Paul in OK in forum Daewoo/Doosan
    Replies: 0
    Last Post: 05-24-2007, 05:21 PM
  3. Help - Can you identify this issue?
    By Alex_Cole in forum Servo Motors / Drives
    Replies: 4
    Last Post: 05-11-2007, 01:04 AM
  4. Help with selector switch wiring issue (***actually a motor issue***)
    By BEDFORD in forum Charter Oak Automation Support Forum
    Replies: 7
    Last Post: 04-07-2006, 09:19 PM
  5. THC Issue
    By Aldoseri in forum CamSoft Products
    Replies: 3
    Last Post: 01-31-2006, 11:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •