Hello Guest it is April 25, 2024, 11:46:29 AM

Author Topic: Feed Hold in MDI Window hangs up mach 4?  (Read 1858 times)

0 Members and 1 Guest are viewing this topic.

Feed Hold in MDI Window hangs up mach 4?
« on: August 02, 2019, 09:22:09 AM »
Hi,

Feed hold is working fine in gcode files.
But if I enter something very simple like:

M3 S3000
G04 p5000
M5

And Press "Feed Hold" during this G4 - Mach will not offer the "Cycle Start" Button to be active as usual when pressing feed hold.
Also spindle keep running forever, the complete program hangs.
Even when exiting Mach 4 - it can not be started again because a "Mach 4 GUI" Process is still running as seen in the task manager. You have to manual quit this task with windows task manager and start complete mach 4 again.

Using Mach 4 with ESS.
Re: Feed Hold in MDI Window hangs up mach 4?
« Reply #1 on: August 02, 2019, 09:23:12 PM »
Hi,
I don't have an answer...but rather a question.

When Mach is executing a Gcode program and you <feedhold> the buffered moves execute and then the  machine stops.
Mach would transition from MC_STATE_FRUN to MC_STATE_HOLD. No problems....normal. The length of time between
you hitting <feedhold> and the machine stopping is determined by the buffer length of the your motion controller, the default
with the ESS is 180ms.

With the code you have posted the buffer will have time slices stacked up in the buffer, to the length of the buffer, all with
no motion because the Gcode is a g4 p.....Thus when you hit <feedhold> I would expect the buffered moves to be executed,
ie nothing happen as they are all no-motion time slices, and then Mach would stop. Mach would in this case transition from
MC_STATE_MRUN, because the executing code string is MDI data, to MC_STATE_MRUN_FH. Because the <feedhold> has
interrupted the Gcode interpreter I would not expect the m5 to have been interpreted and put in the buffer. In this circumstance
I would anticipate that the spindle would carry on running because you have not commanded it do otherwise.

Note that this behavior can be changed. See the attached pic. I'm guessing that these two settings add code to enact the desired
behavior to the <feedhold> function within Machs core.

Even if you make those settings as appropriate to your desired behavior that does not explain why Mach should hang
up after hitting <feedhold>.

May I suggest some experiments that explore this quirk a little further. For instance if you had a motion command that was
interrupted rather than a wait command. For example MDI:
m3
g1 x100 f100
m5
and while the X axis move is executing hit <feedhold> and see what happens.

Quote
Even when exiting Mach 4 - it can not be started again because a "Mach 4 GUI" Process is still running as seen in the task manager. You have to manual quit this task with windows task manager and start complete mach 4 again.

This is normal, if Mach crashes or exits unusually then one chunk of code is left running and must be manually shut down
before you can restart. The trick is to avoid Mach crashing!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Feed Hold in MDI Window hangs up mach 4?
« Reply #2 on: August 02, 2019, 09:32:20 PM »
Hi,
I've just been experimenting on my laptop.

The MDI code I posted can be interrupted by a <feedhold> and subsequently be restarted with <cycle start MDI>.

The code you posted, namely the g4 p5000 cannot be interrupted by a <feedhold> on my laptop, the <feedhold> is ignored
and the MDI code continues execution which includes the m5 at the end which turns off the spindle.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Feed Hold in MDI Window hangs up mach 4?
« Reply #3 on: August 03, 2019, 02:37:20 AM »
Thank you for your test and confirming that you also see this bug there with G4 in MDI.
Would be interesting to see, if this also happen if the G4 ist in a gcode file.
Unfortunately I can not test this for 2 weeks, because of vacation ;).

So this seems to be really a bug in the core or in the ESS Plugin, because expectation would also be to pause the pause.
Any idea how to find out if this is related to the Plugin or the core?
And how to submit this bug report then?

Re: Feed Hold in MDI Window hangs up mach 4?
« Reply #4 on: August 03, 2019, 02:44:55 AM »
Hi,

Quote
So this seems to be really a bug in the core or in the ESS Plugin, because expectation would also be to pause the pause.

I'm not so sure I would call it a bug. As often happens with Mach4 is it behaves a certain way which you might initially
consider to be mistaken. Often once the inner workings a described you realize why it behaves as it does. Just because
it doesn't do as you expect does not always mean a fault.

Continue experimentation to explore what happens.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Feed Hold in MDI Window hangs up mach 4?
« Reply #5 on: August 03, 2019, 02:55:51 AM »
This is a critical safety issue in my opinion.

Imagine you hit feed hold during a G4 to manual fix something - for example adjust the cooling nozzle or vacuum device.
You can not tell if the machine still is stopped due to the G4 or the Feed hold, you see only it is not moving and can not tell the difference.

So you manipulate on your device and the machine starts running again out of the sudden.
You can loos fingers or your hand/arm with such behavior.

Pause or stop need to be really reliable to stop the machine from harming or killing you...
Re: Feed Hold in MDI Window hangs up mach 4?
« Reply #6 on: August 03, 2019, 03:02:55 AM »
Hi,

Quote
Pause or stop need to be really reliable to stop the machine from harming or killing you...

<feed hold> is not or was never intended to be a safe state, feedhold followed by stop is however. Of course so is
<Dis-able> or <Estop>, but both involve the loss of reference, in fact <stop> will also cause loss of reference unless
it is preceeded by a <feed hold>.

If you wish to work on your machine <feed hold> THEN <stop>.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Feed Hold in MDI Window hangs up mach 4?
« Reply #7 on: August 03, 2019, 04:20:38 AM »
This is not really an option, because after stop you can not continue your programm.
Spindle will not start again, colant will not flow again ....


So if this is true what you say, then mach 4 has no way to reliable pause a program in order to fix something and then continue the program... This is even in all the open source software like GRBL/bCNC,... possible and an absolute must for professional machining. You can not loose a part all the time when a miner issue happen. Nor can you restart the complete program from beginning after such changes. Nor can you all the time create custom "Finish this part" Program for all stop locations...
Re: Feed Hold in MDI Window hangs up mach 4?
« Reply #8 on: August 03, 2019, 04:39:10 AM »
Hi,

Quote
This is not really an option, because after stop you can not continue your programm

That is not correct, that is how I operate my machine. I have to restart the spindle manually, I've never investigated whether
I can have the spindle restart automatically. The essential point to realize is that if you execute a modal command while
stopped when you restart the mode will be different.

You either have to 'dry run' prior to restarting, also called 'Run From Here' or write a extra code in the CycleStop function
to save the modal status and more code in the <cycle start> button to restore the modal information.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Feed Hold in MDI Window hangs up mach 4?
« Reply #9 on: August 03, 2019, 05:57:31 AM »
Yes, this would be options.

But this "Fix something during milling" usecase is way more convinient in other software.
For Example in bCNC Stop button does what in Maach 4 the "Feed Hold" Button does.
But you can just press start again after this and everything just continue.

Also on Mazak machines feed hold is working that way.
If you have to stop the spindle, coolant or move the cutter away, there is a dedicated "Restart" button to start the programm from the last Feed hold position.

Haas Machines further more store the last position of feed hold when jogging. Then there is a "Jog Return" Button, followed by Cylce start to continue the program.

Also Mach 3 based machines like Tormach even use feed hold for the door switch sensor and just continue after closing doors and press cycle start.


But all those super fancy features are not even expected in Mach 4 Hobby... Only to do a defined operation for all G-/M- Codes and not for "all but with the exception of one not". It just doent make sense to interrupt all other Gcodes but not G4.