Hello Guest it is March 28, 2024, 01:59:51 PM

Author Topic: How to resume after G code is stopped safely - problem  (Read 10768 times)

0 Members and 1 Guest are viewing this topic.

How to resume after G code is stopped safely - problem
« on: January 17, 2018, 02:55:48 PM »
Hi community, I have little problem / question.

I will give you real example , that will be G code for drilling process

N20 G21 G18 G64 G80 G90 M48 G90.1 G40 G49
N30 M08
; TOOL definition
N50 T0909
N60 G00 X0.0 Z10.0
N70 G49
N80 ( End Mill  12mm Dia )
N90 T0202
N100 G00 X0.0 Z5.0
N110 G97 S1000
N120 M04 G94 F40.0
N130 G00 Z1.0
N140 G01 Z-24.633
N150 G00 Z1.0
N160 Z-23.633
N170 G01 Z-49.267
N180 G00 Z1.0
N190 Z-48.267
N200 G01 Z-73.9
N210 G00 Z1.0
N220 M05 M09
N230 M30

Lets imagine spindle "feels" to much load at line N140 and Stop file is triggered /pressed, at line N120 there is command that sets feed at 40 mm/ min and when I resume with executing G code machine will continue with feed 40 mm/ minute (after I clean chips, press M4 manually and press Cycle start).

Now thing is when my endmill completed job of drilling hole I want to be retracted @ 300 RPM and Feed 300mm/min so I made little change in G code

N20 G21 G18 G64 G80 G90 M48 G90.1 G40 G49
N30 M08
; TOOL definition
N50 T0909
N60 G00 X0.0 Z10.0
N70 G49
N80 ( End Mill  12mm Dia )
N90 T0202
N100 G00 X0.0 Z5.0
N110 G97 S1000
N120 M04 G94 F40.0
N130 G00 Z1.0
N140 G01 Z-24.633
N150 G00 Z1.0
N160 Z-23.633
N170 G01 Z-49.267
N180 G00 Z1.0
N190 Z-48.267
N200 G01 Z-73.9
N205 S300 F300
N210 G01 Z1.0
N220 M05 M09
N230 M30

notice line N205 and N210

Now , if I activate Stop file button at line N140 as in example above and I clean chips, press manually M4 , Cycle start it is logical to me that Mach3 resume/ continue from where it stopped with executing G code with feedrate @ everything was stopped, BUT it will resume with Feed 300 mm/min.

Now I would like to know why, and is it possible to change something in order to that not be like that (edit some function, or do I write my Gcode wrong, it can be very dangerous and I become aware of that before few days ago even I use my CNC lathe for some time and I saw that something strange is going on but never succeed to define what is going on because all my programs are created with CAM and are much longer then this simple example.

I even made 10 minute video where I described what is going.

It came to my mind to try to edit post processor to generate with every G01 command Feed value , so will have redundancy , did not succeed yet with that idea so I am wondering do I do something wrong, and what is usual thing to do.

I can after every Stop of executing Gcode press Rewind button and start G code from line zero (start) but that is waste of time because usually 90 % of job is done already and I would cut air  90% of time.

Here is video

https://youtu.be/eYbE-kntcss

Thank you in advance for any help or idea, suggestions or something else  :)

« Last Edit: January 17, 2018, 03:01:16 PM by zmajmr »
Re: How to resume after G code is stopped safely - problem
« Reply #1 on: January 17, 2018, 04:59:11 PM »
Don't use the stop button, use feed hold. Using the stop button requires you to start over.Feed hold pauses the motion.You can then turn off the spindle, do what you need to do and then hit cycle start.

Mike
We never have the time or money to do it right the first time, but we somehow manage to do it twice and then spend the money to get it right.
Re: How to resume after G code is stopped safely - problem
« Reply #2 on: January 18, 2018, 04:56:21 PM »
Don't use the stop button, use feed hold. Using the stop button requires you to start over.Feed hold pauses the motion.You can then turn off the spindle, do what you need to do and then hit cycle start.

Mike
Hi Mike, there was situations where I used feed hold in past , thing why I do not like to use it is because it stops with movement of axis when Mach decide, sometimes it is 1 second , sometimes 2 or 3 seconds. If there is no danger of destroying your tool (there is nothing that will stall your spindle) then you can use Feed Hold but when you want immediately stop everything then you need to use Stop File or E Stop. For given G code example I went to try what will happen even if i use Feed Hold and result was not good. Only thing that helped was that I edited manually G code (given example) and every G01 command contains feed command, for example line N140 G01 Z-24.633 looks like this after my edit N140 G01 Z-24.633 F40 and after edit  there is no problems no matter if I use feed hold or stop file, only that stop file, stops movement of axis same second. Here is video of test if somebody is interested https://youtu.be/VSHC9O4CVrA

