585,708 active members*
3,857 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > Help me pls.CNC- G-code, where's the problem?
Page 1 of 3 123
Results 1 to 20 of 49
  1. #1

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

    Hi,

    I'm not sure what I am going wrong.
    Here are some details of my set-up. I am using a desktop dremmel cnc (whittle cnc) that runs on Universal G-code Sender(USG )platform 2.0, grbl 0.9
    My design was made in Rhino (vectors only) then sent to Vetric aspire 9.5 to make my toolpaths and simulation the cuts for me before sending it to USG.

    Now, since this is my first go, I'm zero-ing out the machine the top of the material and once it starts running the g-code (it's a basic rectangle) and there is over 5k kines, I think it's a bit much.
    it automatcally hits my Z limits. I'm not sure where the error is, is it in the CAM program of the controller program? I believe all my homing is set correctly.
    Does the controller program override any g-code commands over the cam g-code?

    Here are my first lines

    T1
    G17
    G21
    G90
    G0Z20.320
    G0X0.000Y0.000
    S10000M3

    when I home (after i set the tool on the material surface), I enter G91 to be safe and ask the machine to start at the tool position. The cnc then hits my Z+ limit switches and crashes at S10000M3,
    I get an alarm message and the error S10000M3.
    I don't know where the problem is located, I believe is cause my G0Z20.320, but this was automatically set up in aspire, code this because the tool I selected is incorrect? It's litterally a rectange with a cut depth total 1'' and several pass at 1/8th, and their is over 5k lines of G-code. I'm not sure where I am going wrong, which program?
    Also, in source code editor do the colours of the code mean anything?
    Blue, Green, Purple?
    Any suggestions?


    See below for error message reports from USG

    java.lang.NullPointerException
    at com.willwinder.universalgcodesender.model.GUIBacke nd.canSend(GUIBackend.java:662)
    at com.willwinder.ugs.nbp.core.actions.StartAction.is Enabled(StartAction.java:75)
    at com.willwinder.ugs.nbp.core.actions.StartAction.la mbda$UGSEvent$0(StartAction.java:70)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknow n Source)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessI mpl.doIntersectionPrivilege(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
    [catch] at org.netbeans.core.TimableEventQueue.dispatchEvent( TimableEventQueue.java:136)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)

  2. #2
    Join Date
    Jan 2005
    Posts
    15362

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

    Quote Originally Posted by missgeneralidea View Post
    Hi,

    I'm not sure what I am going wrong.
    Here are some details of my set-up. I am using a desktop dremmel cnc (whittle cnc) that runs on Universal G-code Sender(USG )platform 2.0, grbl 0.9
    My design was made in Rhino (vectors only) then sent to Vetric aspire 9.5 to make my toolpaths and simulation the cuts for me before sending it to USG.

    Now, since this is my first go, I'm zero-ing out the machine the top of the material and once it starts running the g-code (it's a basic rectangle) and there is over 5k kines, I think it's a bit much.
    it automatcally hits my Z limits. I'm not sure where the error is, is it in the CAM program of the controller program? I believe all my homing is set correctly.
    Does the controller program override any g-code commands over the cam g-code?

    Here are my first lines

    T1
    G17
    G21
    G90
    G0Z20.320
    G0X0.000Y0.000
    S10000M3

    when I home (after i set the tool on the material surface), I enter G91 to be safe and ask the machine to start at the tool position. The cnc then hits my Z+ limit switches and crashes at S10000M3,
    I get an alarm message and the error S10000M3.
    I don't know where the problem is located, I believe is cause my G0Z20.320, but this was automatically set up in aspire, code this because the tool I selected is incorrect? It's litterally a rectange with a cut depth total 1'' and several pass at 1/8th, and their is over 5k lines of G-code. I'm not sure where I am going wrong, which program?
    Also, in source code editor do the colours of the code mean anything?
    Blue, Green, Purple?
    Any suggestions?


    See below for error message reports from USG

    java.lang.NullPointerException
    at com.willwinder.universalgcodesender.model.GUIBacke nd.canSend(GUIBackend.java:662)
    at com.willwinder.ugs.nbp.core.actions.StartAction.is Enabled(StartAction.java:75)
    at com.willwinder.ugs.nbp.core.actions.StartAction.la mbda$UGSEvent$0(StartAction.java:70)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.desktop/java.awt.EventQueue$4.run(Unknown Source)
    at java.base/java.security.AccessController.doPrivileged(Unknow n Source)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessI mpl.doIntersectionPrivilege(Unknown Source)
    at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
    [catch] at org.netbeans.core.TimableEventQueue.dispatchEvent( TimableEventQueue.java:136)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
    You should never need to use a G91, using this could cause a crash, you have a G90 in your program

    G0Z20.320 will move the Z axis up, all down movement for the Tool need to be a Negative move Z-, from wherever you have set the Tool ( Z0.00 ) so you could have other things wrong.

    You could try M3S10000 but both ways should work.
    Mactec54

  3. #3
    Join Date
    Dec 2003
    Posts
    1216

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

    First thing that comes to mind is that the program should simulate correctly in Aspire.It its doing so correctly,the problem isn't the program,although I am a bit bemused by the mention of 5K lines of Gcode for a rectangle.Would I be correct in guessing that you may have ticked the box for a ramp entry?What looks more likely is that you don't have a G54 anywhere in the program header and by homing the machine,it may be trying to move from a home position it believes to be 0,0,0 to a position with a Z value 20.320 above such a point.Obviously it would run out of travel before it reaches that point.

    I don't know much about UGS beyond the fact that I found it more difficult to install than I really wanted a hobby system to be and so chose LinuxCNC for my hobby machine.So please take this into account before doing anything rash.Were you using the correct post processor for UGS?It isn't unknown for somebody new to the world of CNC to select a post processor that isn't correct for the units the piece has been designed in.In the example above there is a G21 which is correct for an metric job,but was the part imported into Aspire with a metric setup?

    Then there is what I suspect to be the likely root of the problem,telling the machine where the part datum is by means of a G54.In both Rhino and Aspire there will be a 0,0,0 datum and you need to be certain that it is where you may imagine it to be.For 2D vectors you will have one less variable to deal with but you need to check the Aspire file to see if the job is set up with the Z datum at the top or the bottom.Then you need to move the machine to a point that corresponds and somehow input the zero value.You don't usually have to be at the job's 0,0,0 for this and can usually do each axis individually a little distance away from the part.I would then expect that when you home the machine it will have some sort of display indicating a position of X- a number,Y-a number and Z+a number or maybe a G54 but as mentioned,I don't know a lot about UGS.For a first attempt I suggest running with no tool and no workpiece just to check the movement of the machine.If you don't have a fed rate override control you may need to be cautious about following speed and feed rates for a hobby machine as most lack the power of the commercial machines that the usage charts are intended for.

  4. #4
    Join Date
    Nov 2007
    Posts
    352

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

    T1
    G17
    G21
    G90
    G0Z20.320
    G0X0.000Y0.000
    S10000M3







    T1
    G00G90G21G49
    G00G28Z0.0
    G00G28X0.Y0.
    ()
    G00G54X0.0Y0.0G97M3S10000
    G00G43H1Z1.0
    ()
    G00G28Z0.0G49
    G00G28X0Y0
    M5
    M30

  5. #5
    Join Date
    Jan 2018
    Posts
    1516

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

    You accidentally in inches and not mm?. Z trying to go up 20 inches?.
    Just a thought.

  6. #6
    Join Date
    Jan 2005
    Posts
    15362

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

    Quote Originally Posted by routalot View Post
    First thing that comes to mind is that the program should simulate correctly in Aspire.It its doing so correctly,the problem isn't the program,although I am a bit bemused by the mention of 5K lines of Gcode for a rectangle.Would I be correct in guessing that you may have ticked the box for a ramp entry?What looks more likely is that you don't have a G54 anywhere in the program header and by homing the machine,it may be trying to move from a home position it believes to be 0,0,0 to a position with a Z value 20.320 above such a point.Obviously it would run out of travel before it reaches that point.
    The Z axis is only moving G21 G0 20.320, understand what the code is doing if his Z axis only has 20.320 of travel it would not be any use for anything
    Mactec54

  7. #7
    Join Date
    Jan 2005
    Posts
    15362

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

    Quote Originally Posted by dazp1976 View Post
    You accidentally in inches and not mm?. Z trying to go up 20 inches?.
    Just a thought.
    Read the code a G21 is metric
    Mactec54

  8. #8
    Join Date
    Nov 2007
    Posts
    352

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

    You have no tool offsett called or fixture g54/59 called so unless you are touching the tool off on the part you will never have the right figures

  9. #9
    Join Date
    Dec 2003
    Posts
    1216

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

    Quote Originally Posted by lshingleton View Post
    You have no tool offsett called or fixture g54/59 called so unless you are touching the tool off on the part you will never have the right figures
    There's an echo in this thread!!!!

    from mactec54

    The Z axis is only moving G21 G0 20.320, understand what the code is doing if his Z axis only has 20.320 of travel it would not be any use for anything

    Which is why I posted that if the machine had been homed at the top of the Z travel-it had no headroom to move up by 20.320mm.it would have taken the home position as Z0 because the machine had no G54 value to reference the part datum.

  10. #10

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

    Thanks, @Mactec54, I appreciate your feedback and taking time to write me.

    I thought you could use G91 (incremental mode) when you want to start the machine program from the tool location. My machine controller (USG) automatically has G90 default when it starts. SHould my file be saved as one over the other? If I bring in g-code that uses G90, would I be able to overwrite that in the USG? I'm not sure of the "heiracrchy" of who can overwrite who? Does that make sense?
    Maybe I am missunderstanding machine coordinates over work coordinates. How do I know if machine coordinates and working coodinates are setup and positioned correctly. Wouldn't G-code 90 & 91 come to play here?

  11. #11

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

    Hi @Routalot! I appreciate you taking the time to write me. Thank you!


    "First thing that comes to mind is that the program should simulate correctly in Aspire".
    I'm re-doing the sign in aspire right now. From the looks of it, I am setting-up my material parameters correctly. All measurements are correct.
    My safe Z= 0.125" and my home position is X=0 Y=0 Z=0.5

    "It its doing so correctly,the problem isn't the program,although I am a bit bemused by the mention of 5K lines of Gcode for a rectangle.Would I be correct in guessing that you may have ticked the box for a ramp entry?" - I might, again I'm starting over and hopefully I can figure out what I am doing wrong.

    "What looks more likely is that you don't have a G54 anywhere in the program header and by homing the machine,it may be trying to move from a home position it believes to be 0,0,0 to a position with a Z value 20.320 above such a point". - I don't get how it's reading this....but yes, in aspire i create it in inches (therefore the code is G20), in USG the default is [G0 G54 G17 G21 G90 G94 M0 M5 M9 T0 F0.] Could I not as the program to workin in incheas G20? Again the question of which program can overwrite which g-code?


    "Then there is what I suspect to be the likely root of the problem,telling the machine where the part datum is by means of a G54.In both Rhino and Aspire there will be a 0,0,0 datum and you need to be certain that it is where you may imagine it to be."
    - The datum is placed on the lower left corner (simulating the machine homing 0,0,0). On the top of the surface material with a clearence of 0.125.



    "Then you need to move the machine to a point that corresponds and somehow input the zero value.You don't usually have to be at the job's 0,0,0 for this and can usually do each axis individually a little distance away from the part.I would then expect that when you home the machine it will have some sort of display indicating a position of X- a number,Y-a number and Z+a number or maybe a G54 but as mentioned,I don't know a lot about UGS.For a first attempt I suggest running with no tool and no workpiece just to check the movement of the machine.If you don't have a fed rate override control you may need to be cautious about following speed and feed rates for a hobby machine as most lack the power of the commercial machines that the usage charts are intended for."

    [G54:0.000,25.400,-13.000] is when I type $#. I tried the intial set-up and when I hit my homing switch it goes to the correct location. I tried setting up G54 but wasn't able to "write the code" in USG.

    I might look at LinuxCNC if I can't trouble shoot this today. It's been 5 days of patience. I find that USG lags when I jog sometimes and takes a minute to boot. I just don't know how to know if my machine is set-up correctly, I am assuming it is.

  12. #12

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

    HI Ishlingleton,

    Could you explain this to me. Let's say for example you have a 6" x 3" x 0.750 piece on your top of your cnc and you 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]

  13. #13
    Join Date
    Jan 2005
    Posts
    15362

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

    Quote Originally Posted by routalot View Post
    There's an echo in this thread!!!!

    from mactec54

    The Z axis is only moving G21 G0 20.320, understand what the code is doing if his Z axis only has 20.320 of travel it would not be any use for anything

    Which is why I posted that if the machine had been homed at the top of the Z travel-it had no headroom to move up by 20.320mm.it would have taken the home position as Z0 because the machine had no G54 value to reference the part datum.
    He had homed, the machine and then touched off his tool, depending on what control / software he is using he does not need a G54
    Mactec54

  14. #14
    Join Date
    Dec 2003
    Posts
    24220

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

    Quote Originally Posted by missgeneralidea View Post
    I thought you could use G91 (incremental mode) when you want to start the machine program from the tool location. My machine controller (USG) automatically has G90 default when it starts.
    T1
    G17
    G21
    G90
    G0Z20.320
    G0X0.000Y0.000
    S10000M3
    Just an incidental point, G00 & G01, like many codes are Modal.
    i.e. No need to state on every line that applies.
    CNC, Mechatronics Integration and Custom Machine Design

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

  15. #15
    Join Date
    Jan 2005
    Posts
    15362

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

    Quote Originally Posted by missgeneralidea View Post
    HI Ishlingleton,

    Could you explain this to me. Let's say for example you have a 6" x 3" x 0.750 piece on your top of your cnc and you 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]
    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.
    Mactec54

  16. #16
    Join Date
    Dec 2003
    Posts
    1216

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

    First of all,don't go adding G91 to the code,it will cause chaos.The code that Aspire generates will not run because you will be confusing the machine.The other thing that looks odd is that you are apparently using Aspire in Imperial mode and yet generating a program with a G21 in the header.This may cause your machine to believe it is receiving instructions to move a long way behind it's envelope.Can you post a diagram of your project on the machine with a sketch of where you have placed the datum?

  17. #17
    Join Date
    Nov 2007
    Posts
    352

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

    If you jog the machine to your xyz part zero and cancel them out on the control i do not know it this is just changeing the number to zero or a new recorded postion of zero ----------Alot of Hydenham controls do work that way when using only one tool --------Then you would referance the machine and if you called goo x0 y0 z0 it should take the axis back to that position with no other command -------------------Your G54 looks like it is set to X0.0 and Y25.4 amd Z-13.000 ------------Try G10 P0 L20 x-100.0 y-100.0 z-100.0 ---------------This program then would be
    G00G90G28Z0
    G00G28X0.Y0.
    ()
    G00 G54 X0. Y0.Z0.
    M30

  18. #18
    Join Date
    Jan 2005
    Posts
    15362

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

    Quote Originally Posted by Al_The_Man View Post
    Just an incidental point, G00 & G01, like many codes are Modal.
    i.e. No need to state on every line that applies.
    Some controls require the G statement, even though they are Modal.
    Mactec54

  19. #19
    Join Date
    Jan 2005
    Posts
    15362

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

    Quote Originally Posted by lshingleton View Post
    If you jog the machine to your xyz part zero and cancel them out on the control i do not know it this is just changeing the number to zero or a new recorded postion of zero ----------Alot of Hydenham controls do work that way when using only one tool --------Then you would referance the machine and if you called goo x0 y0 z0 it should take the axis back to that position with no other command -------------------Your G54 looks like it is set to X0.0 and Y25.4 amd Z-13.000 ------------Try G10 P0 L20 x-100.0 y-100.0 z-100.0 ---------------This program then would be
    G00G90G28Z0
    G00G28X0.Y0.
    ()
    G00 G54 X0. Y0.Z0.
    M30
    This is a bad way to program and worse than what he had done
    Mactec54

  20. #20
    Join Date
    Nov 2007
    Posts
    352

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

    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

Page 1 of 3 123

Similar Threads

  1. Replies: 0
    Last Post: 03-18-2019, 06:59 PM
  2. pls, a code sample for double OD Y holders :)
    By deadlykitten in forum Okuma
    Replies: 15
    Last Post: 05-21-2018, 05:05 PM
  3. servo motor problem pls help?
    By rotsenmendoza in forum Servo Motors / Drives
    Replies: 2
    Last Post: 09-09-2015, 03:01 PM
  4. problem in my cnc , help me pls
    By mks80eng in forum DNC Problems and Solutions
    Replies: 10
    Last Post: 09-15-2013, 06:25 PM
  5. pls help me boss 8 problem
    By joanpim in forum Bridgeport / Hardinge Mills
    Replies: 0
    Last Post: 03-18-2009, 01:58 AM

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
  •