584,800 active members*
4,854 visitors online*
Register for free
Login

Thread: g code help

Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2020
    Posts
    6

    g code help

    can someone proficient with geometric code please message me! i'm an apprentice at a plastic injection plant in tooling.. we recently got a milltronics mb20 cnc mill and i need a very simple, one tool program created. i've been learning the basics but nobody knows g code and im struggling! help! attached is an image of what i need. any responses are highly appreciated
    Attached Thumbnails Attached Thumbnails IMG_4496.jpg  

  2. #2
    Join Date
    Dec 2003
    Posts
    1206

    Re: g code help

    There is nothing showing.It may be that you need more posts to gain image posting rights.To gain a bit more posting credit,can you describe the type of operation?Are you cutting an outline,sinking a pocket,drilling a hole pattern or something else.Its good to see an apprentice using his initiative to find a solution.

  3. #3
    Join Date
    Jan 2020
    Posts
    6
    I'm sinking a pocket! Not sure why it won't show the attachment, shooting you a message as we speak!

    Appreciate the quick response as well

  4. #4
    Join Date
    Dec 2003
    Posts
    1206

    Re: g code help

    Just saw this and still can't see anything.Do you have any form of CAM software or programming capability at the machine?Its a whole lot easier if you do.The alternative is to sit down with a calculator and work out tool centreline trajectories and then to type out the program header and end commands.Its a huge step for a newbie with no guidance and no technical literature on hand.Do you have the ability to figure tool speed and feed rate for the material?You also need to determine a part datum position for a G54 entry to tell the machine where the part is located.You may need an edge finder or a probe for this part.If you have Machinery's Handbook available there is a lot of relevant information.

    I would highly recommend giving the machine a false Z value and telling it that it is working a distance above the actual job.That way you can run the program in fresh air and see if it is doing the things you expect,in the location it is meant to be working.It also gives you the chance to program the spindle start and stop commands and to be sure the working plane is correctly identified.Before committing to a run-turn the feed rate down very low and keep a hand close to the E-stop button.If you are in one of those shops where some joker thinks its funny to make loud banging noises when you are trying a new job,let it be known that it is very juvenile and you won't be impressed.

    If you can get the machine moving correctly,cautiously approach the real thing,and maybe if the real thing is of significant value,try the cut in an offcut of the same material to prove things.If it works you will have earned the right to feel great.

  5. #5
    Join Date
    Jan 2020
    Posts
    6
    Hey I appreciate the response! Try checking if the image is attached to this reply.

    I have figured out the basics of the machine pretty quickly and have prior experience in programming (Nothing like G-Code though, lol)

    I've continuously been playing with the demo programs the milltronics mb20 and trying to pull code from other programs to implement into the one I need. Eh, I'm getting there..

    If it's not attached;

    1.500 WIDE

    3.500 LONG

    1.00 DEEP

    Any help or guidance in the correct direction is highly appreciated.

  6. #6
    Join Date
    Jun 2018
    Posts
    362

    Re: g code help

    Here is a simple pocket at 3.5 x 1.5 x 1 deep. All in inches as you didn't specify so be very careful!

    It is using a 0.25 inch cutter at 50% step-over with a spiral pattern to keep the calculations simple and easy to read for your question.

    All the text between parentheses are comments to help follow the flow).

    The cryptic looking codes are simple motion indicators such as:

    BFFM = BeforeFirstFeedMove or BLFM = BeforeLastFeedMode (if there are any)
    AFFM = AfterFirstFeedMove
    ...

    and so-forth

    Score points to post a note which direction the spiral is taking :-)

    Before you try it, run it in a simulator, then do an air cut.

    It has not been tested or run and is for educational reading only.

    No responsibility accepted for any breakages :-)
    Attached Files Attached Files

  7. #7
    Join Date
    Jan 2020
    Posts
    6
    Thank you very much! This is incredibly helpful information and I'll be having a go at it Monday! I look forward to letting you know my results..

    Thank you so much again!!

  8. #8
    Join Date
    Jan 2020
    Posts
    6
    Hey! I tested the code you gave me. All I had to change was G21 to G20 (G21 = MM G20 = IN) ((CORRECT ME IF I'M MISTAKEN)

    Also, do I have to convert anything else to inches? (Code wise)

  9. #9
    Join Date
    Jun 2018
    Posts
    362

    Re: g code help

    Quote Originally Posted by zachbarrett View Post
    Hey! I tested the code you gave me. All I had to change was G21 to G20 (G21 = MM G20 = IN) ((CORRECT ME IF I'M MISTAKEN)

    Also, do I have to convert anything else to inches? (Code wise)
    In theory, that should be all good to go. BEWARE the following considerations!

    The motion coordinate movements specify the distances in machine "units".

    If set to metric (G21 (mm)) then the movement is in mm. If set to G20 then they will be in inches.

    The parameters chosen were:

    Cutter: 0.25 Dia (or 0.125 radius) units
    X = 3.5 units
    Y = 1.5 units
    Z = 1.0 units

    Tool StepOver (for a pocket cut) = 50%
    DOC = 1 Unit (using 0.25 (or 25% of 1 Unit) for 4 cuts to get from surface to final DoC)

    Example:
    Check the calculation values of the Z DoC and see if they match the parameters:

    N170 G01 Z-0.250 F150.0 (plunge rate in units per minute BEWARE!)
    N200 G01 X0.625 Y0.875 Z-0.250 F2000.0
    N230 G01 X0.625 Y0.625 Z-0.250 F2000.0
    N510 G01 X3.375 Y1.375 Z-0.250 F2000.0


    N560 G01 Z-0.500 F150.0
    N590 G01 X0.625 Y0.875 Z-0.500 F2000.0
    N620 G01 X0.625 Y0.625 Z-0.500 F2000.0
    N900 G01 X3.375 Y1.375 Z-0.500 F2000.0


    N950 G01 Z-0.750 F150.0
    N980 G01 X0.625 Y0.875 Z-0.750 F2000.0
    N1010 G01 X0.625 Y0.625 Z-0.750 F2000.0
    N1290 G01 X3.375 Y1.375 Z-0.750 F2000.0


    N1340 G01 Z-1.000 F150.0
    N1370 G01 X0.625 Y0.875 Z-1.000 F2000.0
    N1400 G01 X0.625 Y0.625 Z-1.000 F2000.0
    N1680 G01 X3.375 Y1.375 Z-1.000 F2000.0

    Above we have 4 cuts at a depth of 25% of 1 unit per pass - looks right. For a mm metric depth, that's not much per cut but for inches it's probably too aggressive for a little machine.

    For the X and Y motions (and remember the tool diameter size was specified as 0.25 (Units) so) the radius should be 0.125 (start and end values should be + or - the radius measurement because it's an inside pocket cut within the X and Y limits).

    These values are omitted here as an exercise for the reader :-)

    BEWARE:

    The F value for cut speed of 2000 is also in UNITS so 2000 at ipm is scary fast! BEWARE of the F value for Z motion rate as well 150 imp is really fast for a plunge!

    The Z value DoC of 0.250 increments if in inches is about 6 mm which may well be too aggressive and break a bit REALLY easily! Especially at 2000 inches (units) per minute!!!

    BEWARE:

    SIMULATOR and then AIR CUT FIRST!

    Do we get to hear an "oops" comment? :-)

Posting Permissions

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