Page 1 of 3 123 LastLast
Results 1 to 12 of 26

Thread: Writing Your Own GCode?

  1. #1
    Registered
    Join Date
    Jul 2011
    Location
    USA
    Posts
    20
    Downloads
    0
    Uploads
    0

    Default Writing Your Own GCode?

    I'd like to ask a few "survey" questions:

    1. How many people write their own GCode on a regular basis?

    2. Is it pretty simple stuff, or does it involve many lines of code?

    3. What editor do you use?

    4. What is your reason for doing it manually?

    Thanks

    Similar Threads:


  2. #2
    Registered Don Clement's Avatar
    Join Date
    Jan 2007
    Location
    Running Springs, California USA
    Posts
    1149
    Downloads
    0
    Uploads
    0

    Default

    It would be more effectual to ask who doesn't write their own G-code.



  3. #3
    Registered
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    12136
    Downloads
    0
    Uploads
    0

    Default

    'Survey' answers.

    1. I do.

    2. What do you call simple? The longest program has twelve tools, machines sixteen parts in four positions on a rotating fixture and uses thirty two work zeros. I don't know exactly how many lines of code but it was around 2000.

    3. Write them in Notepad and edit them on a Haas Simulator.

    4. Two reasons: I never learned how to do CAD/CAM and when I introduced CNC machines to my business CAM programs were nearly always slower running than hand coded programs when hand coding was possible. This becomes important when doing thousands of parts because even a difference of a minute in runtime can justify an extra 16 hours coding time per thousand parts machined.

    An open mind is a virtue...so long as all the common sense has not leaked out.


  4. #4
    Registered
    Join Date
    Aug 2011
    Location
    Sweden
    Posts
    8
    Downloads
    0
    Uploads
    0

    Arrow G-codes sucks.

    Yes I do bc my teatcher forces me to do it.
    The problem with G-coding is that it's a lousy way to create SW.
    As a former professional C-programmer I find the language incredibly primitive.
    Man is not supposed to remember what G00, G01, G02, M30 etc means because that is a job for a computer.
    So where is the assembler language?
    There is a macro language in the Fanuc Oi- controller but I haven't tried it yet.
    That gives you the opportunity to create loops and using symbolic variables, but that is also implemented in a very primitive way it seems.
    Maybe it's a topic here for that too?

    / Roger



  5. #5
    Registered
    Join Date
    Aug 2010
    Location
    US
    Posts
    28
    Downloads
    0
    Uploads
    0

    Default

    1. I write some from complete scratch. Most programs I do some form of editing between CAM and actual machining. Sometimes that is changing just a couple of things, others it is a lot. It is something you should be prepared to do.

    2. None of my programs developed from complete scratch have been very complicated and I would guess are less than 200 lines.

    3. Notepad or Wordpad.

    4. I do manually programming when the work seems fairly simple and I want to machine it a certain way. I am not a CAM Master, so I do what it takes to get it done. For instance, I needed to remove material from a round piece held horizontally in the rotary table. I use Sprutcam and at the time, didn't know how to do the indexing in Sprutcam to machine the four sides with each one being different. I knew how I wanted to do it, so I wrote it by hand for each side and added the 4th axis moves to index to each side. It didn't take long at all. It would have been a long time in Sprutcam, with editing needed anyway.



  6. #6
    Registered
    Join Date
    Jul 2011
    Location
    USA
    Posts
    20
    Downloads
    0
    Uploads
    0

    Default

    Geof - You're definitely in the advanced class of hand coding! I would say a simple program is less than 100 lines of actual GCode.

    RogerHq:
    My thoughts exactly. It is a crude language. The numbered codes are not descriptive, so they're hard to remember. A macro language would be nice. The problem with that is, it would have to kick out GCode to be run, and then you would still need to know the language when verifying/debugging the tool path. One more comment. I'd like to kick the clown that decided that parenthesis should be used for comments, and square brackets for operator precedence. Square brackets? Give me a break. The entire world uses parenthesis for operator precedence. At least they allowed the typical programming language double slash // for comments.

    Tbkahuna:
    I haven't gotten going with a CAM program, mainly because I'm just starting out. Everything I've done so far is simple 2.5D stuff. After researching CAM programs, I can see it might often be easier to hand code the simple stuff. Of course 3D is an entirely different story. I tried some of the wizards included with Mach3, but I find them very user unfriendly. I spent about 4 hours trying to figure out what some of the more obscure parameters do. I finally gave up, and wrote my own code in about 30 minutes.


    So far, 4 responses out of 45 views, which is about 10 percent. I suppose some number of those who "viewed" do write their own, but just didn't take the time to respond.



  7. #7
    Registered
    Join Date
    Jun 2007
    Location
    usa
    Posts
    143
    Downloads
    0
    Uploads
    0

    Default

    I am a model-maker or prototyper.

    I, generally, do NOT write G code. I can read, understand and modify it if necessary.
    Unlike the gent above that must conserve every minute of machine time, I rarely make more that 5 of anything. The 5 extra minutes of machine time is more than compensated by the efficiency of the CAM program producing the G code in minutes.

    As a matter of comment, G code was invented before C code. G code was implemented on very primitive controllers; think paper tape, teletypes and controllers with clock speeds less than 1 MHz (about 3000 times slower than the typical PC of today). I can understand your dislike for it RogerHg, but it is the foundation of CNC machines, you had better accept, understand and know it if you hope to be successful in your trade. You don't know the G codes? Keep a chart at your desk, one sheet of paper ought to do it. It takes a whole book for the C language. If you have that in your head, you ought to get the page of G codes memorized in no time :>}



  8. #8
    Registered Don Clement's Avatar
    Join Date
    Jan 2007
    Location
    Running Springs, California USA
    Posts
    1149
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by flyinchips View Post
    I am a model-maker or prototyper.

    I, generally, do NOT write G code. I can read, understand and modify it if necessary.
    Unlike the gent above that must conserve every minute of machine time, I rarely make more that 5 of anything. The 5 extra minutes of machine time is more than compensated by the efficiency of the CAM program producing the G code in minutes.

    As a matter of comment, G code was invented before C code. G code was implemented on very primitive controllers; think paper tape, teletypes and controllers with clock speeds less than 1 MHz (about 3000 times slower than the typical PC of today). I can understand your dislike for it RogerHg, but it is the foundation of CNC machines, you had better accept, understand and know it if you hope to be successful in your trade. You don't know the G codes? Keep a chart at your desk, one sheet of paper ought to do it. It takes a whole book for the C language. If you have that in your head, you ought to get the page of G codes memorized in no time :>}
    Hello world! I also programmed in C and think that G-code is primitive. I started programming with Blat IV Fortran back in 1972 on 80 column punch cards before C was widely used. Fortran on punch cards is more sophisticated than G-code but still primitive, not as primitive as writing assembly code for an 8008 microprocessor though. Remember the Adam Osborne books?

    I agree that a good CAM program (i.e. SprutCAM) is the way to go however one really does need to know G-code even when using CAM. It's like using NI LabView vs programming in C. One does not have to know C to program in LabView but it sure helps to program better.

    Don



  9. #9
    Registered
    Join Date
    Jul 2005
    Location
    Canada
    Posts
    12136
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by flyinchips View Post
    ...As a matter of comment, G code was invented before C code. G code was implemented on very primitive controllers; think paper tape, teletypes and controllers with clock speeds less than 1 MHz (about 3000 times slower than the typical PC of today)......
    This is what a lot of you young guys either overlook or are not aware off. NC machines predated personal computers and the G and M codes have been 'etched in stone' for a long time. It is somewhat analogous to the Qwerty/Dvorak keyboard situation. Dvorak is more efficient but how many people use them? Qwerty hangs on simply because it is the most common.

    An open mind is a virtue...so long as all the common sense has not leaked out.


  10. #10
    Registered
    Join Date
    Mar 2010
    Location
    USA
    Posts
    816
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by Money Pit View Post
    I'd like to ask a few "survey" questions:

    1. How many people write their own GCode on a regular basis?

    2. Is it pretty simple stuff, or does it involve many lines of code?

    3. What editor do you use?

    4. What is your reason for doing it manually?

    Thanks
    I don't. Mainly because I have been using CAD for almost 30 years and very comfortable drawing something in CAD and using to create the Gcode.


    That being said recently I have been doing tasks that I realize can benefit from writing my own Gcode. Just made 20 parts with a secondary opt that was simply two holes drilled on each side. A simple Gcode would have been quicker than manually moving the axis.. But I learned more about the MDI commands



  11. #11
    Registered
    Join Date
    Jul 2011
    Location
    USA
    Posts
    20
    Downloads
    0
    Uploads
    0

    Default

    For those of you using regular Windows Notepad, you should check out Notepad++. It's free, and you can find it at Notepad++ Home

    One of the really nice features is that you can create a User Defined Language, which is a way to highlight syntax. I've attached a sample GCode file that is highlighted by a UDL.

    Attached Thumbnails Attached Thumbnails -notepad-gif  


  12. #12
    Registered
    Join Date
    Apr 2010
    Location
    Singapore
    Posts
    228
    Downloads
    0
    Uploads
    0

    Default

    1. I very, very rarely write gcode.

    2. When I do write manual gcode it is usually to test something. The blocks might be complex, but there are very few of them.

    3. If I use an editor I use Textpad. It doesn't have any gcode specific features, I just like it.

    4. Like I said, my reason is to test something, or to learn something.

    I use Vectric's VCarve for 99.99% of my work. It does the gcode for me.



Page 1 of 3 123 LastLast

Posting Permissions

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


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