Hello Guest it is October 15, 2021, 05:55:23 PM

Author Topic: 2 stage homing script  (Read 6370 times)

0 Members and 1 Guest are viewing this topic.

Offline Tarak

*
  •  229 229
    • View Profile
2 stage homing script
« on: August 15, 2011, 04: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

Offline Greolt

*
  •  956 956
    • View Profile
Re: 2 stage homing script
« Reply #1 on: August 15, 2011, 05: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, 05:05:01 AM by Greolt »

Offline Tarak

*
  •  229 229
    • View Profile
Re: 2 stage homing script
« Reply #2 on: August 15, 2011, 05: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, 05:47:35 AM by Darc »

Offline Greolt

*
  •  956 956
    • View Profile
Re: 2 stage homing script
« Reply #3 on: August 15, 2011, 06: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, 06:17:05 AM by Greolt »

Offline Tarak

*
  •  229 229
    • View Profile
Re: 2 stage homing script
« Reply #4 on: August 15, 2011, 06:24:34 AM »
Yet again, Thanks Greg