Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: replicaprops on June 10, 2006, 06:16:59 PM

Title: Limit switches don't work when all are plugged in
Post by: replicaprops on June 10, 2006, 06:16:59 PM
I have a Camtronics servo system and on the back it has the following:
Limit: pin 15
home: x  pin 10/ y  pin 12/ z  pin 13


I have a N/O switch on each axis
The switches are all wired together so regardles of which switch is triggered they all light up.
Now the problem is this. Mach3 performs perfectly if only 1 switch is connected. I made a parralell breakout board so I can plug and unplug the switches.
When I plug in another switch, the software refuses to come off estop when limit is triggered, even with auto over ride activated. The funny thing is with just one switch connected. I can use that one switch as both a limit and home and auto override works perfectly.

Does shareing the same pin for more than one limit switch cause this problem?
Title: Re: Limit switches don't work when all are plugged in
Post by: sshneider on June 10, 2006, 11:08:24 PM
I just got through with sussing out similar problems with my limit switches.  My Home switches always worked ok.  Your description of your problem is a little unclear to me so let's try to go through this step by step.

Are your limit switches wired in series or parralell?

#1  Although you can use Normally open switches for your Home switches, I think it is better to use Normally Closed switches.  The N.C. method is safer because if you have a problem with a switch you will see it immediately whereas with a N.O. switch you won't.

#2  It seems like the Pin config for your Home switches is fine.  Also No, it is not a problem to share all 3 limit switches on the same pin as you describe if you use N.C. switches

#3.  I can not imagine how you can wire your limit switches in series using N.O. switches.  Wiring something in series means that every component in the series must pass the signal along or else the circuit will be broken and, when broken, will trigger an action (in this case a limit request to Mach 3 which in turn will cause a reset condition).  If your Limit switches are wired in parralell, then I think you need to check the polarity on each switch and make sure that everything is copasetic.

HTH.

Regards,

Sid


Title: Re: Limit switches don't work when all are plugged in
Post by: replicaprops on June 10, 2006, 11:32:13 PM
So is this the way it should be set up?

