Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Bill CNC on December 14, 2007, 02:18:51 AM

Title: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 14, 2007, 02:18:51 AM
Hello All,

Well I am trying to set up my home and Limit switches and I am getting  frustrated to say the least. I have watched the video and it does not run through it completely unless I am brain dead or something of that nature, maybe I am just at my wits end and cant see it.

The Problem.....


I have six switches all in NC and wired in series, all at the end of the three axis. I want to use the X-, Y- and the Z+ as the homing switches. Well I don't know what pins I put them to or if they are supposed to all be high or low active or what. Also when I did the automated setup it put them all at 15. I made the home switches 11 only because the video did, and now I have no clue as to whats what.

I have added a picture of what I have.


Question ...

Can someone please tell me what the pins are supposed to be?

Setup ...

X2 HF Mini Mill
Hobby CNC Pro Board
Keling Technology KL23H286-20-8B Steppers on X,Y,and Z
Mach3


Any Help would be GREATLY APPRECIATED!!!!

Thanks
Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Hood on December 14, 2007, 03:03:50 AM
If you have all of yopur limits wired in series then you will only be using 1 pin on the port, this is the pin that you enter for all limits and also all homing. So if as in your example you are using pin 15 for the limits the home switches will also be pin 15 as essentially the home switch is a limit switch. When Homing Mach treats the limit switch as a home switch, at all other times its a normal limit switch.
 If you want to change the direction of your homing have a look on the Config menu then Homing and Limits page and then you can choose whether to home negative or not.
Hood
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 14, 2007, 12:29:26 PM
Hood,

Thanks for your reply!

One question though,

I tried to set it up so when it hits the home switch, it will back off of it automatically but I cant seem to get it to do that, How does that work and were do I set that up at?

Thanks Again
Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: stirling on December 14, 2007, 01:16:23 PM
I tried to set it up so when it hits the home switch, it will back off of it automatically but I cant seem to get it to do that, How does that work and were do I set that up at?

Hi Bill - You don't have to set anything up. The backoff is part of the (inbuilt) homing behaviour. Not of course to be confused with hitting a limit which does not backoff. Are you saying when you command home it doesn't backoff?
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Overloaded on December 14, 2007, 01:35:09 PM
Stirling,
Just to clarify......... If you JOG into the switch, it should just stop instantly ?
But if you command the axis to HOME, it goes through the homing sequence of tripping the switch then backing off the preset amount in the software ?
Thanks
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Hood on December 14, 2007, 01:54:15 PM
Yes thats correct, if you accidently Jog (or your programme) hits a limit Mach will stop instantly. You can also set up soft limits so that as you are approaching a limit switch Mach will slow and stop before you hit the switch and warn you that the soft limits have been activated. This also has an advantage as when softlimits are set and you load some code and press the Cycle Start button Mach will look and see if any of the movements in your code will cause an axis to be out of limits, if it is then you will get a message box asking if you are sure you want to continue.


Hood

Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 14, 2007, 02:49:07 PM
Stirling - Hood,

I was jogging to test the switch and I can see how that will not work. I will need to  try and hit the home all and see if that works. I do want to use the soft limits so I need to set that up also. Boy this is harder than the haas here at work!

With that all said, I cant wait to get her set up and test this out properly so I can buy the software. BTW - I really like it, it's just a little overwhelming at times.

Thanks again guys
Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 14, 2007, 11:20:08 PM
Well guy's

When I got home from work, I went into my shop and fired her up. I hit the Ref All Home bar and it hit the Z switch and DID NOT back off. I am including a picture of the two menus.

What could it be?

Thanks
Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Hood on December 15, 2007, 04:43:50 AM
Does the LED for the Home stay on (Diagnostics page) when the switch is triggered? Does that axis show as being homed ?(Green LED on Axis Zero button)

Hood
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: stirling on December 15, 2007, 04:46:21 AM
Things that could potentially stop the homing procedure finishing properly:

1) switch bounce leading Mach to "think" it's come off the switch prematurely. see config/general config - debounce (top right of dialog)
2) your switch is prematurely closing for some other reason - coming off the cam/ramp whatever perhaps? - i.e. once a home switch is hit it must stay hit until Mach has a chance to roll off.

edit: Hood posted while I was composing - looks like we're thinking similarly :)
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Hood on December 15, 2007, 05:21:17 AM
edit: Hood posted while I was composing - looks like we're thinking similarly :)


ahhhhhh but that now poses another question, is it a case of
Great minds think alike
or
Fools seldom differ

