Unconfigured Ad Widget

Collapse

First attempt at G Code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Germz
    Vendor/Retailer
    • Apr 2013
    • 4691

    First attempt at G Code

    I'm very new to g code, but I have been trying to do the pertinent research on my own for all the metrics that I think apply (SFM, IPT, RPM...not sure what else to consider). I've literally had about 15 minutes program experience on an actual machine, and I am absolutely fascinated.

    I'm attempting to replicate an m16 style pocket, assuming that the lower I will be using will already have the rear takedown lug pocket machined as with most newer lowers. also, if you can help me fill in any blanks I am missing. I know there is a specific code for my origin but I can't remember it. when I was playing around on a haas vf2ss at work I remember I did a number 11 and number 6 offset to come up with that somehow...maybe muscle memory will kick in next time.

    The part will be held in a vise so the front take down pin lugs would be facing toward you.
    My origin will be the center front edge of the FCG pocket, which is 3.265" from the center of the front takedown pin hole.
    I plan on doing the majority of removal with a 3/8" 3 flute and the trigger with a 5/16" end mill.
    I'm doing more research on depth of cut, but I just took a guess that 0.050" wasn't a terrible increment.

    Anyway here is my code.

    Code:
    TOOL DIA: .375
    SPINDLE RPM: 2000
    IPT: .003
    IPM: 22.5
    
    ;
    T2 M06 ;
    G43 H02 ;
    <-----CODE FOR ORIGIN?
    M03 S2000 ; 
    G00 X0. Y0.1875 Z4. ;
    M08 ;
    G00 Z0.25 ;
    
    ///////////////FIRE CONTROL GROUP POCKET SHELF////////////////////
    
    G01 X0. Y0.1875 Z-0.05 F6. ;
    G01 X0.1575 Y0.1875 Z-0.05 F9. ;
    G01 X0.1575 Y2.495 Z-0.05 F9. ;
    G01 X-0.1575 Y2.495 Z-0.05 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.05 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.1 F6. ;
    G01 X0.1575 Y2.495 Z-0.1 F9. ;
    G01 X-0.1575 Y2.495 Z-0.1 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.1 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.15 F6. ;
    G01 X0.1575 Y2.495 Z-0.15 F9. ;
    G01 X-0.1575 Y2.495 Z-0.15 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.15 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.2 F6. ;
    G01 X0.1575 Y2.495 Z-0.2 F9. ;
    G01 X-0.1575 Y2.495 Z-0.2 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.2 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.25 F6. ;
    G01 X0.1575 Y2.495 Z-0.25 F9. ;
    G01 X-0.1575 Y2.495 Z-0.25 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.25 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.3 F6. ;
    G01 X0.1575 Y2.495 Z-0.3 F9. ;
    G01 X-0.1575 Y2.495 Z-0.3 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.3 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.35 F6. ;
    G01 X0.1575 Y2.495 Z-0.35 F9. ;
    G01 X-0.1575 Y2.495 Z-0.35 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.35 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.4 F6. ;
    G01 X0.1575 Y2.495 Z-0.4 F9. ;
    G01 X-0.1575 Y2.495 Z-0.4 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.4 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.4555 F6. ;
    G01 X0.1575 Y2.495 Z-0.4555 F9. ;
    G01 X-0.1575 Y2.495 Z-0.4555 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.4555 F9. ;
    
    ////////////////MAIN FIRE CONTROL GROUP POCKET////////////////////
    
    G01 X0.1575 Y0.1875 Z-0.5 F6. ;
    G01 X0.1575 Y2.495 Z-0.5 F9. ;
    G01 X-0.0625 Y2.495 Z-0.5 F9. ;
    G01 X0. Y2.495 Z-0.5 F9. ;
    G01 X0. Y1.695 Z-0.5 F9. ;
    G01 X-0.1575 Y1.695 Z-0.5 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.5 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.55 F6. ;
    G01 X0.1575 Y2.495 Z-0.55 F9. ;
    G01 X-0.0625 Y2.495 Z-0.55 F9. ;
    G01 X0. Y2.495 Z-0.55 F9. ;
    G01 X0. Y1.695 Z-0.55 F9. ;
    G01 X-0.1575 Y1.695 Z-0.55 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.55 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.6 F6. ;
    G01 X0.1575 Y2.495 Z-0.6 F9. ;
    G01 X-0.0625 Y2.495 Z-0.6 F9. ;
    G01 X0. Y2.495 Z-0.6 F9. ;
    G01 X0. Y1.695 Z-0.6 F9. ;
    G01 X-0.1575 Y1.695 Z-0.6 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.6 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.65 F6. ;
    G01 X0.1575 Y2.495 Z-0.65 F9. ;
    G01 X-0.0625 Y2.495 Z-0.65 F9. ;
    G01 X0. Y2.495 Z-0.65 F9. ;
    G01 X0. Y1.695 Z-0.65 F9. ;
    G01 X-0.1575 Y1.695 Z-0.65 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.65 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.7 F6. ;
    G01 X0.1575 Y2.495 Z-0.7 F9. ;
    G01 X-0.0625 Y2.495 Z-0.7 F9. ;
    G01 X0. Y2.495 Z-0.7 F9. ;
    G01 X0. Y1.695 Z-0.7 F9. ;
    G01 X-0.1575 Y1.695 Z-0.7 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.7 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.75 F6. ;
    G01 X0.1575 Y2.495 Z-0.75 F9. ;
    G01 X-0.0625 Y2.495 Z-0.75 F9. ;
    G01 X0. Y2.495 Z-0.75 F9. ;
    G01 X0. Y1.695 Z-0.75 F9. ;
    G01 X-0.1575 Y1.695 Z-0.75 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.75 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.8 F6. ;
    G01 X0.1575 Y2.495 Z-0.8 F9. ;
    G01 X-0.0625 Y2.495 Z-0.8 F9. ;
    G01 X0. Y2.495 Z-0.8 F9. ;
    G01 X0. Y1.695 Z-0.8 F9. ;
    G01 X-0.1575 Y1.695 Z-0.8 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.8 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.85 F6. ;
    G01 X0.1575 Y2.495 Z-0.85 F9. ;
    G01 X-0.0625 Y2.495 Z-0.85 F9. ;
    G01 X0. Y2.495 Z-0.85 F9. ;
    G01 X0. Y1.695 Z-0.85 F9. ;
    G01 X-0.1575 Y1.695 Z-0.85 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.85 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.9 F6. ;
    G01 X0.1575 Y2.495 Z-0.9 F9. ;
    G01 X-0.0625 Y2.495 Z-0.9 F9. ;
    G01 X0. Y2.495 Z-0.9 F9. ;
    G01 X0. Y1.695 Z-0.9 F9. ;
    G01 X-0.1575 Y1.695 Z-0.9 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.9 F9. ;
    
    G01 X0.1575 Y0.1875 Z-0.95 F6. ;
    G01 X0.1575 Y2.495 Z-0.95 F9. ;
    G01 X-0.0625 Y2.495 Z-0.95 F9. ;
    G01 X0. Y2.495 Z-0.95 F9. ;
    G01 X0. Y1.695 Z-0.95 F9. ;
    G01 X-0.1575 Y1.695 Z-0.95 F9. ;
    G01 X-0.1575 Y0.1875 Z-0.95 F9. ;
    
    G01 X0.1575 Y0.1875 Z-1.0 F6. ;
    G01 X0.1575 Y2.495 Z-1.0 F9. ;
    G01 X-0.0625 Y2.495 Z-1.0 F9. ;
    G01 X0. Y2.495 Z-1.0 F9. ;
    G01 X0. Y1.695 Z-1.0 F9. ;
    G01 X-0.1575 Y1.695 Z-1.0 F9. ;
    G01 X-0.1575 Y0.1875 Z-1.0 F9. ;
    
    G01 X0.1575 Y0.1875 Z-1.05 F6. ;
    G01 X0.1575 Y2.495 Z-1.05 F9. ;
    G01 X-0.0625 Y2.495 Z-1.05 F9. ;
    G01 X0. Y2.495 Z-1.05 F9. ;
    G01 X0. Y1.695 Z-1.05 F9. ;
    G01 X-0.1575 Y1.695 Z-1.05 F9. ;
    G01 X-0.1575 Y0.1875 Z-1.05 F9. ;
    
    G01 X0.1575 Y0.1875 Z-1.1 F6. ;
    G01 X0.1575 Y2.495 Z-1.1 F9. ;
    G01 X-0.0625 Y2.495 Z-1.1 F9. ;
    G01 X0. Y2.495 Z-1.1 F9. ;
    G01 X0. Y1.695 Z-1.1 F9. ;
    G01 X-0.1575 Y1.695 Z-1.1 F9. ;
    G01 X-0.1575 Y0.1875 Z-1.1 F9. ;
    
    G01 X0.1575 Y0.1875 Z-1.15 F6. ;
    G01 X0.1575 Y2.495 Z-1.15 F9. ;
    G01 X-0.0625 Y2.495 Z-1.15 F9. ;
    G01 X0. Y2.495 Z-1.15 F9. ;
    G01 X0. Y1.695 Z-1.15 F9. ;
    G01 X-0.1575 Y1.695 Z-1.15 F9. ;
    G01 X-0.1575 Y0.1875 Z-1.15 F9. ;
    
    G01 X0.1575 Y0.1875 Z-1.2 F6. ;
    G01 X0.1575 Y2.495 Z-1.2 F9. ;
    G01 X-0.0625 Y2.495 Z-1.2 F9. ;
    G01 X0. Y2.495 Z-1.2 F9. ;
    G01 X0. Y1.695 Z-1.2 F9. ;
    G01 X-0.1575 Y1.695 Z-1.2 F9. ;
    G01 X-0.1575 Y0.1875 Z-1.2 F9. ;
    
    G01 X0.1575 Y0.1875 Z-1.25 F6. ;
    G01 X0.1575 Y2.495 Z-1.25 F9. ;
    G01 X-0.0625 Y2.495 Z-1.25 F9. ;
    G01 X0. Y2.495 Z-1.25 F9. ;
    G01 X0. Y1.695 Z-1.25 F9. ;
    G01 X-0.1575 Y1.695 Z-1.25 F9. ;
    G01 X-0.1575 Y0.1875 Z-1.25 F9. ;
    
    \\\\\\\\\\\\\\\\\TOOL CHANGE TO 5/16 END MILL\\\\\\\\\\\\\\\\\\\\
    /////////////////TRIGGER HOLE////////////////////////////////////
    
    TXX M06 ;
    G43 HXX ;
    M03 S3000 ;
    G00 X0. Y0.856 Z4. ;
    M08 ;
    G01 X0. Y0.856 Z-1.4 F6. ;
    G01 X0. Y1.244 Z-1.4 F9. ;
    M30 ;
    ;
    Last edited by Germz; 01-21-2016, 11:02 PM.
    Retired Account
  • #2
    toddh
    Banned
    • Dec 2010
    • 1914

    The only thing I would change.....

    After you do the trigger hole, run the 5/16 into the corners for a smaller radius.

    I've found that with a few different drop-in trigger boxes, the larger 3/8 ths cutter radius caused a little interference at the corners.

    I changed it to the 5/16 and no issues with anything I stick in there.


    .
    Last edited by toddh; 01-21-2016, 11:45 PM.

    Comment

    • #3
      kcstott
      I need a LIFE!!
      • Nov 2011
      • 11796

      What machine is this for. you shouldn't have to G01 every line.
      G00, 01,02,03 ,04 act as switched as does most G/M code.

      it picks up the command and uses the X,Y,Z, coordinates and continues on.

      Comment

      • #4
        Germz
        Vendor/Retailer
        • Apr 2013
        • 4691

        Originally posted by kcstott
        What machine is this for. you shouldn't have to G01 every line.
        G00, 01,02,03 ,04 act as switched as does most G/M code.

        it picks up the command and uses the X,Y,Z, coordinates and continues on.
        It is a haas vf2ss

        I will research those codes more. I was not aware of those codes. Thanks. And thanks for hosting prints on your site. They are what i used as references

        Sent from my SM-N920V using Tapatalk
        Retired Account

        Comment

        • #5
          kurac
          Veteran Member
          • Dec 2005
          • 2917

          If you are running a carbide endmill and plenty of coolant, you can run it a lot faster. I don't know how easy it is to adjust the RPM while the HAAS is running but you want to find a range where you don't have a lot of chatter. I am thinking somewhere between 5000-7000 rpm, with carbide will be the sweet spot. Also, make sure that 3/8" endmill is sticking out of the tool holder enough because the receiver extension is going to get in your way. Run the first one slow and keep your finger on the feedhold button.
          www.culinagrips.com
          "custom grips for shooters by shooters"

          Comment

          • #6
            kcstott
            I need a LIFE!!
            • Nov 2011
            • 11796

            Germs
            G00 is rapid movement
            G01 is linear feed and your F designator determines the rate
            G02 is clockwise circular interpolation
            G03 is counter clockwise
            G04 is dwell

            Each one of these will change how the machine feeds.
            I also see you are cutting a square frame. Not a very good way to approach the task. But not having a CAM program to writ your G code for you don't help.

            It will work and it will do a perfectly fine job it just won't be efficient for production. As if that is even a concern.

            Comment

            • #7
              saxman
              Senior Member
              • Dec 2007
              • 555

              If you're running a vf2 and you're cutting into aluminum with a .375" end mill, max out your spindle speed. There is no reason whatsoever for you to be only running at 2k rpm.

              Comment

              • #8
                saxman
                Senior Member
                • Dec 2007
                • 555

                Also, you'll set your origin by calling g54(or whatever other origin you set on the machine, somewhere in the g54 to g60ish range, but for simplicity sake, just use g54)

                Comment

                • #9
                  grymster
                  Veteran Member
                  • May 2009
                  • 4724

                  As well as KC's comment on not needing to repeat the G01 (it is modal) you shouldn't need to repeat an unchanged axis position for each line either.

                  G01 X0.1575 Y0.1875 Z-1.15 F6. ;
                  G01 X0.1575 Y2.495 Z-1.15 F9. ;

                  For the second line, you can just go with Y2.495 F9.;

                  And yes, your feedrates are low. Not sure why you're going from 6 to 9 either. All of those moves could likely be made at the same (higher) feedrate.
                  grym

                  Lay me dun in the caul caul grun.....

                  caput ferrum equus ego veho

                  Comment

                  • #10
                    AC_DC
                    Member
                    • Nov 2015
                    • 281

                    even though everything here is greek to me... tagged for future review

                    Comment

                    • #11
                      yari
                      Senior Member
                      • Nov 2010
                      • 908

                      OK I didn't read past the first two lines of code, what kc has stated above is correct. On a vf2 at you have atleast 7500 rpm, use it! Start with the old school rule of 50/50, 50% of tool diameter in depth and step over. .05 is nothing, .1875 is a starting depth of cut. Feed rate with a .004-.006 chipload per tooth, you can easily run 60-100 inches a minute. Plunge in at 15-20 slot the middle at 25-45, then 50/50 your way out. Or go balls out helix in with a sub routine and a rectangular sub at full depth. Google Haas subroutines to figure it out.

                      Comment

                      • #12
                        Lostsheep
                        Senior Member
                        • Aug 2010
                        • 927

                        Why are you writing this code by hand? Surely if you have access to a VF2 you also have access to a worthy CAM program?

                        If you have solidworks, download the free HSMexpress for it. HSM is only 2D but its free and is extremely user friendly.

                        Comment

                        • #13
                          Wolfgunner5150
                          Junior Member
                          • May 2007
                          • 28

                          Haas is a very common machine. You should look into NTMA, a vocational school , or HASS themselves sometimes have short intro classes. They all have basic G code classes. Have fun and do your first run way above the part to make sure everything looks ok.

                          Comment

                          • #14
                            eaglemike
                            CGN/CGSSA Contributor - Lifetime
                            CGN Contributor - Lifetime
                            • Jan 2008
                            • 3939

                            Simple cam programs are out there, and once you use one, you'll never go back to hand coding.
                            OTOH, it's a great first step you have taken!
                            Tip here, to add to some of the above: Using a 5/16" end mill to finish the corners of the larger pocket is a good thing, but don't just go straight all the way to the corner. You'll want to interpolate the corner radius, make it a .166 radius, so you are machining an arc in the corner. This will give you a better finish. You'll also learn how to do the math for this, it's actually pretty easy (you get to start brushing up on a little trigonometry too ).

                            Not a bad idea for you first effort to run slow. Stuff can happen pretty fast on a cnc mill when you aren't ready for it.

                            ETA: don't know how familiar you are with the control. The graphics button is your friend - you can sometimes see a major oops before actually running the program. Get someone to show you how to zoom in and single step through the program.
                            Last edited by eaglemike; 01-25-2016, 9:36 PM.
                            There are some people that it's just not worth engaging.

                            It's a muzzle BRAKE, not a muzzle break. Or is your muzzle tired?

                            Comment

                            • #15
                              grymster
                              Veteran Member
                              • May 2009
                              • 4724

                              grym

                              Lay me dun in the caul caul grun.....

                              caput ferrum equus ego veho

                              Comment

                              Working...
                              UA-8071174-1