Page 2 of 2 FirstFirst 12
Results 13 to 24 of 24

Thread: G52 Main vs Sub

  1. #13
    Registered
    Join Date
    Jan 2007
    Location
    US
    Posts
    432
    Downloads
    0
    Uploads
    0
    Have to run for now, will come back and post examples of both.


  2. #14
    Registered
    Join Date
    Feb 2007
    Location
    USA
    Posts
    21
    Downloads
    0
    Uploads
    0

    G52 to TravisR100

    Sorry TravisR100, N1000 should have been O1000. When G52 is called, the X,Y values transform those coordinates to X0Y0. G52 X0Y0 then transforms those new coordinates to the original values. The coordinates inside the G65 subprogram are always at X0Y0 (new values). Calling G52 X0Y0 at the end transforms the new values back to the original values.


  3. #15
    Registered
    Join Date
    Jan 2007
    Location
    US
    Posts
    432
    Downloads
    0
    Uploads
    0
    I think a lightbulb just came on for me. Maybe not. Let me know. This M98/G65 stuff calls a completely separate program, correct? So if I develop a part program for a single part, all I have to do to fixture it for a multipart fixture is create a NEW, SEPARATE program with all the different G52's and simply call the main part program using an M98/G65, correct? The only modification I have to make to the original part program is getting rid of the M30 at the end and changing it to an M99. Have I got it right? See Example 1.

    Example 1:

    %
    O00001;
    (Original Part Program);
    G54 G90;
    S3000 M3;
    G0 X0 Y0 Z0;
    G1 Z-.25 F7;
    G1 X2. F14;
    G0 Z1.;
    G28 G91 Z0 X0 Y0;
    M5
    M99
    %

    %
    O00002;
    (Fixturing Program);
    G52 X0 Y0;
    G65 P00001;
    G52 X2 Y2;
    G65 P00001;
    (etc, etc);
    M30;
    %

    Then all I'd do is run program 00002?

    Example 1 seems like a poor way to do it however. The reason is that I'm returning the machine to home after each part. It's also re-executing all the initalization commands (G54 and G90 in this case). I also end up with two separate programs to keep up with. Example 2 would seem a better way to do it.

    Example 2

    %
    O00001;
    N1 G54 G90;
    N2 S3000 M3;
    N3 G0 X0 Y0 Z0;
    N4 G52 X0 Y0;
    N5 M97 P1000;
    N6 G52 X2 Y2;
    N7 M97 P1000;
    N8 G28 G91 Z0 X0 Y0;
    N9 M5;
    N10 M30;

    N1000 G1 Z-.25 F7;
    N1001 G1 X2. F14;
    N1002 G0 Z1.;
    N1003 M99;
    %

    Example 2 keeps it all in one program and doesn't repeat anything unnecessary.


  4. #16
    Registered
    Join Date
    Nov 2008
    Location
    USA
    Posts
    76
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by TravisR100 View Post
    Wow, no. That confused me even more. Why an M98 call in addition to the G65? You're specifying P1000 with your G65 call but there's no O1000 that it's calling nor is there any M99 for a return.

    I would just take your servos off and put stepper motors on it with Gecko drives and run Mach 3.







    jk

    PM Geof. He is the master and the best at explaining Haas info


  • #17
    Registered
    Join Date
    Jan 2007
    Location
    US
    Posts
    432
    Downloads
    0
    Uploads
    0
    I figure I'll let Geof post here for the benefit of anyone else who might have similar questions.


  • #18
    Registered
    Join Date
    Jan 2005
    Location
    USA
    Posts
    2,923
    Downloads
    0
    Uploads
    0
    TravisR100

    G52 is good if you understand how to use it, Geof is a hand programer, this is were a G52 is good when you program everything by hand.

    You have got a cam system/program use it you don't need any G52 in your program, in your case the jobs you are doing it is very inefficent to use a G52 in your program
    Mactec54


  • #19
    Registered
    Join Date
    Jan 2007
    Location
    US
    Posts
    432
    Downloads
    0
    Uploads
    0
    G52 itself I understand with no problems. The best way to implement it is what I'm after. It seems my question is more about general programming style than G52 itself. Yes, I do have CAM but I like to be able to read what it generates and understand how and why it generates what it does. With the limited experience I have it seems like CAM is great for spitting out code to do what you need but I'd argue that many times it's actually very ineffecient in the way it does it.


  • #20
    Registered
    Join Date
    Jan 2005
    Location
    USA
    Posts
    2,923
    Downloads
    0
    Uploads
    0
    TravisR100
    Yes cam can be very ineffecient if not set up properly & if you don't know how to use it, that is the reason you set up your postprocesser to how you want the G code to be to make it effecient, the reason to have a cam system is so you don't have to stand at the control & punch in your code & then hope you have not missed something, then stand with your hand on the big red button???? did I do it right.

    With cam set up right you load your program, with your offsets done just press start & make parts no messing around no second guessing
    Mactec54


  • #21
    Registered
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    11,960
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by TravisR100 View Post
    I figure I'll let Geof post here for the benefit of anyone else who might have similar questions.
    Maybe I don't want to jump into the middle of a (mild) controversy for fear of this fate.

    But then again maybe I will in a few days when I arrive back and have a full size keyboard available.
    An open mind is a virtue...so long as all the common sense has not leaked out.


  • #22
    Registered
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    11,960
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by TravisR100 View Post
    ....It seems that if I develop a program for a single part then want to move that part to a multipart fixture that G52 is a great way to do it. First, is this typically the way someone would do this? Develop the program first then do a multipart fixture and use a macro with a loop to setup for running that same program at each part location on the fixture?......
    This is the way I do things except I don't use Macros because it is not really necessary.

    My approach for multipart fixtures is to have a reference point on the fixture which is used to set the main Work Zero, most often G54. This way when the fixture is removed and replaced it is only necessary to find and enter one set of work coordinates. It is necessary when replacing the fixture to make sure that it is correctly aligned with the X or Y axis and for this sometimes I will face along one side of the fixture for dialling it in or I will use a pair of dowel pins or keys locating in the table slots.

    All the G52 work zeros use the G54 and of course these are all embedded in the program.

    The program uses subroutines for each tool.

    The 'Main' program is a series of G52 commands that create the secondary work zeros at each part followed by a call to the tool subroutine like this for a program using three tools on two parts:

    O00000
    (Comments about program, etc)
    G52 X Y Z (Coordinates for first part)
    M97 P1000
    G52 X Y Z (Coordinates for second part)
    M97 P1000
    (-------)
    G52 X Y Z (Coordinates for first part)
    M97 P2000
    G52 X Y Z (Coordinates for second part)
    M97 P2000
    (-------)
    G52 X Y Z (Coordinates for first part)
    M97 P3000
    G52 X Y Z (Coordinates for second part)
    M97 P3000
    (-------)
    G53 G00 Z0.
    M30
    (------)
    N1000
    (Tool 1 operations)
    M99
    (------)
    N2000
    (Tool 2 operations)
    M99
    (------)
    N3000
    (Tool 3 operations)
    M99

    The code in any of the subroutines can come from CAM or hand code.

    This example shows the same operations being performed by each tool at all the locations but it is possible to do different operations at each part. For example the first part could be the raw stock which is getting the first side machined while the 'second' part is the partially machined piece flipped over. In this case the second parts subroutines are going to be different like this:

    O00000
    (Comments about program, etc)
    G52 X Y Z (Coordinates for first part)
    M97 P1000
    G52 X Y Z (Coordinates for second part)
    M97 P1100
    (-------)
    G52 X Y Z (Coordinates for first part)
    M97 P2000
    G52 X Y Z (Coordinates for second part)
    M97 P2100
    (-------)
    G52 X Y Z (Coordinates for first part)
    M97 P3000
    G52 X Y Z (Coordinates for second part)
    M97 P3100
    (-------)
    G53 G00 Z0.
    M30
    (------)
    N1000
    (Tool 1 operations on first side)
    M99
    (------)
    N1100
    (Tool 1 operations on second side)
    M99
    (------)
    N2000
    (Tool 2 operations first side)
    M99
    (------)
    N2100
    (Tool 2 operations second side)
    M99
    (------)
    N3000
    (Tool 3 operations first side)
    (------)
    N3100
    (Tool 3 operations second side)
    M99

    When parts are being done like this pn both sides it is often necessary to have a Z coordinate in the G52 to take into account the difference height for Z0.0 at the two locations.

    Alternatively it is possible to use G54, 55, 56, etc instead of G52 but this means that all these coordinates have to be entered each time the fixture is removed and replaced which takes more time and introduces chances for error.

    When G54, 55 etc are being used it is possible to get all the code out of Mastercam with the option of doing each tool at it each location or all tools at each location. I can't do this but DonkeyHotey spent some time in a different thread sorting out how to do it.
    An open mind is a virtue...so long as all the common sense has not leaked out.


  • #23
    Registered
    Join Date
    Jan 2007
    Location
    US
    Posts
    432
    Downloads
    0
    Uploads
    0
    Geof, thanks. That was what I was getting at. In your examples the G52's are set in the main and the work is being done in the subs. It seems to save using macro programming to loop the work when it's done as in your example.


  • #24
    Registered
    Join Date
    Nov 2008
    Location
    USA
    Posts
    76
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by TravisR100 View Post
    Geof, thanks. That was what I was getting at. In your examples the G52's are set in the main and the work is being done in the subs. It seems to save using macro programming to loop the work when it's done as in your example.
    Looks like good stuff to me


  • Page 2 of 2 FirstFirst 12

    Similar Threads

    1. Need Help!- Main and Subprogram
      By vanm in forum Fadal
      Replies: 7
      Last Post: 10-06-2009, 11:15 AM
    2. rod and main bearings
      By Hiredgun in forum I.C. Engines
      Replies: 3
      Last Post: 05-04-2008, 01:46 AM
    3. Your Main Page Is Down !
      By CheekieMonkies in forum Forum Questions or Problems
      Replies: 10
      Last Post: 08-19-2007, 06:26 PM
    4. Main current for a drive? (BRU-200)
      By toninlg in forum Servo Motors and Drives
      Replies: 1
      Last Post: 06-02-2007, 02:27 PM
    5. main haas board
      By daleman in forum Haas Mills
      Replies: 4
      Last Post: 03-16-2007, 07:58 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.