Newbie Help me pls.CNC- G-code, where's the problem? - Page 2


Page 2 of 3 FirstFirst 123 LastLast
Results 21 to 40 of 49

Thread: Help me pls.CNC- G-code, where's the problem?

  1. #21
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24216
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by mactec54 View Post
    Some controls require the G statement, even though they are Modal.
    Which control ????

    If Modal, means they do not need repeating!
    If they do, they are not standard.

    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  2. #22
    Member routalot's Avatar
    Join Date
    Dec 2003
    Posts
    1206
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Anybody else notice that the first move would be a rapid to the UNDERSIDE of the job?Not a good idea in anybody's book.For goodness sake don't try to run any program until we have seen the first few lines of code.

    Pick a system of units and stick with it and make sure the post processor that is selected from the huge range is the right one for those units.You won't be the first one to try to send a machine to a point yards outside it's physical limits because of picking the wrong one but you have been warned about it.

    Importantly,set a safe height at a height equal to the workpiece plus a bit because your 1/8" could well be referenced from the part datum at the bottom.Which will lead to gouging through the piece if it actually is configured like this.

    A few diagrams will help us get to the root of the problem.



  3. #23
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24216
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by mactec54 View Post
    Some controls require the G statement, even though they are Modal.
    Seems it does not apply here anyway.
    If the system in the OP is anything to go by.
    Per International standard ISO 6983

    Attached Thumbnails Attached Thumbnails Help me pls.CNC- G-code, where's the problem?-grbl-jpg  
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  4. #24
    Member
    Join Date
    Jan 2018
    Location
    United Kingdom
    Posts
    1516
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by mactec54 View Post
    Read the code a G21 is metric
    Still schooling me.
    Never had to pay attention to it.



  5. #25
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by Al_The_Man View Post
    Which control ????

    If Modal, means they do not need repeating!
    If they do, they are not standard.
    Most international standards Use the G statement in every line, commercial and Hobby controls, it's just a thing they do, UCCNC used to be like this, another one Eding CNC also.

    It's not really a big deal, it a simple change in the Post Processor

    Mactec54


  6. #26
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by routalot View Post
    Anybody else notice that the first move would be a rapid to the UNDERSIDE of the job?Not a good idea in anybody's book.For goodness sake don't try to run any program until we have seen the first few lines of code.
    Your glasses must be fogged up, the first Z move is up not down, no matter how you look at it.

    Quote Originally Posted by routalot View Post
    Importantly, set a safe height at a height equal to the workpiece plus a bit because your 1/8" could well be referenced from the part datum at the bottom.Which will lead to gouging through the piece if it actually is configured like this.
    He set his tool to the top of the work, so no chance of this happening.

    Quote Originally Posted by routalot View Post
    Anybody few diagrams will help us get to the root of the problem.
    It's as simple as looking at the program code, nothing more to it, no diagrams needed, the program code tells you every move, so you can make your own drawing of what he is trying to do.

    Mactec54


  7. #27
    Member machinehop5's Avatar
    Join Date
    Aug 2009
    Location
    United States
    Posts
    1566
    Downloads
    5
    Uploads
    2

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by mactec54 View Post
    It's not really a big deal, it a simple change in the Post Processor
    ...the Easy button dont panic



  8. #28
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by lshingleton View Post
    Ya for a machine you dont know and talking to a man with 35 yrs progamming cnc's of every type !!!
    First try and home the machine
    2nd see how it picks up offsetts if it even does as some dont
    Maybe try and help this man get the machine just moving about and changing stuff he can understand and make his own observastions
    Well then you should know you don't use a G00 with a G28 a G28 is already a rapid move all by itself it is used in more than one different way. this is just 2 examples of how it should be used

    You also would never do a G00G54X0Y0Z0. this is what someone new to CNC programming would do, not someone with 35 years' experience.

    G91G28Z0
    G91G28X0Y0

    G90G28Z0
    G90G28X0Y0

    Mactec54


  9. #29
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by dazp1976 View Post
    Still schooling me.
    Never had to pay attention to it.
    You are getting there.

    Mactec54


  10. #30
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by machinehop5 View Post
    ...the Easy button dont panic
    With the control and software, he is using it is very basic to make a change to suit what the G-Code format needs to be for his control.

    Mactec54


  11. #31
    Member routalot's Avatar
    Join Date
    Dec 2003
    Posts
    1206
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by mactec54 View Post
    Your glasses must be fogged up, the first Z move is up not down, no matter how you look at it.



    He set his tool to the top of the work, so no chance of this happening.



    It's as simple as looking at the program code, nothing more to it, no diagrams needed, the program code tells you every move, so you can make your own drawing of what he is trying to do.
    I don't know if you are quite as bombastic in person and when sober.We have a newbie who is mixing up absolute and incremental programming,creating in a mixture of metric and imperial and using a controller which from it's own website seems to use the parked position of the machine as a home position.If we don't have a clear idea of what he believes he has done and what it might have led to,it will be hard to overcome any misapprehensions he/she may have.Which is why a diagram would ensure we all see the same things and from which we might devise a solution.



  12. #32
    Member machinehop5's Avatar
    Join Date
    Aug 2009
    Location
    United States
    Posts
    1566
    Downloads
    5
    Uploads
    2

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by missgeneralidea View Post
    jog your bit to the low left corner and set the "zeros" in x,y,z on the controller. Would that temporary store the program origin to set your work coordinates? Would this adjust the G54 settings. I tried changing my coordinates G10 P0 L20 X0 and nothing happened. I guess I don't understand how to change this correclty.

    Could you explain this to me like I am 5? AT homing my $# = [G54:0.000,25.400,-13.000]
    ...you were close. the format would look like this G10L20P1X0Y0Z0 (P1 is Work Offset storage for G54) maybe this will help explain Work Coordinates G54-G59 Linuxcnc works the same way as UGS most likely.
    https://linuxcnc.org/docs/html/gcode...#gcode:g10-l20

    https://linuxcnc.org/docs/2.5/html/g...rdinate-system



  13. #33
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    24216
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by mactec54 View Post
    Most international standards Use the G statement in every line, commercial and Hobby controls, it's just a thing they do, UCCNC used to be like this, another one Eding CNC also.
    Of all the Industrial controls I have worked with conform to the ISO standard.
    In many decades I have never come across any system that did not conform.
    You must operate in a different sphere !

    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  14. #34
    Member joejoemoejoe's Avatar
    Join Date
    Jan 2022
    Posts
    3
    Downloads
    0
    Uploads
    0

    Default

    [QUOTE=missgeneralidea;2491530]Hi,
    Most of the replies so far make a lot of assumptions about your understanding of the processes you need to know. Although I’m no expert, I’ll try to make a beginner’s step-by-step checklist.

    1. Know what units your CAD design uses, Imperial (inches) or Metric (mm) This is in your CAD software. Your CAM software settings should match. If your software is a CAD/CAM package, make sure the CAM setup matches the design.

    2. Check that your CNC controller firmware is properly configured. You should be able to see and change the configuration settings or firmware settings by typing commands in the console panel of the UNIVERSAL GCODE SENDER. Within the control board firmware, you can set defaults such as units, flatbed XYZ limits and a host of other settings. Your machine or controller documentation should explain how to read and change all of the settings.

    3. In CAD go through and understand the job setup parameters. The most important are:
    a. Raw stock dimensions and margins or offsets. Margins/ offsets tells the machine the location of the part within the stock. Make sure there is at least enough margin to accommodate the tool diameter. If you don’t, the tool will likely go up against the physical limits of your machine and stall it out or crash the Gcode. There should also be clearance settings to accommodate hold downs and fixtures.
    b. XY zero location. This establishes where The starting point will be. Some people prefer bottom left and others use center of workpiece. It just depends on a number of factors like workpiece mounting, repeatability, multiples of the same part and other factors.
    c. Define where you want to set the Z zero point. Most of the time you will want that to be the top surface of the stock but other options are top of the table or center of the stock.
    d. Go through the other setups such as tooling, speeds and feeds, type of operation and so on.

    5. Check and select your Post Processor. This is the version or dialect of Gcode you need that is compatible with your machine. Most commercial software comes preloaded with a bunch of different industrial machines and many of the most popular hobbyist or desktop machines. Many of these have proprietary or specialized versions of the Gcode language. If your machine is not listed use Generic or GRBL. Generate your toolpaths (Gcode).

    5. Most CAD/CAM software packages have built in simulators. Test your Gcode to make sure it’s doing what you intend. There are also free Gcode simulators out there. Make sure the tool starting point is where you want it. This might be shown as a triad of arrows or representation of the tool.

    6. Home your machine via UGS. This should send the tool to the XY zero point (usually bottom left) and the Z uppermost limit of your machine.

    7. Jog the tool down until it just touches the top of the workpiece.

    8. In UGS click on the “Zero Machine” button. This sends a G54 code to the controller and tells the controller “This is the starting point. Everything after this is referenced off of this point.” UGS should show XYZ all set to zero.

    A few other notes:
    G90 vs G91:
    G90 is Zero referenced which means all subsequent XYZ moves are referenced off of the machine starting point of X0, Y0, Z0. X10 means the tool will go to a position 10” from X0. The next X move to X12 means go to a position 12” from X0.

    G91 is additive. It tells the controller that all subsequent moves will be the distance from the previous move. So, if starting from X0, X10 means go to 10” from X0. With the next X move, say X12, the machine will go another 12” which will be 22” from X0.

    G20 and G21: This tells the machine that all subsequent moves will be in inches (G20) or in mm (G21). G20 X2 moves the tool 2”. G21 X2 moves it 2mm. If you see G21 and your design is in inches, go back and check your CAM setup.

    Z10 vs Z-10: Z10 moves the tool up 10” or 10mm depending on your setup. Z-10 move it down 10” or 10mm. If your first Z move doesn’t make sense, your machine zero is wrong. Go back to step 7 and establish your machine zero.

    I hope this helps.



  15. #35
    Member missgeneralidea's Avatar
    Join Date
    Jan 2022
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by mactec54 View Post
    No do not use a G91 anywhere Just use your program Using a G91 will mess things up.

    So, Home your Machine, move X & Y axes to where you want to start the work piece, look in your work off set page and G54 save the X & Y position Z should be ( 0 ) do not change or set the Z axis at this point

    Now move the Z Axis to touch of the tool to the top of your part, open Tool Offset page, look for Tool T1 and save this setting there move you tool up and you should be ready to run your program

    Like this

    G17G40G80
    G21
    T1M6
    G54 ( X---- Y----- Saved Position from Home)
    S10000M3
    G90G0X0.000Y0.000
    G43Z3.H1 ( G43 where your Tool offset is saved this will move the Tool too 3mm above the part ) ( H1= Tool 1 )

    Your cut program here.
    Thanks. I've reworked the G-code file and still have a few problems but not as many as before. I think, I had multiple set-up worng, First, I reconfigured all my settings to match my post-processor. They all work in metric now. This seems to have elimated the error. I also set up a few of the tools that I will be testing and the file seems to be running. I am currently air running a job as I type. It looks fine except that I could probably increase the speed but I dont know how to do that yet and afraid of jumping seteps. I do think I will need to change from using USG. There seems to be loads o problems when I upload the new file, for example, it doesn't reconginze T1M6 and I have to run the file from the following line. I'm also not able to use the console command keys when the machine is running which I think is strange since I would assume you could run G-code commands like '!' or '?" incase something goes wrong. I'll look into LinuxCNC and try this program.

    Thank you again. I appreciete your support while I am learning!



  16. #36
    Member missgeneralidea's Avatar
    Join Date
    Jan 2022
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    I think the main issue is me being a newbie and mixing up everything. I think using metric helped and the positioning now works once it's set above the material. I'm still a bit confused, but I guess this is huge learning curve.

    this is my current code for some text:

    T1
    G17
    G0Z12.700
    G0X0.000Y0.000S12000M3
    G0X10.214Y13.611Z3.175
    G0Z0.000
    G1Z-3.175F1200.0
    G1X10.244Y13.204F3600.0



  17. #37
    Member missgeneralidea's Avatar
    Join Date
    Jan 2022
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    [QUOTE=joejoemoejoe;2491792]
    Quote Originally Posted by missgeneralidea View Post
    Hi,
    Most of the replies so far make a lot of assumptions about your understanding of the processes you need to know. Although I’m no expert, I’ll try to make a beginner’s step-by-step checklist.

    1. Know what units your CAD design uses, Imperial (inches) or Metric (mm) This is in your CAD software. Your CAM software settings should match. If your software is a CAD/CAM package, make sure the CAM setup matches the design.

    2. Check that your CNC controller firmware is properly configured. You should be able to see and change the configuration settings or firmware settings by typing commands in the console panel of the UNIVERSAL GCODE SENDER. Within the control board firmware, you can set defaults such as units, flatbed XYZ limits and a host of other settings. Your machine or controller documentation should explain how to read and change all of the settings.

    3. In CAD go through and understand the job setup parameters. The most important are:
    a. Raw stock dimensions and margins or offsets. Margins/ offsets tells the machine the location of the part within the stock. Make sure there is at least enough margin to accommodate the tool diameter. If you don’t, the tool will likely go up against the physical limits of your machine and stall it out or crash the Gcode. There should also be clearance settings to accommodate hold downs and fixtures.
    b. XY zero location. This establishes where The starting point will be. Some people prefer bottom left and others use center of workpiece. It just depends on a number of factors like workpiece mounting, repeatability, multiples of the same part and other factors.
    c. Define where you want to set the Z zero point. Most of the time you will want that to be the top surface of the stock but other options are top of the table or center of the stock.
    d. Go through the other setups such as tooling, speeds and feeds, type of operation and so on.

    5. Check and select your Post Processor. This is the version or dialect of Gcode you need that is compatible with your machine. Most commercial software comes preloaded with a bunch of different industrial machines and many of the most popular hobbyist or desktop machines. Many of these have proprietary or specialized versions of the Gcode language. If your machine is not listed use Generic or GRBL. Generate your toolpaths (Gcode).

    5. Most CAD/CAM software packages have built in simulators. Test your Gcode to make sure it’s doing what you intend. There are also free Gcode simulators out there. Make sure the tool starting point is where you want it. This might be shown as a triad of arrows or representation of the tool.

    6. Home your machine via UGS. This should send the tool to the XY zero point (usually bottom left) and the Z uppermost limit of your machine.

    7. Jog the tool down until it just touches the top of the workpiece.

    8. In UGS click on the “Zero Machine” button. This sends a G54 code to the controller and tells the controller “This is the starting point. Everything after this is referenced off of this point.” UGS should show XYZ all set to zero.

    A few other notes:
    G90 vs G91:
    G90 is Zero referenced which means all subsequent XYZ moves are referenced off of the machine starting point of X0, Y0, Z0. X10 means the tool will go to a position 10” from X0. The next X move to X12 means go to a position 12” from X0.

    G91 is additive. It tells the controller that all subsequent moves will be the distance from the previous move. So, if starting from X0, X10 means go to 10” from X0. With the next X move, say X12, the machine will go another 12” which will be 22” from X0.

    G20 and G21: This tells the machine that all subsequent moves will be in inches (G20) or in mm (G21). G20 X2 moves the tool 2”. G21 X2 moves it 2mm. If you see G21 and your design is in inches, go back and check your CAM setup.

    Z10 vs Z-10: Z10 moves the tool up 10” or 10mm depending on your setup. Z-10 move it down 10” or 10mm. If your first Z move doesn’t make sense, your machine zero is wrong. Go back to step 7 and establish your machine zero.

    I hope this helps.
    Joejoemoejoe!!! Thank you for this step by step. Super clear and helpful! I got most of the steps correct except for the measurements, I am now only working in mm becauase USG seems to have that preference. I may try Linux CNC because I am finding USG runs many errors. Unfortunatly, I bought a desktop milling machine (dremmel) that has no support. A mistake I won't do again. Community, like this one is super important. I think what I did wrong as well was using the default tool measurements to run the program. After I adjusted my design setting for both the tool and metric, the files are sending the correct coordinates.

    I'm printing out your notes to reference again. I'm going to be cutting in foam at some point today and I hope everything works!

    Thank you @joejoejoemoejoe



  18. #38
    Member joejoemoejoe's Avatar
    Join Date
    Jan 2022
    Posts
    3
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    I started using UGS only recently and have found it to be much easier and more reliable than what I was using before. If you haven't already, go through the setup wizard. It's under the "Machine" tab of the app window's top menu. You can also change your units on the "State" tab in the left pane.



  19. #39
    Member missgeneralidea's Avatar
    Join Date
    Jan 2022
    Posts
    13
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by joejoemoejoe View Post
    I started using UGS only recently and have found it to be much easier and more reliable than what I was using before. If you haven't already, go through the setup wizard. It's under the "Machine" tab of the app window's top menu. You can also change your units on the "State" tab in the left pane.
    Thanks! I have gone through the set-up wizard and some online videos. I find a few things challenging. I'm not sure why when I run a program, everthing gets greyed out. You would think you could write commands in the console but you can't in USG (from what I know). Also, I'm not sure how you can run from this line when a program fails. I was air running the prgram right now (without the dremmel on) and it as working fine untill I decide to turn on the dremmel while running to see what would happen. The system alarm went on right away (without touching anything). I wanted to see if I could resume the job at the last position and found USG not allowing me to 1.) find the last line 2.) enter anything in the console.

    I'm now going to write another thread to see if someone can help with some issues in GRBL, G-code and USG.

    What a learning curve!!! @joejoemoejoe



  20. #40
    Member mactec54's Avatar
    Join Date
    Jan 2005
    Location
    USA
    Posts
    15362
    Downloads
    0
    Uploads
    0

    Default Re: Help me pls.CNC- G-code, where's the problem?

    Quote Originally Posted by missgeneralidea View Post
    Thanks! I have gone through the set-up wizard and some online videos. I find a few things challenging. I'm not sure why when I run a program, everthing gets greyed out. You would think you could write commands in the console but you can't in USG (from what I know). Also, I'm not sure how you can run from this line when a program fails. I was air running the prgram right now (without the dremmel on) and it as working fine untill I decide to turn on the dremmel while running to see what would happen. The system alarm went on right away (without touching anything). I wanted to see if I could resume the job at the last position and found USG not allowing me to 1.) find the last line 2.) enter anything in the console.

    I'm now going to write another thread to see if someone can help with some issues in GRBL, G-code and USG.

    What a learning curve!!! @joejoemoejoe
    So, the Dremel killed your control because of EMI noise, Dremel's create a lot if electrical interference, not sure how you could get around that with a Dremel as it does not have an electrical Ground.

    Mactec54


Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

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 for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Help me pls.CNC- G-code, where's the problem?

Help me pls.CNC- G-code, where's the problem?