Hello Guest it is March 28, 2024, 07:34:07 AM

Author Topic: Significant Problem - Mach4 freeze on M codes  (Read 11484 times)

0 Members and 1 Guest are viewing this topic.

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Significant Problem - Mach4 freeze on M codes
« on: September 08, 2015, 09:22:24 AM »
Ran into a nasty bug. This is with the latest Sept plug in as well as the previous. Problem present on all V2 MACH4 releases.

This problem is not present using the MACH4 sim or the ESS board, so it is definitely being caused by the HiCON

M codes in general are not handled reliably and MACH4 hangs sometimes on M98, sometimes on M99  . . these issues clear if MACH4 is restarted

Hangs consistently on custom M macros after an 'A' axis move. i.e. removing the A axis move removes the problem.

Hands on M30 and after manual rewind, will not run the G-code again until MACH4 is restarted.

This is not much to go on, I realize. I noted in previous HiCON release notes that 'M code list' (or something similarly named) was fixed in a previous release, so I'm hoping this is/was a previous problem that has resurfaced.

If needed I can supply the G-code and the Macros that demonstrate the problem.

« Last Edit: November 01, 2016, 12:49:39 PM by Vital System Support »
Re: Significant Problem - Mach4 freeze on M codes
« Reply #1 on: September 08, 2015, 02:31:17 PM »
Hello,

