591,376 active members*
7,314 visitors online*
Register for free
Login
Results 1 to 17 of 17
  1. #1
    Join Date
    Aug 2022
    Posts
    51

    Find location in Goode where machine crashed.

    I have Mach 4, gecko g540.

    I was running a file and my g540 faulted out.

    When I figure out and fix my g540, how do I find the location in the gcode in Mach4? (Long file)
    I would like to try to continue from where it stopped, or a few steps previous.

    Any good video’s?

    Thanks Eric

  2. #2
    Join Date
    Apr 2004
    Posts
    5795

    Re: Find location in Goode where machine crashed.

    Was it at line 500, by any chance? That's where the unlicensed versions of Mach stop working. To fix the problem, you need to get a license, if you don't have one already, and put the file in the main Mach directory.
    Andrew Werby
    Website

  3. #3
    Join Date
    Aug 2022
    Posts
    51

    Re: Find location in Goode where machine crashed.

    No, it was about 35 minutes into the file. Maybe 30% done.

    I’ve got the g540 running. Not 100% sure, but I think it was the E-stop.

    Anyways, I still need a way to locate the gcode where it stopped.

    Any ideas out there. I saw ventric has a way, you think mach4would have a way.

    Thx Eric

  4. #4
    Join Date
    Dec 2003
    Posts
    1267

    Re: Find location in Goode where machine crashed.

    It won't help you now but when I was working with large files (100 million lines of code was not unusual) in a business that suffered occasional power cuts,I made a point of noting line numbers every twenty minutes or so.Which meant that I could edit out the part prior to the last noted line and only lose a few minutes of machining time when the power came back.

  5. #5
    Join Date
    Apr 2004
    Posts
    5795

    Re: Find location in Goode where machine crashed.

    Have you tried running the same file again? If it faults in the same place, note down the line number and look there, or immediately previous, to see if the G-code is causing the problem. If it doesn't crash then, it might be something else - did you turn off Windows Update, which is notorious for this sort of thing?
    Andrew Werby
    Website

  6. #6
    Join Date
    Aug 2022
    Posts
    51

    Re: Find location in Goode where machine crashed.

    I’m going to reset to my origin and re-cut. I’m hoping it will re-cut right over what I cut already and continue on to the end.
    It’s about an hr and half file. I don’t have file numbers, but I would guess some were around 8k-10k lines. I’ve also got quite a bit time in the project already, so I want to try and save it.

    A lot of detail, see pic

    EZ

  7. #7
    Join Date
    Aug 2022
    Posts
    51

    Re: Find location in Goode where machine crashed.

    I’m going to reset to my origin and re-cut. I’m hoping it will re-cut right over what I cut already and continue on to the end.
    It’s about an hr and half file. I don’t have file numbers, but I would guess some were around 8k-10k lines. I’ve also got quite a bit time in the project already, so I want to try and save it.

    Computer is not online, no updates
    Attached Thumbnails Attached Thumbnails IMG_0666.jpg  

  8. #8
    Join Date
    Nov 2013
    Posts
    4816

    Re: Find location in Goode where machine crashed.

    Hi,
    there is no simple way to do as you want, or at least without doing some coding.

    I use Mach4 and have done for years. Some of my circuit board programs are 5M and longer, and it is sometimes necessary to change to a fresh tool. Being able to restart the job after
    a manual tool change is advantageous.

    I would suggest in the first instance you experiment with the Run-From-Here (RFH) feature. If you've not used it before then you need to experiment with it....it will cause crashes until you get the procedure!
    The RFH feature of Mach3 was the same and caused more crashes than any other feature in Mach3.

    If, having worked out RFH then you can write some code to record the line numbers as the job progresses. Should you require it just read the register that recorded the line, then search the file until you find the line.
    Start the job from prior to where it stopped.......after having experimented with RFH you'll know why!

    This requires that all your Gcode have line numbers, and that is a feature of most CAM programs. I have one circuit board program that numbers lines up to 10,000 lines, and then starts again. So there could be
    five line number N1234 in a file of 50,000 lines. You need to watch for that sort of thing.

    Assuming that you now have useful line numbers you need to write a script to record it when the job is running.

    I think I'd put it in the PLC script. I'd use a test to determine if a Gcode job is running, and if so then record the current line number to a register you have created for that purpose.

    Code:
    LUA Syntax: 
    val, rc = mc.mcCntlGetGcodeLineNbr(
    		number mInst)
    
    Description:
    Returns the line number of the current move being made.
    You'd use the status numbers to determine whether a job was running.

    Craig

  9. #9
    Join Date
    Nov 2013
    Posts
    4816

    Re: Find location in Goode where machine crashed.

    Hi,
    just been experimenting, I think the line number function returns the number of the line from the head of the file, not necessarily the Nnnnnn line number assigned by your CAM program.
    That's handy, it would still work even if your Gcode file does not have line numbers.

    Craig

  10. #10
    Join Date
    Nov 2013
    Posts
    4816

    Re: Find location in Goode where machine crashed.

    Hi,

    In order to get the status of the machine use:

    Code:
    LUA Syntax: 
    mcState, rc = mc.mcCntlGetState(
    		MINSTANCE mInst)
    
    Description:
    Get the current controller state.
    The status codes are:

    mcStateCheck = {
    [0] = "MC_STATE_IDLE",
    [1] = "MC_STATE_HOLD",
    [2] = "MC_STATE_FRUN_SUB",
    [3] = "MC_STATE_MRUN_SUB",
    [4] = "MC_STATE_JOG",
    [5] = "MC_STATE_DRYRUN",
    [6] = "MC_STATE_HOME",
    [7] = "MC_STATE_CONFIG",
    [100] = "MC_STATE_FRUN",
    [101] = "MC_STATE_FRUN_FH",
    [102] = "MC_STATE_FRUN_PROBE",
    [103] = "MC_STATE_FRUN_PROBE_FH",
    [104] = "MC_STATE_FRUN_THREAD",
    [105] = "MC_STATE_FRUN_THREAD_FH",
    [106] = "MC_STATE_FRUN_FH_JOG",
    [107] = "MC_STATE_FRUN_TAP",
    [108] = "MC_STATE_FRUN_MACROH",
    [109] = "MC_STATE_FRUN_MACROH_JOG",
    [110] = "MC_STATE_FRUN_SINGLE_BLOCK",
    [111] = "MC_STATE_FRUN_RETRACT",
    [112] = "MC_STATE_FRUN_HOMING",
    [113] = "MC_STATE_FRUN_SINGLE_BLOCK_HOLD",
    [199] = "MC_STATE_FRUN_END",
    [200] = "MC_STATE_MRUN",
    [201] = "MC_STATE_MRUN_FH",
    [202] = "MC_STATE_MRUN_PROBE",
    [203] = "MC_STATE_MRUN_PROBE_FH",
    [204] = "MC_STATE_MRUN_THREAD",
    [205] = "MC_STATE_MRUN_THREAD_FH",
    [206] = "MC_STATE_MRUN_TAP",
    [207] = "MC_STATE_MRUN_MACROH",
    [208] = "MC_STATE_MRUN_MACROH_JOG",
    [209] = "MC_STATE_MRUN_RETRACT",
    [210] = "MC_STATE_MRUN_HOMING",
    [299] = "MC_STATE_MRUN_END",
    }
    For your purpose you want to know when the machine is running a Gcode file, ie "MC_STATE_FRUN", which is, numerically, 100.

    The test would look something like:

    Code:
    local minst=mc.mcGetInstance()
    local CurrentMachineState=mc.mcCntlGetState(minst)
    if(CurrentMachineState==mc.MC_STATE_FRUN)then
    ......................
    ......................
    ......................  (code for saving the line number to a register)
    end

    Craig

  11. #11
    Join Date
    Aug 2022
    Posts
    51

    Re: Find location in Goode where machine crashed.

    Wow, way beyond my pay grade.
    Thx for the reply, maybe someone will benefit from your info.

    I will probably zero out and start from the beginning, cut air for a while.

    I did see a video where you could click on a line in your graphic and it would show which line that is on your gcode.
    I think it was vetric, which gives me an idea to look at my carveco software.

    Thx all EZ

  12. #12
    Join Date
    Aug 2022
    Posts
    51

    Re: Find location in Goode where machine crashed.

    I had another mishap with this file. Not sure why my machine is acting up. Motors too hot???

    Anyways. There is a way to find the location with mach4.
    I will explain it when I get some time

    Side note, the file was about 165k of gcode.
    Just the V-cut run time, was about 2hrs.

    I did finish the file and saved the project.
    EZ

  13. #13
    Join Date
    Dec 2003
    Posts
    1267

    Re: Find location in Goode where machine crashed.

    Great that you found a way to save the project and sharing the method will help somebody at some point in the future.

  14. #14
    Join Date
    Aug 2022
    Posts
    51

    Re: Find location in Goode where machine crashed.

    Here is how to find a line in your gcode when your machine crashed or stopped, using mach4.
    (No line numbers)

    Load a gcode into mach4. See uploaded pictures.

    In mach4, look at the box that has your gcode that you loaded. In one of the pictures you will see this box and the first line of the gcode has a box around it. (Highlighted)

    Now look at the picture of the graphic of the file you are cutting. You will see 4 green circles and a green square. Also notice I have the file ops tab clicked. The “line” box says line 1. Whatever line is highlighted in your gcode will be the number in that box.

    If you look at the other picture where a random line in the gcode is highlighted. Then look at the other picture of the file ops tab, you will see I picked line 4694. Also notice that the square and 2 circles are now cyan colored. That tells you that those lines have been cut and the green lines still need to be cut.

    If you scroll the gcode up or down, you will see the line number change ( file ops tab) AND you will see the graphics change. If you know about where you crashed, you should be able to find the line to start at to continue. Yes, you will have to zero out, the run from that line.

    If you look at the file ops tab, you will see a button that says “run from here”. Whatever line of gcode is selected, you will start from that line. My button is shadowed out because my machine was disabled.

    Play with it, but think it thru. Probably want to pick a line that is a rapid move that is above the cutting surface.

    I will check which photos I uploaded. And upload more if I got the wrong ones.

  15. #15
    Join Date
    Aug 2022
    Posts
    51

    Re: Find location in Goode where machine crashed.

    Watch the graphic screen the next time you run a file. The lines will turn from green to cyan to show where you are at.

    The red lines are rapid moves.

    I re-zeroed my machine and selected one of the rapid moves to where I crashed. Think it thru. I started at x0 y0 z.25. Rapid to the area I crashed. Then let the file run to the end. I was about an hr and 45 minutes into a 2 hr file when it crashed.

    Hope this helps. I had to start around line 158000. To get to the end of file, line 165000.

  16. #16
    Join Date
    Nov 2013
    Posts
    4816

    Re: Find location in Goode where machine crashed.

    Hi,
    all Gcode programs are modal. For instance :

    Code:
    g1 x123 y456
    x125 y457
    x127 y458
    x129 y459
    Were you to start from the top, Mach would enter g1 mode, namely linear interpolation between two points at the current feed rate and then to each of the subsequent x,y positions.
    But what would happen if you started at line 2? Mach would not know that it was in g1 mode, it has never encountered it before, so it would interpret the string of x,y positions
    in the mode Mach is in at the moment, and almost inevitably be wrong. There are many 'modes', not just motion, but Feed Rate for example. The Feed Rate is nominated at some previous block
    and remains in force UNLESS it is later updated by some other block.

    In order for Mach to Run-From-Here it needs to run through the program from the start to the desired Gcode start location so it can establish the modal parameters. It can do this without movement and therefore it happens fairly quickly,
    seldom more than ten seconds or so. That is what the Run-From-Here button does. The other thing required is that the machine must be put in a position as if indeed it was just carrying on. It is this pre-positioning move
    that causes all the drama. The Mach4 preparatory move setup is much better than the same feature in Mach3 but can still catch you out.

    Craig

  17. #17
    Join Date
    Aug 2022
    Posts
    51

    Re: Find location in Goode where machine crashed.

    Makes sense. Something to think about if it happens again.
    I must have lucked out, because I did save the project.
    Thx EZ

Similar Threads

  1. New to EDM. Crashed machine. Start Up procedures?
    By Lost-Luggage in forum EDM Discussion General Topics
    Replies: 1
    Last Post: 08-29-2012, 10:38 PM
  2. New to EDM. Crashed machine. Start Up procedures?
    By Lost-Luggage in forum Maintenance DIY Discussion
    Replies: 1
    Last Post: 08-10-2012, 03:50 AM
  3. New to EDM. Crashed machine. Start Up procedures?
    By Lost-Luggage in forum Education - Teachers and Students Hangout
    Replies: 0
    Last Post: 07-21-2012, 02:21 PM
  4. crashed machine, viper not coming up
    By i_r_machinist in forum Viper Servo drives
    Replies: 2
    Last Post: 12-21-2011, 01:02 AM
  5. crashed the machine, now spindle makes weird noise!!!!
    By lm6769 in forum CNC Machining Centers
    Replies: 7
    Last Post: 09-01-2008, 06:23 PM

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
  •