Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: zmajmr on January 17, 2018, 02:55:48 PM

Title: How to resume after G code is stopped safely - problem
Post by: zmajmr 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  :)

Title: Re: How to resume after G code is stopped safely - problem
Post by: TOTALLYRC 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
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr 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.
Title: Re: How to resume after G code is stopped safely - problem
Post by: rcaffin 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
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr 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.




Title: Re: How to resume after G code is stopped safely - problem
Post by: wmgeorge on January 19, 2018, 09:06:06 AM
Does not the Gcode FR  display in the window to the right?  Set manually if needed.
Title: Re: How to resume after G code is stopped safely - problem
Post by: Davek0974 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.
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr 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).
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr 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.
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr 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.
Title: Re: How to resume after G code is stopped safely - problem
Post by: Overloaded on January 19, 2018, 01:38:03 PM
A few things you could try to eliminate the problem and negate the work-around.

Adjust the speed/feed rates  (power permitting)
Generate chips instead of a bird nest.
More appropriate tooling (2 flute ?)
Pilot hole ?
Change drilling strategy (peck)

Similarly: If turning the OD and stalling the spindle, I'd adjust the doc, feed and speed appropriately to match the machines capabilities instead of the approach you are taking.

Kind regards,
Russ
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 19, 2018, 04:06:16 PM
A few things you could try to eliminate the problem and negate the work-around.

Adjust the speed/feed rates  (power permitting)
Generate chips instead of a bird nest.
More appropriate tooling (2 flute ?)
Pilot hole ?
Change drilling strategy (peck)

Similarly: If turning the OD and stalling the spindle, I'd adjust the doc, feed and speed appropriately to match the machines capabilities instead of the approach you are taking.

Kind regards,
Russ

Hi Russ, yes this is work around what you suggest, even how I bore holes like this is work around how I initially started, I bore 8.5 mm pilot hole and used carbide boring bar to increase inside bore, and I was stalling spindle because of chips built inside of hole which is deep. So I changed strategy, made spindle overload protection about I talked in topic to protect tools.  So in video that is possible to see I already bore 8.5 mm pilot hole, then bored 12 mm hole with 4 flute endmill and after that bore with 4 flute 14 mm end mill. I am using peck drilling, I even made pauses where after few peck I  clean end mill. So machining process is not problem for me, problems is that I ran complicated programs then this from example and saw that weird things are going on when I pause feed or stop program and I want to continue where I stopped. As it all develops pretty fast in front of screen you are not sure did you think that something is going on strange or you just think that you made it up and probably everything is Ok. So just to be on safe side I rewind program in most cases and start from zero and that means spending lot of time cutting air. So now when I finally mange to see on simple example what is going on I am trying to figure out is it possible to make something in mach 3 in order to solve that problem or I will edit post processor to generate feed value for every G01 command (which I still did not mange to do).

My machine have 1.5 kW motor , originally it was around 4 Kw motor  but when I bough machine it came with 1.5 kw so I left it , so motor could be stronger but that is not what interests me, I am asking about software solution of problem if it exist. Anyway thank you for help, and yes I have also bird nest and they prevent coolant to get inside deep in hole,so this is why I made also spindle protection system. When I turn OD I can use higher RPM and motor then have more torque so there I do not have problems.
Title: Re: How to resume after G code is stopped safely - problem
Post by: wmgeorge on January 19, 2018, 04:24:13 PM
FYI Nobody watches a 36 minute video.
Title: Re: How to resume after G code is stopped safely - problem
Post by: Overloaded on January 19, 2018, 04:31:27 PM
Hi zmajmr.
I hope you find the solution that works for you. Mach3 "is what it is" and will never be troubleshot or developed further.
I'm sorry I can't help you with that part.

I did not notice the peck in your video.
Maybe you could try a peck with full retract cycle in order to keep the tool and the bore clean ?
All I can offer is various machining strategies.
Regards,
Russ
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 19, 2018, 04:45:19 PM
FYI Nobody watches a 36 minute video.
I assume that majority will not watch 36 min video, I posted 4 minute video before that 36 min and i conclude even 4 minute is to long concluding from what I can read in topic, but if somebody will have or will be aware of problems like I do maybe it will watch 36 min video, 4 min video is part from 36 min video where I basically talk about all what is written here. I also do not watch videos about thing that do not interests me but if video is about that will solve my problems I will watch it FYI.
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 19, 2018, 05:02:12 PM
Hi zmajmr.
I hope you find the solution that works for you. Mach3 "is what it is" and will never be troubleshot or developed further.
I'm sorry I can't help you with that part.