I ran into a bug during testing that involved the Mach4 GCode Processor getting hung up with an MCode command (I think this is also what you're seeing). This was due to Mach4 waiting on a response from our plugin, but the problem is that the plugin never got a corresponding request from Mach4. We were able to track down the problem to the Motion Sync, and are now working with the Mach4 team to fix it.

Right now, I'm waiting on a new build from them, but I'll reply on this thread when the problem gets fixed.


-Marc
Vital System Inc.
« Last Edit: September 22, 2015, 10:02:00 PM by Vital System Support »
Re: Significant Problem - Mach4 freeze on M codes
« Reply #2 on: September 14, 2015, 12:47:23 PM »
Hello,

Unfortunately, the bug with the motion sync isn't completely fixed. I had hoped to get a complete fix before posting a reply on this thread, but it looks like things are getting delayed. Right now, Mach4 build 2686 should be available on the web and it should prevent the GCode interpreter from getting stuck, but instead of getting stuck, it may skip GCode lines instead.

However, there is a work-around available that can be done to avoid skipping the gcode line after M05


If you place another M code right after the M05, like so:
M05
M2001 (has a milisleep inside)
G00 x1 y 1 z0
m03

Inside the M2001 I put a milisleep function of 10ms. This works %100. No problems at all. It will go for an hour and not skip a line. look ahead was setup for "5".


I'll also post a another notification on this thread once the bug is completely fixed and this workaround is no longer needed.

If this still doesn't solve the problem, then email me your GCode file (support at vitalsystem dot com) and I'll try running it here myself. Oh, and I'll also need those "custom macros", and your profile as well.


-Marc
Vital System Inc.

« Last Edit: December 16, 2015, 05:01:04 PM by Vital System Support »

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Significant Problem - Mach4 freeze on M codes
« Reply #3 on: September 14, 2015, 01:17:50 PM »
Hello,

Unfortunately, the bug with the motion sync isn't completely fixed. I had hoped to get a complete fix before posting a reply on this thread, but it looks like things are getting delayed. Right now, Mach4 build 2686 should be available on the web and it should prevent the GCode interpreter from getting stuck, but instead of getting stuck, it may skip GCode lines instead.

Interesting. There was nothing in the release notes about this issue being addressed at all.  86 does not hang on M codes, but it still will not re-run the G-code, so it still requires shutting down and restarting MACH4 to run the same code again.

Quote

I'll also post a another notification on this thread once the bug is completely fixed and this workaround is no longer needed.

If this still doesn't solve the problem, then email me your GCode file (support at vitalsystem dot com) and I'll try running it here myself. Oh, and I'll also need those "custom macros", and your profile as well.


Thanks for the prompt response and the work around. Unfortunately, I spent the weekend installing MACH3 on the HiCON setup in order to get parts made for a deadline. MACH3 seems to work fine, so I will continue to use that until this problem is resolved. I have put my MACH4 projects on hold.

My custom macros were fairly complicated and I suspected them at first because that is where MACH4 was hanging up. But as you also found, the problem is unrelated as it happens with M5 as well. Also, all of the custom macros run fine early in the code. Near the end of the code, MACH4 hangs on any M code. I found some work arounds also, but could never get MACH4 to re-run the code without restarting MACH4. I made about a dozen or so of the several hundred parts needed and gave up on that procedure. Once MACH3 was installed, the parts were run without any problems.


« Last Edit: September 22, 2015, 10:06:40 PM by Vital System Support »
Re: Significant Problem - Mach4 freeze on M codes
« Reply #4 on: September 14, 2015, 02:03:28 PM »
Hello,

Haven't checked the release notes, but 2686 does prevent the GCode processor from getting stuck.

I'm not 100% certain that your issue is the same as what I'm fixing, but the symptoms sounded similar. The thing with the "M5" in the example that I posted was that it was implementing custom functionality (which called a motion sync) for THC control where the problem was most prominent. The problem applied to any time a motion sync was called in the middle of a GCode file. It's hard to pinpoint where this could happen unless I run your files with some debugging information from Mach and our plugin.

Oh, and about re-running the GCode File, have you tried M99? M30 is used to rewind the file to the start, but doesn't run until the Cycle Start button is clicked. M99, on the other hand, re-runs the GCode file from the start for continuous execution.


-Marc
Vital System Inc.



« Last Edit: September 22, 2015, 10:03:21 PM by Vital System Support »

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Significant Problem - Mach4 freeze on M codes
« Reply #5 on: September 15, 2015, 05:12:15 AM »
Hello,

Haven't checked the release notes, but 2686 does prevent the GCode processor from getting stuck.

Oh, and about re-running the GCode File, have you tried M99? M30 is used to rewind the file to the start, but doesn't run until the Cycle Start button is clicked. M99, on the other hand, re-runs the GCode file from the start for continuous execution.


Yes, I noted in my post that 86 is not hanging on M codes. However, it gets stuck after running the file and will not re-run the file unless MACH4 is closed and restarted, so MACH4 remains essentially unusable for practical purposes.  M47 or M99 is not a solution because they are continuous, as you mentioned, the code needs to rewind and stop so that the workpiece can be changed out, then run again with cycle start.


Quote

I'm not 100% certain that your issue is the same as what I'm fixing, but the symptoms sounded similar. The thing with the "M5" in the example that I posted was that it was implementing custom functionality (which called a motion sync) for THC control where the problem was most prominent. The problem applied to any time a motion sync was called in the middle of a GCode file. It's hard to pinpoint where this could happen unless I run your files with some debugging information from Mach and our plugin.


In all versions prior to 86, MACH4 was hanging on the standard internal M5 (i.e. no M5 in the macros folder). I substituted the standard M5 for my custom macro thinking that my macro might be the problem. The exact same macro had already run several times earlier in the code, but I was out of ideas to try. M5 seemed like a 'sterile' candidate, but it hung the interpreter also at the same point.
As I reported earlier, it was always near the end of the G-code and was related in some way to 'A" axis moves. If I removed the "A" axis move, the interpreter would execute the M5 (or my original custom macro). I wish I could give you more to go on, but this is the extent of what I discovered over several hours of trying to figure out where the problem was.

The G-code seems to be working with 86, but if you think it will be useful, I'm happy to send it to you via e-mail or PM. I'll need to take a look at the  macros as I think these may be calling custom subs in MACH4, so I would need to include those as well for the macros to work. Just let me know if you still want this stuff.

The main problem remaining is that MACH4 will not re-run the G-code after M30.



« Last Edit: September 22, 2015, 10:03:33 PM by Vital System Support »
Re: Significant Problem - Mach4 freeze on M codes
« Reply #6 on: October 06, 2015, 03:52:33 PM »
Here is another temporary fix that is shared by Aaron to avoid skipping the gcode line after M05.

...I tried out your doubling up of the g-code so that it would not miss a line. This worked 80% of the time. After about 5 min, it would do it again.... So this is what I found:

If you place another M code right after the M05, like so:
M05
M2001 (has a milisleep inside)
G00 x1 y 1 z0
m03

Inside the M2001 I put a milisleep function of 100ms. This works %100. No problems at all. It will go for an hour and not skip a line. My look ahead was setup for "5".

Re: Significant Problem - Mach4 freeze on M codes
« Reply #7 on: October 07, 2015, 07:05:48 PM »
we are working with mach4 developers on a daily basis to find a solution for this issue.  should have something solid by next week.  This problem is only showing up when the controller itself generates motion, aside from mach4 motion planner.
Re: Significant Problem - Mach4 freeze on M codes
« Reply #8 on: October 28, 2015, 03:28:44 PM »

Please download the latest mach4 software and also the latest plugin from our website.  There had been many updates that happened between now and last few weeks.  Please let us know what error are you seeing so we can narrow it down and try to resolve it.

regards
Rufi

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Significant Problem - Mach4 freeze on M codes
« Reply #9 on: October 30, 2015, 09:15:37 AM »

Please download the latest mach4 software and also the latest plugin from our website.  There had been many updates that happened between now and last few weeks.

I do not understand this comment. The last plug-in on your site is dated Oct 9th. You posted on Oct 28th stating that many updates have happened over the last few weeks, but there has not been a new plug-in posted in 4 weeks.

There has only been one MACH4 release and the release notes say nothing about this problem.

Quote

Please let us know what error are you seeing so we can narrow it down and try to resolve it.

regards
Rufi


I pulled the plug on MACH4 around week 3 of this issue, but I continued to spend time working with Vital Systems to identify and test this bug. At some point, I tested a new plug-in/Mach4 release and the problem seemed to be gone.

However, subsequent to that, Vital Systems posted another work around for the same issue, so obviously it was not fixed. Also obvious is that discovering that the bug still existed must have required much more extensive testing than I did.  

The problem has been the same since I reported it on Sept 8th. The latest workaround posted by Vital Systems identifies the same problem. I already tested a 'fix' and did not see the problem, yet Vital Systems did find it again later, apparently in more extensive testing. As I have no idea what they were doing to make the bug resurface, most likely I would not find it in cursory testing.

I have only two HiCON's and both are now configured for and running MACH3 with no problems. I am not inclined to load and reconfigure MACH4 and flash the HiCONs to do more testing using machines that need to be running. I think I have done more than my share in helping Vital Systems find and fix this issue.

Vital Systems is well aware of what the problem is and should be able to say if it is fixed or if it is not fixrd, and in what version of the plug-in and/or MACH4.

« Last Edit: October 30, 2015, 09:17:51 AM by simpson36 »