Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: spaceman on October 14, 2010, 09:10:35 PM

Title: same switch for all 3 x axis requirements
Post by: spaceman on October 14, 2010, 09:10:35 PM
Can I set 1 switch for X++ and X-- and X Home?  I've tried to wire it this way with all three switches using one cable on Port 1/Pin 10 but can't get Mach 3 to Ref Home. The Limit function of the switches works but not the home.
Title: Re: same switch for all 3 x axis requirements
Post by: whitehedr on October 15, 2010, 01:58:54 AM
You can use one switch if you want.  You just need to locate it so a trigger device at each end of the travel
will trip the switch at the right time.  You can use two or three switches each wired to an input if you want
 but that is wasteful of the inputs to Mach.

I set my system up so that one switch does X++, X- -, and X home.  Set   X++ to the same pin and port that you specify for
X - - and X home.  Then make sure that the system is setup so that the condition is the same for all three functions. 
That is all three must be looking for a high OR a low.

I would suggest that you set your system up so the contacts are normally "closed" and then open to say that
the limit is reached or that the axis is homed.

 You can use one switch to do both the limit function and the home function. 
When you tell Mach to Ref Home the system is looking for the switch to change state.   When it sees the state change
it will then reverse direction until the state change goes away.  You are then homed.   All other times the system
is looking at that switch as a limit switch and will act accordingly, stopping movement and requiring a reset.

RWW
Title: Re: same switch for all 3 x axis requirements
Post by: Hood on October 15, 2010, 03:03:36 AM
Further to what has been said you can use two Normally Closed switches per axis and have them wired in series, you can then wire the other  axis switches in series with them and that way you will only require one input to Mach for all axis.

Hood
Title: Re: same switch for all 3 x axis requirements
Post by: spaceman on October 15, 2010, 09:05:58 AM
Thanks for the responses guys. Reading my OP, I realized I didn't quite word my setup correctly.  I have 2 switches for each axis.  One at ++ extreme and one at -- extreme.  Each axis is wired to a single pin.  X on 10, Y on 11, and Z on 12.  I just can't get the Home to work yet with this setup.  I did find a couple of articles about debounce and will play with that to see if it works and will report my findings.  Right now,  when I home, it only works if I disable ++/-- and have the switch active as Home.  If the ++/-- is enabled, the axis gets to home and then ( I'm guessing) the switch acts like a limit and triggers an Estop.

Thanks again!

Slainte Mhath Hood
Title: Re: same switch for all 3 x axis requirements
Post by: Hood on October 15, 2010, 09:08:48 AM
Do the machine coords zero?
Hood
Title: Re: same switch for all 3 x axis requirements
Post by: BR549 on October 15, 2010, 09:35:25 AM
DO you  have the 2 switches wired in series ?  

Just a thought, (;-) TP
Title: Re: same switch for all 3 x axis requirements
Post by: spaceman on October 15, 2010, 10:33:46 AM
The home function didn't work at all so the coords don't zero.  Mach 3 interprets the switch, even in the home function as a limit.

UPDATE: it now works in Ref Home because I set the debounce. I'm going to add capacitors to see if that quiets everything.


DBR549: the switches are in parallel
Title: Re: same switch for all 3 x axis requirements
Post by: Hood on October 15, 2010, 10:38:35 AM
If it was a bouncing switch, which it seems as debounce is working,  then it should have zeroed the machine coords. Reason is Mach would have thought homing was complete and reactivated the inputs as limits, so it would trigger the E-Stop.
Hood
Title: Re: same switch for all 3 x axis requirements
Post by: whitehedr on October 15, 2010, 10:47:39 AM
You stated that the axis switches are in parallel.  I strongly recommend that
you change that configuration to a series configuration using the normally
closed contacts on the switches.  I think that will fix your problem. 

RWW
Title: Re: same switch for all 3 x axis requirements
Post by: spaceman on October 15, 2010, 06:02:08 PM
You stated that the axis switches are in parallel.  I strongly recommend that
you change that configuration to a series configuration using the normally
closed contacts on the switches.  I think that will fix your problem. 

RWW


Are you concerned about the axis crashing if a switch fails or is there another reasone behind it?
Title: Re: same switch for all 3 x axis requirements
Post by: whitehedr on October 15, 2010, 06:36:13 PM
If you use a series connection with the normally closed contact a switch that

fails open or a broken wire will cause the system to stop because it sees the
mill at a limit.  just a little bit of built in safety.

RWW
Title: Re: same switch for all 3 x axis requirements
Post by: spaceman on October 19, 2010, 11:24:27 AM
After a day of diagnosing, from PC all the way to the switch.... it turns out I had a bad switch!

(paraphrasing) ARGH!

My next question about axis is this:
I hope to use Mach 3 for a 3D printer I'm making (Heated ABS plastic extrusion printing). But I'm stumped how to set up the Z axis home/limit.

For the printer to work, the head must be a very specific distance from the table for the first layer. As opposed to a milling maching, the print head will be stationary in the Z axis and the table will move up and down.  If the Mach 3 moves the table up to trip the switch during the Ref Home operation and then backs the table down until it is off the switch, during the first phase of Ref home (switch trip) the table will crash into the print heads.

Has someone out there already solved this?

My first edumacated guess would be to place a second thickness onto the first table with circular cut-outs of the print heads in the X-Y home position.  This would allow the dual thickness table to trip the switch, back off and be just the right distance for the first layer print. However, can I change the order of Ref Home axis in Mach 3.  I believe it does the Z first, which would defeat the whole idea.
Title: Re: same switch for all 3 x axis requirements
Post by: Hood on October 19, 2010, 12:21:09 PM
Can you not just home the opposite way for Z and set up a Home Off value equal to the distance home is away from where you want machine zero to be?
As for your other question, yes just change the order in the RefAll button, do it from Operator menu then Edit Button Scripts, the Ref All will be flashing, Click on it and in the editor that opens put DoButton(24) to the end instead of the beginning.
Hood
Title: Re: same switch for all 3 x axis requirements
Post by: spaceman on October 20, 2010, 11:03:17 AM
I'm confused then.  I thought Home Off was merely a 'DRO offset'.  As the Home switches are at 0,0,0 without Home Off.  the DRO would read the same.  If I set Home Off. to  5,5,5 the head doesn't actually move this distance, correct?  How would that help?
Title: Re: same switch for all 3 x axis requirements
Post by: Hood on October 20, 2010, 11:19:48 AM
 You said if you homed the Z up it would hit the nozzle, so I said can you not home it the opposite way, ie reposition your switch so its at the other end of the axis. Then when you home you have a home off value set so the machine coords for that axis get set as you home off value.
Hood