:D
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: stirling on December 15, 2007, 05:25:23 AM
I'd like to think it's the former, but then if I'm the latter, I would wouldn't I?  ;D
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Hood on December 15, 2007, 06:14:23 AM
well I am definitely the latter :D
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Chaoticone on December 15, 2007, 06:21:26 AM
I say, in the case of you two, Great minds think alike  ;D 

Brett
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Hood on December 15, 2007, 06:46:51 AM
I say, in the case of you two, Great minds think alike  ;D 

Brett

nah that cant be right, because I often agree with you Brett :D
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: stirling on December 15, 2007, 09:21:29 AM
I was always taught to accept a compliment with good grace - so cheers Brett - a man of rare insight I believe ;D
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 17, 2007, 02:36:16 PM
This is connected to another problem at this thread, http://www.machsupport.com/forum/index.php/topic,5189.0.html

Anything will help

Thanks
Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Hood on December 17, 2007, 03:19:01 PM
I would disconnect all your limits and just connect up one, but still have all the limits set up in Ports and Pins like you have already.
 Have it so you can activate it by hand and do the homing sequence. Once the Z starts to home press the switch and Mach should stop and start to reverse, when it starts reversing release the switch and it should stop and the Y axis should start, just repeat the procedure for the Y and then the X.
 If this works OK then you need to look at either your wiring or the way the switches are activated, but we will cross that bridge if you get it working with one switch.
Hood
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Chaoticone on December 17, 2007, 03:57:23 PM
Wise words Hood.  :)

Brett
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 17, 2007, 05:38:47 PM
All,

Ok, I will give that a try, stirling also suggested that I hook up the X, Y, and Z on 3 separate pins, split them up. I Will give it a go as soon as I get home from work.

Thanks Again
Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Chip on December 17, 2007, 07:37:31 PM
Hi, Bill

Your use of 6 series wired NC switches, That's fine.

If I'm following your post's correctly your issue is, It's homing but will not move to the popper position after homing.

Home OFF setting, Just set's the DRO on the screen to the Home OFF Value you've set.

As I Understand It, Example:

For a 10X 10Y 10Z Table,  If you want all axises to Home and move to the Center of table and Zero Out.

If your Home All to -X -Y +Z "Home Switch's Pos", There are actually -5X  -5Y +5Z on the Table.

Set Home OFF to -5 -5 +5, then Add ( code "G00 x0 y0 z0" ), To the end of your "Reff. All"  Button's as below.

To add this to your buttons, Operator, Edit Button Script, Click on the "REF ALL HOME" button that's flashing,  Add the, code "G00 x0 y0 z0" , then X, Yes to save.

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

code "G00 x0 y0 z0"

Hope this Helps, Chip
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: CNCwt on December 17, 2007, 10:40:29 PM
Hi, based on your Ports & Pins pictures that you posted, I think there may be something wrong with it.

The first picture shows it is using only 2 input pins (11 & 15) while the 2nd one is using only 1 (15). If I am not mistaken, you need at least a minimum of 3 input pins to wire X, Y, and Z limit and home switches.

This is how I understand it:

