586,062 active members*
4,443 visitors online*
Register for free
Login
IndustryArena Forum > MetalWorking Machines > Milltronics > Advice needed on first G Code program
Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2016
    Posts
    7

    Advice needed on first G Code program

    Hi all,

    I posted this in another thread but then I found the Milltronics forum so I'm gonna ask here also.

    Over the last 20 years as a maintenance mechanic, i have picked up a little skill with manual machining. Now, however, I need to use a Milltronics MB-20 milling machine. I have three pieces of mild steel that I need to cut three 1.5" x 1.5" square holes in. None of the holes are in the same location on the metal but all nine holes are the same size. I have written the following G Code program. I want to locate the starting position on each piece and then run the program below to cut the hole. I'm not sure about the G92 command. Can anyone take a look and advise me please?

    Thanks,

    (Cuts a square hole 1.5 x 1.5)
    G20 (inches)
    G55
    G92X0Y0 (Set Local Coordinate)
    M6 T1 (Change Tool: Diameter: 0.3150 in)
    M3 (Start Spindle)
    M7 (Flood Coolant On)
    G0Z0.5000
    G0X0.0Y0.605 (Origin 0)


    G1Z-0.0500F2.0 (Depth 1)
    G1X0.605Y0.605F6.0 (leg 1)
    G1X0.605Y-0.605F6.0 (leg 2)
    G1X-0.605Y-0.605F6.0 (leg 3)
    G1X-0.605Y0.605F6.0 (leg 4)
    G1X0.0Y.605F6.0 (leg 5)


    G1Z-0.1000F2.0 (Depth 2)
    G1X0.605Y0.605F6.0 (leg 1)
    G1X0.605Y-0.605F6.0 (leg 2)
    G1X-0.605Y-0.605F6.0 (leg 3)
    G1X-0.605Y0.605F6.0 (leg 4)
    G1X0Y.605F6.0 (leg 5)


    G1Z-0.1500F2.0 (Depth 3)
    G1X0.605Y0.605F6.0 (leg 1)
    G1X0.605Y-0.605F6.0 (leg 2)
    G1X-0.605Y-0.605F6.0 (leg 3)
    G1X-0.605Y0.605F6.0 (leg 4)
    G1X0Y.605F6.0 (leg 5)


    G1Z-0.2000F2.0 (Depth 4)
    G1X0.605Y0.605F6.0 (leg 1)
    G1X0.605Y-0.605F6.0 (leg 2)
    G1X-0.605Y-0.605F6.0 (leg 3)
    G1X-0.605Y0.605F6.0 (leg 4)
    G1X0.0Y0.605F6.0 (leg 5)


    G1Z-0.2500F2.0 (Depth 5)
    G1X0.605Y0.605F6.0 (leg 1)
    G1X0.605Y-0.605F6.0 (leg 2)
    G1X-0.605Y-0.605F6.0 (leg 3)
    G1X-0.605Y0.605F6.0 (leg 4)
    G1X0.0Y0.605F6.0 (leg 5)


    G0Z0.5000 (Retract)
    M9 (Coolant Off)
    M5 (Stop Spindle)
    G0X0Y0 (Origin)
    M30 (End of Program)

  2. #2
    Join Date
    Sep 2006
    Posts
    6463

    Re: Advice needed on first G Code program

    Hi.....being a noob at CNC and G code general, I think that when you have identical holes in different positions the G54....G59 positioning for each hole on each piece of steel would be simpler to set-up as the hole creation code sequence is the same for each hole and only needs to be created once then moved to the next position.

    I used copy and paste in Notepad to create the identical hole code group and use G54....G59 to move the group to the next position without having to write it out again and again........the N sequence numbering needs to be changed after the pasting.
    Ian,

  3. #3
    Join Date
    Nov 2016
    Posts
    7

    Re: Advice needed on first G Code program

    Thank you Ian,

    I should have said this in my original post. The distance between holes is greater than the machine travel so I have to reposition the work piece for each hole.

  4. #4
    Join Date
    Sep 2010
    Posts
    529

    Re: Advice needed on first G Code program

    So are you going to pickup each new position with a wiggler or something? If so, you could just X Origin, Y origin and don't need the G92 line in the program. One comment, you are conventional milling around the hole, would work better if climb milling, just go the opposite direction around the hole, CCW instead of CW.

  5. #5
    Join Date
    Nov 2016
    Posts
    7

    Re: Advice needed on first G Code program

    Quote Originally Posted by Brian L View Post
    So are you going to pickup each new position with a wiggler or something? If so, you could just X Origin, Y origin and don't need the G92 line in the program. One comment, you are conventional milling around the hole, would work better if climb milling, just go the opposite direction around the hole, CCW instead of CW.
    Thanks for your reply Brian. No, I am going to find each location by a 8mm hole that has been drilled in each piece. I am going to use a 8mm bit and lower it into the hole. From that point I will cut out the square. After retracting the bit, of course. And thanks or the tip on the direction.

  6. #6
    Join Date
    Sep 2010
    Posts
    529

    Re: Advice needed on first G Code program

    8mm pin in the hole works... still think it would be easy to then hit XY origin at that point, you are going to be in jog or hand wheel anyway. Then you just run the part. What size end mill are you using, you say a 1.5" hole and you have 1.21 of movement, makes for an odd .29" diameter end mill?

  7. #7
    Join Date
    Nov 2016
    Posts
    7

    Re: Advice needed on first G Code program

    Quote Originally Posted by Brian L View Post
    8mm pin in the hole works... still think it would be easy to then hit XY origin at that point, you are going to be in jog or hand wheel anyway. Then you just run the part. What size end mill are you using, you say a 1.5" hole and you have 1.21 of movement, makes for an odd .29" diameter end mill?
    Yes Brian and THANK YOU. I am doing away with the G92 and then set the XY origin as you suggested. I am using an 8mm end mill. I have allowed .02" clearance so the actual dimension will be 1.52" x 1.52". These holes will be used to locate 1.5 x 1.5 structural steel tubing to be welded. A welding jig so to speak.

    Again, thank you for your advice.

  8. #8
    Join Date
    Sep 2010
    Posts
    529

    Re: Advice needed on first G Code program

    OK, makes sense to me now.... :-)

  9. #9
    Join Date
    Sep 2006
    Posts
    6463

    Re: Advice needed on first G Code program

    Hee Hee.....now if that was a piece of 3mm plate stock I'd hit it with a square punch in my fly press......I just happened to have a 25mm square hole punch from another job.....totally heretical I know as this is a CNC solution thread.
    Ian.

  10. #10
    Join Date
    Mar 2014
    Posts
    55

    Re: Advice needed on first G Code program

    Don't forget to add a spindle speed after the spindle direction.

  11. #11
    Join Date
    Nov 2016
    Posts
    7

    Re: Advice needed on first G Code program

    Thank you for your response tlowe. I have finished cutting the holes and used the speed control on the front panel but I will remember your advice for the next project.

Similar Threads

  1. Steps to develop VB program to read CNC (G-code) program.
    By BhushanM01 in forum Visual Basic
    Replies: 7
    Last Post: 12-12-2017, 07:57 PM
  2. [ADVICE NEEDED] Z-Axis not moving - CNC builder needed
    By baodogg in forum Australia, New Zealand Club House
    Replies: 2
    Last Post: 06-03-2014, 12:42 PM
  3. Mazatrol Program into a G Code Program
    By fuzzman in forum Mazak, Mitsubishi, Mazatrol
    Replies: 15
    Last Post: 09-25-2012, 04:27 PM
  4. fanuc program code vs. Haas code
    By sixty8frbrd in forum Fanuc
    Replies: 6
    Last Post: 03-11-2011, 04:05 AM
  5. How to program bar feeder- M or G code needed?
    By robert0707 in forum G-Code Programing
    Replies: 2
    Last Post: 01-30-2011, 07:36 PM

Tags for this Thread

Posting Permissions

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