So if nobody does not have more ideas my only solution is to find out how to edit post processor to generate feedrate information with every G01 command.

Offline rcaffin

*
  •  1,052 1,052
    • View Profile
Re: How to resume after G code is stopped safely - problem
« Reply #3 on: January 19, 2018, 05:02:18 AM »
If you read the manual it will TELL you what STOP does. You can NOT continue from there. It is equivalent to an external eStop.
Yes, Feed Hold can take a while to execute, because there is stuff in the pipeline, AND the halt is subject to the deceleration for the motors.
No use complaining that the CNC does not do what you want when what you want is even more dangerous! Hit Stop and the spindle stops. Hit Cycle Start and there is NO M3 to turn the spindle back on.

You do NOT need to put a F40 at the end of every line. Just one F40 on a line by itself where you want the speed change is quite enough.

Cheers
Roger
Re: How to resume after G code is stopped safely - problem
« Reply #4 on: January 19, 2018, 06:39:50 AM »
If you read the manual it will TELL you what STOP does. You can NOT continue from there. It is equivalent to an external eStop.
Yes, Feed Hold can take a while to execute, because there is stuff in the pipeline, AND the halt is subject to the deceleration for the motors.
No use complaining that the CNC does not do what you want when what you want is even more dangerous! Hit Stop and the spindle stops. Hit Cycle Start and there is NO M3 to turn the spindle back on.

You do NOT need to put a F40 at the end of every line. Just one F40 on a line by itself where you want the speed change is quite enough.

Cheers
Roger

Hi Roger, I assume you did not watched 4 minute video in my post above yours.

So to clear things (I read manual and conclusion is that I need to test everything because I can read something and in reality /practice I see that something does not exist or does not work, do not have list of those things but in last 4 - 5 years I saw those kind of things while I was using Mach 3).

So from my experience you can use STOP and you can continue from point where you stopped BUT off course you need manually to TURN ON spindle and select appropriate rotation (M3 or M4) , you do not need to set Spindle RPM again, it is saved .

Diffrence between Stop file and E stop is that after E stop I need to press RESET  and rewind program, with Stop file I do not need press RESET and I can continue from point where I stopped but need to have appropriate feedrate , need to TURN ON spindle and select appropriate rotation.  

So as I mentioned in posts before problem is that Mach3 does not continue with feed with which I stopped no matter if I chose Feed hold or Stop File . If I use G code in this version:

N20 G21 G18 G64 G80 G90 M48 G90.1 G40 G49
N30 M08
; TOOL definition
N50 T0909
N60 G00 X0.0 Z10.0
N70 G49
N80 ( End Mill  12mm Dia )
N90 T0202
N100 G00 X0.0 Z5.0
N110 G97 S1000
N120 M04 G94 F40.0
N130 G00 Z1.0
N140 G01 Z-24.633
N150 G00 Z1.0
N160 Z-23.633
N170 G01 Z-49.267
N180 G00 Z1.0
N190 Z-48.267
N200 G01 Z-73.9
N210 G00 Z1.0
N220 M05 M09
N230 M30

There is no problem, my feed rate will be F40 no matter if I use Feed hold or Stop file but if I use G code in this version:

N20 G21 G18 G64 G80 G90 M48 G90.1 G40 G49
N30 M08
; TOOL definition
N50 T0909
N60 G00 X0.0 Z10.0
N70 G49
N80 ( End Mill  12mm Dia )
N90 T0202
N100 G00 X0.0 Z5.0
N110 G97 S1000
N120 M04 G94 F40.0
N130 G00 Z1.0
N140 G01 Z-24.633
N150 G00 Z1.0
N160 Z-23.633
N170 G01 Z-49.267
N180 G00 Z1.0
N190 Z-48.267
N200 G01 Z-73.9
N205 S300 F300
N210 G01 Z1.0
N220 M05 M09
N230 M30

notice line N205 and N210

and for example I activate Feed hold button @ line N140  Mach 3 for some reason set Feed to be 300 mm/ min just because I add line

N205 S300 F300

and I just want to retract with feed F300 , not with rapid feedrate.

And to confirm that there is no problems if I use G code in this shape :

