Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Fastest1 on September 10, 2011, 07:18:09 PM

Title: Homing Macro?
Post by: Fastest1 on September 10, 2011, 07:18:09 PM
I would like to have my homing routine (RefAllHome) go either all simultaneously or the Z first and then X & Y at the same time. From what I understand I needed to clone my screen and then edit the RefAllHome buttons script. I have cloned the screen successfully on a new experimental xml. All of the prior features work. I believe from here I would select "Operator/EditButton Script/press the RefAllHome button at which point the VB editor window pops up, which in my case due to using the tutorials displays "Msgbox"This is the new RefAllHome button script". From here  I would think I would delete the wording, replace it with the correct script for all of the homing, click save and close the editor, click "view"and then "Save Current Layout. Close Mach and reopen and see if it all works. I need to know 2 things so far.
1. The correct script to acheive the homing sequence I would like (either all simultaneous or Z first then both)

2. If there are any steps explained above that were missed and or misunderstood.

Again as always, thanks for any and all of your help!
Title: Re: Homing Macro?
Post by: Hood on September 10, 2011, 07:45:57 PM
You wont need to exit Mach after editing the button.
From memory the code is RefCombination(0+1+2) where 0 is X axis and 1 is Y etc

Hood
Title: Re: Homing Macro?
Post by: Hood on September 10, 2011, 07:47:54 PM
Just tried it out and looks like maybe you can only home two axis at a time with that.
Hood
Title: Re: Homing Macro?
Post by: Hood on September 10, 2011, 07:54:03 PM
Ok you can, where I went wrong is X = 1, Y=2, Z=4, A=8 etc
So
RefCombination(1 + 2 + 4)

should do all three axis (X Y and Z )at the same time
Hood
Title: Re: Homing Macro?
Post by: Hood on September 10, 2011, 08:02:57 PM
Just looked at Rays VB manual and it seems you can actually do it with even less code as all you would need is
RefCombination(7)

Reason is, X=1 Y=2  Z=4 so 1+2+4 =7

Hood
Title: Re: Homing Macro?
Post by: Ya-Nvr-No on September 10, 2011, 09:36:28 PM
so this would work for Z first, then X & Y?
RefCombination(4)
RefCombination(3)
Title: Re: Homing Macro?
Post by: Fastest1 on September 10, 2011, 09:54:04 PM
Thanks all of you! I used Ya-Nvr-No's approach and it worked great. I would have tried the 3 axis simultaneous homing but I dont really understand what to copy of Hood's response, just type in RefCombination (7) or does the statement or reasoning have to be in there also. I guess it is easy enough to change. I will try it right now. Thanks again, I am dangerous now.
Title: Re: Homing Macro?
Post by: ger21 on September 10, 2011, 09:58:15 PM
RefCombination(7) is all you need.
Title: Re: Homing Macro?
Post by: Fastest1 on September 10, 2011, 10:02:28 PM
OK I am back, both ways worked just like described. I ended up going back to the 1 Ya-Nvr-No wrote. Most likely because it seems safer to raise the Z first, then X & Y simultaneously. This does prevent crashing into the vise or workpiece. I do notice that this works on the "Load" screen but not on the "Run" screen. Do I have to modify the same button on different pages? Maybe I will go look there too.
Title: Re: Homing Macro?
Post by: Fastest1 on September 10, 2011, 10:05:00 PM
I did the same editing process on the "Run" screen and it worked beautifully. Thanks all.
Title: Re: Homing Macro?
Post by: ger21 on September 10, 2011, 10:07:26 PM
The proper way is probably:

DoButton(24)
Refcombination(3)

And you need to change every button, as each is unique.
Title: Re: Homing Macro?
Post by: Fastest1 on September 10, 2011, 10:17:29 PM
Gerry, thanks for the input. What exactly is the difference here? Today is the first day of me figuring any of this out. Or should I say altering any of my own screens after much deliberation and hesitancy. Like most things, it hasnt been as bad as I thought. Of course dont tell Dave of CVI/MSM that, he has been answering plenty of questions before I got this far. :-)
The proper way is probably:

DoButton(24)
Refcombination(3)

And you need to change every button, as each is unique.

Title: Re: Homing Macro?
Post by: Fastest1 on September 10, 2011, 10:24:30 PM
Gerry, I did change it to the above script with the DoButton(24) etc. I didnt see any difference in its operaton in relation to the RefCombination(4) RefCombination(3) script.
Title: Re: Homing Macro?
Post by: Ya-Nvr-No on September 10, 2011, 10:26:57 PM
http://groups.yahoo.com/group/mach1mach2cnc/files/Mach3%20v3%20Documentation/

On page 50 all you ever needed to know about the RefCombination() sub routine

Thanks Hood; another great doc that needs to be added to BR549 reading library he is trying to get organized.
Title: Re: Homing Macro?
Post by: BR549 on September 10, 2011, 10:27:40 PM
 I would do it this way. It ensures the Z completes before the XY starts.

DoOemButton(1024)
While Ismoving()
Wend
RefCombination(3)

Just a thought, (;-) TP
Title: Re: Homing Macro?
Post by: ger21 on September 11, 2011, 04:49:49 AM
Gerry, thanks for the input. What exactly is the difference here?

