587,696 active members*
3,427 visitors online*
Register for free
Login
Results 1 to 11 of 11
  1. #1
    Join Date
    Jun 2009
    Posts
    5

    First time with G code :(

    Hi
    Few days ago I started with learning some G code - but really basic one.
    I tried to programmed it for the letter ''P'' and I came to this:

    N10 #120=500
    N20 G0 X75 Y0
    N25 G1 X75 Y35 F#120
    N30 G1 X89.639
    N35 G1 X95.844 Y30.642
    N40 G1 X95.844 Y19.356
    N45 G1 X90.011 Y16.0
    N50 G1 X74.994

    So far I belive this is ok. Now I have the task to do something similar but for the letter "N". The problem is because I have several requirements given:
    - the code has to be given (?) on the following sketch: HERE
    I have absolutelly no idea what is this and how to use this sketch
    - commands that can be used are G0, G1 and M30
    - depth of process is 0,2mm
    - starting point is at the bottom left corner
    - area of material Z=0
    - process is towards -X (negative) where X is almost whichever number (and not towards +X positive)
    - speed of process is 100 mm/min
    - dimension of the square aare 50x50 mm

    I think I could do the program code for ''N'' letter without any requirements but those requirements (already the first one) confused me a lot.
    So if anyone is willing to help to create this G code, I would appreciate it.

    Thank you.

  2. #2
    Join Date
    May 2007
    Posts
    781
    Looked at your sketch, I cannot find a letter N in there anyplace. Got no idea what you are asking for.

    Your code for the letter P.
    Just a word of warning for many controls using (X75) when you really want (X75.0) will result in a less then desirable outcome.

    They read X75 to be 75 steps at the machines smallest step size.


    You can get by with just (X75.) but I do not like to have a decimal point hanging off the beginning or end of a number.
    I had some collage chem and physics instructors who would scrap your entire paper if they seen too many hanging decimal points, too easily confused with a sentance ending period.
    Attached Thumbnails Attached Thumbnails Char P 1.PNG   Char P 2.PNG  

  3. #3
    Join Date
    Jun 2009
    Posts
    5
    There is no ''N'' inside the sketch. I just need to create a G code that will make a letter ''N'' (inside the square with starting point at the bottom left corner). I was able to do it for ''P'' because there was no requirements. All those requirements that are for the letter ''N'' confuse me. I have no idea how to use the data, for example, depth of process is 0,2mm (and others that I typed in my first post), in the programming code.

  4. #4
    Join Date
    Oct 2005
    Posts
    1237
    If it wasn't for the sketch, Id think you wanted us to do your school assignment.

    With a starting point of bottom left, and a need for the "N" to be in -X, the "N" won't even be on the part.

    Depth of process merely refers to depth of cut. So your cutter would cut at -Z.2 (I'm assuming the "," is really a decimal point sign.)

    Area of Z material means your Z surface height is at 0.0 on the Z plane.

    What exactly ae you doing. Could we have more info?

  5. #5
    Join Date
    Jun 2009
    Posts
    5
    With -X I meant that ''N'' needs to be INSIDE surface of the material which is in a shape of square. Depth (how ''far'' inside the material should be) is 0,2mm. If you meant how big ''N'' should be, it can be on the whole surface of this square.
    Here is another sketch that I make, just for example: CLICK
    With it, I hope I will be better understandable. As you can see on this second sketch starting point of ''N'' on purpose isn't really at the bottom left corner otherwise half of the square wouldn't be visible.
    I have never programmed any G code. The ''P'' letter was the first time ever. So don't know how to use parameters as 100 mm/min.

  6. #6
    Join Date
    Oct 2005
    Posts
    1237
    If the corner of your material is "0,0" (0.0 in X and 0.0 in Y, plus 0.0 in Z) you would need to step over enough for the tool diameter so you are cutting the block when you start.

    One thing you NEED to stop doing is using a comma "," instead of a decimal point when talking depth. It is NOT 0,2. This will give you errors. It is and can only be 0.2

    Lets assume some things for ease of understanding

    Your cutter diameter is 2mm.

    Your feed is 100mm per minute

    Your rapids are whatever the machine will do. Means G0 will go as fast as the machine can go.

    N10 G0 X20 Y20 (puts your cutter over part and gives a 10mm edge)
    N15 Z10 (rapidly lowers Z to 10mm over part)
    N20 G1 Z-.2 F100 (feeds Z to "process depth)
    N25 Y200 (moves cutter in Y for first leg of "N")
    N30 X150 Y20 (moves cutter on the diagonal line)
    N35 Y200 (moves cutter for last vertical line)
    N40 G0 Z200 (raises Z at rapid speed)

    This code will make an "N" but will not fit in your block dimensions. You can play around with the numbers to do that.

    G0 and G1 are model and do not get repeated one set to rapid or feed. Only to change model state so you don't need G before every feed move or G0 for every rapid if the control is already in that model state.

  7. #7
    Join Date
    Jun 2009
    Posts
    5
    Thank you. So if I understand correctly, the lines where there is NO ''G'' (2., 4., 5. and 6.) means that the tool will move and won't cut any piece of material? but just replace one position (end point of current step) to another position (starting point of next step)? You forgot about M30 command.

  8. #8
    Join Date
    Oct 2005
    Posts
    1237
    No, it means the tool will move at the LAST modal change (sorry, I spelled it wrong.) A MODAL change, changes how the machine (tool) moves. If you have G0, then ALL moves after the G0 will be in rapid. You DO NOT need to write "G0" before every line.

    HOWEVER, when you want to slow down and machine, you change the "G0" to "G1". All your moves will be machine feed rate AFTER the G1 at the feed rate you set. This is the same as writing G1 before every move.

    Think of modal moves as family groups. If you specify a G0 family, then all moves after the G0 will be rapid moves UNTIL you change the family to G1. Then all moves will be in the G1 family and move at the feed rate you set.

    A special note on feed rates. If you do not give a "F" at the end of your G1 line at the beginning of the G1 moves, your control may just sit there and tell you it has no feed rate set. In this case it just sits there leaving you scratch your head wondering what is wrong.

    Line "N20" gives G1, lists a position, and then says, "F100". This means the cutter will move at 100mm per minute. From this point on all G1 moves will travel at 100m per minute until you change the feed rate speed with another "F" command at the end of your line of code.

  9. #9
    Join Date
    Jun 2009
    Posts
    5
    Hmmm sounds complicated. Thank you for your time for me MrWild. Hope I will be able to do this task now.

  10. #10
    Join Date
    Oct 2005
    Posts
    1237
    Your welcome. It isn't real complicated, but rather involved. I went to the local tech college bookstore and got one of the text books for G-code programing. It wasn't cheap, but it did a good job explaining every step.

  11. #11
    Join Date
    Feb 2006
    Posts
    338
    To clarify/simplify what MrWild was saying
    Colored text is not required because they are modal. Once set the control assumes that is what you mean, so they can be omitted.
    Sorry for the ugly colors.

    N10 G0 X20 Y20 (puts your cutter over part and gives a 10mm edge)
    N15 G0 Z10 (rapidly lowers Z to 10mm over part)
    N20 G1 Z-.2 F100 (feeds Z to "process depth)
    N25 G1 Y200 F100 (moves cutter in Y for first leg of "N")
    N30 G1 X150 Y20 F100 (moves cutter on the diagonal line)
    N35 G1 Y200 F100 (moves cutter for last vertical line)
    N40 G0 Z200 (raises Z at rapid speed)

    This will do the same as MrWild posted, but as programs get more complex it makes it harder to read and edit. The best programming is usually using only what you need.

Similar Threads

  1. Replies: 8
    Last Post: 12-15-2010, 09:32 PM
  2. calculate machining time from G-Code
    By smar in forum G-Code Programing
    Replies: 15
    Last Post: 02-23-2009, 11:06 PM
  3. milling time (not to be confused with hammer time)
    By barefoot0 in forum G-Code Programing
    Replies: 4
    Last Post: 05-03-2007, 12:18 AM
  4. X2 Conversion Time (shopping time)
    By Micro Rotors in forum Benchtop Machines
    Replies: 2
    Last Post: 03-04-2007, 06:11 PM

Posting Permissions

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