View Full Version : Limit switch repeatability.


DomB
01-01-2007, 10:18 AM
Hi guys,
Has anyone had any experience with the repeatability of limit switches. Are we really just designing a switch method to stop the mill going crazy assuming that it only takes a zero reading at the start of the job so the work is always relative to that point therefore accuracy is not too important.

Or do the limit switches need to be able to repeat to very high accuracy, incase there is a power cut and a half finished part needs to be restarted when the power is put back on, or between tool changes the cutter may do a home check to keep missing step errors from multiplying?

Or in such a circumstance would you try and re measure the component zero with something like an expensive tool probe for instance?

Any ideas
Dom

ger21
01-01-2007, 10:47 AM
Limit switches are to stop the machine from overtravel. Home switches, on the other hand, should be repeatable. From what I've heard, even cheap $2 switches are quite repeatable, usually with .001-.003. If you need a very precise home position, you can use an encoder on the screw and this board. http://www.cncbuildingblocks.com/breakout.html

If you're missing steps enough to have to re-home, you need to fix what's causing the missed steps.

wcarrothers1
01-01-2007, 03:23 PM
2$ Home switches are what I"m using. Can save your but finding your zero if things fault out. That is of course if you take down your machine coridance from home for zero of your work piece before starting the cut..

I'm glad I do this from time to time..

b.

DomB
01-02-2007, 02:10 PM
Hi Guys,
Thanks for the replies.

I did some testing today with switches of various types used in various positions.

It looks like a micro switch is the only type of switch that goes fully on to fully off with no contact bounce.

I set up various switches in the vice of my VMC and pushed on them with the back of a milling cutter. They were connected up to an led to see they their state. I moved the z axis, to switch each type on and off 10+ times, and recorded each set of readings.

I found that the microswitch used in a straight push, could turn on to an accuracy of 0.005mm but would disconnect with an accuracy of 0.002mm this would have been 0.001mm but the first reading was 0.001mm different (the other 9 were exactly the same), which could have been my fault when I moved the Z axis for the first time.

I am afraid that I cannot measure the movement any better than that as my VMC only has 3 decimal points on it!!, so I would say that is pretty good.

Question is, can Mach3 software be made to trip on switch release rather than switch on, to use the more reliable reading of the zero position.

Thanks
Dom

Rance
01-02-2007, 02:39 PM
Dom,

[goes fully on to fully off with no contact bounce]

You can't see contact bounce with your eyes, you have to use an oscilliscope. Virtually ALL switches have some bounce in them, especially the cheap ones. That's an attribute of 'cheap'. However, what you are using should work just fine. :)

As to the off vs. on, I'm pretty sure Mach can do this but get confirmation from someone else.

Rance

wcarrothers1
01-02-2007, 03:37 PM
Mach can be configured to react normaly closed or normaly open. ports and pins inputs "Active Low" check box or X in the box.

If active low is X'd if your switchs are to trigger the input when open... (Pretty sure) but easy enough to check..

b.

Greolt
01-02-2007, 03:55 PM
Question is, can Mach3 software be made to trip on switch release rather than switch on, to use the more reliable reading of the zero position.
Mach homing strategy is to move on to the switch (make active) then slowly move off. Home position is at the point it comes off (make inactive).

Makes no difference to that if you have active high or active low.

ger21
01-02-2007, 03:56 PM
Question is, can Mach3 software be made to trip on switch release rather than switch on, to use the more reliable reading of the zero position.

Thanks
Dom

I believe that is how it works. It moves until the switch trips, than backs off until it opens, which is your zero.

DomB
01-02-2007, 05:33 PM
Mach homing strategy is to move on to the switch (make active) then slowly move off. Home position is at the point it comes off (make inactive).

Makes no difference to that if you have active high or active low.


Thats good then as that gave by far the best results, perhaps they have done this testing also.


As far as contact bounce, I only used the term to describe the situation, I did not mean it in the terms of electrical noise on contact closure.

What I meant is that almost all the switches I tested could be made to flicker the led to an uncertain on off state, like a poor connection. Where as the microswitch would reach the trip point and click over with no ambiguity at all, the same when it went from on to off as the plunger was retracted.

Many thanks
Dom

