Stop and restart program

More
01 Dec 2015 10:55 #66156 by albova
Hello
I have a rather long gcode
I also have a sub that controls the tool length every n times that g0 is executed and if the tool is within the tolerance date the program continues.
question:
if the tool is not within the tolerance, I have to stop the program and change the tool. How do I start from the point where it left off ?
I also need to know the line number from where to start.
Whatever idea is well accepted
Thank you

Please Log in or Create an account to join the conversation.

More
01 Dec 2015 11:36 #66159 by ArcEye
Replied by ArcEye on topic Stop and restart program

I also have a sub that controls the tool length every n times that g0 is executed and if the tool is within the tolerance date the program continues.
question:
if the tool is not within the tolerance, I have to stop the program and change the tool. How do I start from the point where it left off ?


You probably need to explain your subroutine a bit more. Exactly how does it determine if the tool is worn beyond tolerances?
Probing a contact?

If worn, what type of tool change is required? Manual - switch to identical tool in another bay?

Is there scope to incorporate a conditional tool change in the sub, then resume?

To resume a program, you right click on the line to continue from and click on 'Run From..'
It needs to be a linear move of at least the diameter of the tool, so possibly several lines back from where you halted and you need to set spindle running at speed and feed rate manually first, so that might affect its placement

regards

Please Log in or Create an account to join the conversation.

More
01 Dec 2015 11:51 - 01 Dec 2015 11:57 #66160 by albova
Replied by albova on topic Stop and restart program
the control is done by sending the tool on a probe and the change is done manually, after I reset the tool always manually.
The purpose is given by gcode very long (nesting of engravings) and a further problem is to know which line the gcode stopped.
Should I store the feed rate current at the point where I'm going to check the tool and after launching a program with a button that turns on the spindle and adjusts the feed rate with the one previously stored. Subsequently launch the program with "start from here"
is there a system to do this?
Last edit: 01 Dec 2015 11:57 by albova.

Please Log in or Create an account to join the conversation.

More
01 Dec 2015 15:27 - 01 Dec 2015 15:28 #66164 by ArcEye
Replied by ArcEye on topic Stop and restart program
There are all sorts of problems with stopping and restarting, it is best to mitigate them from the outset.

Other controllers have facility to 'Start from block NN..', the controller searching back to get the last spindle speed, feed etc. the move normally restarting at a safe Z height and re-entering the path from there.

Linuxcnc does not and re-starting a file is best avoided.
It is often actually better to split the code up into a series of discreet files and do whatever is required between them.

Without seeing your code, it is impossible to tell if the tests you are making and the manner of them could be improved.
You have not said what the mechanism is that counts your G0 moves and determines that a check is required and when that check is done, immediately or before the next loop.

You should never stop inside a conditional loop. The line number is meaningless when the position is determined by one or more other variables.
Likewise you should not stop inside a subroutine.

There are methods to programatically determine the current line number, but they are not always accurate.
emcStatus->task.currentLine , emcStatus->task.motionLine and emcStatus->task.readLine, can all return different values and sometimes none of them are right B)

I would recommend you 'design out' the majority of your problems, resuming from a stored speed and feed in itself, is not a problem.

regards
Last edit: 01 Dec 2015 15:28 by ArcEye.
The following user(s) said Thank You: albova

Please Log in or Create an account to join the conversation.

More
01 Dec 2015 19:27 #66173 by albova
Replied by albova on topic Stop and restart program
the call of the control is generated by the postprocessor (VCarve) that every time he sees a movement g0 inserts "o <ctrltool> call"
Inside the sub, a variable count them and when it reaches the set value, performs control tool on the probe.
I think I have solved:
if the tool is worn out, instead of stopping the program, I put it on pause.
Doing so, the operator, before stopping the program, writes the line and when pressed the button to continue, the tool moves in the change position and here the program stops.
What do you think about it ?
From simulated tests, it works.
regards

Please Log in or Create an account to join the conversation.

More
02 Dec 2015 01:46 - 02 Dec 2015 01:47 #66192 by andypugh
Replied by andypugh on topic Stop and restart program
What does (DEBUG, Program line = #<_line>) give you? (possibly the line number in the subroutine)
linuxcnc.org/docs/2.7/html/gcode/overvie...ned-named-parameters
Last edit: 02 Dec 2015 01:47 by andypugh.
The following user(s) said Thank You: albova

Please Log in or Create an account to join the conversation.

More
02 Dec 2015 07:13 #66202 by albova
Replied by albova on topic Stop and restart program
Hi,
the command (DEBUG, # <_line>) works correctly in the main gcode
obviously it does not work in sub but solve my case.
many thanks to all for the help
Alessandro

Please Log in or Create an account to join the conversation.

More
02 Dec 2015 10:22 #66206 by andypugh
Replied by andypugh on topic Stop and restart program

the command (DEBUG, # <_line>) works correctly in the main gcode
obviously it does not work in sub but solve my case.


In that case, you could replace every call to the sub
O<ctrl_tool> CALL
with
O<ctrl_tool> CALL [#<_line>]
Then in the sub
O<ctrl_tool> SUB
(DEBUG, subroutine called by line #1)

ie, pass the number of the calling line to the subroutine. You could extend this to suggest a spindle speed to set before restart too,

Please Log in or Create an account to join the conversation.

More
02 Dec 2015 11:53 #66207 by albova
Replied by albova on topic Stop and restart program
Hello
the system works
to restore the speed of work I thought of using the mdi simply entering "Fxxx" , but when I restart the program "run from here", do not seem to have it loaded
Fxxx command is not read by the operator mdi?
regards

Please Log in or Create an account to join the conversation.

More
02 Dec 2015 12:33 #66208 by andypugh
Replied by andypugh on topic Stop and restart program
I wonder if M70 is any help in your situation?

linuxcnc.org/docs/2.7/html/gcode/m-code.html#mcode:m70

Please Log in or Create an account to join the conversation.

Time to create page: 0.180 seconds
Powered by Kunena Forum