584,812 active members*
5,303 visitors online*
Register for free
Login
IndustryArena Forum > WoodWorking Machines > DIY CNC Router Table Machines > Avid CNC > How do i pick up from where i left off?
Results 1 to 18 of 18
  1. #1

    How do i pick up from where i left off?

    New User and Visitor to this forum. Greetings All!

    So we purchased a Pro4896 , so far we love it. This is also my first CNC so please bear with me if any of my terminology is not accurate.

    Moving along to my problem,
    I have a PC that is running Mach4, occasionally this PC will crash (I'm working on fixing that - this isn't the problem I am coming to you all for help with). When the PC crashes Mach 4 obviously closes out. When I start back up the G-code is gone and I am not confident in the machines position, or where it left off in the g-code.

    How do I go about picking up where I left off on my work piece in the CNC? (it is really frustrating to have spend 8 or 9 hours of machine time to have this happen and to waste that material and time! - yes I know get the computer fixed! )
    When Mach 4 shuts down does it loose positional data?
    Do I need to re-home and reload work piece X,Y, and Z zeros? Or is there an easy fix? If i have started machining my piece placing the XYZ touch-plate in the same spot is obviously not going to work as there will have been some material removed at least in the z axis if not others. So how do I compensate and correct this? I assume i could home the machine using the buttons in Mach 4 to zero out then record the material XYZ offsets on paper to input later on if the machine/ PC crash again - where would i find that data or offset or how would I go about applying it?

  2. #2
    Join Date
    Jul 2015
    Posts
    33

    Re: How do i pick up from where i left off?

    I can't answer for Mach 4, I use UCCNC but the solution I use is probably the same.

    1. for a long project put a known size hole (say 1/4") in the waste in a known location relative to the rest of the project. That might be at 0,0 which makes things easy. Then you can jog a 1/4" bit into that hole and you know where you are. If it's not 0,0 no big deal, just jog the bit into that hole at a known location (i.e. 100,00). Once it's in then move -100,-100 and that's home.
    2. UCCNC presents the machine coordinates and project coordinates; take a picture/note down the machine coordinates at 0,0 (which are fixed when I rehome -- assuming you have limit switches - they will always be the same), then use that to rezero.

  3. #3
    Join Date
    Jan 2012
    Posts
    222

    Re: How do i pick up from where i left off?

    In Mach4 I think you double click the line in the Gcode window and hit cycle start...

  4. #4
    Join Date
    Nov 2013
    Posts
    4280

    Re: How do i pick up from where i left off?

    Hi,

    When Mach 4 shuts down does it loose positional data?
    Do I need to re-home and reload work piece X,Y, and Z zeros? Or is there an easy fix?
    That depends on the manner that Mach4 shuts down. If you close it normally it will record the current machine position in the .ini file and therefore if the machine moves not at all from the moment of
    shutdown until the start of the next session you could use the recorded data to re-establish position without homing....although its not recommended.

    If Mach crashes then it does not go through the normal ScreenUnload script and machine position is usually lost, even if g54 (g55, g56....etc) is retained.

    The correct procedure is to home at each restart. If you have good homing switches you should be able to home to within 0.01mm to 0.05mm repeatably. If you do so then you can use the saved g54,
    or whatever set of work offsets you are using to pick up the 0,0,0 location of the workpiece.

    Do you have good home switches? Good home switches that can be repeated again and again will make the whole procedure much more secure and accurate. Without them and you will struggle....I know
    I certainly did until I fitted them. Best improvement I ever made to my machine.

    There is a <Run From Here> function in Mach4. It allows you to start the code running at some intermediate line of Gcode within a file. Note that Mach has to do a preparatory move before it can start,
    and that preparatory move has caused lots of crashes. If you practice it a bit you will come to understand the sequence of events and not be caught out......but it is a procedure you must follow
    accurately or you will have a crash. I try to avoid using <Run From Here>.

    In Mach4 I think you double click the line in the Gcode window and hit cycle start...
    This is not a good technique and can lead to some wild results. As a job is progressing Mach changes modes, for instance absolute/incremental, g0/g1 etc. Thus the line of Gcode is interpreted in the existing Mach
    mode which is determined by the previous Gcode. <Run From Here> solves this issue by doing a highspeed dummy run through the Gcode from the beginning of the file but without movement. Thus it can establish
    all the correct modes prior to running a new line, the line you want to start from.

    Craig

  5. #5
    Join Date
    Jan 2012
    Posts
    222

    Re: How do i pick up from where i left off?

    Quote Originally Posted by joeavaerage View Post
    Hi,

    This is not a good technique and can lead to some wild results. As a job is progressing Mach changes modes, for instance absolute/incremental, g0/g1 etc. Thus the line of Gcode is interpreted in the existing Mach
    mode which is determined by the previous Gcode. <Run From Here> solves this issue by doing a highspeed dummy run through the Gcode from the beginning of the file but without movement. Thus it can establish
    all the correct modes prior to running a new line, the line you want to start from.
    That is simply not true. You need to read the Mach4 docs. Page 41 "Startng from the Middle of a g Program"

    Operation Manual - Hobby.pdf

    Of course, Be aware that you do need to set a safe Z or you will collide with things. So manually move the Z to the top and jog to about where you need it so the starting moves are less fast in case your machine has lost steps and starts doing things you didn't want it too.

  6. #6
    Join Date
    Nov 2013
    Posts
    4280

    Re: How do i pick up from where i left off?

    Hi,
    the instruction on pg 41 is correct, namely you can start a program from any line.....however it may not work as you expect. Gcode programs are modal, always have been. For example
    this is a drill file I use regularly for drilling holes in a PCB:

    Code:
    G0 Z2
    M3 S24000 
    G4 P6.00 
    N00150 G82 X-31.9900 Y8.5500  Z-2.5000 F300   R2.0000  P0.100000
     X-32.0100 Y29.5100 
     X-42.4900 Y19.0000 
     X-21.4600 Y19.0600 
    N00250 G82 X-53.2800 Y13.4700 Z-2.5000 F300   R2.0000  P0.100000
     X-55.2800 Y13.4700 
     X-57.2800 Y13.4700 
     X-59.2800 Y13.4700 
     X-61.2800 Y13.4700 
     X-63.2800 Y13.4700 
    N00370 G82 X-31.4500 Y48.9100 Z-2.5000 F300   R2.0000  P0.100000
     X-37.6750 Y3.4250  
     X-45.3500 Y38.8500 
     X-46.5500 Y64.0000 
     X-49.3750 Y13.4250 
     X-49.4500 Y38.9000 
     X-53.0500 Y38.8500 
     X-5.4500 Y27.3000 
     X-56.1250 Y18.8750 
     X-57.7500 Y38.8000 
     X-58.1500 Y73.6000 
     X-58.7250 Y18.7750 
     X-61.2500 Y18.7000 
     X-63.8000 Y18.7000 
     X-12.6500 Y38.5000 
     X-14.6500 Y36.0000 
     X-18.4000 Y35.3500 
     X-20.2500 Y39.4000 
     X-20.6250 Y36.8250 
     X-21.5500 Y3.8500  
     X-25.8000 Y62.8500 
    N00640 G82 X-38.7400 Y12.2900 Z-2.5000 F300   R2.0000  P0.100000
     X-38.7400 Y25.7300 
     X-25.2900 Y25.7500 
     X-25.3400 Y12.2700 
    G0 Z50
    X0 Y0
    M30
    At the top of the file the spindle is turned on and run at 24000rpm (M3 S24000 )
    Note that once Mach has read one of the drill cycle lines, for example:N00370 G82 X-31.4500 Y48.9100 Z-2.5000 F300 R2.0000 P0.100000
    that each subsequent line is interpreted as a new hole at the XY location on the line but with the other parameters as has been set by the previous drill cycle line.
    If you attempt to start Mach at this line the spindle will not start, I mean Mach hasn't read it so why would it start? It would interpret: X-49.3750 Y13.4250
    probably as a linear G0 move, it would have no idea that it's supposed to drill a hole, it has not read the drill cycle line and so is not in drill mode.

    In order for a line of Gcode to be interpreted correctly Mach needs the history of the job so that it knows what mode its in otherwise it may well misinterpret what its supposed to do.

    Another example is something like this:

    g0 x0 y0
    g91
    g1 x10 y10 f500
    g1 x10 y10
    g1 x10 y10

    Because of the g91, ie incremental mode each successive line:g1 x10 y10 will cause the machine to advance 10 mm in X and 10mm in Y. If you started the code at;g1 x10 y10 f500
    when the machine is still in absolute mode, Machs normal mode, then it will drive to x10 y10 but then stay there. Only if its in incremental mode would it carry on.

    I suggest you do some experiments because if you have a clash between absolute/incremental mode you will get wildly unexpected results. Its for this reason that <Run From Here> was invented
    way back in Mach3 days. Mach4 needs it also.

    Craig

  7. #7
    Join Date
    Jan 2012
    Posts
    222

    Re: How do i pick up from where i left off?

    Quote Originally Posted by joeavaerage View Post
    Hi,
    the instruction on pg 41 is correct, namely you can start a program from any line.....however it may not work as you expect. Gcode programs are modal, always have been. For example
    this is a drill file I use regularly for drilling holes in a PCB:

    I suggest you do some experiments because if you have a clash between absolute/incremental mode you will get wildly unexpected results. Its for this reason that <Run From Here> was invented
    way back in Mach3 days. Mach4 needs it also.

    Craig
    If you tested the code, I am sure Trevor over at Newfangled would be happy to help you file a bug report.

    Helping debug this stuff just helps the overall community. Thank you for your contribution!

  8. #8
    Join Date
    Nov 2013
    Posts
    4280

    Re: How do i pick up from where i left off?

    Hi,

    If you tested the code, I am sure Trevor over at Newfangled would be happy to help you file a bug report.
    It not a bug, its just how Mach is and always has been, and its how all ANSI standard Gcode interpreters work. Consult Peter Smids book on CNC, 'CNC Programming Handbook' the Gcode bible, and you'll see that's
    how Gcode has always worked.

    Starting a Gcode file midway can have some unexpected results, I would suggest you experiment so you can establish a clear understanding of the limitations of the simple 'double click on the line'
    approach or you may have a very nasty surprise in store. That's how I learnt about it years ago.

    Craig

  9. #9
    Join Date
    Jan 2012
    Posts
    222

    Re: How do i pick up from where i left off?

    Quote Originally Posted by joeavaerage View Post
    Hi,

    It not a bug, its just how Mach is and always has been, and its how all ANSI standard Gcode interpreters work. Consult Peter Smids book on CNC, 'CNC Programming Handbook' the Gcode bible, and you'll see that's
    how Gcode has always worked.

    Starting a Gcode file midway can have some unexpected results, I would suggest you experiment so you can establish a clear understanding of the limitations of the simple 'double click on the line'
    approach or you may have a very nasty surprise in store. That's how I learnt about it years ago.

    Craig
    Oh, I thought that bit of code showed that Mach4 couldn't resume correctly.

    So, stupid question; if what you say is true, why doesn't the operator's manual say what you just said? That is some very, very important information that was left out, right?

    That kind of goof up breaks equipment and can even kill people.

    File a bug report. Tell Newfangled that their manual is missing some very serious information.

    I am sure they will be very happy you helped them find this mistake they have had in their manual since... 2014?

  10. #10
    Join Date
    Nov 2013
    Posts
    4280

    Re: How do i pick up from where i left off?

    Hi,

    Oh, I thought that bit of code showed that Mach4 couldn't resume correctly.
    It can resume correctly IF you use <Run From Here>, but not if you just click on the line that you want it to resume and <Cycle Start>.

    So, stupid question; if what you say is true, why doesn't the operator's manual say what you just said? That is some very, very important information that was left out, right?
    Well perhaps, but then I'd assume you know how Gcode works and that you would run the job from the beginning OR use <Run From Here> or some equivalent function. To my knowledge
    all Gcode controllers work that way.

    That kind of goof up breaks equipment and can even kill people.
    Yes it is a goof and could cause a crash, killing people is probably a bit extreme, but a crash could ensue. That's why I commented that I thought your technique was a poor one,
    or at least that there are circumstances that it could cause a crash. I do not consider it a fault, its just the way Gcode works and we all need to understand it if we want to use
    it without crashing. The manual said you can start a program at any line, what it did not say was that you can resume a program at any line. There is a difference.

    Craig

  11. #11
    Join Date
    Jan 2012
    Posts
    222

    Re: How do i pick up from where i left off?

    Quote Originally Posted by joeavaerage View Post
    Hi,

    Yes it is a goof and could cause a crash, killing people is probably a bit extreme, but a crash could ensue. That's why I commented that I thought your technique was a poor one,
    or at least that there are circumstances that it could cause a crash. I do not consider it a fault, its just the way Gcode works and we all need to understand it if we want to use
    it without crashing. The manual said you can start a program at any line, what it did not say was that you can resume a program at any line. There is a difference.

    Craig
    Ok, so you are NOT going to file a bug report?

    Well, that's a shame. It would have been fun to hear about.

  12. #12
    Join Date
    Nov 2013
    Posts
    4280

    Re: How do i pick up from where i left off?

    Hi,

    no, as I say I do not consider it a bug but rather just the way Gcode interpreters work. A cautionary note in the manual about resuming a program might be a good idea.

    Craig

  13. #13
    Join Date
    Jan 2012
    Posts
    222

    Re: How do i pick up from where i left off?

    Quote Originally Posted by joeavaerage View Post
    Hi,

    no, as I say I do not consider it a bug but rather just the way Gcode interpreters work. A cautionary note in the manual about resuming a program might be a good idea.

    Craig
    My only question was if double clicking the line would set it. As far as starting at any arbitrary line in a file is mute as I have done it many times in Mach4.

    Never had a problem.

    Now, I haven't done it since I installed the ATC. That might be a wrinkle I myself didn't plan on since I wrote that code.

    That would be and interesting edge case I need to explore before I release the ATC carousel kit.

  14. #14

    Re: How do i pick up from where i left off?

    I really appreciate the information this is exactly the type of response I was hoping for!

    When the PC crashes, it is a BSOD scenario and thus the Mach4 and G-Code are not reloaded and homing has been lost. I do like the idea of recording the absolute machine position for the work piece and driving back to those coordinates. I will need to tweak and fine tune my homing switches to get a nice and precise start point for this.

    I am new to the CNC world and our R&D department just got its first machine for fabrication of prototypes, I am really excited to get such good info and opinions here again thanks for the help!

  15. #15
    Join Date
    Jan 2012
    Posts
    222

    Re: How do i pick up from where i left off?

    Quote Originally Posted by MS_Engineering View Post
    I really appreciate the information this is exactly the type of response I was hoping for!

    When the PC crashes, it is a BSOD scenario and thus the Mach4 and G-Code are not reloaded and homing has been lost. I do like the idea of recording the absolute machine position for the work piece and driving back to those coordinates. I will need to tweak and fine tune my homing switches to get a nice and precise start point for this.

    I am new to the CNC world and our R&D department just got its first machine for fabrication of prototypes, I am really excited to get such good info and opinions here again thanks for the help!
    I touch off from the spoilboard and then set the thickness of the material on top of that as the surface. I never touch off from the actual stock surface. So keep that in mind!

    After a computer crash and reboot, power outage, etc I would re-home but purposely set the Z too high. Then I would go back to a line I know executed and start there. Make sure the cut is going as you expected. If it does, then stop and re-home again. Touch off to the spoilboard and add the original stock height again and start from that same line.

    Any modern motion planner will have the ability to start in the middle of a file and account for modals and axis positions. That is kind of why we started using motion planners as opposed to state machines of the past. Smarter means they can do magic like this.

    Just be careful though! Do the air cuts first and prove it works before putting that tool back against the stock.

    Good luck.

  16. #16
    Join Date
    Nov 2013
    Posts
    4280

    Re: How do i pick up from where i left off?

    Hi,
    the PC controlling my machine is a dual core Atom single board PC without a graphics card. Its well less than is recommended by NFS
    and yet it does fine, and I leave it running for months at a time, no BSOD.

    Mach4 is pretty stable but you can crash it, but even a Mach4 crash still does not cause BSOD. I think you need a new PC. It does not need to be powerful,
    one of the kids cast-off laptops would be fine. I would expect never to have BSOD...and you should not put up with it. There are enough challenges in getting good
    parts from your CNC without BSOD BS.

    Good home switches are worth their weight in gold. I use roller plunger Omron types:
    https://nz.element14.com/omron/z-15g...ller%20plunger

    Craig

  17. #17

    Re: How do i pick up from where i left off?

    Quote Originally Posted by joeavaerage View Post

    Mach4 is pretty stable but you can crash it, but even a Mach4 crash still does not cause BSOD. I think you need a new PC. It does not need to be powerful,
    one of the kids cast-off laptops would be fine. I would expect never to have BSOD...and you should not put up with it. There are enough challenges in getting good
    parts from your CNC without BSOD BS.


    Craig
    The PC was one from an old project a few years ago and I'm pretty sure its either the Ram or the SSD. I just haven't had the time to troubleshoot it. I do have another PC, touchscreen from yet another project i might switch over too just so i don't have to TS the other one!

  18. #18
    Join Date
    Nov 2013
    Posts
    4280

    Re: How do i pick up from where i left off?

    Hi,
    highly recommended, my machine PC runs for months at a time between shutdowns/reboots, and even then it tends to be because I want to turn off the incoming AC supply that I might
    work on hardware, like installing a new pump or a fourth axis. Very seldom do I ever have to close or crash Mach or use Task Manager to end it.

    A useful tip is to use g54,g55,g56 etc wisely.

    g54 (g55, g56 etc) is a work offset which is a set of data, about 10 items that define a work offset in machine units from the machine Zero. Commonly if you start a job the machine will assume
    g54, the first offset. Note that g54 is modal, that is to say that it will remain in force UNTIL you nominate another, say g54.1P15 for example. You may view and even edit the work offsets
    called the Fixture Table which can in turn be found on the Offsets tab, per the pic attached.

    Lets say you are working on a part that might take a few hours and you are concerned about losing reference over that time. If you at the start of the job include a line g54.1p15 for example
    that work offset will be applied to the job. Lets say you now jog to pick up the corner of the material. Each time you zero an axis the work offset g54.1P15 is updated. Eventually you dial in
    on your work offset 0,0,0. At that time the g54.1P15 entry in the fixture table will be populated with the machine coordinate positions of the work zero 0,0,0.

    Should the machine or PC crash you can restart, reference to your switches and MDI g54.1P15 and you'll now be able to drive to the pre-existing work zero with the <GoToWorkZero> button. Easy.
    It pays to have the Z axis near top of it travel so the machine can move in X & Y without tagging the spindle when using <GoToWorkZero>!.

    This procedure is pretty easy but absolutely relies on being able to reference your machine accurately and repeatably every time. I promise you it will be a night and day difference once you get
    good home switches.

    Craig

Similar Threads

  1. Trying to pick a machine
    By Torontocnc in forum DIY CNC Router Table Machines
    Replies: 1
    Last Post: 04-07-2018, 07:41 AM
  2. Speed pick-up
    By mccafferty in forum Shopmaster/Shoptask
    Replies: 5
    Last Post: 12-03-2014, 01:10 PM
  3. Trying to pick the right operation
    By murphmoose in forum Tormach Personal CNC Mill
    Replies: 10
    Last Post: 03-27-2011, 07:40 PM
  4. Why did you pick your avatar?
    By WallCrawler in forum Community Club House
    Replies: 24
    Last Post: 10-20-2003, 01:53 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
  •