I did not notice the peck in your video.
Maybe you could try a peck with full retract cycle in order to keep the tool and the bore clean ?
All I can offer is various machining strategies.
Regards,
Russ

Hi Russ one more time, I know that Mach 3 will not be developed further because Mach 4 exist, I was trying to find out do I wrote something in wrong format (I am talking about Gcode) so that is maybe  reason why is this happening or is it possible to edit something in Mach 3, some function by me, something I do not know, that is it, mainly I was expecting to hear what I could do software wise.  You are right you probably did not see end mill how it goes in and out because I remove it out of tool changer for testing purposes but If you read G code from example you will see that starting point is Z = 1 mm and endmil enters 3 time out of part untill it rich full depth.
Will try to edit postprocesor from CAM that I am using to generate  G01 together with Feed value and will use Mach 3 like that, main thing that everything work as I expect, more letters on screen will not hurt me or my computer :) Will make short video about drilling hole.
Title: Re: How to resume after G code is stopped safely - problem
Post by: Overloaded on January 19, 2018, 06:18:35 PM
If you are fixed on a sw solution so be it ... I wish you all the best.
 
IMO, your 25mm (+/-) peck depth is a bit excessive considering the results you are experiencing.
That's producing a BIG birdnest between each retract.
Drilling 75mm (+/-) deep might perform better with more frequent pecks.

Just something I would experiment with.
Good luck to you, my friend,
Russ

Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 19, 2018, 06:58:04 PM
If you are fixed on a sw solution so be it ... I wish you all the best.
 
IMO, your 25mm (+/-) peck depth is a bit excessive considering the results you are experiencing.
That's producing a BIG birdnest between each retract.
Drilling 75mm (+/-) deep might perform better with more frequent pecks.

Just something I would experiment with.
Good luck to you, my friend,
Russ



Hi, here is video , just to get idea how I drilled until I figured out how many pecks is needed and until I decide to add 15 seconds pauses after every peck with 14 mm (there is no pauses shown in video) end mill so I can clean long chips from end mill and also , I show "system" and example where it is possible to see how it stopped boring operation safely.

https://youtu.be/b6eO-k6hoyw

After every attempt I improved something until I got G code where nothing will be stalled, I only need to clean chips from end mill and like I said I add feed information with every G01 but manually (so just in case "system" is triggered I can contine from where I stopped) , so will try to make to postprocessor do that instead of me. When you make holes wit endmill, endmill need to be aligned pretty good with axis of spindle otherwise is chatters , so when you remove it in and out until it gets in contact with material it makes nasty sound so less pecks better for my ears , this is why I only have 3 pecks, for pilot hole with 8.5 mm drill which is not shown in video I have 26 pecks, but I was not concentrating on machining process so this is why there is no all that in video, I also cut of out of video those noises to save your ears :)
Anyway thx to all you guys for help, if I manage to make post processor to "spit" code as I want that will be next video.
Title: Re: How to resume after G code is stopped safely - problem
Post by: garyhlucas on January 19, 2018, 07:36:16 PM
Zmajmr,
What you want is to do something wrong and the machine will gracefully stop and let you try again?  Hitting the Stop button, not E-stop while any axis is moving looses position. It may be a small amount if your machine is slow and you don’t notice it. My machine travels quite fast and no way I can recover from a Stop push, but no problem with feed hold. So lets work on your skills.

When drilling a hole almost any depth always use a peck until you know how the material reacts. The CNC can’t that you can drill 3 holes and will suddenly wrap the chip. A peck is a chip breaking technique that is why it is there.  

When opening up a hole you drilled using a boring bar try pecking that too. Going from a 1/2” drilled hole to a 1” hole x 2” deep, do it in 1/4” pecks leaving a little for a full depth finish pass.  This will keep the chips from packing.  The part will be stiffer for each cut and may reduce chatter.

When you program a part set your feeds higher than you think you need. Mach 3 feed overide goes up only 250% but it can go down 20 to 1 to 5% with no problem. Then always start with the overide way down and increase it until it is cutting properly.

