Hello Guest it is March 28, 2024, 01:52:16 PM

Author Topic: No GCode Movement after pressing stop  (Read 1175 times)

0 Members and 1 Guest are viewing this topic.

No GCode Movement after pressing stop
« on: May 02, 2019, 04:42:39 AM »
Hi,

when I press stop to interrupt a running gcode - afterwards it is not possible to:
- Start gcode loaded from file
- Start MDI Gcode
- use GUI buttons which do movments, for example go to work zero.

But this is still working:
- Homing
- Jogging

I can press Stop, Reset, Enable, Disable - nothing changes this "not working movement" state, until i restart the program.
And yes, my Mach 4 is lisenced.
No text in the last Error Text line.

Any idea what this could be?
Where to se the Mach 4 status, what might explain me why there is no movement any longer?
Re: No GCode Movement after pressing stop
« Reply #1 on: May 02, 2019, 07:33:23 AM »
Hi,
using the <Stop> button is poor practice, Mach interprets that as an immediate stop and aborts all remaining moves
in the buffer. This often means loss of reference......you might in fact be pleased you can't <CycleStart> as the job would
resume but displaced from its correct start position wrecking your job!

The correct way to pause a job is <FeedHold>. Mach will execute the moves in the buffer and then stop. Note that Mach is
still engaged with the job, you cannot jog or MDI nor will any GUI movement occur, the motion planner is still commanded
by the Gcode file you are involved in, its just that the job is paused.....but still in control.

If however you <FeedHold> and then <Stop> the motion planner is released by the Gcode interpreter and the machine should
( and does on my machine) enter the 'idle' state and can thereafter be jogged, MDI'ed, or GUI moves be executed.

The fact that you can't do that means that the machine is hung up in some other state.....and that is a mystery.

May I suggest go to:

https://www.machsupport.com/forum/index.php?topic=40051.0

Download (and maybe save) Mach4MachinesStates2.txt.

Now I suggest adding some code to the CycleStop() function that allows you to see what state Mach ends up in. It may not
solve the problem but may give you information about why its doing what its doing.

Open the screen editor and look at the events tab of the <Stop> button like the attached pic.
Note that when  you hit the  <Stop> button the function CycleStop() executes.

The function CycleStop() is defined in the screen load script. To display the screen load script look at the events tab
of the profile root like the pic attached. Veiw the screen load script by hitting the <...> button.

Scan down the screen load script until you find the CycleStop() function, on my installation about line 185.

Code: [Select]
---------------------------------------------------------------
-- Cycle Stop function.
---------------------------------------------------------------
function CycleStop()
    mc.mcCntlCycleStop(inst);
    mc.mcSpindleSetDirection(inst, 0);
local machineState=mc.mcCntlGetState(inst)
local machineStateName=mc.mcCntlGetStateName(inst,machineState)
wx.wxMessageBox(machineStateName)
    mc.mcCntlSetLastError(inst, "Cycle Stopped");
end

Note that I have added a few lines of code that you wont find in your function:
        local machineState=mc.mcCntlGetState(inst)
        local machineStateName=mc.mcCntlGetStateName(inst,machineState)
        wx.wxMessageBox(machineStateName)

I have added these lines simply as a diagnostic. Whenever you hit the <Stop> button  hopefully the machine will stop and
a messagebox will appear showing Machs state, on my installation the state is 'idle' ie Mach is free to jog, MDI etc.

What does your installation do?

Craig
« Last Edit: May 02, 2019, 07:35:39 AM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: No GCode Movement after pressing stop
« Reply #2 on: May 02, 2019, 01:25:47 PM »
Thank you for all the input.
Im using Stop as a intermediate, when something goes wrong but no estop is needed.


I found out, that mach 4 ist stuck in the m6 script.
I think stop only breaks the current Gcode execution and the script continues to run.
Might that be true?

How to check in the script, if stop was called?
I check already for extop each logical block.


Re: No GCode Movement after pressing stop
« Reply #3 on: May 02, 2019, 02:12:07 PM »
Hi,
have you tried adding the lines of code I have suggested?

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: No GCode Movement after pressing stop
« Reply #4 on: May 02, 2019, 02:35:57 PM »
Not now, its in the middle of the night.
Will do it tomorrow in the workshop. Promised.
Re: No GCode Movement after pressing stop
« Reply #5 on: May 03, 2019, 03:36:23 AM »
The state shows "Idle" in that case.

But Im shure it depends on m6.
I think the current "mcCntlGcodeExecuteWait" is skipped and the next instruction still executed.
This means - the current tool it thrown all over the workshop in some cases, because the clamp opens in wrong position. -> Very very very bad.

How to check if stop was pressed before the next command?
How to cancel m6 if stop is pressed?
Why gcode is no longer working, in idle state, but stuck in middle of m6 execution?
Re: No GCode Movement after pressing stop
« Reply #6 on: May 03, 2019, 04:49:48 AM »
Hi,
not sure why it is that m6 appears to throw a spanner in the works. I'm guessing it that is because he
CycleStop() function does not execute gracefully when its in a macro, in this case m6.

As I said at the beginning of this thread <Stop> is poor operating practice, the correct procedure is <Feedhold> followed
by <Stop>.

Try <Feedhold> then <Stop> while an m6 is executing and see if the behavior differs.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: No GCode Movement after pressing stop
« Reply #7 on: May 03, 2019, 05:24:58 AM »
You are absolutely right about bad practice.
But for savety reasons, there should not be a tool thrown around if the operation presses a bad practice button.

By tests i proved, that stop is not exiting m6 script.
Stop will only terminate the current mcCntlGcodeExecuteWait and continues in the script.
So you must check for estop, stop,... each second line in your script.


I solved it by checking the coordinates after mcCntlGcodeExecuteWait if this was executed successful.
Found no ther way to test if stop was called.

If coordinates ware wrong - I exit m6 script.
This also solves the "no movement possible" problem.

Stuck in M6 seems not to be a detectible machine state, it sais still idle, even stucking in middle of m6 lua.