PDA

View Full Version : Home Switches & Slave Axis in Mach 3



Tenson
20-02-2013, 01:21 PM
I've just set up a couple of switches to home my Y axis (the long one) which has two motors where A is slaved to Y in Mach 3.

Could somebody help explain how to setup Mach 3 so the home switches on each side of the gantry work independently so that the gantry is automatically squared when I hit home?

I had a go yesterday and for some reason the slaved axis carried on after it hit the switch and crushed it! Do I need to set them as limit switches too?

Thanks!

kingcreaky
20-02-2013, 02:50 PM
slaved axis carried on after it hit the switch and crushed it! :hysterical:

for my own reference, keen to hear a response to this question... think my switches turn up this week.

JAZZCNC
20-02-2013, 09:59 PM
You need each switch on slaved axis on it's own input then go into Config/General config and unset the "Home Slave with master Axis".
Should work now.!

TIP: To test click the switches manually by hand well before axis gets near switches. Keep hand over E-stop just in case it doesn't work.. . .Simplizzz.

Setting them has limits won't make any difference because Mach ignores Limits while it's homing when sharing switch.

Shinobiwan
22-02-2013, 12:42 AM
You need each switch on slaved axis on it's own input then go into Config/General config and set the "Home Slave with master Axis".
Should work now.!

That works fine for a single switch on a dual axis but if you want to home each of the two sides of the gantry independently ie. to auto square. then you leave this disabled. It could be you had this enabled and that's why it crushed your switch since it ignored one and looked only for the other.

What you have to do is:



In general config set 'Home slave with master axis' to disabled
Make sure you have each of the two switches on a separate input to Mach. Auto squaring doesn't work with the switches in series on the same input. Note: You can have all your switches in series bar one of them on the dual axis thus using only two inputs if your restricted
In ports and pins correctly assign the inputs to the switches and test them to make sure their working as intended. Take care to ensure the correct switch corresponds to its associated axis. (assume you know how to do this since you already have working switches on your machine)
Check that your motor tuning is identical for the Master and Slave axis because once you start to home they run independently and are no longer slaved during that operation so Mach will use these settings - if they're different you'll twist the gantry.
Go into homing and soft limits setup and check that the Master and Slave axis settings are identical here too.


Some additional advice. If your using the cheap mechanical switches ditch them, they really are shit. They bend so easily and not particularly accurate in general. If you can ensure that no swarf is going to get to them then inductive proximity switches are far better since there's no mechanical action. I use these and found them to be dead on accurate and its impossible to crush them - bonus! lol

SN04-P 4mm Approach Sensor Proximity Switch PNP NO DC 10-30V 200mA New | eBay (http://www.ebay.co.uk/itm/SN04-P-4mm-Approach-Sensor-Proximity-Switch-PNP-NO-DC-10-30V-200mA-New-/380533544939?pt=UK_BOI_Electrical_Components_Suppl ies_ET&hash=item58999117eb)

JAZZCNC
22-02-2013, 12:51 AM
Good spot Ant.!! . . It should have read " Unset the "Home slave with master Axis" " . . :thumsup:

Shinobiwan
22-02-2013, 01:00 AM
Yep not just a pretty a face! Haha

Tenson
22-02-2013, 01:57 AM
Ahh I'm still having trouble! If I select 'home slave with master' then it homes well, but only pays attention to the one switch on the master axis. If I don't have that ticked then it seems like it homes the master and slave at the same time and uses both switches which is good, but after it hits both switches and backs off it then seems to start homing the slave axis on it's own! It's tricky to know exactly what it's doing since I need to abort as soon as it tries to twist the gantry.

Shinobiwan
22-02-2013, 02:14 AM
Did you follow the stuff above?

Once mach hits a switch and backs off it doesn't try to home again so what you think is happening won't be the case. You'll have to dig deeper in the diagnostics and watch the pins to see if they light and go out as expected. Check wiring and go over all your settings thoroughly. Make sure your motor output pins for A, B, C aren't sharing too.

Tenson
22-02-2013, 02:28 AM
It seems like it is homing the Y axis and the A goes with it as they are slaved and it does just what it should. Then it goes and homes the A axis independently like it thinks it is not only slaved, but also independent... I'll have another look tomorrow and probably twist the gantry!

Tenson
22-02-2013, 06:52 PM
I fixed it! The problem was that I was hitting 'Ref All Home' which seemed to home Y with A at the same time since they are slaved then homed A independently. The solution was to go to the diagnostics page and click 'Ref Y' on its own rather than Ref All Home.

Shinobiwan
22-02-2013, 07:06 PM
I use the Mach2010 screenset and I guess its got its own macro's for homing because ref all doesn't try to home slaved axis on their own.

JAZZCNC
22-02-2013, 09:43 PM
I fixed it! The problem was that I was hitting 'Ref All Home' which seemed to home Y with A at the same time since they are slaved then homed A independently. The solution was to go to the diagnostics page and click 'Ref Y' on its own rather than Ref All Home.

Check what code is in the "Ref all home" Button. Go to "Operator" menu and select "Edit Button script" it will read something like:
DoButton( 24 )
RefCombination(3)

DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)

Either Delete and enter what's below or comment out the existing lines by putting ( ' ) before, anything after the ' is ignored and treat has comment. (It's on same key has @ on my keyboard.?)

DoButton( 24 ) ' Z axis
DoButton( 23 ) ' Y axis
DoButton( 22 ) ' X axis

First Z axis will move then Y axis then X axis.
If you want Y & X other way round then just switch last two lines.

Oh and make sure you save before closing Script editor.!!

Should work fine now.?

Tenson
23-02-2013, 12:07 AM
Thanks Jazz I'll try it next week... I crushed the buttons again! My fault this time I had limits switched off and hit the wrong key >.< Doh!

Cube3
03-03-2014, 10:47 PM
Hi,

I have today finally breathed some life into my router and too are looking to home the Y Axis (2 x Stepper + 2 x Proximity Switches). A few things that I would like some help on please. Are there only certain buttons that the script can be changed? What are the script changes mentioned above actually doing? Would the script changes mean that I wouldn't be able to use the individual Reference axis buttons on the Diagnostic page? The Ref All Home button on my Mach3 doesn't match the quoted scipt above. It is as below. Any reason for this and does it matter?

DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )

DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)

I am a little scared that a wrong setting could potentially damage my machine during the homing process and therefore I want to learn what these changes and settings are actually doing so that I am better able understand my machine and in the future hopefully help others. Regards Simon

JAZZCNC
03-03-2014, 11:43 PM
Hi,

I have today finally breathed some life into my router and too are looking to home the Y Axis (2 x Stepper + 2 x Proximity Switches). A few things that I would like some help on please. Are there only certain buttons that the script can be changed? What are the script changes mentioned above actually doing? Would the script changes mean that I wouldn't be able to use the individual Reference axis buttons on the Diagnostic page? The Ref All Home button on my Mach3 doesn't match the quoted scipt above. It is as below. Any reason for this and does it matter?

DoButton( 24 )
DoButton( 23 )
DoButton( 22 )
DoButton( 25 )

DoOEMButton(133)
DoOEMButton(134)
DoOEMButton(135)

I am a little scared that a wrong setting could potentially damage my machine during the homing process and therefore I want to learn what these changes and settings are actually doing so that I am better able understand my machine and in the future hopefully help others. Regards Simon

That will be fine.
The first 4 commands home the Z,Y,X,A in that order and the other 3 would Zero X,Y,Z encoders if they where connected.