The faster you can feed the better. Not only do you get done faster but tool life goes up to. That happens because the cutting edges pass through the material less time. A heavier cut also helps to break the chip. If you haven’t broken any cutters by feeding too fast you should. You will likely be shocked how far from too fast you really are. I had a slotting job in steel that was 1/3 done and had worn out 3 end mills. Pushing the feed way up finished the job in half the time using one endmill.
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 20, 2018, 05:42:04 AM
Zmajmr,
What you want is to do something wrong and the machine will gracefully stop and let you try again?  Hitting the Stop button, not E-stop while any axis is moving looses position. It may be a small amount if your machine is slow and you don’t notice it. My machine travels quite fast and no way I can recover from a Stop push, but no problem with feed hold. So lets work on your skills.

When drilling a hole almost any depth always use a peck until you know how the material reacts. The CNC can’t that you can drill 3 holes and will suddenly wrap the chip. A peck is a chip breaking technique that is why it is there.  

When opening up a hole you drilled using a boring bar try pecking that too. Going from a 1/2” drilled hole to a 1” hole x 2” deep, do it in 1/4” pecks leaving a little for a full depth finish pass.  This will keep the chips from packing.  The part will be stiffer for each cut and may reduce chatter.

When you program a part set your feeds higher than you think you need. Mach 3 feed overide goes up only 250% but it can go down 20 to 1 to 5% with no problem. Then always start with the overide way down and increase it until it is cutting properly.

The faster you can feed the better. Not only do you get done faster but tool life goes up to. That happens because the cutting edges pass through the material less time. A heavier cut also helps to break the chip. If you haven’t broken any cutters by feeding too fast you should. You will likely be shocked how far from too fast you really are. I had a slotting job in steel that was 1/3 done and had worn out 3 end mills. Pushing the feed way up finished the job in half the time using one endmill.

Hi , thx for post, I do not claim that I do know everything about machining but I understand lot of things that you wrote but as I wrote my machine (cnc lathe have 1.5 Kw motor for spindle motor instead original 4 Kw motor, so even with this what I am doing I am pushing my machine).

So just to try to explain what is the problem for me, lets ask our self first one things , is this what will follow next legit G code that Mach 3 can "understand" , maybe somebody see something that I do not see:

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

I will try to explain it by words, select tool number 2, position that toll in Z axis with coordinate Z=5 mm , set Spindle RPM to 1000, set spindle direction to M4, set Feed to 40 mm/ min, from there go with rapid feedrate to Z = 1 mm. From point Z= 1 mm start to drill hole with feed 40 mm/ min , go till coordinate Z =Z-24.633 mm, after that retract with rapid feed rate to Z = 1 mm and so on...

So in my opinion it is legit G code that Mach  3 can understand (I believe).

Now lets focus (I mean really hard :)) "go till coordinate Z = Z-24.633"  or originally written N140 G01 Z-24.633 and let imagine that I pressed Feed hold button in Mach3 (I could pressed E stop or Stop file but I decided on purpose to press Feed hold check 4 min video if you do not believe me https://youtu.be/VSHC9O4CVrA).

Now, let ask our self what we expect with which feed will machine continue to move after we press Cycle start button?

Options available : a) F =40 mm/min
                         b) rapid feed rate
                         c) F = 300 mm/min
                         d) something else

Anwser is......................





b) + c)  (rapid feedrate , and then F = 300mm/min)



And my question is why?

Please look where is F = 300mm/min written in G code, and try to count how many times there is G01 command before you get to command
N205 S300 F300


To be honest I never experienced that machine lose position after I press Stop file, I have toolchanger as Y axis so I would notice that something is strange, tools would be unlocked, x axis needs to be on x=0 when I drill, so I would notice there also that something is strange, and when I am drilling I use Feed 40mm/min so there no reason in my mind to lose anything.

Thing is if you watch my 4 min video that I would lose my tool ,I would jam it with 300 mm/min inside part that I am trying to drill  or in better case I would just push part inside of chuck and score surface of part, .

I appreciate all comments but I have feeling like I asked question on Practical Machinist forum and not on Mach 3 forum , just little joke :)

Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 20, 2018, 04:48:05 PM
problem solved, check video if you are interested

