Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: jrobson on May 30, 2011, 10:00:53 AM

Title: Reset = E-stop?
Post by: jrobson on May 30, 2011, 10:00:53 AM
Hi

Is there another way to reset, when I use OEM 1021 and click reset the message: "Estop button pressed" is there another OEM code that simply resets (program, error messages etc) without being tied to E-Stop?

Title: Re: Reset = E-stop?
Post by: Hood on May 30, 2011, 10:12:19 AM
Clear will clear error messages, but reset is basically the same as E-Stop. What exactly are you wishing to do?
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on May 30, 2011, 10:30:57 AM
Thank you.
In a practical example, let's say I start a new program, find out somewhere half way through that it has a problem. Usually already in feedhold at this point, but single block is also possible or perhaps an alarm.
Pull the Flash card out, plug into notebook, load new program, put flash card back, press reset, program zero's machine anyway and it all starts again.

On an older lathe if I don't have a G28 in the beginning of the program then I would manually return it to home first.

From your post I assume the procedure would then be to "Clear error label" then followed by "Reload" and depending on other factors it would either home itself with the new program or require the user to manually home?


Title: Re: Reset = E-stop?
Post by: Hood on May 30, 2011, 10:36:31 AM
Feedhold then Stop would be what I would do. Then if you want to close the code press close, if you want to rewind press rewind, if you want to load revised code then use load code etc.

No need to clear the error messages unless you really want to but to do that then clear is what you use.

One other thing I would say is according to the guys that write Mach it is best to run code from your computers hard drive rather than from a networked or flash card etc.
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on May 30, 2011, 10:55:17 AM
Thanks again, sorry for the dumb questions but I'm new to the way Mach works, will Mach continue to run even if there are active error messages?

The idea is to try and reduce buttons as far as possible, for instance Stop, rewind, reload, clear messages etc all really are part of the same thing, namely, reset? So perhaps the solution would be to write a script that "STOPS" then "Clear message" then etc... Does Mach read the program every time the start button is pressed? I assume that since you "load" "close" and "reload" a program that it is cached?

