Hello Guest it is April 19, 2024, 04:09:05 PM

Author Topic: Stop Button Problem... Bug or my ignorance?  (Read 3284 times)

0 Members and 1 Guest are viewing this topic.

Stop Button Problem... Bug or my ignorance?
« on: August 11, 2015, 03:27:14 AM »
Hi Guys... I'm (very) slowly figuring out how to use Lua to get my machine running like I want by reading through the forum post but I've run into another problem I can't figure out... When I press the stop button all axis motion stops but my spindle keeps running till I press the Spindle CCW button or the Reset Button.
Should the spindle not stop also or am I missing something? The btnStop event list Cycle Stop as the Left Up Action... What events should occur on Cycle Stop? I've tried to figure out how the Cycle Stop action works but can't find any info about it.  Also can you also have a Left Up Script and a Left Up Action on the same button? If you did would both be run?
Once again, Thanks in advance.
 
Hit the e-stop! Hit the e-stop!
Re: Stop Button Problem... Bug or my ignorance?
« Reply #1 on: August 25, 2015, 09:05:41 PM »
Hello, hello... is there anyone out there?  ;D
Hit the e-stop! Hit the e-stop!
Re: Stop Button Problem... Bug or my ignorance?
« Reply #2 on: August 25, 2015, 11:34:51 PM »
I'll jump in here with the big caveat that I am guessing on part of this (I am *not* a machinist, I'm just an engineer who designs stuff for them :-)

As you've seen, the "Cycle Stop" halts execution of the current GCode file of MDI sequence, and halts motion (X/Y/Z/A/B/C).  I have never seen it alter spindle operation.  The script engine (apparently) does not track the state of the spindle, though obviously the Mach4 core *does* know about it.

I don't know if you can have BOTH a "Left Up Action" and "Left Up Script" assigned to a button, but you could certainly delete the "Left Up Action" and add something link this as the "Left Up Script" (**UN-TESTED**)

local mInst = mc.mcGetInstance();
mc.mcCntlCycleStop(mInst);
mc.msSpindleSetDirection(mInst,0);

Setting the direction to zero stops the spindle.  BUT NOTE: The GCode processor (or MDI processor) won't know to turn the spindle back on if you the click on "Cycle Start".  And there may be important reasons (that machinists know but I don't) as to why one would want to leave the spindle running on "Cycle Stop".

Bob

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Stop Button Problem... Bug or my ignorance?
« Reply #3 on: August 26, 2015, 12:27:36 AM »
Actually it should be a controlled stop and retract to SafeZ. Some controls allow it to go to a SAFE position defined in the Parameters.  The spindle stays running in the event you are in a deep hole and need it to turn until it gets to safe Z Same with coolant. THEN the Operator can turn OFF the coolant and spindle if needed. 

IF it is an emergency then THAT is what the big red button is for. 

Just a thought, (;-) TP
Re: Stop Button Problem... Bug or my ignorance?
« Reply #4 on: August 26, 2015, 08:35:00 AM »
Thanks for the replies guys. I was thinking that on my Mach 3 setup the cycle stop did shut off the spindle (I'll have to reload Mach 3 & check). I'll try the code you suggested and see if it works... thanks again
Hit the e-stop! Hit the e-stop!

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Stop Button Problem... Bug or my ignorance?
« Reply #5 on: August 26, 2015, 10:08:57 AM »
Mach3 is the only controller I have ever seen that moves to safe Z if stop is commanded and it shouldn't IMO. What happens if your using a T-slot or keyhole cutter?

But, with Mach you have the flexibility to make it do almost anything you can imagine. All I ever want stop to do is stop motion. I will do everything else depending on the situation. Anything else is hazardous IMO but like opinions, machines vary drastically and in the right setting I could see additional actions being a good thing for the operator, tooling, machine, part, etc.

So, while we are on this subject, what do you think should happen when the stop button is pressed? What parameters would you want to look at (if any) to determine this action?  
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Stop Button Problem... Bug or my ignorance?
« Reply #6 on: August 26, 2015, 10:57:56 AM »
That is an easy one it SHOULD come to a "controlled" STOP  with the option of Safe Z or not , with the option of spindle /coolant on ,off.  MACH3 does not do a safe Z retract as standard you have to setup the Safe Z to do it.

(;-) TP
« Last Edit: August 26, 2015, 11:00:46 AM by BR549 »