Hello all
I am after a macro for the Ref All Home button on Mach3.
When i press the button, i want all the three axis to go the home positions (X,0 Y,0 and Z,25)
Can anyone help me with this.
Thanks
Kevin
Printable View
Hello all
I am after a macro for the Ref All Home button on Mach3.
When i press the button, i want all the three axis to go the home positions (X,0 Y,0 and Z,25)
Can anyone help me with this.
Thanks
Kevin
Hi Kevin
I'm no expert with g code, but could you not just set up a "work offset" in mach3 for your required position, ref all, then goto zero position in the required offset.
I have an 'Auto Tool Zero' macro which sets the Z position using a touch plate to a height above the plate. This is 10mm above the gage block height specified on the offsets screen. The touch plate is just a brass block bonded to some acrylic sheet and machined flat. I then measured the thickness and this is the gage block height. The brass part is connected to the touch probe input and the tool is earthed (mine earths through the machine). So you put the block under the tool, click auto tool zero and it sets the tool height. The 'Ref All Home' has a macro which moves X and Y to the home switches.
If I can find out how to attach the files I will do. Otherwise you can PM me. I only live up the road from you (In Nottinghamshire)
Here are the two files (converted to txt)
Kevin,
What are you calling Ref all home button ?
Can't see this on the standard screen
You don't need macro this can be done very easy direct in Mach. Here's how.
Goto to operator menu across top and choose "Edit Button Script" Some of the buttons on screen will flash. These are the buttons that can be edited direct in Mach.
The Ref-All-Home should be flashing so click on it and VB script editor will open. You will see something displayed like
DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )
DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)
Just add these lines after DoButton( 24 ) and before DoButton( 23 ) on separate lines like shown.
Also note I put Z-25 (Minus) you may want to change this depending if your Z doesn't travel in the negative which most folks do.
Code "G53 G0 z-25"
While IsMoving()
Wend
Remember to save the script.!! . . . .That's it Done.!!
This setup presumes you have Home switches the Z will first move to switch and set machine Zero then back off to -25mm using the G53 machine coordinate command.
You can use the same code for the other Axis and change the values to suit. These are the button numbers for each Axis
DoButton( 24 ) = Z
DoButton( 23 ) = Y
DoButton( 22 ) = X
DoButton( 25 ) = A
You can also change the homing order by moving the line position of it's button command.
IE Z, A, X, Y would be.
DoButton( 24 )
DoButton( 25 )
DoButton( 22 )
DoButton( 23 )
Hope this helps.
On my machine the Z axis homes and zeroes at the top of travel. Zeroing to the bottom means the home switch compensates for tool length, otherwise CRUNCH. With the tool height set you can go to a known zero position (relative to machine bed or workpiece).
I did not write the button scripts, but may have modified them slightly. There is help on this on the Artsoft website.
I would advise that before homing the X and Y, that you get the Z axis up and out of the way.
Hello,
Can somehow add a key from keyboard to "reference all home" in MACH 3?
Thanks in advance
I find most useful these to be 2 separate commands. The way i work i mean.
XY0 and Z0 to be on separate buttons.
Can you tell me how is done?
Thanks