If limit switches are wired in series for each individual axis with home switch utilizing one of the limit SW, then you need at least 3 input pins. Like:
X+ in series with X-, X- as home switch (Input Pin #11)
Y+ in series with Y-, Y- as home switch (Input Pin #12)
Z+ in series with Z-, Z+ as home switch (Input Pin #13)

If all axes' limits switches are wired in series, then separate home switches should be used for each individual axis. You will then need 4 input pins. Like:
X+, X-, Y+, Y-, Z+, and Z- are all wired in series (Input Pin #11)
X home switch (Input Pin #12)
Y home switch (Input Pin #13)
Z home switch (Input Pin #15)

The 1st one is how I wire my switches as the 2nd one will entail my using a 2nd parallel port.

I can be totally wrong as it does happen to me and someone correct me if I am.

Thanks,
Weedy



Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Chaoticone on December 17, 2007, 10:47:56 PM
Hey Weedy,
    I didn't understand it at all when I first heard of it, but you can use one input for all of your homing and limit switches.

Brett
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: CNCwt on December 17, 2007, 11:17:22 PM
Hi Brett,

Do you mean I can use 6 limit switches, wire them all up in series and I can use only 1 input pin to have a complete 3-axis LIMIT and HOME switches?

Can we confirm this as I have the impression it cannot be?

Thanks,
Weedy
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Chip on December 18, 2007, 12:31:01 AM
Hi, Weedy

Yes, In Homing Mode, Mach nows which axis is moving, It's just looking for the  Switch to open, Then it Reverses the axis till the switch closes again.

In Limit Mode, Mach is looking for a switch to open to show a limit has been exceeded.

1 Pin, 6 Switches in series.

Thanks, Chip
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 18, 2007, 01:29:32 AM
Well I am home from work now and jezz this is frustrating!

I tried the switch as hood stated ..... The SAME!

Chip,

Yes I am going to the limit switch when I hit Ref All Home, but ... I don't get the green home signal, I get all six switches in the yellow and I get a message, ..... External EStop Requested signal.

The code you gave me the ...... code "G00 x0 y0 z0" (copied in it's entirety) did nothing. I removed the word code and I get a little box that says Syntax Error.

Boy I don't know what else to do!!!!!!!!!!!!!!

Thanks for everything
Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 18, 2007, 01:35:38 AM
I forgot to add the screen I am learning to hate! This is all I see every time I try to Ref All Home.

Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 18, 2007, 01:52:57 AM
Chip,

Is this how the code should look when added?

Thanks
Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Hood on December 18, 2007, 02:20:36 AM
Bill that message is not the one I was thinking of, I was meaning a message scrolling in the warning box. You dont have the eStop connected with the limits do you, or even the estop set up as the same pin as the limits?

Hood
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: CNCwt on December 18, 2007, 04:46:35 AM
Hi, Chip and Brett,

Thanks for confirming that. I went thru the Yahoo group past messages and indeed, it was there. Nice to know that it can be wired that way now.

Weedy
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: stirling on December 18, 2007, 04:52:22 AM
Where I was coming from with my suggestion of using 3 pins was:

Yes, it SHOULD work with just one pin - BUT it isn't and I'm suspecting a bug - not unheard of - even in Mach   ::)

It should work with just one pin because when acting as a limit - i.e. at any time other than when you command "ref all home" all Mach does is react to any limit input by deadstopping all axis - it doesn't care nor need to know which switch was hit - it just dead stops - period.

With a "ref all home" - by default Mach homes each axis SEQUENTIALLY and so again only needs one input. ONE advantage to using 3 pins is that you can (if you want) make Mach home all 3 axis in parallel.

I can't help but think at the moment you're making things more difficult by splitting this accross two threads and also trying to get home offsets sorted at the same time. Personally I'd forget this for the moment and concentrate on getting simple homing to work as it should.

My guess at what is happening is that Mach is homing Z but when it hits the switch its confusing the input as not only a home on Z but ALSO as a limit hit on X and/or Y. Like I say this shouldn't happen but...

From the point of view of homing, everything you've apparantly done is correct and yet it still isn't working. Try 3 pins. If that works then it more or less proves a bug in Mach with one pin. If not I'll take all this back and admit defeat   ;D

Cheers

Ian

EDIT: I've just read your other thread again (see what I mean about two threads!) and on post 9 you've said you get a limit message when you home. That confirms (to me at least) that it's a bug as I've said above.
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Chaoticone on December 18, 2007, 07:20:06 AM
I knew where you were headed with that Stirling. Was a thought I had as well. Everyone has their on way and or reason for trouble shooting and IMO, he has had lots of good, sound advise. Not my machine, but thanks guys for sticking with this one. We'll get it, too many great people here not too.  :)

Bill, I have sent you a personal message.

Brett 
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 18, 2007, 10:42:56 AM
Hood,

 ;D  :o

OK I checked the EStop pin and it was also set at 15 just like the switches. It now works!!!!!!

But,

Now I get the Normal / AbNormal bar flashing yellow / green. Could this be because I set the EStop to pin 10 so I didn't have to change all the others?

What could this be?

Man This is a BIG jump in solving my problems. Not only does the Homing work and travel back of the switch, I can get the machine coordinates on 0!!!

Yippee

Many, Many Thanks
Bill
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Chip on December 18, 2007, 12:21:38 PM
Hi, Bill

Your getting the Normal Condition flashing because you made some setting changes,  Double Click on the button.

A window will pop up, Just click Yes to reset, it'll then reset the button to normal green.

Yes to the script you added to your "ref all home" button.

On the Diagnostic page the Home/Limits are all in series, So when any switch is open all the leds will be on (yellow).

Thanks, Chip
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Hood on December 18, 2007, 05:20:41 PM
Glad you are sorted Bill, its one of these ones that if I had been there and saw that message I would have known right away what was wrong but at least we got there in the end :)

Hood
Title: Re: Home and Limit Switches ... I'm Going Crazyyyyyyyyy!!!!!!!!!!!!
Post by: Bill CNC on December 18, 2007, 07:37:15 PM
TO ALL,

I just want to thank you ALL for all the wonderful help you ALL have given me. The support here is second to no other and for that alone I WILL be purchasing Mach for my Christmas present to myself!

And a special thanks to (in no particular order)...  Hood, Chaoticone, afn09556 and stirling

Thank You All Again
Bill