https://www.youtube.com/watch?v=mG0e0Jv_jik
Title: Re: How to resume after G code is stopped safely - problem
Post by: garyhlucas on January 20, 2018, 07:42:38 PM
The why is very simple. All CNCs apply look ahead. They don’t process one command at a time. A G1 is a cutting move and what follows is important too. If it is the last cut the tool must come to a complete stop. If it is an arc and you have continuous motion enabled it needs to consider the radius to decide how to slow down but not stop. It also must calculate the deceleration moves involved. These calcs get done as quickly as possible and stuffed into a buffer that is feeding the commands to the motor. so to actually maintain position you need to empty the buffer in a feedhold. Hitting Stop basicly says forget about where the tool is and stop as fast as possible.  See your 300mm rapid? On my machine the rapid move is 7600mm/min!
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 21, 2018, 03:08:59 AM
The why is very simple. All CNCs apply look ahead. They don’t process one command at a time. A G1 is a cutting move and what follows is important too. If it is the last cut the tool must come to a complete stop. If it is an arc and you have continuous motion enabled it needs to consider the radius to decide how to slow down but not stop. It also must calculate the deceleration moves involved. These calcs get done as quickly as possible and stuffed into a buffer that is feeding the commands to the motor. so to actually maintain position you need to empty the buffer in a feedhold. Hitting Stop basicly says forget about where the tool is and stop as fast as possible.  See your 300mm rapid? On my machine the rapid move is 7600mm/min!
Hi, this is what I was asking whole time, thank you answering, now it have little more sense .

But I still do not understand, I am machining with feed 40 mm/min and I press Feed Hold and when I press Cycle start Mach3 takes feed 300 mm/min. So, it should continue with feed 40 mm/min not 300/min , that is problem in my opinion, I tested Feed Hold, Stop file, same result for me.

My machine have rapid 4000 mm/min but I set it to 2100 mm/min.
Title: Re: How to resume after G code is stopped safely - problem
Post by: garyhlucas on January 21, 2018, 11:23:56 AM
Mach 3 can’t rewind the buffer. So it starts up again at the next line after the buffer. Mach 3 can be restarted anywhere in the program. However you really need to think about this because if the 300mm feed rate got applied in the buffer then you need to start at a point before the 40mm feed was called and you should make sure the first move after that is a safe one. Preferrably it is a move to the clearance plane.
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 21, 2018, 01:44:53 PM
Mach 3 can’t rewind the buffer. So it starts up again at the next line after the buffer. Mach 3 can be restarted anywhere in the program. However you really need to think about this because if the 300mm feed rate got applied in the buffer then you need to start at a point before the 40mm feed was called and you should make sure the first move after that is a safe one. Preferrably it is a move to the clearance plane.

I read couple of time what you wrote and only question is that I am asking my self does Feed Hold button have any purpose then, if I press Feed Hold button, machine will not stop in same second, it will stop slow but safe and it should be able to continue from that line in G code where process was stopped when I press Cycle start button, if that is not the case I do not see any reason why Feed Hold exist (except to stop G code and to start after all from zero).

You say : "Mach 3 can’t rewind the buffer"

I ask my self why it should rewind buffer at all, I just want machining process to continue from point from where I pressed Feed Hold (Even I like more Stop file, but will pretend that I will use Feed hold, I tested both and I see no difference except feed hold is slower and it does not turn off spindle, and coolant and so on..)

So in buffer should be information that I set Feed to 40 mm/min and couple of commands down I use G01 movement , and all the way down I set Feed to 300 mm/min, why would in buffer be 300 mm/min , I do not understand that part? Is there any link wher I can find how buffer works (intuitive for me is that I should not even care how it works, logical would be if I press feed hold, it stops with one feed and when I want to continue it should carry on with same feed).
Title: Re: How to resume after G code is stopped safely - problem
Post by: Davek0974 on January 21, 2018, 02:57:01 PM
"Feed Hold" is exactly what it says - it will hold the process at the next opportunity i.e. it stops filling the buffer and allows it to empty then pauses or holds. I have used it a few times when i have not been happy with my hold-downs, paused, added another clamp then continued etc. It does not "Stop" the machine - for this you use the stop button or the big red button if its going to hit the fan ;)

Two different actions and two different methods of achieving them.
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 21, 2018, 03:32:51 PM
"Feed Hold" is exactly what it says - it will hold the process at the next opportunity i.e. it stops filling the buffer and allows it to empty then pauses or holds. I have used it a few times when i have not been happy with my hold-downs, paused, added another clamp then continued etc. It does not "Stop" the machine - for this you use the stop button or the big red button if its going to hit the fan ;)