The flash card was just an example of how I currently work (With my machine it's easier and quicker just to run straight off the flash).
Title: Re: Reset = E-stop?
Post by: jrobson on May 30, 2011, 11:00:10 AM
Okay I see now, I added a cycle start button quick to check, mach3 locks the file, so to edit one would need to close it first?
Title: Re: Reset = E-stop?
Post by: jrobson on May 30, 2011, 11:28:32 AM
And it also appears that "rewind" can function as "reset".
Title: Re: Reset = E-stop?
Post by: BR549 on May 30, 2011, 11:36:12 AM
WHen running a file and you find a need to stop to correct something:

Hit feedhold and WAIT until Mach stops moving.  (important to maintain xyz positions) IF you hit stop BEFORE mach stops movement you will LOOSE position and will have to rehome

Then Hit STOP, this will clear any activity that MACH is holding for the current program.

Now if you wish to manually edit the Current program then use EDIT to acces the file. Save when done then Mach will reload it and you are ready to proceed.  You can restart from the beginning OR mid program if needed by use of run from here.

NOW IF you need to modify the current program Via CAD/CAM program then CLOSE the current file. This will aloow MACH to release the file so it can be opened elsewhere.

Just a thought, (;-) TP
Title: Re: Reset = E-stop?
Post by: jrobson on May 30, 2011, 11:43:55 AM
Thank you BR549, that is exactly what I wanted to know!

Title: Re: Reset = E-stop?
Post by: jrobson on June 05, 2011, 08:22:36 AM
I coded my reset button:

DoOEMButton(1003) (Stop)
DoOEMButton(172)   (Clear error)
DoOEMButton(1002) (Rewind)

Works great, when I hit it it stops the program, clears the error, rewinds. Then can't start the program again, when hitting start again timer starts running but that is it.
Title: Re: Reset = E-stop?
Post by: jrobson on June 05, 2011, 08:23:48 AM
Perhaps 1003 is feedhold and not stop?
Title: Re: Reset = E-stop?
Post by: Hood on June 05, 2011, 08:56:20 AM
1003 I believe is Stop and should really only be used when all motion has stopped, so likely better to use OEM 1001 (feedhold) first and have a
While IsMoving()
Wend

between the two

Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 05, 2011, 02:13:40 PM
I found the problem, possibly an error with mach, when issueing 1003 controller goes into e-stop, therefore the only way to retrieve would be to "reset" since issueing 1003 a second time doesn't help. When the button is assigned directly as stop instead of via script then it stops only, doesn't go into estop.

Title: Re: Reset = E-stop?
Post by: BR549 on June 05, 2011, 02:57:41 PM
HUM 1003 does not go into reset/estop here when used in a script.

So you want a script that will safely stop the program and then rewind and clear messages??

Hood is correct that you should do a Feedhold/pause and the While ISmoving Wend then issue the stop. Otherewise you can loose position.

I have a script that will do what you want I will look it up and test it.

Just a thought(;-) TP
Title: Re: Reset = E-stop?
Post by: BR549 on June 05, 2011, 03:11:26 PM
Can you post teh code you tried so I can test it here?

Thanks (;-) TP
Title: Re: Reset = E-stop?
Post by: jrobson on June 05, 2011, 04:29:03 PM
Don't mind losing position, however, "DoOEMButton(1003)" by itself causes estop to activate, even just that line by itself. Like I said before if I hit the button when it isn't coded and given function stop standard code 3 it works just fine, it stops, doesn't rewind though, but it stops without going into e-stop.

I've tried the code, still didn't work, even if the program is not executing, just by pressing the button with code 1003 causes e-stop to activate.

Title: Re: Reset = E-stop?
Post by: jrobson on June 05, 2011, 04:51:33 PM
You can see the attached screen.
Title: Re: Reset = E-stop?
Post by: jrobson on June 05, 2011, 04:53:38 PM
F10 is shortcut for start when in the auto section.
Title: Re: Reset = E-stop?
Post by: Hood on June 05, 2011, 05:29:23 PM
Do you have servos? Do they have a fault output that you have going to Mach? If yes then that will be why you are getting the E-Stop triggering when you do OEM1003

Hood
Title: Re: Reset = E-stop?
Post by: BR549 on June 05, 2011, 07:20:51 PM
Just tested the 1003 here and it does not trip a reset here.

(;-) TP
Title: Re: Reset = E-stop?
Post by: BR549 on June 05, 2011, 07:34:17 PM
OK where in your screen set is the code you want us to check?

(;-) TP
Title: Re: Reset = E-stop?
Post by: BR549 on June 05, 2011, 09:45:54 PM
Hood could you test something on your end to confirm something? The While Ismoving will NOT work with the feedhold RUNNING a Gcode Progam. As long as the feedhold is still active the while Ismoving()  loop holds up VB in a wait loop.  

IF you Press the STOP button manually it releases the loop and continues the VB code  (;-( I don't remember it being that way in the past.


DoOemButton(1002) 'Feedhold
While Ismoving()
Sleep 10
Wend
Message " It made it passed the Feedhold"
Sleep 5000
DoOemButton(1003)
Message "It made it to STOP"
end
Title: Re: Reset = E-stop?
Post by: BR549 on June 05, 2011, 10:07:35 PM
Sorry Hood the first line should reference button(1001)  Feedhold. Not 1002
Title: Re: Reset = E-stop?
Post by: BR549 on June 06, 2011, 12:11:25 AM
OK I think I figured it out. The While Ismoving will not release the loop because mach is still active in a paused mode. 

We will need to use

 While IsStopped() =0
Wend

That Way the LOOP is released the moment ALL the axis's actually stop moving.

I could have sworn the ismoving() used to work for this ?????  Maybe the brain has faded.

(;-) TP
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 02:00:26 AM
Hood: No servo's, I'm busy with the screen first.

BR549, it's at all the reset buttons, thanks for the code, but it also does it while mach3 is not executing g-code.

I don't know if it needs a reinstall, this is on my notebook, I'll have to try put it on the dedicated machine to see if it makes a difference but I loaned that out and can only use it again on Wednesday.


Title: Re: Reset = E-stop?
Post by: BR549 on June 06, 2011, 02:23:00 AM
NOW I see it happening in YOUR screenset. That same code runs fine in MY screen set. That mean you may have some crossed up button code or possible duplicate hotkeys somewhere in the screenset.

Been there done that one before. I will start looking for the problem to help out.

(;-)TP
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 02:24:52 AM
Okay thanks for confirming, I'll have a look around and see if I can find it as well.

I used the mouse to test.

Title: Re: Reset = E-stop?
Post by: BR549 on June 06, 2011, 02:41:08 AM
OK I cleaned out all the button code for all the resets and reentered the code and it seems to work fine here.  NO resets when you use the button

Opened with MachScreen and it declared the screen set corrupt for some reason.

(;-) TP
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 02:44:18 AM
Hmmm... okay what does that mean, must I redo it?
Title: Re: Reset = E-stop?
Post by: BR549 on June 06, 2011, 03:02:53 AM
I don't know for sure all I did was clean out the code and retype it in again and it worked OK.

Give that a try, (;-) TP
Title: Re: Reset = E-stop?
Post by: BR549 on June 06, 2011, 03:08:49 AM
J it said it was missing 1 image file "PG1.png"

(;-) TP
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 03:13:12 AM
Oh okay, I think that's from a previous screen that I removed, I find these strange problems with screen designer...
I think I should just do it from scratch again, clearing and retyping the code didn't fix it...

Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 03:34:23 AM
Just awake and looking at your screenset, maybe I dont have things loaded correctly but how do you even know its in Reset as I dont see any LEDs or error messages when I load your screen.
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 03:36:54 AM
It has both a section for error messages(Label "Error") as well as a ticker(Label "Ticker0")...
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 03:38:37 AM
Ok yes see that now, eyes still half shut, trying to catch up on lack of sleep in the last week :D
Hood
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 03:41:14 AM
Ok next question, how do you get it out of Reset in the first place? Might have already said as I have not gone through all the posts.
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 03:42:02 AM
You mean when starting up? Click on initialize.
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 03:44:11 AM
Ok, how do yo get back to the initial screen?
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 03:47:43 AM
I had to reload to get back to the initial screen then pressed Initialise  to take Mach out of reset, then loaded code, ran it a bit and pressed your reset button and all seemed fine for me. How are you getting it to fault by using the Reset button? Can you attach your xml as well as it may be something in it.
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 03:52:43 AM
Hmmmm Strange... Let me reinstall quick and see. Btw how did you get it to e-stop after initializing?
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 03:56:39 AM
I think I deliberately called OEM 1021 from VB to do that. Even though I did that, what would you do if an E-Stop happened, dont see any way for you to correct that?
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 03:58:44 AM
The way it should work is when you hit E-Stop the machine goes into E-Stop, you then twist the knob to release it, then reset to clear error and it should carry on. Something tells me Mach doesn't work this way though.
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 04:00:09 AM
One thing for you to try is Uncheck the watchdog on General Config page, that could be putting you into reset if it detects something not quite right with your computer, sometimes the watchdog can be a bit sensitive with some computers.
Hood
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 04:00:47 AM
Ok but you dont have any way to press Machs Reset that I can see, ie DoOemButton (1021)
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 04:09:03 AM
It's definitely a problem on my notebook, after reinstalling I can't even get the default screen to go out of e-stop. No watchdog checked.

The problem with the mach "reset" is that it isn't really a reset, it's an e-stop. I have never used a system (pc included) that requires the pressing of a reset button twice to actually reset... reset should be distinguished  from E-stop they are not the same thing so basically I'm trying to see if it is possible via workarounds.

 
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 04:29:04 AM
Reset as it is called in Mach disables everything similar to an E-Stop would in hardware. Not sure what you mean about needing to press it twice as only once is needed, unless you are meaning that yyou taking the real E-Stop switch off is pressing the Reset?

May be a way to monitor the E-Stop input signal to press Reset in the background by using the macropump.

Regards the laptop, likely you dont have the E-Stop configured in Ports and Pins but why pressing your Reset button puts Mach into Reset I have no idea as it doesnt here, again your xml may hold the clue to that.
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 04:38:10 AM
Thanks again Hood, the way reset "should" function is exactly according to the definition of the word, once pressed it should stop operation AND be ready to start again. Otherwise it's a "stop and hold" known as stop or e-stop. Mach has reset and e-stop sort of converged into the same thing, the first time you press it, it stops like an e-stop, the second time it resets.


Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 04:39:23 AM
Reset should not actually have to stop the spindle or turn off the water, but it should stop axis motion and rewind the program at the minimum, the thing is if you try and rewind mach with give you an error stating that you need to stop first.
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 05:09:34 AM
Just different names I suppose, its the way Mach is, rename the button to what you want would be the answer, maybe just simply call it E-Stop.
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 05:16:38 AM
That's exactly what I am trying to do, it's rename to initialize, but I'm trying to recreate reset, seems like it does work I just need to try it on the other "clean" installation, since the notebook has so many other applications on I suppose I should refrain from testing on here.
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 05:40:23 AM
What about an IF statement that checks if E-Stop is activated and if it is then resets it with 1021?
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 06:03:30 AM
Got it working if anyone wants a "reset" button here is the code:
DoOEMButton(1003)
DoOEMButton(172)
DoOEMButton(1002)
Sleep 10
If(GetLED(0))Then
DoOEMButton(1021)
end if

Thank you guys for helping out, much appreciated!
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 06:25:19 AM
Good to see you got it the way you want.
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 06:45:38 AM
I hope it works with a hardware e-stop though, but I'll test that when the console is done. It should release the e-stop then immediately activate it again... in theory :) which is exactly how the reset normally works.
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 06:50:56 AM
Think I would have the macropump monitoring your E-Stop input and Machs Reset LED and if in the combination you want then untwisting the E-Stop would automatically take Mach out of Reset. Or at least I think that may be what you are trying to achieve.
Hood
Title: Re: Reset = E-stop?
Post by: jrobson on June 06, 2011, 07:03:32 AM
Not really, untwisting may leave it in e-stop, as long as it resets after just fine, I just don't want it to reset while the e-stop is pressed in.
Title: Re: Reset = E-stop?
Post by: Hood on June 06, 2011, 07:08:18 AM
Ok then should work fine the way you have it.
Hood