Category: O Codes (subroutines) and NGCGUI
Hello.
Finally, my head blown up after a years of this problem.
Linux Wheezy 2.7, 2.8, and the latest 2.9 (debian?) - problem still persist on several machines, several years, all versions.
Remaped M300 code to call o-subroutine (remaped in *.ini). For example, Z-touching. Soubroutine started, performing all commands, but just after touch plate (making contact), program stops with nothing. Respectively pause, but without "pausing". Just stop, do nothing, still pretending working. Need to press ESC and call routine again.
After a several testing, I am figured out that it always stop at first command for G1 move (G1 Z5 F1000, for example, no matter distance or absolute/relative or speed). A little anoying in Z-probing, just run it again, but very anoying with ATC - stopping during tool change. If I change command to G0, it work, but its not always possible to use G0, toolchange for example. Always at first G1 command in subroutine.
There is a days it not happens, but there is also days it happen all times. Absolutely random. No matter program running before or during or after, and never happen twice in a row. No matter computer, old or new. No matter version.
My head finaly blown up.
Need to figure it out. Stopping randomly during tool change is not a good option of ATC.
Thank you.
Ps.: Oh - never happen when calling M300 via button on pendant. Weird, ya?
Z-touch subroutine -
(ztouch.ngc)
o<ztouch> sub
#<vyska_osy_Z> = 191.000
#<vyska_senzoru> = 65.000
#<rozdil_vysek> = 126.000
M66E0L0 ; prepocitani/aktualizace
M70 ; ulozit soucasny modal state, obnovi se na konci
G90 ; absolutni souradnice, kdyby nahodou byla zapla relativni
G53 G0 Z0 ; vyjed uplne nahoru
G59.3 ; prepnout souradnicovy system
G49 ; zrusit kompenzace delky nastroje
G40 ; zrusit kompenzace radiusu nastroje
G92.2 ; docasne vypnout kompenzace G92/G52
G10 L20 P0 Z0 ; nastavit soucasnou polohu jako nula
G91 ; relativni souradnice
G38.2 Z-164 F1000 ; rychle najdi Ztouch s nastrojem
G4 P0.1 ; momentik
HERE IT STOP
G1 Z3.0 F10000 ; kousek se vratit o 3mm
G4 P0.1 ; momentik pockat, aby opravdu dojel o 4mm vys
G1 Z-2.0 F10000 ; zase priblizit k senzoru o 2mm
G38.2 Z-1 F5 ; pomalicku se dotknout
G1 Z1 F10000 ; odtahnout 1mm (vypnout senzor)
;#<z_work_offset> = [#[#5203 + #5220 * 20] + #5213 * #5210] ; uplne presne nevim co to pocita, vytazeno z wiki
G10 L1 P#5400 Z#5063 ; nastavit vypoctenou delku nastroje do tabulky nastroju
G43 ; znovunacist delku nastroje a zapnout kompenzaci
G90 ; absolutni souradnice
G53 G0 Z0 ; vyjed nahoru
G92.3 ; obnovit kompenzace
M72 ; obnovit modal state pred sondovanim
o<ztouch> endsub