Free 186 More Best Homemade Tools eBook:  
New: 300+ fresh build posts/day from 275 forums → BuildThreads.com

User Tag List

Results 1 to 10 of 18

Thread: Using GOTO and IF-THEN-ELSE G-code Commands

Threaded View

  1. #9
    Supporting Member tonyfoale's Avatar
    Join Date
    Nov 2016
    Location
    Spain
    Posts
    1,822
    Thanks
    834
    Thanked 3,242 Times in 910 Posts

    tonyfoale's Tools
    Quote Originally Posted by marksbug View Post
    I dont understand why everything isant simple to program...why still G code stuff.....I sure would love to convert one of my mills to cnc but not if I gotta do the g code. these days I dont think my brain could stand the abuse.
    You have to have some means of transferring instructions to a machine and it is hard to imagine anything simpler than G-code. The stuff that Rick showed could be considered advanced and be a bit intimidating to non-programmers but you do not need to write code using those advanced features. Mostly you can just use the simple commands which reduce down to only two sets of commands. One, to go from where you are to where you want to be in a straight line, and two, to do the same on a circular path. e.g.

    G1 X20 moves in a straight line 20 units (usually inches or mm) in the X direction.
    G1 X15 Y10 Z5 moves the tool or work piece (depending on the machine type) in a coordinated fashion to the position (15, 10, 5)

    If the tool centre is at (0, 20) then either of the following will cut a path to (20, 0) on a clockwise circular arc
    G2 X20 Y0 I0 J0 (I and J are the absolute coordinates of the centre) or G2 X20 Y0 R20 (with R being the arc radius)

    I find it hard to imagine how you could transfer instructions much simpler than that. In any case many machinists do not manually write the G-code. CAM software takes a CAD drawing and spews out the G-code for you. I don't use CAD and so I either write the code manually or write my own software to generate the G-code for specific purposes. You can also do a lot of machining using wizards ( pre-written G-code often called "conversational").

  2. The Following User Says Thank You to tonyfoale For This Useful Post:

    emu roo (Dec 10, 2025)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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