N20 G21 G18 G64 G80 G90 M48 G90.1 G40 G49
N30 M08
; TOOL definition
N50 T0909
N60 G00 X0.0 Z10.0
N70 G49
N80 ( End Mill  12mm Dia )
N90 T0202
N100 G00 X0.0 Z5.0
N110 G97 S1000
N120 M04 G94 F40.0
N130 G00 Z1.0
N140 G01 Z-24.633 F40.0
N150 G00 Z1.0
N160 Z-23.633
N170 G01 Z-49.267 F40.0
N180 G00 Z1.0
N190 Z-48.267
N200 G01 Z-73.9 F40.0
N205 S300 F300
N210 G01 Z1.0
N220 M05 M09
N230 M30

So I am not complaining, I am wondering why Mach 3 does not work correctly even when I use Feed hold to  stop  at line N140.

And why I need instant stop, because I do not want to break tools, inserts ,displace toolchanger , Feed hold is just to slow for what I need it.
When you drill hole you can stall spindle if there is to many chips in hole and hole is deep and there no time to wait for Feed hold to take action, if spindle stops all axis need to stop also same millisecond. And when I clean hole I do not want to run program from begging because that is wast of time, I want to continue where I stopped , few mm +/-  .

Hope now is everything better understood.




Re: How to resume after G code is stopped safely - problem
« Reply #5 on: January 19, 2018, 09:06:06 AM »
Does not the Gcode FR  display in the window to the right?  Set manually if needed.
Retired Master Electrician, Commercial HVAC/R Service and lots of Hobbys.

Offline Davek0974

*
  •  2,606 2,606
    • View Profile
Re: How to resume after G code is stopped safely - problem
« Reply #6 on: January 19, 2018, 09:29:48 AM »

And why I need instant stop, because I do not want to break tools, inserts ,displace toolchanger , Feed hold is just to slow for what I need it.
When you drill hole you can stall spindle if there is to many chips in hole and hole is deep and there no time to wait for Feed hold to take action, if spindle stops all axis need to stop also same millisecond. And when I clean hole I do not want to run program from begging because that is wast of time, I want to continue where I stopped , few mm +/-  .


IMHO, The part in bold would be an example of when an e-stop could be used - you see a situation arising, it needs to stop, now! The answer is - press the big red button.

After that is what matters though - i would never attempt a quick restart after an e-stop, i would certainly re-ref the machine, check my co-ordinates, note the code line i stopped on, fix the issue and use run-from-here, unless near the start of the code where i would just run through the code again.
Re: How to resume after G code is stopped safely - problem
« Reply #7 on: January 19, 2018, 10:57:09 AM »
Does not the Gcode FR  display in the window to the right?  Set manually if needed.

Hi, I do not understand what you say/think/ask.

I can set manually feed but need to go back to manual  mode (do not like that idea).
Re: How to resume after G code is stopped safely - problem
« Reply #8 on: January 19, 2018, 11:13:14 AM »

And why I need instant stop, because I do not want to break tools, inserts ,displace toolchanger , Feed hold is just to slow for what I need it.
When you drill hole you can stall spindle if there is to many chips in hole and hole is deep and there no time to wait for Feed hold to take action, if spindle stops all axis need to stop also same millisecond. And when I clean hole I do not want to run program from begging because that is wast of time, I want to continue where I stopped , few mm +/-  .


IMHO, The part in bold would be an example of when an e-stop could be used - you see a situation arising, it needs to stop, now! The answer is - press the big red button.

After that is what matters though - i would never attempt a quick restart after an e-stop, i would certainly re-ref the machine, check my co-ordinates, note the code line i stopped on, fix the issue and use run-from-here, unless near the start of the code where i would just run through the code again.


Hi, you are definitely right that is situation when Estop can be used , imagine now system that will automatically stop spindle and movement of axis , you just need to decide at which RPM you still allow movement of drilling tool into work piece, for example if you drill something with 1000 RPM, and everything above 700 RPM is good, if RPM drops below 700 RPM everything should stop automatically in same second, this is how I did it https://www.youtube.com/watch?v=qaacj7kBw1s

So I do not need to see anything, just need to decide @ which RPM level  everything need to stop because it is not safe to continue, after that remove tool out, clean hole and continue.
After E stop I usually reload Gcode because have toolchanger  as y axis (and x and z are regular axis for lathe)  so sometimes my tools are messed up after E stop, this is why I prefer Stop file option, it is fast and no need to RESET and reload G code program, with one command/button I shut down spindle and all axis.
Re: How to resume after G code is stopped safely - problem
« Reply #9 on: January 19, 2018, 12:17:01 PM »
I made longer video where I show everything about I talked in this topic, what are problems and what I can do to resolve problem because I do not understand what to change in Mach 3 https://youtu.be/nUJe-3X-VJw

If somebody have more ideas please let me know.