(http://www.replicaprops.com/images1/misc/homelimit.jpg)
Title: Re: Limit switches don't work when all are plugged in
Post by: sshneider on June 10, 2006, 11:44:14 PM
Wow that is kind of a trippy drawing.  The reason I say that is because it only shows 3 switches being used for BOTH the limit AND the Home.  This, of course is not really possible since the the home and limit switches are normally on oposite sides of the table.

So, do you have 3 switches or 6.

To answer you question, that method of wiring the LIMIT switches is called parallel and yes that is how you would wire it up w/ N/O switches.  Is that how you have it wired?

Sid
Title: Re: Limit switches don't work when all are plugged in
Post by: Hood on June 11, 2006, 02:58:16 AM
Not sure if I fully understand your drawing, but if you only have three switches then what I would think best is to do away with the wires to pin 15 from each switch.  Then in the setup of mach just configure X++, X-- and X home to pin 10,  Y++, Y-- and Y home to pin 12, Z++, Z-- and Z home to pin 13.
Hood
Title: Re: Limit switches don't work when all are plugged in
Post by: replicaprops on June 11, 2006, 10:44:11 AM
What I did was I used magnetic switches. This way I only need one switch for each axis. The switch stays centered, while the magnets are positioned on each und of the tablle. So when the table moves to the end, the magnet is brought near the switch and trips it. I can switch to NC switches, and wire them in serial.
Title: Re: Limit switches don't work when all are plugged in
Post by: Hood on June 11, 2006, 10:47:40 AM
I have optical switches and basically they are wired as per your drawing except I do not have them set up as a seperate home. ie there are just three pins used for all axis and homes. Suggest you try and remove the wires from pin 15 and all should work ok.
Hood
Title: Re: Limit switches don't work when all are plugged in
Post by: sshneider on June 11, 2006, 11:41:35 AM
Hood,  I'm confused- if he removes pin 15 how will he trigger any limit stop?

IMHO, I think serial wiring w/ N.C. switches on the limit loop is the way to go. 

Your idea of using a magnetic switch to save is clever but, I'm not really sure what it is getting you.  You still have to mount and wire something at both ends of the table and ALSO mount a magnet to your trolley so, in my mind it seems like you have MORE to do with the magnetic system.  I could be missing out on something here as I have never used these type of switches so, forgive me if I am not seeing something.

It sounds to me like your Home switches were working OK when we started- is that correct?  If so, I would just leave that alone and be happy that you are getting your homing refs to work. 

On the Limits loop... If you can change the receiver part of your magnetic switch to be N.C. I would do that and wire in series (wire from pin 15 to input on X limit switch-> output of X limit switch to input on Y limit switch -> output of Y L.S. to input on Z L.S. output of Z L.S. back to common).  Wiring this way means that if any of those switches are triggered they will break that circuit and cause a limit stop.

After you get it wired, go to the Diags page in M3 and you can check if your switches are working by looking at the LEDS on the screen.  They should light up when you trip your switches.

Good Luck!

Regards,
Sid
Title: Re: Limit switches don't work when all are plugged in
Post by: Hood on June 11, 2006, 11:48:47 AM
Hood,  I'm confused- if he removes pin 15 how will he trigger any limit stop?
In the ports and pins setup,  if the home, X++ and X-- are set to pin 10, Y Home Y++ Y-- to pin 12 and finally Z Home Z++ and Z-- to pin 13
 When you do a home Mach will move to the limit switch but will consider it as a Home switch and will not trigger it as a limit. Any other time Mach will see it as a limit.
Hood
Title: Re: Limit switches don't work when all are plugged in
Post by: Hood on June 11, 2006, 11:55:00 AM
Heres a screenshot of my setup
Hood

(http://mysite.wanadoo-members.co.uk/hoodsmachiningpages/LimitsConfig.jpg)
Title: Re: Limit switches don't work when all are plugged in
Post by: sshneider on June 11, 2006, 12:02:42 PM
Hood,

That's friggin' brilliant!  How in the heck did you figure that out?  Experimentation?  or is that documented somewhere?  I had no idea.  Nice to learn something new!  Thanks!

Regards,

Sid
Title: Re: Limit switches don't work when all are plugged in
Post by: Hood on June 11, 2006, 12:03:50 PM
I am sure its in the documentation written by John P.
Only problem is all LEDS for a given axis will light up when a switch is triggered but it doesnt take much to work out which limit has been triggered, it will either be the ++ or the -- and a quick look at the table position will let you work it out ;)
Hood
Title: Re: Limit switches don't work when all are plugged in
Post by: replicaprops on June 11, 2006, 09:25:08 PM
Boy when it rains it pours.

I replaced all the switches with NC. I wired them in serial and they all work perfectly. That is until I engage the Servos. There may be some sort of signal messing with the wires. I guess the only thing to do is replace the wires with a thicker shielding.
Title: Re: Limit switches don't work when all are plugged in
Post by: replicaprops on June 12, 2006, 12:42:52 AM
 ;D
Solution found
;D
Well, im happy to Say, Art figured the problem out. It had to do with the debounce setting in config/logic .
He told me to set it to 25000 and that fixed the constant e-stop and limit switch requests. I can only assume there is noise interference some where, amd that noise was simulating the signal of limit and estop. The signal was so fast it barely lit the yellow leds in the diag screen. The debounce now requires the limit signal to be constant for a certain amount of time. So this makes the time from when the limit is actually tripped to the time when Mach3 responds a little longer. If you are using push button switches, you may run the risk of crushing the switch. The magnetic switches are unafected becasue there is no physical contact and you can simply relocate the magnet some where closer to stop at a predetermined spot. The magnets can also be stacked to double their effective range. The magnetic switches as well as having no external moving parts are also sealed from liquid penetration so they are good for coolant flood conditions, which is one reason I chose them. Plus, they are $5 each. I bought a dozen of them.

I now have it set up in the following way.
I have 3 radio shack NC magnetic alarm switches wired in series. Each is mounted in the center of its axis.
So there is a magnet on each side of the table and on the top and bottom of the head dove tail.
The switches on the X and Y are stationary while the magnets move back and fourth with the table.
The switch on the Z is mounted to the head and moves with it until it hits the magnets feild.
All pins are set at 15 which for me is the limit pin. So I cant see individual limit requests, but each axis homes and limits off the same switch and performs perfectly.

Ill take a video of it and post it later.
Title: Re: Limit switches don't work when all are plugged in
Post by: Kryten on June 30, 2006, 12:48:15 PM
From the circuit diagram above it looks like all home inputs will activate when any of the switches closes as they are all connected together at the limits pin.
Are you using diodes between the switches and the limits pin ? ( perhaps this is where your LED indicators are )
Regards,
Glen.