Hello Guest it is March 28, 2024, 06:46:27 PM

Author Topic: Hazardous Motion - Mach4 Software  (Read 3668 times)

0 Members and 1 Guest are viewing this topic.

Hazardous Motion - Mach4 Software
« on: May 09, 2021, 05:45:52 PM »
I've recently switched from Mach3 to Mach4, so the following problem may be due to my inexperience with Mach4 or some incorrect software setting.  However, I encountered a very serious "runaway" situation today and would like to get some advice.

Using the Jogging screen that comes with Mach4, I was setting the tool to the part origin,  I had switched to incremental jog mode with increments set at 0.001".  (The attached photo shows the preset jogging conditions.) However, when I went to jog the X axis the motion was continuous, not a jog.  Worse, it did not stop when I released the button

I used the hard-wired E-stop to halt motion but by then the tool was destroyed and the part damaged.  I'm very glad my fingers were not in the tool path!

But it gets worse...

After releasing the E-stop, I used the jog button for the A-Axis (the Knee) in continuous mode to drop the work clear of the tool collet.  Once again, the motion did not stop when the key was released.  Neither the Stop Button nor the Reset Button on the main Program Run screen would do more than pause the motion.  As soon as they were released, the A-Axis motion continued.  Finally I had to use the E-stop to halt the motion.

Can anyone suggest what might have caused this problem and suggest how to avoid it in future?

PS.  I'm using ESS to drive DMM servos and motors.

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Hazardous Motion - Mach4 Software
« Reply #1 on: May 10, 2021, 01:08:00 AM »
It sounds like you are using softlimits and they are not setup correctly.  And the planner is trying to "wrap" back around.

Steve
Re: Hazardous Motion - Mach4 Software
« Reply #2 on: May 10, 2021, 01:12:55 AM »
Yes, I have soft limits enabled but this problem occurred several inches away from both the soft and hard limits on the X axis.  I'll check tomorrow to see if the soft limits have somehow been altered, but more research on the forum tells me that jogging runaway events are not uncommon.  If there is a software bug, it needs to be fixed ASAP as it is a safety issue.

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Hazardous Motion - Mach4 Software
« Reply #3 on: May 10, 2021, 01:58:52 PM »
Yes, the runaway jog issue is a common configuration problem.  How do you think I knew you were using soft limits?  :)  Because it is something that is common, as opposed to a bug.  And the result is EXACTLY the symptom you are complaining about.  Here is a link where I discuss properly setting the soft limits:

https://www.machsupport.com/forum/index.php?topic=43196.msg279918#msg279918

There are literally tens of thousands of Mach 4 installations.  I know pretty quickly when there is a real bug.  If you are running a general release (4612), then I pretty confident there is no bug.  However, if you are running a dev build, your mileage may vary.  But you didn't specify which build you are running, so I don't know. 

Also, and this gets people coming from Mach 3, Mach 4 is not Mach 3.  Mach 4 acts more like an industrial machine control.  The stop button will not stop a jog, it stops a cycle.  The reset button will not stop a jog, it resets the interpreter.  The thing that would stop a jog is the disable button (if you have your drives connected to the motor enabled signals.) or the physical E-stop button (You have one, right?  But again, if that was implemented/wire properly).  However, it is your responsibility to make these work in the intended manner.  But both of those will stop a runaway machine, no matter what the cause. 

Steve
Re: Hazardous Motion - Mach4 Software
« Reply #4 on: May 10, 2021, 08:38:56 PM »
I am using Mach 4 build 4612 and ESS build 268.

As I said at the beginning of my first posting, I'm quite prepared to accept I've made some configuration problem.  However, I have checked that the soft limits are in place and appear to be both logically and physically correct.  They were set up just as you outlined in the link you provided.  I'm still baffled how a soft limit that was inches (over 3") away from the tool position could cause continuous motion when jog motion was commanded. Should I turn off Soft Limits and wait/hope the problem goes away or is there a better solution?

And yes, I do have a properly wired E-stop which I mentioned I had to use to stop the runaway motion.  I trust the "Disable" button will work as well, but did not try that in the panic of the moment.

Taking the Microsoft approach ("That's not a bug, its a feature") is not helpful.  If it is a common problem (to quote you and as seen on the forum) then it needs to be addressed either through warnings or a software fix.  I'm pretty sure that NewFangled Solutions insurance company would not be sanguine to realize that there is a "common" situation which causes damage and potential injury that is not being addressed.  For example, having provided a button labelled "STOP" which does not actually stop the machine is easily misconstrued.  I could go on, but you get my point.

I do appreciate the fact you are attempting to assist me with this problem and am quite willing to follow suggestions to make sure the situation does not reoccur, but if it is not due to soft limits, what do I do next?



Re: Hazardous Motion - Mach4 Software
« Reply #5 on: May 11, 2021, 01:29:15 AM »
Hi,
I believe the problem you are experiencing is after-run.

When in continuous jog mode Mach issues  a stream of jog steps at the current jog increment. If the machine can move 20mm/sec but the steps
are indicating a move of 30mm/sec then the extra steps get buffered. Thus even when the button is released and Mach stops issuing jog steps the
steps in the buffer still have to execute, and will carry on until the buffer is drained, ie after-run.

You might consider this is a bug, its not. Its is that your selected jog increments mean that the buffer can fill up.......and it catches you by surprise.
If you reduce your maximum jog increment down to a realistic amount the problem ceases to exist.

As an example I used to have my max jog step set at 1mm/step. If I spin the MPG fast the steps exceed the ability of my machine to execute them
immediately, and I would get after-run with the attendant surprise and consternation. I have since set my max jog step to 0.1mm/step. Now I can
spin the MPG as fast as I like and my machine executes all  those steps nearly instantly, the buffer never fills up and therefore no after-run.