Two different actions and two different methods of achieving them.

You are right , but then what is procedure to continue with same feed after Feed Hold is pressed and about what all I should take care before I dare to press Cycle start ? So to be more vivid, my tool changer does not moves, but my spindle rotates with 1000RPM and somewhere down in my Gcode there is command
S300 F300, few seconds ago before I pressed Feed hold was active command G01 -23.5  F40 mm/min, what you think what will happen if I press Cycle start (I know I must be boring probably :) ) ?


So in other words what should I do to be by text book in order to know outcome of result when I press cycle start if I pressed Feed hold before Cycle start?
Title: Re: How to resume after G code is stopped safely - problem
Post by: wmgeorge on January 21, 2018, 06:05:00 PM
I think Dave just told you, it works fine for him. What is different on your machine or controller than his?  If other people are having the same issue as you,  they would say so.  For me, with just a simple router, Feed Hold works as described per Dave. It runs the buffer out and stops and will restart at the next line.
Title: Re: How to resume after G code is stopped safely - problem
Post by: garyhlucas on January 21, 2018, 06:10:21 PM
zmajmr,
When you pressed feed hold it was already too late!  The speed change was already in the buffer. Seriously, thousands of machines operate this way without problem and you want to argue that it is wrong because you lack the necessary programming skills to do it correctly.  Work on that, you'll get there faster.
Title: Re: How to resume after G code is stopped safely - problem
Post by: RICH on January 21, 2018, 08:01:12 PM
zmajmr,
Mach 3  is the way it is, there will be no updates or changes, and as already been posted things work the way they work and not how you want or envision how something  should work.
 
Get over it and use what you now  know  and move forward.

RICH
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 22, 2018, 04:05:28 AM
RICH , garyhlucas, wmgeorge,  guys , just so I do not need to write 3 separate posts...

RICH I moved forward, long time ago (there is video on top of this page where I showed that I made changes in post processor as I planed) because I know Mach3 will not be updated or will be no changes, I am using CSMIO IP S motion controller for my CNC lathe and because of that I am using some older version of Mach3 because guys from CS Lab recommended to use it otherwise they can not help me with my other problems that I had because then there is no sense, I wanted to tell you, when I bought my Mach3 license I envision that newest Mach3 version is the best, apparently I was wrong (I listen always people who have more experience then me).

Now back on topic, "how you want or envision how something  should work", so I went to Mach3 Turn manual I went to find what it say what is function of each button , so it say:

Cycle Start: This will run the part program from the current block (line) or continue after a feed hold or an M00 or M01 command.

Feed Hold: Will stop the part program running as soon as possible but in a totally controlled way so that it can be restarted. Spindle and Coolant will stay on if they were on at the time of the Feed Hold. During Feed Hold you can perform whatever operation, such a jogging, updating Wear offsets in the tool table, altering spindle speed etc. that is required to overcome a problem with the machining. Cycle Start will resume the run of the program.

Stop: Will stop the run of the part program as quickly as possible. Resumption of the run will not generally be possible and the axes may have lost or gained steps due to the rapid stop so the lathe needs to be re-referenced.

I also went to find in Mach3Turn manual pdf document word "buffer" and zero finds.

So under Feed Hold it say : "Cycle Start will resume the run of the program."  I am just trying to find out how and to be sure so I can stick to that principle. And also wanted to find why, and we started to talk about that only on third page after we went through about machining techniques.

wmgeorge you say : "It runs the buffer out and stops and will restart at the next line." So you say that buffer is ran out , does that means it is empty?

garyhlucas you say : "When you pressed feed hold it was already too late!  The speed change was already in the buffer."

And I say that makes sense to me , not just because I understand how thousand of other machine operate , because I saw that on my machine with Mach3 ,from some reason Mach3 continues with feed 300 mm/min(which is 8 to 10 lines down) instead 40 mm/min.
I am not trying to argue I am just trying to figure out what is going on, if it works like that I do not see solution other then write my G code like I said I would and apparently I will, it looks there must be feed command with every G01 command if I expect to resume with feed with which I activated Feed Hold button.

then you say :"... because you lack the necessary programming skills to do it correctly". I also asked did I wrote something wrong in my G code that maybe I do not see , I do not claim that I know much about G code programming because I use CAM all the time and I just make minor corrections in already made  G code manually.

So if somebody know some good link about Mach3 buffer please let me know.

