Automaticly return to G90 when probe fails

More
02 Jun 2015 02:55 #59319 by REEEN
Hello,
I have a problem here.
I have a tool probe macro, and if I run this macro and stop it for some reason, I will stay in G91 mode because the line where the sub returns to G90 is not executed then. This is a problem, because if someone doesn't remember dramatic things can happen. Is there a way that G90 returns when the routine is stopped from execution or errors ?

Greets Rene

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

More
02 Jun 2015 03:53 #59320 by BigJohnT
The only way to prevent surprises is to have a good well thought out preamble in your G code files on the first line.

gnipsel.com/linuxcnc/g-code/gen01.html

You could also have a MDI button to execute the preamble.

JT
The following user(s) said Thank You: REEEN

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

More
02 Jun 2015 05:08 #59321 by cmorley
It's possible to catch errors when remapping codes.
Maybe you could remap a code to do probing and if it errors call G90.
Just a thought I have not done this.

Chris M
The following user(s) said Thank You: REEEN

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

More
02 Jun 2015 14:15 #59331 by REEEN
A thank you to both of you !

Yes you are right with the preamble, but the heavier problems are MDI commands for positioning, doing them with G91 on is dangerous if I forget that, I will try to make an error message that warns me when G91 is activated.

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

More
02 Jun 2015 17:17 - 02 Jun 2015 17:50 #59338 by Rick G
That is a problem.
On my probe routines I try to add some error checking, if the probe fails change to g90 then exit...
O110 WHILE [#7 gt 0]
G91 (Incremental mode)

;start of probe

;Find Z
G38.3 F#1 Z-#3
G4 P#17
 O105 IF [#5070 lt 1] 
 (MSG, Probe not complete Z missed)
 G90
 M2  
 O105 ENDIF 
G0 Z#16 (retract Z)

G38.3 F#2 Z-#3
 O110 IF [#5070 lt 1] 
 (MSG, Probe not complete Z missed slow probe)
 G90
 M2  
 O110 ENDIF 

www.linuxcnc.org/index.php/english/forum...r-center-of-material

Parameter 5070 is set to 1 if the probe succeeded and 0 if the probe failed.


linuxcnc.org/docs/html/gcode/gcode.html#sec:G38-probe


Rick G
Last edit: 02 Jun 2015 17:50 by Rick G.

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

More
02 Jun 2015 20:43 #59344 by REEEN
That is a good idea, i did a lot of error cheking to, but when I missed to put the probe in the right place or else, I hit the stop button and this makes the routine stop in the current line, so no additional code will be read.

I will make some dialogs before the probe starts which will ask a few thing and do an M0 so I have to push resume to go on, G91 will be set as late as possible, so I can prevent my machines from the biggest risks.

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

More
17 Jun 2015 03:27 #59889 by lerman
Isn't that what M73 is for?

Do an M73 at the beginning of each subroutine to save the modal settings.

Then when the subroutine exits -- by a return, or by falling through the bottom -- the modal settings will be restored.

Ken

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

More
17 Jun 2015 06:21 #59900 by BigJohnT

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

More
19 Jun 2015 17:28 #59979 by verticalperformance
Not sure that M73 will work if you abort a running program. Docs say

Aborting a running program in a subroutine which has an M73 operation will not restore state .

But until I read this thread I wasn't even aware of M70-M73 so I haven't tried it myself :)

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

More
19 Jun 2015 19:25 #59990 by lerman
You are correct. The state will not be restored on an abort. But having a subroutine explicitly saving and restoring the state won't work either. On an abort, the stack is just thrown away and the restore code won't run.

Ken

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

Time to create page: 0.239 seconds
Powered by Kunena Forum