Another way of saying it is that the maximum jog increment  and jog step rate should match the velocity of the machine and thereby avoid
accumulated steps in the motion buffer.

Craig
« Last Edit: May 11, 2021, 01:44:08 AM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Hazardous Motion - Mach4 Software
« Reply #6 on: May 11, 2021, 12:11:02 PM »
Hi Craig.  Thanks for your response.  It does make sense that an unemptied buffer could cause the problem, but I would call that a bug.  If the expectation is that jogging will stop when the button is released (I'm using a screen button not an MPG) then that's what should happen and the buffer should be flushed.  Any unexpected motion is cause for serious concern.  There should be no "catches you by surprise" when dealing with machine motion.

However, in my situation with the X axis movement, all motion had stopped before I switched to incremental mode at 0.001" per jog.  The very first button push caused the run-away.  If that was due to unused steps in the buffer, how does the operator know that or force a buffer flush?  By the way, the jog rate was at 4% on the slider scale - that is all that prevented blood on the machine.  With the jog increment at 0.001" and the velocity at 4%, I would expect the machine can keep up without any difficulty.  I've seen it process G code at rates much higher than this set up jogging.

In the case of the A axis runaway, I had switched to continuous jogging and the motion continued after the button had been released.  Not just a few steps, but inches of movement as I tried to stop it.  If this was a buffer finishing stored steps, there must have been several thousand steps accumulated and not flushed on button release.

I am still baffled about how to avoid this problem occurring again.
Re: Hazardous Motion - Mach4 Software
« Reply #7 on: May 11, 2021, 03:41:52 PM »
Hi,

Quote
Thanks for your response.  It does make sense that an unemptied buffer could cause the problem, but I would call that a bug.  If the expectation is that jogging will stop when the button is released (I'm using a screen button not an MPG) then that's what should happen and the buffer should be flushed.  Any unexpected motion is cause for serious concern.  There should be no "catches you by surprise" when dealing with machine motion.

BS. Mach is doing EXACTLY what its supposed to do, if you issue 211 pulses of 1mm per pulse then it will move 211mm. That a number of those steps are
'in the buffer' and you can't visualize where that 211mm movement is going to end up is your problem......not Machs, it just going to the 211mm mark as
you requested.

When I first encountered this problem six years ago I too thought it a fault, and the hundreds of people since then that have posted about this
in the years since, all imagine its a Mach bug. ITS NOT!!!! If I tell Mach to move to a BS location, it goes there and crashes, its because I told it to go
there, its not up to Mach to try to anticipate my BS mistake.

Reduce the jog increment down to the situation that very few if any steps end up in the buffer and you'll never have the problem again.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Hazardous Motion - Mach4 Software
« Reply #8 on: May 11, 2021, 04:08:38 PM »
Hi Craig.
I really didn't want to get into a discussion of whether this is a bug or not.  Clearly I think it is and you and smurph do not.  OK, let's not argue about that.  The purpose of my post was twofold.  One to advise others of this potentially hazardous situation.  Two, to get help on preventing it from happening again.

smurph believes the problem is my soft limits, but not only were they configured properly according to his linked post, but they were not turned on at the time of the incident.  So, that's not helping me avoid the problem in future.

Your suggestion is to reduce the jog increment down so few steps are in the buffer.  OK, the jog increment was 0.001" - I guess I could go to 0.0001" if you think that would help.  As far as knowing how many steps are in the buffer, how do I determine that?  If not determinable, is there some command to flush the buffer that a user can trigger?

Any help is appreciated.

Brian
Re: Hazardous Motion - Mach4 Software
« Reply #9 on: May 11, 2021, 04:43:33 PM »
Hi,

Quote
Your suggestion is to reduce the jog increment down so few steps are in the buffer.  OK, the jog increment was 0.001" - I guess I could go to 0.0001" if you think that would help.  As far as knowing how many steps are in the buffer, how do I determine that?

That is a good question. In my case, as I use an MPG and do not use on-screen buttons, the solution and result are much plainer.

Lets say for example your machine has a max velocity of 1200mm/min. I choose this number as it suits my mini-mill which because of axis gearing
has relatively low G0 speeds.
1200/60= 20mm/sec.

If I set the max jog increment to 1mm, then if I spin the MPG (100 pulse/rev), at any greater than 20 clicks per second then movement is going to accumulate
in the buffer. Its entirely possible to spin the MPG at 1 rev, or 100 pulse per second, and thus I would have significant accumulated motion in the buffer.
If however I reduce the increment to 0.1mm then that same 100 pulse per second input results in 10mm/sec movement which is within my machine velocity
and therefore no accumulated movement.

The trick here is that I know how many steps per second I am applying by virtue of me spinning the MPG.

In your case using Mach's jog buttons is issuing a certain rate of steps....and exactly what they are I don't know. Lets guess and say that Mach is issuing 1000 pulses
per second, then at 0.1mm jog increment that would indicate a movement of 100mm/sec which exceeds my machine velocity and therefore get motion
accumulation. If I selected a jog increment of 0.01mm then the same 1000 pulse/sec input would result in 10mm/sec movement which is suitably within my machine limits.

I'm not sure off-hand how Mach determines the pulse rate. On the jog screen there is a slider at the bottom which is a percentage of max, whatever max is. Using that slider
you can slow the pulse rate down until you approach the balance point necessary to avoid accumulated motion.

I'm hoping that smurph sees this post and he will surely know how to set the rate. My guess is that once you make an appropriate setting you will then never touch it
again for the life of the machine. Such has been the case with my max jog increment, once I found the 'sweet spot' of 0.1mm it gets left there for months at a time.
I will sometimes drop down to 0.01mm if I have a fine touch off to complete, but even that does not happen that often.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'