Hello Guest it is April 24, 2024, 05:01:36 AM

Author Topic: How to make the machine not operate unless it is homed first...  (Read 7662 times)

0 Members and 1 Guest are viewing this topic.

Offline Tarak

*
  •  229 229
    • View Profile
Is it possible to make the machine not operate unless it is homed after switching on power?
Re: How to make the machine not operate unless it is homed first...
« Reply #1 on: March 21, 2007, 09:51:39 PM »
Yes you can do that in the Macro pump... you just need to look at the Ref Led and tell the system to error out if i is asked to run a Gcode file.
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline Tarak

*
  •  229 229
    • View Profile
Re: How to make the machine not operate unless it is homed first...
« Reply #2 on: April 13, 2007, 02:28:20 AM »
Hi Brian, thanks for the reply (sorry it's taken me so long).
I've been reading up on the Macro pump and now I understand what it is and how it works.
I looked at the LED I need to check and it's OEM code 808.
I'm just having a try at coding it at the moment.
Thanks.

Hood

*
Re: How to make the machine not operate unless it is homed first...
« Reply #3 on: April 13, 2007, 09:29:29 AM »
OOPS I posted this in the wrong thread, thats what happens when you get older ;)
Hood
« Last Edit: April 15, 2007, 03:48:25 AM by Hood »

Offline Tarak

*
  •  229 229
    • View Profile
Re: How to make the machine not operate unless it is homed first...
« Reply #4 on: April 15, 2007, 09:36:49 PM »
If you get a chance could you please have a look at the code I'm trying to write, it keeps giving me a syntax error, but hey I've got to start somewhere....

If GetLED (808) = 0 'Std Y axis home LED
Sub DoButton (2082) 'Not sure if this number is correct, it says in the manual that this is the scan code (I'm just using the standard STOP-Esc)
CODE "(HOME MACHINE BEFORE USE)" 'I thought this way it would flash, because it is technically an error with the brackets.
End If

CODE "(MACHINE READY FOR USE)"
CODE "G90 G54"
CODE "G00 Y1.0"
CODE "M03"
CODE "G01 Y20.0 F70"
CODE "G90 G00 Y5.0"
CODE "M05"
CODE "M30"

Offline zealous

*
  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: How to make the machine not operate unless it is homed first...
« Reply #5 on: April 16, 2007, 07:34:26 AM »
Don't forget if you have a "If" statment you need an  "Else".

Look out for that VB editor, it doesn't seem to want to save scripts and is acting wird  :P bet Brain if fixing that now  ;D

This should work fine, some one might have a better way than this please post  :)

If GetLed (808)=0 Then 'Std Y axis home LED

DoOEMButton (1021) 'Estop OEM LED
CODE "(HOME MACHINE BEFORE USE)"


Else

CODE "(Ready to go)"

End If

Offline zealous

*
  •  489 489
  • HI!
    • View Profile
    • Artsoft Solutions
Re: How to make the machine not operate unless it is homed first...
« Reply #6 on: April 16, 2007, 08:35:39 AM »
Darc,
Acualy after testing the code out I found that since the estop is active I'm unable to Home the axis (obviously  ;D) via the macro pump.
If your trying to not allow the operator to run Gcode you could put the above code on the Gcode button and add the "DoButton (0) 'Play Gcode" and add "DoOEMButton(290-295) to disable jog movment of each axis".

PS I belive we're looking for a =0 value is sent if the axis are ref home

Put this on the Start Gcode button:

If GetLed (808)=1 Then 'Std Y axis home LED

DoOEMButton (1021) 'Estop OEM LED
CODE "(HOME MACHINE BEFORE USE)"

Else
DoButton (0) 'Strat Gcode
End If


Put this in the macro Pump:
If GetLed (808)=1 Then 'Std Y axis home LED

DoOEMButton (250) 'Stop Jog X
DoOEMButton (251) 'Stop Jog Y
DoOEMButton (252) 'Stop Jog Z
DoOEMButton (253) 'Stop Jog A
DoOEMButton (254) 'Stop Jog B
CODE "(HOME MACHINE BEFORE USE)"


Else
DoOEMButton (290) 'Allow Jog X
DoOEMButton (291) 'Allow  Jog Y
DoOEMButton (292) 'Allow  Jog Z
DoOEMButton (293) 'Allow  Jog A
DoOEMButton (294) 'Allow  Jog B

CODE "(Ready to go)"

End If



If a talented VB coder would add in a "SUb Main" and "Sub exit" to have it exit the macro pump script once the Axis are homed that would be great  ;D since there is no reason for Mach to keep check the code once the axis are refered.
« Last Edit: April 16, 2007, 09:18:11 AM by zealous »
Re: How to make the machine not operate unless it is homed first...
« Reply #7 on: April 16, 2007, 09:35:58 PM »
This will do it... You just need to change the UserLED to some other LED...

Sub Main()'//this must be at the start of the function

 If (GetUserLED (1100)= true)Then'//something to show that you don't need to run the Macro
 Exit Sub'//Get OUT and don't run the code!
 End If
 
 
If GetLed (808)=1 Then 'Std Y axis home LED

DoOEMButton (250) 'Stop Jog X
DoOEMButton (251) 'Stop Jog Y
DoOEMButton (252) 'Stop Jog Z
DoOEMButton (253) 'Stop Jog A
DoOEMButton (254) 'Stop Jog B
CODE "(HOME MACHINE BEFORE USE)"


Else
DoOEMButton (290) 'Allow Jog X
DoOEMButton (291) 'Allow  Jog Y
DoOEMButton (292) 'Allow  Jog Z
DoOEMButton (293) 'Allow  Jog A
DoOEMButton (294) 'Allow  Jog B

CODE "(Ready to go)"

End If

End Sub'//This is the End of the SubMain function

Main'//Put this at the end of the code file
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline Tarak

*
  •  229 229
    • View Profile
Re: How to make the machine not operate unless it is homed first...
« Reply #8 on: April 16, 2007, 09:55:54 PM »
Thanks Zealous & Brian, holy crap that's confusing, I'll give it a go today.
I thought most people would want to use this function, just for safety.
Thanks again.

Offline Tarak

*
  •  229 229
    • View Profile
Re: How to make the machine not operate unless it is homed first...
« Reply #9 on: April 17, 2007, 02:31:27 AM »
Hey guys, I tried to use both of them, but I think I was doing something wrong, cause I couldn't get it to work properly.
Interestingly enough after I tried those, I gave up & unchecked use MacroPump and remove the code from within the button I was testing it on.
Now for some reason my spindle will not start up using the CODE "M03" in my scripts.
When I press ESC (cycle stop) during the cycle of the script, the spindle starts up???????
But if I load a normal G code program the spindle works fine with M03.....
Well I've done it this time.....