And last thing what it say for Stop file ?

Stop: Will stop the run of the part program as quickly as possible. Resumption of the run will not generally be possible and the axes may have lost or gained steps due to the rapid stop so the lathe needs to be re-referenced.

will not generally be possible  ,    may have lost

Like I wrote from my experience I generally can continue from Stop file and did not lose anything, probably because when I drill I do not use rapid federate.

So basically maybe I should name this topic how Mach3 buffer works and what all you know about it :)



Title: Re: How to resume after G code is stopped safely - problem
Post by: RICH on January 22, 2018, 05:15:14 AM
How the buffer actually functions "internally" in Mach I do not know. It's just transparent to me and frankly don't care.

RICH
Title: Re: How to resume after G code is stopped safely - problem
Post by: Davek0974 on January 22, 2018, 06:56:21 AM
There was a document floating on the 'net from Art IIRC it was very in depth as to the internals of M3 and very interesting reading reading, M3 is indeed a very clever bit of software.

Think i can find it now :(

Of course not.
Title: Re: How to resume after G code is stopped safely - problem
Post by: olf20 on January 22, 2018, 07:17:01 AM
What is your "look ahead" setting? The higher the
number the longer it takes for M3 to empty the buffer.
olf20 / Bob
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 22, 2018, 07:32:12 AM
What is your "look ahead" setting? The higher the
number the longer it takes for M3 to empty the buffer.
olf20 / Bob

Hi BoB, my look ahead is set on 20, never change it because did not know what it does, but now I have some idea for what is serves. So I assume I should set it on 3 and would in that case still have feed 40 mm/min ?
Title: Re: How to resume after G code is stopped safely - problem
Post by: Davek0974 on January 22, 2018, 07:38:14 AM
I would not go lower than 20, I think mine is on 100 IIRC, a setting of 3 could upset the trajectory planner i reckon.
Title: Re: How to resume after G code is stopped safely - problem
Post by: wmgeorge on January 22, 2018, 08:30:12 AM
Since your using an older version of Mach its possible some of your concerns were addressed in the later or final versions.  Once again if Feed Hold is working for others, your controller or the older version might be an issue.  Have you contacted the vender for your controller?
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 22, 2018, 09:12:51 AM
Since your using an older version of Mach its possible some of your concerns were addressed in the later or final versions.  Once again if Feed Hold is working for others, your controller or the older version might be an issue.  Have you contacted the vender for your controller?
Guys which work  in CS LAB told me to use version of Mach 3 :Version R3.043.053, because with that version there is only few problems which are tolerable, and they professionally retrofit machines with Mach3 and their motion controller so they for sure have much more experience then me.

I am using Mach3 few years and last year pretty often so as I create more and more different G code programs I have opportunity to notice some thing for which when I started thought they are normal , or in most cases did not want to gamble so lot of time just to be sure I rewind program and start from start if I had some problems, or in some cases I would reload program and load it again, or I even was not aware what would happen if I press cycle start , pure lack saved me. So after some time you manage to notice some things that do not seams normal. So, for example, when I use G code version of program from page 1  where there do not exist command S300 F300 there is no problem, you can say even with my version of Mach3 feed hold works as intended , but when I write command at the end of G code program, S300 F300 and I press Feed Hold at line where I have command G01 -20 F40  then you can notice /say that Mach 3 does not work as you thought that it works, so I am just trying to find out how it works in order not to experience some nasty surprise.

Like I wrote I found workaround with editing post processor so I will have for each G01 command F (feed) command, I make all G codes with CAM, so it is no problem how Mach3 works, it works how it works , I am just curious to find out how it works in order to  know what I can expect from each situation I am in.
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 22, 2018, 10:54:11 AM
I would not go lower than 20, I think mine is on 100 IIRC, a setting of 3 could upset the trajectory planner i reckon.

Well I do not know nothing about that how it works, hope somebody will explain .
Title: Re: How to resume after G code is stopped safely - problem
Post by: Davek0974 on January 22, 2018, 01:45:47 PM
I would not go lower than 20, I think mine is on 100 IIRC, a setting of 3 could upset the trajectory planner i reckon.

Well I do not know nothing about that how it works, hope somebody will explain .

AS I understand it....

Inside Mach (and probably all CNC controllers) there is a thing called the trajectory planner - its responsible for calculating the deceleration and acceleration for constant velocity (CV) moves as the code runs, amongst other things, probably works out radii from different input as well and so on - it plans the trajectory of the tool path on the machine.

The planner does its calculations and feeds the results into the code buffer, this is like a safety net so the machine can keep running smoothly - if the buffer empties on the job, you get a "Buffer Underrun" and the motion will stop or stall for an amount of time until there is sufficient code to make more moves - this is ALWAYS a bad thing and will make a mess.

Now, to stop an underrun Mach has to work in front of where the machine currently is - it takes time to do its calculations - measurable time, so to stop a risk of under run as well as correctly plan the trajectory, Mach has to "Look Ahead" a set amount of code lines - the look ahead setting. Its really not that vital now as PC's are pretty damn fast these days and 20 lines ahead seems ok, mine is 100 but i cant recall why now.

You can force an underrun if you like, just use the PC for something like a screen-saver or anything that will divert processor cycles away from Mach3's intensive use and your machine will stall and stutter like hell - this is why we use bare-bones setups for running Mach3. There is a very fine line between OK and underrun and it takes little to upset it, setting the look ahead too short will make it worse. If using the parallel port things get even tighter as the PC has to generate millions of stepper pulses and control the LPT port as well as updating the user interface - DRO's and the path indicator etc

Mach3 is a brilliant bit of software and i'm glad i have access to it really.


An analogy (of sorts) - the trajectory planner in a racing car - the drivers brain.

You are driving along and see a corner, you have no trajectory planner, so you drive to the corner and either take it at full speed (CV) or stop then take the corner (exact stop) - chances are you will crash with taking it at full speed and exact stop will annoy other racers as you stop and then turn.

Now, with the trajectory planner installed in your head, your eyes give it "look-ahead" - you can see the corner approaching a way off, your brain assesses a safe speed in which to take the corner, you slow in time (decelerate), take the corner and then accelerate away at feed-rate again.

The buffer kind of lets you see the next corner and the one after it.
Title: Re: How to resume after G code is stopped safely - problem
Post by: zmajmr on January 23, 2018, 01:22:28 PM
I would not go lower than 20, I think mine is on 100 IIRC, a setting of 3 could upset the trajectory planner i reckon.

Well I do not know nothing about that how it works, hope somebody will explain .

AS I understand it....

Inside Mach (and probably all CNC controllers) there is a thing called the trajectory planner - its responsible for calculating the deceleration and acceleration for constant velocity (CV) moves as the code runs, amongst other things, probably works out radii from different input as well and so on - it plans the trajectory of the tool path on the machine.

The planner does its calculations and feeds the results into the code buffer, this is like a safety net so the machine can keep running smoothly - if the buffer empties on the job, you get a "Buffer Underrun" and the motion will stop or stall for an amount of time until there is sufficient code to make more moves - this is ALWAYS a bad thing and will make a mess.

Now, to stop an underrun Mach has to work in front of where the machine currently is - it takes time to do its calculations - measurable time, so to stop a risk of under run as well as correctly plan the trajectory, Mach has to "Look Ahead" a set amount of code lines - the look ahead setting. Its really not that vital now as PC's are pretty damn fast these days and 20 lines ahead seems ok, mine is 100 but i cant recall why now.

You can force an underrun if you like, just use the PC for something like a screen-saver or anything that will divert processor cycles away from Mach3's intensive use and your machine will stall and stutter like hell - this is why we use bare-bones setups for running Mach3. There is a very fine line between OK and underrun and it takes little to upset it, setting the look ahead too short will make it worse. If using the parallel port things get even tighter as the PC has to generate millions of stepper pulses and control the LPT port as well as updating the user interface - DRO's and the path indicator etc

Mach3 is a brilliant bit of software and i'm glad i have access to it really.


An analogy (of sorts) - the trajectory planner in a racing car - the drivers brain.

You are driving along and see a corner, you have no trajectory planner, so you drive to the corner and either take it at full speed (CV) or stop then take the corner (exact stop) - chances are you will crash with taking it at full speed and exact stop will annoy other racers as you stop and then turn.

Now, with the trajectory planner installed in your head, your eyes give it "look-ahead" - you can see the corner approaching a way off, your brain assesses a safe speed in which to take the corner, you slow in time (decelerate), take the corner and then accelerate away at feed-rate again.

The buffer kind of lets you see the next corner and the one after it.

thx for posting