Hello Guest it is August 03, 2021, 10:32:52 PM

Author Topic: Hangs After Last Motion Command, Does Not Execute M05 Spindle Off  (Read 1063 times)

0 Members and 1 Guest are viewing this topic.

Configuration: USB RnRMotionController and stepper motors, running purchased and licensed Mach3 on a WinXP Thinkpad.

Laptop has all the power management and screen saver turned off, runs continuously.  Wireless networking is disabled and Ethernet is unplugged.  Not running any other application.

Intermittently the whole NC motion file will run successfully, but stop before executing the last 2 lines M05, M30.  So the spindle is still running.  Mach3 is hung at this point.  Need to close Mach3 to recover.  Sometimes Mach3 application can be closed.  Other times it is showing an unrecoverable error dialog box, has to be force-closed.

I have turned off the NC path display.  This seems to have fixed a hang in updates to the NC program display, but it did not cure the basic hanging issue.

Why is Mach3 successfully running a huge file of motions, then wedging at the spindle off command?  Possible issue with RnRMotionController?  Thanks for your help!

Offline ZASto

*
  •  385 385
    • View Profile
Re: Hangs After Last Motion Command, Does Not Execute M05 Spindle Off
« Reply #1 on: November 20, 2019, 03:07:09 PM »
Check your G-Code file with notepad.
If there is no % at the last line, just add it.
Make no mistake between my personality and my attitude.
My personality is who I am.
My attitude depends on who you are.
Re: Hangs After Last Motion Command, Does Not Execute M05 Spindle Off
« Reply #2 on: November 20, 2019, 04:50:45 PM »
Tag % onto the end of the last line, or as a new line following last line?  Thanks.

Offline ZASto

*
  •  385 385
    • View Profile
Re: Hangs After Last Motion Command, Does Not Execute M05 Spindle Off
« Reply #3 on: November 20, 2019, 06:24:10 PM »
% as single character on the last line.

Every G-Code line ends with CRLF character combination (nonprintable Carriage Return / Line Feed). Often missing at the last line of G-Code.
For that reason I've edited all postprocessors that I use to put % as a single character on the last line.

Eg.

Code: [Select]
.
.
.
M30
%
Make no mistake between my personality and my attitude.
My personality is who I am.
My attitude depends on who you are.
Re: Hangs After Last Motion Command, Does Not Execute M05 Spindle Off
« Reply #4 on: November 20, 2019, 07:05:36 PM »
Viewed in notepad++ all lines including last end with CR,LF.  But I'll try adding a lone % line anyway.
Re: Hangs After Last Motion Command, Does Not Execute M05 Spindle Off
« Reply #5 on: November 22, 2019, 04:55:50 PM »
Added the leading and trailing % lines. Each is %CRLF specifically. Ran the operation sequence 3 times and it failed on the 3rd run. Same symptom, all moves executed but the spindle-off command not executed and hung. So yeah it is one of those nasty intermittent things. Unfortunately did not respond to the % lines.

I think I'll chop down the sequence, investigate if there is any dependence on length of the move sequence. If I can pare it down to a manageable size that executes quickly (and still fails) I can iterate on experiments without waiting hours of machine time. Maybe experiment with adding delays before the spindle-off command.

Offline ZASto

*
  •  385 385
    • View Profile
Re: Hangs After Last Motion Command, Does Not Execute M05 Spindle Off
« Reply #6 on: November 22, 2019, 06:35:25 PM »
Last % line just ensures that the preceding is terminated with CRLF.
% per se is just a character that is ignored.

Try reinstalling Mach3. Just days ago I wanted to do some fine tuning of motors and could not enter Motor Tuning. Reinstall corrected, to me unknown, corrupted file(s).
Make no mistake between my personality and my attitude.
My personality is who I am.
My attitude depends on who you are.