Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: AMorris on March 05, 2009, 01:13:49 PM

Title: Z Axis help
Post by: AMorris on March 05, 2009, 01:13:49 PM
Hello, I have a plasma cutter and I would like to have the Z axis reference to a switch, which I now have and works, but I would like Z to retract to a position rather than just back off the switch. I have a floating head, and the people that are going to operate the machine I know will forget to raise the head before making moves. What is the best way to home Z, and then have it back up a certain amount after backing off the switch?

Thanks
Title: Re: Z Axis help
Post by: Overloaded on March 05, 2009, 01:36:26 PM
You could mount the switch at the Z full up position. Then when it is homed, it will be all the way up.
Or, you could change the Z home button script to make it go where ever you wish after homing.
RC
Title: Re: Z Axis help
Post by: AMorris on March 05, 2009, 01:46:57 PM
I think I would rather change the Z home script. I have been looking for how to do that, but I haven't found it. Can someone get me started please?
Title: Re: Z Axis help
Post by: Overloaded on March 05, 2009, 02:00:21 PM
Click on OPERATOR/EDIT BUTTON SCRIPT, then cklick the flashing REF ALL button and add what I added.
make the Z value whatever you wish....short of a crash that is.
RC

EDIT: Assuming you are using the standard Mach Plasma .set. If not, post a copy of what is in your button.
Title: Re: Z Axis help
Post by: Hood on March 05, 2009, 02:21:22 PM
Or you could add a G28 position for the Z Axis (homing and limits page) and add
Code("G28")
At the bottom of the RefAll macro, if you do as RC has then best to  change to machine coords first by putting the following.

Code("G53")
Code("G0Z6")
While IsMoving
Sleep(10)
Wend
Code("G54")



Hood
Title: Re: Z Axis help
Post by: AMorris on March 05, 2009, 02:29:18 PM
I am not using the standard plasma set, I'm using the thc1000C set from C andCNC. No ref all button, but I have a ref z button. I cants seem to pick it from the editor
Title: Re: Z Axis help
Post by: Hood on March 05, 2009, 02:34:16 PM
Ref Z button is not a VB button so you cant edit it. You could alter it so it was a VB button by going into Screen4 and opening your screenset and double clicking on that button and changing it to a VB button. Save then go back into Mach and  do as RC said to edit the button, then put
DoButton(24)
Code("G28")

in it and save and exit.
Next go to Config then Homing and limits and put the distance you want into the G28 box for the Z axis.
Hood
Title: Re: Z Axis help
Post by: Overloaded on March 05, 2009, 02:38:24 PM
OH Yeah...G28
MUCH better plan.
Thanks Hood,
RC
Title: Re: Z Axis help
Post by: AMorris on March 05, 2009, 03:08:02 PM
Great ideas everyone, I will give it a try. Wish me luck!
Title: Re: Z Axis help
Post by: AMorris on March 05, 2009, 05:42:25 PM
I tried, I had no luck. I'm sure I did something wrong. I'm not a VB'er.
I went into screen 4 and made the change. Then into MACH and wrote DoButton(24)
Code("G28") on the button in the editor. Changed to .2 in the g28 part of Z for homing/limits. It didn't move when I tried it. I guess I need a helping hand.
Title: Re: Z Axis help
Post by: Hood on March 05, 2009, 06:04:18 PM
Check the button again in case it didnt get saved, also check you have it exactly as below (copy and paste if you wish)

DoButton(24)
Code("G28")



Hood
Title: Re: Z Axis help
Post by: Overloaded on March 05, 2009, 06:39:33 PM
Also, if Z+ is UP direction on your machine, and you want it to home off in the + direction, you need to enter -.2 (negative.2) in the Z Home Off box.
I think that is the way it is working on mine.
RC
Title: Re: Z Axis help
Post by: AMorris on March 06, 2009, 11:55:10 AM
Ok, I have tried this several times and still doesn't work. I changed the ref Z button in screen 4 to a VB script. I then load the MP1000C-THC prifile into Mach and put the DoButton(24) Code("G28") code in HiddenScript.m1s. That is the one that pops up when I do Edit Button Script. I go into config\homing\limits and change g28 z to .25. When I run the ref z it does the same as always, runs down to the switch, backs off the switch and zeros the z.
I suspect I'm not in the correct script, but I don't know what or where to find others.

