Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: turbothis on May 18, 2011, 02:24:27 PM

Title: z home switch for toolchanger
Post by: turbothis on May 18, 2011, 02:24:27 PM
i have a switch on the quill for the tool changer home postion. it is about .100" before the limit switch.  pin 15 on the bob.

i need the quill to run up to this switch for tool change.

what setup do i need? i have the inputs tab enabled for the z home. pin 15
the switch works on the diagnostic page.

is there a g code comand to tell it to rapid to home switch.

i have searched but the ref home and such makes no sense to me. i just want a comand to z switch.

thanks
Title: Re: z home switch for toolchanger
Post by: Hood on May 18, 2011, 02:46:13 PM
Is this  an automatic tool changer or are you simply wanting the axis to move up on Z so you can change manually?
Hood
Title: Re: z home switch for toolchanger
Post by: turbothis on May 18, 2011, 02:55:33 PM
it will have an auto but for now i just want to set mach to start hold or whatever and then i can use the power drawbar.

i assume the changer will have a comand in the macro?
for now if i can just drop in a line of code to achieve this i would be happy!
Title: Re: z home switch for toolchanger
Post by: Hood on May 18, 2011, 03:04:52 PM
Ok several ways you could do it but likely the easiest would just be to use the switch as the home switch for Z (as you have it set now) and then when you start Mach you press the RefAll button to home the machine. If you dont have home switches on the other axis then Mach will set Machine zero for them where you presently are so really its best to jog the machine fully  negative on X and Y before you RefAll.
As the Z will have the switch then the RefAll will make the Z move to the switch and then back off until the switch closes, that will now be the Z set as machine coords zero.
So in the macro a command to go to Machine zero on Z would be all thats needed so

code "G53G0Z0"

would do that. You would also need to set the toolchange to Auto Toolchanger on the general config page.
Hood
Title: Re: z home switch for toolchanger
Post by: turbothis on May 18, 2011, 03:14:47 PM
do i hit ref all in machine cord. or no?
either way no z movement but it does zero all 4 axis. ???
Title: Re: z home switch for toolchanger
Post by: turbothis on May 18, 2011, 03:31:51 PM
some screen shots....