RefCombination is for homing multiple axis' together, Since your homing one axis, I'd just use the button for that.

Terry is correct, that DoOEMButton(1024) is the newer version of DoButton(24).

While some say that you should use While IsMoving just about anytime you do anything, the stock Ref All doesn't use it, and I've never seen anyone say the stock RefAll doesn't work without it.
Title: Re: Homing Macro?
Post by: BR549 on September 11, 2011, 10:10:04 AM
Ger, I really wonder how many people ACTUALLY use the RefAll on a daily basis? WOULD most even NOTICE that all axis ended up homing at once instead of Z first then XY? Most people I have talked with when they find something acting strange they just don't use it any more. It seems to be the nature of the DIY crowd.

Just a thought, (;-) TP
Title: Re: Homing Macro?
Post by: ger21 on September 11, 2011, 02:54:28 PM
Quote
Ger, I really wonder how many people ACTUALLY use the RefAll on a daily basis?

I think that a lot of router users do.

Quote
Most people I have talked with when they find something acting strange they just don't use it any more

Maybe some features, but homing is pretty important. If you go through the trouble of installing all the switches, I'd think that you would figure out how to make it work if it didn't. And you see at least a few posts every once in a while if it didn't work, and I don't see any.

Mine homes Z first, then Y and the slaved X and A together, and it works every time with no While IsMoving.
Title: Re: Homing Macro?
Post by: BR549 on September 11, 2011, 03:15:13 PM
Not picking on ya but I bet MOST don't ever refhome the machine. I would say 50% don't even know what it means to refhome(;-)

 Fire up the machine, Load Gcode program , load material ,set Work 0,0,0 and go(;-)

NOw that is just an opinion based on years of working with Mach3 and PEOPLE,

 (;-) TP

Title: Re: Homing Macro?
Post by: Ya-Nvr-No on September 11, 2011, 03:44:16 PM
When I hit my reference home button, that's what impresses the onlookers; to see it move all at once and find each of the homes at the same time. Their expression is priceless. Great way to get there attention before the chips fly.
Title: Re: Homing Macro?
Post by: alenz on September 11, 2011, 11:24:22 PM
Not picking on ya but I bet MOST don't ever refhome the machine. I would say 50% don't even know what it means to refhome(;-)
 (;-) TP
TP, I bet your estimate is conservative. I for one am in the 50% category. On my little tabletop mill the home/limit is when the table hits a 10-32 screw and stalls the stepper (even tho I don’t use it for that, I would think it is fairly repeatable).
Al
PS Now and again I need to be reminded that Mach is also used on REAL machines that might use 100 lb rotary tables etc. <big grin>
al
Title: Re: Homing Macro?
Post by: Fastest1 on September 12, 2011, 10:45:33 AM
Ya, exactly. I too think it is impressive. Hence why I wanted to do it. Not for any real reason than to start to understand how to manipulate the code or screens. After a little thought, I do see it wiser to raise the Z first. I have a tendency to crash anyway. It is amazing just how slow a machine (if you can call a Sherline based mill, a machine?) can crash and still not be able to react. :-)
When I hit my reference home button, that's what impresses the onlookers; to see it move all at once and find each of the homes at the same time. Their expression is priceless. Great way to get there attention before the chips fly.
Title: Re: Homing Macro?
Post by: Fastest1 on September 12, 2011, 10:52:17 AM
BR, I am in no way a machinist and have very little if any "guided" experience besides the tips from here, reading and youtube. It took me a while to figure out how to recover if a mistake was made. I got tired of trashing all of the work. Now I start the machine up, ref all home, load the gcode,  then 0 out on the part, then hit play. Sure makes it easy to recover if I break a tool or see something negative about to happen. I can now just ref all home, go back to 0 and then start the gcode somewhere near the line of error. I am sure you were fully aware of the process, I spit it out there because there is surely more to learn in those regards. If you see another step or precaution, let me know. I only want to get better.
Not picking on ya but I bet MOST don't ever refhome the machine. I would say 50% don't even know what it means to refhome(;-)

 Fire up the machine, Load Gcode program , load material ,set Work 0,0,0 and go(;-)

NOw that is just an opinion based on years of working with Mach3 and PEOPLE,

 (;-) TP


Title: Re: Homing Macro?
Post by: BR549 on September 12, 2011, 11:29:25 AM
HIYA Fastest, You are doing it by the book. Certainly NOTHING wrong wiith that(;-).  But as with all things there are MANY ways to do the same job. As you gain more experiance you too will learn the OTHER ways.

Just a note(;-): Your little machine moves exactly the same way the big boys do. SO YES you are a CNC machinist. Never discount the fact that you are working in the small end of the world. Some of the HARDEST machine work to do IS the micro machining world(;-)

Good Job Keep slinging chips, (;-) TP
Title: Re: Homing Macro?
Post by: murilolana on March 21, 2012, 11:16:45 AM
Hi folks,

I'm trying to set ref combination but it's not working. Any code there I try gives me the same result: only one axis move and nothing happens after. I've tried the ref combination comands listed on this thread, but no joy.
I've read something about that might be an issue with the SS board related to the ref combination. Could anyone confirm if this?