Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 12:59:18 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  2 stage homing script
Pages: 1   Go Down
Print
Author Topic: 2 stage homing script  (Read 228 times)
0 Members and 2 Guests are viewing this topic.
Darc
Active Member

Offline Offline

Posts: 177


View Profile
« on: August 15, 2011, 03:27:16 AM »

Currently I use pretty much the standard homing routing, is it possible to home at rapid for the first cycle, then home at the normal slow speed, just to make it a lot quicker?
These are the buttons that currently run the slow homing cycle.

DoButton( 24 )'Z
DoButton( 23 )'Y
DoButton( 22 )'X
Logged
Greolt
Global Moderator
*
Offline Offline

Posts: 872


View Profile
« Reply #1 on: August 15, 2011, 04:01:55 AM »

Try this,

SetParam ("YRefPer",100)
DoOEMButton (1023)  'home at 100%
While IsMoving()
Wend
Code "G53 Y5"  'move off switch 5mm
While IsMoving()
Wend
SetParam ("YRefPer",5)
Sleep 200
DoOEMButton (1023)  'home at 5%
While IsMoving()
Wend
SetParam ("YRefPer",100)


This is for the Y axis,   you will need to write similar for other axis.

Greg
« Last Edit: August 15, 2011, 04:05:01 AM by Greolt » Logged
Darc
Active Member

Offline Offline

Posts: 177


View Profile
« Reply #2 on: August 15, 2011, 04:44:15 AM »

Thanks Greg, I'll give it a go.
I just remembered something else, is it possible to home X&Y at the same time?
« Last Edit: August 15, 2011, 04:47:35 AM by Darc » Logged
Greolt
Global Moderator
*
Offline Offline

Posts: 872


View Profile
« Reply #3 on: August 15, 2011, 05:13:01 AM »

RefCombination command will do that.

Right now I can not get the Mach3 Wiki page to load for some reason.  That has info on using this command.

Greg

PS:  The following is from the Mach3 Macro Reference Manual PDF

RefCombination 
Sub RefCombination(Axes As Integer)
 
This function allows any combination of axes to be simultaneously referenced (homed). 
Which axes will be referenced is determined by the Axes argument, which is a bit-
mapped variable, with the bits mapped as defined below.
 
Arguments:
Axes is a bit-mapped value the defines which axes are to be referenced.  The
value of Axes can be calculated by adding the values corresponding to the
individual axes to be referenced.   The axis values are:
 
 X = 1
 Y = 2
 Z = 4
 A = 8
 B = 16
 C = 32
 
So, for example, to reference the X, Z and B axes, Axes = 1 + 4 + 16 = 21.
Return Value:
 None
Example:
‘ Define some constants
RefX = 1
RefY = 2
RefZ = 4
RefZ = 8
RefB = 16
RefC = 32
‘ Reference Y, Z and C axes
RefCombination(RefY + RefZ + RefC)
« Last Edit: August 15, 2011, 05:17:05 AM by Greolt » Logged
Darc
Active Member

Offline Offline

Posts: 177


View Profile
« Reply #4 on: August 15, 2011, 05:24:34 AM »

Yet again, Thanks Greg
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!