Free 186 More Best Homemade Tools eBook:  
Get tool plans

User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18

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

  1. #11
    Supporting Member marksbug's Avatar
    Join Date
    Apr 2016
    Posts
    1,940
    Thanks
    776
    Thanked 382 Times in 308 Posts
    I guess my brain needs to see it in "3d" on a good size screen when Im programing so i can see the finished part before I ever push start..it's been years since I did it, but only about 30 minutes of instruction from the boss and I was off programing without any issue..with a good print. a month lator I was programing the 3d milling and making stuff out of my head.I cant see any thing being easyer. I dont recall exzactly why he called it other than simple programing code ,but he said it was way faster and 4x eazer than "G" code. ,the older hardinge lathe was "G" code, I ran it some but didnt program it. I was the only one in the shop that could do the 3d programing for some reason. we only did a little of it for some mold injection dies.not needed for most stuff ,we only had 3-4 axis machines at that time.I dont know what he has now the small company with 5 employes at that time has grown to....around a hundred or more now. in 2 or 3 locations. I kinda wish i had kept up with him....it would be great to be on the "night crew"...I used to build a lot of stuff for his toys.never made squat for my self...well I did make 1 seal die for making a molded seal for a floor jack....what a waste of 30 min,it worked but...I bought a new aluminum floor jack a month lator,and never used that heavy steel one again. I wish I had patented or just marketed some of the stuff I made out of my head back them.like the swivel exhaust for the off shore race boats so they stop cracking the water jacketed ss exhaust they have.it worked great on his boat.them boats take a hell of a pounding and flex like hell.

    186 More Best Homemade Tools eBook

  2. #12
    Supporting Member MeJasonT's Avatar
    Join Date
    Jun 2016
    Location
    Lake District in UK
    Posts
    432
    Thanks
    456
    Thanked 281 Times in 163 Posts

    MeJasonT's Tools
    Thanks Rick,
    I found the level perfect for me, not quite a professional machinist yet but want to be. For some reason with the skills shortage they want me to be a snotty nosed teenager - go figure. I have some programming experience in C# and VB so if then statements etc make perfect sense. I have had colleagues in the past read my technical notes and complain about them being too complex. It really is a hard balance to find, anyone can find fault with anything if they try hard enough. I used to receive a lot of technical instructions for work with BP (British Petroleum - now Best in Performance as its no longer British) being asked to comment on the accuracy of the instruction. I cant believe how many Senior engineers couldn't write to save themselves. Double word entries, spelling mistakes really crap punctuation and that's without finding any error in the subject matter. They obviously needed their degrees and masters to be condescending and dumb. We were absolutely hammered one day about weather limits and when and if the job could go ahead - all documented in the Technical instruction. Unfortunately the whole section in the file had been left out, oops. Sorry rant over.

    The subject you have chosen to write about is something that fascinates me immensely. Using GRBL freeware as a machine controller with its limited command set leaves guys at the self build hobby level trying to find antiquated coding techniques to achieve results where the Gcode commands are limited. I find that learning Gcode from the ground up is something that should still be studied even though conversational and canned cycle code is now the norm. To understand what the machine is doing rather than not doing what you expect it to do is much better that having no clue at all. So to speak.

    I would like to call upon you to indulge us further with such coding mysteries, i have had no issue understanding all 3 iterations of your document.
    There are a few snippets of code i have found on the tinterweb to perform such functions as peck drilling, PCD's and auto seeking part zero's based on G0 & G1 moves only (GRBL code set being limited). Its hard to find basic coding techniques on the web which allows for complex canned operations to be carried out on hobby or self build machines. If you were to continue along those line with this thread then i would be much obliged. Particular code i'm looking for at the moment is to locate zero work coordinates based on circle centre.
    Found this guy and i'm currently trying it out.



    Sadly the only way i can try the code from your example is using Macros.
    still a good learning source.

    2,000+ Tool Plans
    Citizen of the "New democratic" Republic of Britain, liberated from the EuroNation

  3. #13
    Supporting Member rgsparber's Avatar
    Join Date
    Nov 2012
    Location
    Phoenix, AZ
    Posts
    1,321
    Thanks
    778
    Thanked 2,843 Times in 670 Posts

    rgsparber's Tools
    Quote Originally Posted by MeJasonT View Post
    Thanks Rick,
    I found the level perfect for me, not quite a professional machinist yet but want to be. For some reason with the skills shortage they want me to be a snotty nosed teenager - go figure. I have some programming experience in C# and VB so if then statements etc make perfect sense. I have had colleagues in the past read my technical notes and complain about them being too complex. It really is a hard balance to find, anyone can find fault with anything if they try hard enough. I used to receive a lot of technical instructions for work with BP (British Petroleum - now Best in Performance as its no longer British) being asked to comment on the accuracy of the instruction. I cant believe how many Senior engineers couldn't write to save themselves. Double word entries, spelling mistakes really crap punctuation and that's without finding any error in the subject matter. They obviously needed their degrees and masters to be condescending and dumb. We were absolutely hammered one day about weather limits and when and if the job could go ahead - all documented in the Technical instruction. Unfortunately the whole section in the file had been left out, oops. Sorry rant over.

    The subject you have chosen to write about is something that fascinates me immensely. Using GRBL freeware as a machine controller with its limited command set leaves guys at the self build hobby level trying to find antiquated coding techniques to achieve results where the Gcode commands are limited. I find that learning Gcode from the ground up is something that should still be studied even though conversational and canned cycle code is now the norm. To understand what the machine is doing rather than not doing what you expect it to do is much better that having no clue at all. So to speak.

    I would like to call upon you to indulge us further with such coding mysteries, i have had no issue understanding all 3 iterations of your document.
    There are a few snippets of code i have found on the tinterweb to perform such functions as peck drilling, PCD's and auto seeking part zero's based on G0 & G1 moves only (GRBL code set being limited). Its hard to find basic coding techniques on the web which allows for complex canned operations to be carried out on hobby or self build machines. If you were to continue along those line with this thread then i would be much obliged. Particular code i'm looking for at the moment is to locate zero work coordinates based on circle centre.
    Found this guy and i'm currently trying it out.



    Sadly the only way i can try the code from your example is using Macros.
    still a good learning source.
    Jason,

    As an author, I find that it is best to first have a clear vision of the intended audience. Then start writing. Nothing worse than an article or document that jumps around on level of detail. However, it is certainly an art form and not a science. One thing that helps is to structure documents similar to newspaper articles. Start out with the conclusion, then give the high level view. Continue to go into more and more detail until you are done. No need for any fancy ending.

    It is great that you are understanding the basics of G-code before dealing with machine generated files. You didn't mention your background, but having experience with manual machining is essential in understanding G-code and CNC.

    If you are interested, check out https://rick.sparber.org/ma.html#Mill for more on CNC.

    I have spent the last 10 years teaching engineering to "snotty nosed teenagers" (and older) at a local community college. They have taught me a lot during this time and it is also great fun.

    Rick
    Rick

  4. #14
    Supporting Member MeJasonT's Avatar
    Join Date
    Jun 2016
    Location
    Lake District in UK
    Posts
    432
    Thanks
    456
    Thanked 281 Times in 163 Posts

    MeJasonT's Tools
    Thanks Rick,
    I clicked on your website link and realised just how many of your articles i had looked at.
    Thank you for the advice on authoring, hopefully its something i will remember and refer back to.
    The opportunities for people across the pond are far superior to those in old blitey. Our local college no longer teaches engineering and electronics but uses a private company to do it instead, the only way to do courses now is to be an apprentice or have your employer send you. not possible to walk in off the street and do short courses any more. The College sold off the 1x Lyon CNC Miller (i've never heard of one either) and the 8 Craftsman lathes. To say i'm disappointed is an understatement. I often bump into the retired Machine shop instructor (Tony Britain), oddly enough at car boot sales.

    With regards my background,
    I started my studies in electronics, joined the Royal Navy - got stitched up by Drafty and ended up a marine engineering mechanic.
    I left the RN and started a career working with submersible vehicles (ROV's). There has been a few different jobs over the years but always an extension to my skills.
    Now working for myself, attempting to run a job shop and producing garden architectural pieces and sculpture. Kind of given up on working for others as they were to eager and to quick to write me off. I have an old Elliot milling machine which i have converted to a CNC, a self built CNC plasma table and an Imported lathe like the Grizzly model B which will not become CNC - it just goes round and round whats the point lol. I caught the bug when i built a 3D printer, with my knowledge of electronics the rest was child's play.

    My plan for the next 10 years is to become a humble middle aged machinist before i'm forced to retire, That plan is not going so well, companies, kids, skills shortage ha ha and nowhere to retrain. so fingers up at them and i will prove i can do it for myself. But still living in hope. I could always move out of the third world county which concentrates all its effort on becoming a theme park for tourists.
    Citizen of the "New democratic" Republic of Britain, liberated from the EuroNation

  5. #15
    Supporting Member MeJasonT's Avatar
    Join Date
    Jun 2016
    Location
    Lake District in UK
    Posts
    432
    Thanks
    456
    Thanked 281 Times in 163 Posts

    MeJasonT's Tools
    Rick
    Just popped out and snapped a couple of pictures for you

    Using GOTO and IF-THEN-ELSE G-code Commands-img_1649.jpg

    Using GOTO and IF-THEN-ELSE G-code Commands-img_1651.jpg

    My Electronics Shop, ROV pictured under bench on right.

    Using GOTO and IF-THEN-ELSE G-code Commands-img_1653.jpg

    And just to show your excellent instruction does reach the masses (please ignore the milky crap in the coolant reservoir)

    Using GOTO and IF-THEN-ELSE G-code Commands-img_1650.jpg
    Citizen of the "New democratic" Republic of Britain, liberated from the EuroNation

  6. #16
    Supporting Member
    Join Date
    Aug 2020
    Posts
    236
    Thanks
    3
    Thanked 25 Times in 22 Posts
    Looks complicated. I grew up in a machine shop and during that time CNC came along. First with punch tapes, and progressed from there. But i was always involved with the second operations that CNC couldn't do at the time. Lately I have entertained the notion of a CNC router, but it's all the programming that has kept me from it. But keep up the good work.

  7. #17
    Supporting Member rgsparber's Avatar
    Join Date
    Nov 2012
    Location
    Phoenix, AZ
    Posts
    1,321
    Thanks
    778
    Thanked 2,843 Times in 670 Posts

    rgsparber's Tools
    It looks complicated because G-code is a very primitive programming language. In something like C++ it would be a few lines.
    Rick

  8. #18
    Supporting Member
    Join Date
    Sep 2020
    Posts
    74
    Thanks
    85
    Thanked 21 Times in 15 Posts
    I recently aquired a CNC router/engraver for my "retirement" fun. I have not set it up yet but I have downloaded your information for future use. CNC has been on my bucket list for a long time and perhaps your post will help me along? Thank You!



    2,000+ Tool Plans

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
  •