ger21
01-02-2007, 09:23 PM
If you need even more accurate homing, check out the index board at www.cncbuildingblocks.com

Rance
01-05-2007, 09:30 AM
Dom,

Something else to consider would be Widget's switch setup. I asked him about it under here (http://www.cnczone.com/forums/showthread.php?p=228884)(post #19/#20). Reference pics are 002_0114.jpg, 002_0115.jpg, and 002_0116.jpg from his router page (http://kiersteadskis.com/cnc-router/cnc-router.htm). You might need to go to a variation of this kind of a setup to get your normally closed situation. Some of the more expensive switches have both 'no' AND 'nc' connections.

Rance

DomB
01-07-2007, 04:15 PM
Hi Rance,
Thanks for the relpy. During my testing I did notice that when the switch is used in a ramp set up like in the pictures it was not as repeatable as a direct push on the face of the switch. However if the switch is being pushed directly, it could be smashed if the machine does not slow down quickly enough sfter tripping the switch (I would only have 2-3mm of overtravel). The microswitch I was looking at using has both NO and NC contacts.

Dom

NC Cams
01-07-2007, 05:30 PM
If you want digital repeatability, interface a "debounce circuit" with the microswitch as the trigger to either a flip flop (4013 CMOS chip) or perhaps a one shot made from a 555 timer IC.

Once you trigger either with the first time"bounce" from wht microswitch, the circuit will "engage" and repeat as often and as repeatably as the microswitch can/will trigger.

Keep in mind that as the switch ages, either corrosion or detioration from repeated current interuptions may cause the switch to trigger a bit differently over time.

For limit switch use, the position degradation probably won't be that deleterious to peformance and/or repeatability. For a "home" sensing, the same caveat applies.

Again, how much "shift" that can/will occur will have to be quantified. Again, assuming that you're not going to pull too much current (10 or 20 milliamps should not cause any appreciable detioration) thru the microswitch, you should have repeatability that will suffice for all but the most psychotic accuracy requirements.

However, at this low a current, atmospheric induced corrosion could cause the switch to lag a bit over time unless the switch "self cleans" somehow ir the contacts are made of a non-corrosive substance. An occasional shot of contact cleaner might adequately "rejuvenate" the contacts.

vger
01-09-2007, 06:24 AM
A physical switch for protection at end of travel is probably the way to go for that. As for home position, an opto interupter will work well. No physical contact, no electrical contacts to wear, and some of them are very very precise.

Rance
01-09-2007, 06:48 AM
I think vger has your best solution suggesting an opto switch. If a person was clever enough, they could hack a computer mouse and harvest the two optos in there for limit/home switches. Mice are virtually FREE (my favorite word) and much more precise than a mechanical switch. I have no problem interfacing a plain ole switch to my HCNC, but don't know what extra electronics would be required for an opto. Has anyone done this? Got a schematic? :D

As a bonus, I'd suggest running a plastic tube from your router motor fan to the opto switches to keep the dust clear of them. Is that overkill?

[Edit: But if you used Widget's setup I referenced in post #11, all the electronics and opto are isolated inside a dust-proof box so dust would not be a problem. I'm beginning to really like this idea. :) You get the best of both worlds. ]

vger
01-11-2007, 08:50 AM
Most of the opto interupters I have come across have 3 leads on them. I've pulled many from old copy machines, printers, scanners, and the like. Internally in the base of them is a little PC board with current limit resistor in series with the IR LED. One lead will be ground that is common to both the LED and the phototransistor. One lead will be power (usually +5 V DC). The third lead will be the output and is generally connected to the collector of the phototransistor. Attaching a resistor (470 ohms) from the output to the + 5 V will make the thing work. When nothing is interupting the beam across the gap, the phototransistor will be turned on and the output lead will be held at, or very near ground level. When the beam is interupted the phototransistor turns off and the resistor will pull the output lead up to 5 volts. This is a logic level signal and can be easily interfaced to computer or controller. If you need to operate a coil based relay with it, an additional circuit will be needed. If you are picking Opto Interupters from used equipment, keep the connector and a fair length of wire that attaches to the opto. As for dust... most of these things are fairly forgiving in that aspect. If moisture is an issue, you could construct a sealed compartment with a spring loaded plunger that could be sealed with an O-ring.