PDA

View Full Version : Help with Mach 3 REF all Home Button



Kevin1970
28-05-2013, 05:09 PM
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

Bazzer
28-05-2013, 05:44 PM
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.

cropwell
28-05-2013, 08:04 PM
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)

cropwell
28-05-2013, 08:35 PM
Here are the two files (converted to txt)

John S
28-05-2013, 09:04 PM
Kevin,
What are you calling Ref all home button ?
Can't see this on the standard screen

JAZZCNC
29-05-2013, 12:38 AM
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

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.

cropwell
29-05-2013, 09:41 AM
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.

ilias86gr
21-04-2015, 07:23 PM
Hello,

Can somehow add a key from keyboard to "reference all home" in MACH 3?

Thanks in advance

Boyan Silyavski
22-04-2015, 10:00 AM
I find most useful these to be 2 separate commands. The way i work i mean.

XY0 and Z0 to be on separate buttons.

ilias86gr
22-04-2015, 10:06 AM
Can you tell me how is done?

Thanks

Boyan Silyavski
22-04-2015, 10:28 AM
Can you tell me how is done?

Thanks

http://www.machsupport.com/Mach3Wiki/index.php?title=Standard_Hotkeys

cropwell
23-04-2015, 11:54 AM
Mach3 also has a Keygrabber, which I use translate the buttons of a microsoft usb game controller into key codes to jog, home and start/stop the spindle.