(http://img715.imageshack.us/img715/9463/unledia.jpg) (http://imageshack.us/photo/my-images/715/unledia.jpg/)

(http://img192.imageshack.us/img192/2917/unled2bf.jpg) (http://imageshack.us/photo/my-images/192/unled2bf.jpg/)

(http://img708.imageshack.us/img708/8648/unled3br.jpg) (http://imageshack.us/photo/my-images/708/unled3br.jpg/)

(http://img156.imageshack.us/img156/9928/unled4o.jpg) (http://imageshack.us/photo/my-images/156/unled4o.jpg/)

Title: Re: z home switch for toolchanger
Post by: Hood on May 18, 2011, 03:49:27 PM
Look on the diagnostics page and see if the Home input is active when not on the switch, if it is then you need to change the active state of it.
Hood
Title: Re: z home switch for toolchanger
Post by: turbothis on May 18, 2011, 04:22:55 PM
ya, i got it so when the switch is tripped then the yellow light comes on.

so the ref all on the machine cor. sets the switchs once and thenb the machine cord are what the tool changer runs to?
Title: Re: z home switch for toolchanger
Post by: Hood on May 18, 2011, 05:32:50 PM
So is it homing correctly now on Z?
Homing sets the machine coords so Mach knows where it is and if your toolchange macro has the above code then it will rapid to machine zero.

BTW your safe Z above will need to be enabled if you are wishing to use Safe Z.
Hood
Title: Re: z home switch for toolchanger
Post by: turbothis on May 18, 2011, 05:52:33 PM
the ref button just zero's the axis. it does not drive the z up to the switch.
what would cause that?

thanks a ton for your help on this!

what is the z safe????
Title: Re: z home switch for toolchanger
Post by: Hood on May 18, 2011, 06:05:54 PM
Can you attach your xml please.
Hood
Title: Re: z home switch for toolchanger
Post by: turbothis on May 18, 2011, 06:16:56 PM
what is xml?   lol
Title: Re: z home switch for toolchanger
Post by: Hood on May 18, 2011, 06:21:21 PM
the xml is the file that holds all your configuration settings. If you attach it I can load it and maybe see where your problem is.
The name of the xml will be the same as the profile you use so open Mach and look at the profile name (lower right of main page) then look in the Mach 3 folder for a file with that name and a xml extension.
Hood
Title: Re: z home switch for toolchanger
Post by: turbothis on May 18, 2011, 07:13:15 PM
help me................
Title: Re: z home switch for toolchanger
Post by: turbothis on May 18, 2011, 08:00:37 PM
wow, that took a long time to get thru
Title: Re: z home switch for toolchanger
Post by: Hood on May 19, 2011, 02:59:24 AM
Just tried it here and it is working fine for me. Just to clarify, the LED on the diagnostics page for the Z home is off when the switch is inactive and On when it is pressed?
If thats the case then I have no idea why it is not working as said it works perfectly well here, ie Z moves until the switch is seen, reverses then stops and sets zero, the other axis because they dont have switches just zero right away.
Hood
Title: Re: z home switch for toolchanger
Post by: Hood on May 19, 2011, 03:15:51 AM
Actually I have found something strange about your xml, it does not seem to matter whether I have active High or Low for the Z Home, the LED only lights when activated. I do not know why this is, will keep looking to see if I can figure it out but possibly setting up a new xml from scratch would be the best idea.
Hood

EDIT

I have just tested with another standard XML and it seems to act the same which may be a Mach issue, can you try changing the active state to see if it works correctly, just be ready with the E-Stop in case it doesnt. I will see if I can find the issue, if not I will inform Brian and see if he can figure out where the issue is as it seems to be Mach at this stage.
What version of Mach are you using?
Title: Re: z home switch for toolchanger
Post by: stirling on May 19, 2011, 07:47:15 AM
Actually I have found something strange about your xml, it does not seem to matter whether I have active High or Low for the Z Home, the LED only lights when activated.

Isn't that how it's allways been and is meant to be? i.e. the LED shows whether the signal is active regardless of which logic you choose.

Ian
Title: Re: z home switch for toolchanger
Post by: Hood on May 19, 2011, 07:56:09 AM
If you have a switch that is NC then active High is wanted and when the switch is closed you will not get the LED. If yo change to active Low then the LED on Diagnostics will be lit when the switch is closed and off when triggered.
Likewise because I was simulating there was nothing connected to the port so in effect Mach thinks the switch is open and the LED is lit but if I change the active state Mach should put out the LED.
Now the interesting thing, here at the workshop it works as expected but its an older version, will go try the newer versions and see.


Hood
Title: Re: z home switch for toolchanger
Post by: Hood on May 19, 2011, 08:07:42 AM
Interesting, here it is working as expected even with the Dev version, must be something up with the home computers port, will have to check it out tonight.
Hood
Title: Re: z home switch for toolchanger
Post by: turbothis on May 19, 2011, 04:23:58 PM
version r3-042-040   
ya, my switch works like a champ
Title: Re: z home switch for toolchanger
Post by: Hood on May 19, 2011, 04:59:10 PM
Not sure where your problem is then as it seems to behave here with your xml when I simulate the input, well except the issue I have here with the active state not changing the LED, that however seems to be an issue with my computer here of which I have not found the answer yet.
So when I use your xml I simulated the Z home switch and pressed the Ref All button, the Z DRO started moving and then when I presses the switch it reversed until I released the switch and then it stopped and set home.

Hood
Title: Re: z home switch for toolchanger
Post by: turbothis on May 20, 2011, 12:56:15 PM
well, in the end i guess i will just set this by hand.

how do you update the mach 3? worth it?

thanks
Title: Re: z home switch for toolchanger
Post by: Hood on May 20, 2011, 01:25:26 PM
Just download the version you want to use and install, it will overwrite the current version. It is often wise to keep a backup of your xml and any custom macros etc that you may have in the unlikely event something goes wrong.

Have a look in the Ref All button and see what the script is, to do that go to operator menu then Edit Button Scripts and then you will see RefAll flashing, click on it and the editor will open.

Hood