Title: Re: Z Axis help
Post by: Hood on March 06, 2009, 01:13:02 PM
Do you have it as you have typed it or as I have?
It needs to be on two lines, I have just tried it here and it works fine. Also remember it is machine coords so maybe you are not seeing the 0.25 movement and just thinking it is reversing off the switch only.If you look at machine coords you will soon know as the DRO will either read 0 or 0.25
Hood
Title: Re: Z Axis help
Post by: AMorris on March 06, 2009, 01:42:41 PM
I typed it on 2 lines just like yours. I'm certain it isn't reversing any farther than just off the switch. I have a prox switch that lites up when it hits it, then the light goes out when it reverses off the switch. The DRO stays at zero. It zeros as soon as the switch is deactivated and travels no farther. I have -.25 set in the G28 home location coordinates.
Title: Re: Z Axis help
Post by: Hood on March 06, 2009, 01:59:05 PM
Where is your home switch and which direction (up or down) do you want it to move off of the home switch?
Hood
Title: Re: Z Axis help
Post by: AMorris on March 06, 2009, 02:12:34 PM
The home switch detects a collar around the plasma torch near the lower travel limit. The torch floats so it goes down, touches the material, the torch then pushes the collar up slightly till it is sensed by the prox switch. Torch then reverses till the prox switch goes off, then stops and zeros. I want to move up, positive direction, off the home switch. If I put in a value of say .2", the orch tip will contact the material, back up, positive, and be above the material apx .2"
The purpose is to set a height off the material with the homing move so the operators will not have to do it. I can just see an operator homing the torch and starting the plasma with the tip touching the material. I do not want this to happen. 
Title: Re: Z Axis help
Post by: Hood on March 06, 2009, 03:07:52 PM
OK so your zero in machine coords is when it is fully down? Do you programme all your z moves as positive numbers? If you do then your G28 should be a positive number. If you dont then you need to go to Homing and limits and tell Mach that your Home Off distance is the amount of travel you have on the Z axis. That would mean that when you home instead of the Z  axis machine coords DRO reading zero it will read minus X where X is the travel you have. Then the G28 would be a negative number but it would be less than the Home Off distance. Example if you have 1 inch of travel you would have the Home Off set for -1, so if you wanted the Z to move up 0.25 from the Home position you would enter -0.75 as a G28 position.
Hope thats clear LOL
Hood
Title: Re: Z Axis help
Post by: AMorris on March 06, 2009, 03:54:39 PM
It just plain does not do anything more than trigger the switch, back up off the switch and zero. I checked the VB code in screen designer and it's right.
I tried -1 and -.75 for the G28...no change. I tried positive #'s......same thing. I rechecked the VB code in screen designer, making dead sure I saved the MP1000C-THC.set......it was correct. I just get no movement after it backs off the switch.
Title: Re: Z Axis help
Post by: AMorris on March 06, 2009, 03:58:26 PM
At this point, the only Z programming I am doing is to raise the z0.15" above the material before it starts a cut then raise it to 1" when the cut is done. I want the ref Z button to let the torch touch the material, trip the prox switch, back off the prox and move an extra 0.2" to finish the ref z routine.

I'm getting dizzy and about ready to go home for the weekend.
Title: Re: Z Axis help
Post by: Overloaded on March 06, 2009, 04:07:24 PM
Quote
I checked the VB code in screen designer and it's right.
I used Screen4 and I dont think you can see the script.....just that it is a VB button.
You can read the script in the running screen under OPERATOR/EDIT BTN SCRIPT.
It works fine here.
RC
Title: Re: Z Axis help
Post by: AMorris on March 06, 2009, 04:29:33 PM
I use screen 4 to change it to a VB button. I go into Mach and then operator and edit button script and cannot get an editing page for the ref z. I have the display mode button flashing, the load material, up and down MP1000 control, the send to MP1000 button and the xfr button all blinking. But I cannot edit the ref z button.
And I can see the VB script for the ref z button in screen designer in  MACH3screen.exe. That tells me the script is correct.
Title: Re: Z Axis help
Post by: Overloaded on March 06, 2009, 04:40:46 PM
Just use Screen4 only.
Open your screen in Screen4.
Make the REF button a VB button.
Save and close Screen4.
Then start Mach Plasma (your profile with the same screen)
Operator/Edit Button Script.
Then.........Click on your new pulsing VB button.
Fill in the instructions and save.
Should work.
RC
Title: Re: Z Axis help
Post by: Hood on March 06, 2009, 05:03:59 PM
Can you attach your xml and I will see if there is any reason it doesnt work by using it.
Hood
Title: Re: Z Axis help
Post by: AMorris on March 09, 2009, 08:04:14 AM
Here is my xml.
Title: Re: Z Axis help
Post by: AMorris on March 09, 2009, 12:44:05 PM
I finally got it working. I had to reload the screen set with view in MACH for it to work. Even though the profile was loading when MACH started, the changes i made to it did not take effect until I reloaded in the view of MACH.


it's always the simplest things it seems like.

Thank you for your help and not yelling at me.
Title: Re: Z Axis help
Post by: Hood on March 09, 2009, 05:58:26 PM
Great you have it working, downloaded your xml earlier but just not had time due to workload but now I dont have to :)
Hood