Welcome! Log In Create A New Profile

Advanced

Optos vs Microswitches

Posted by Triffid_Hunter 
Optos vs Microswitches
June 19, 2011 09:26AM
Hi all, I've heard that preference is swinging towards microswitches as the preferred endstop for reasons of less noise.

Let me just chuck this on the table- I hooked up one microswitch and two optos to my printer, and the microswitch is the only one picking up noise!

I've hooked signal to common and NC to ground so 99.9% of the time the signal line is held low, however this is when it's getting false positives! The only thing I can think of is that it's acting like a loop antenna and picking up noise that way. It doesn't seem to give false negatives despite only having the atmega's internal pull-up, i.e.; once it's triggered it behaves until the axis backs out.

If the loop antenna theory is correct, adding a small resistor (10-100r) in series with the signal line should eliminate the noise. I'll try that tomorrow.

My opto boards are of my own design. The opto led has a 100r resistor for a drive current of 50mA (datasheet says they handle this), and the detector has a 1.8k pull-up (based on datasheet's max sink current @50mA drive, with a bit of leeway) and a 100nF capacitor to ground for a relatively low impedance output. Is this substantially different to the design that everyone finds to be noisy?


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Optos vs Microswitches
June 19, 2011 10:48AM
Yes I found a normally closed microswitch with a 2K2 pullup will read open occasionally if the cable is run very close to the stepper motor wires. That is why I only use them for homing at the beginning with plenty of de-glitch and ignore them after that.

It might be solved by using screened cable for the endstops. Stepper motor leads should also be screened but I have yet to find suitable cable. The current rating is either too low or way too high. I expect more of the coupling is inductive rather than capacitive so screening might not be that effective.

100nF at the board end, as you have done, may solve it as well although as the signal is developed across a dead short it presumably has quite a low source impedance. A series resistance might be needed as well to make an RC filter between the pullup resistor and the input of the micro. In fact if you make R large and C small it will also protect the micro from over voltage and ESD on those lines.


[www.hydraraptor.blogspot.com]
Re: Optos vs Microswitches
June 19, 2011 11:50PM
I have 8x oversampling on my endstops during homing such that I need 8 consecutive positives before deciding we've found home, and that microswitch's noise /still/ causes false positives. Just about to start fitting a resistor to see what happens


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Optos vs Microswitches
June 20, 2011 03:18AM
What I do is step quickly in the foreground until I reach the endstop. I then delay and check I have actually reached it. If not I loop back to the seek, so it will always end up at the endstop regardless of false positives.

I don't think I get false negatives, which again implies inductive coupling rather than capacitive.


[www.hydraraptor.blogspot.com]
Re: Optos vs Microswitches
June 26, 2011 01:46AM
Looks like adding a 100r in series eliminates the false positives from the microswitch, confirming the theory that it's acting as an induction loop.


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Optos vs Microswitches
June 26, 2011 11:44AM
I don't know what you mean by an induction loop. Two parallel wires close together will act like a transformer with half a turn on each coil. So a high frequency current in one can induce a voltage in the other. Putting 100R in series forms a potential divider with the pull-up, with negligible attenuation and forms an RC filter with the input capacitance, but again the constant is very small.


[www.hydraraptor.blogspot.com]
Re: Optos vs Microswitches
September 08, 2011 04:08AM
I just read this I was expecting to see an indication of the repeatability diffrences between the two..

As I was expecting the micro switch to have some measuarble hystresis as it relys on a mechanical switch so it may not be as precise as an opto sensor..

Maybe there is no diffrence I'v also not seen any sugestion of using a Reed switch as an end stop sensor.. Now this could be because a Reed switch has far less repeatability.. maybe..

By reed switch I mean a magnetic reed switch as used in burgular alarm door sensors etc,,


Bodge It [reprap.org]
=======================================

BIQ Sanguinololu SD LCD board BIQ Stepcon BIQ Opto Endstop
BIQ Heater Block PCB BIQ Extruder Peek clamp replacement BIQ Huxley Seedling
BIQ Sanguinololu mounting BIQ standalone Sanguinololu or Ramps mounting Print It Stick It Cut it


My rep strap: [repstrapbertha.blogspot.com]

Buy the bits from B&Q pipestrap [diyrepstrap.blogspot.com]
How to Build a Darwin without any Rep Rap Parts [repstrapdarwin.blogspot.com]
Web Site [www.takeaway3dtech.com]
Re: Optos vs Microswitches
September 08, 2011 06:58AM
hall effect sensors are starting to show up, if you're interested in magnetics.

Add a comparator with a little hysteresis and feed it into your existing endstop inputs smiling smiley


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Optos vs Microswitches
September 08, 2011 08:11AM
Hysteresis doesn't reduce accuracy or repeatability since you only need to use one edge. What is important is that the trip point is repeatable on the Z axis.

With an opto it is basically an analogue measurement because the size of the slit is large compared to the accuracy we need. As the flag covers the slit the received light reduces until some point where the electronics trip. If you use a 5 pin opto it has a Schmitt trigger with some hysteresis built in. If you have a four pin opto you rely on the input characteristics of the micro. Any noise on the signal or variation in the .logic threshold with supply rail or temperature will cause the trip point to change. It is also important the tab enters from the side, not the top as it does on some reprap designs I have seen.

Out of micro switches, reed switches, opto and hall sensors I don't know which is the most repeatable. The $4000 XY table on HydraRaptor uses hall effect so perhaps they are best. I don't need accuracy on XY though so I don't know how well they perform. I have used micro switches all my Z axis limits and have found them to be repeatable enough. They are certainly the cheapest and simplest solution.

Another technique I have used is a brass disc sprung against 3 gold pins. That tarnishes after a few months and fails open but a quick rub and it works again for months. I plan to use a gold disc instead of brass. Hard to see how you could get anything more repeatable than that. It has zero hysteresis so it will bounce, but as long as you look for the first edge it doesn't matter. All the other techniques have some analogue element but gold touching or not touching is pretty digital.

Edited 1 time(s). Last edit at 09/08/2011 08:31AM by nophead.


[www.hydraraptor.blogspot.com]
Re: Optos vs Microswitches
September 08, 2011 08:32AM
nophead, any thoughts of the repeatability of where a microswitch first triggers, vs where it releases?

ie; in teacup firmware, we hit the endstop fast, then back out really slowly and use the point where it releases as zero. Sprinter hits the endstop slow, backs out and hits it again, and uses that trigger point as zero, rather than the release point.

Kliment tells me that the trigger point is more repeatable than the release point but I'm still not convinced either way, just wondering if you have some insight?


-----------------------------------------------
Wooden Mendel
Teacup Firmware
Re: Optos vs Microswitches
September 08, 2011 12:42PM
I also approach fast and then retreat slowly and measure the release point. I don't know if Kliment's way is better. I only care about Z and it seems to be accurate enough but it does make sense that the trip point of a micro switch might be more repeatable than the release point.

My Z probe on HydraRaptor is the opposite way round so the slow retreat actually trips the micro switch. It seems to be repeatable to a couple of hundredths of a millimetre over the short term. I can't tell over the long term because the wooden frame changes a few tenths of a millimetre, which is why I have the probe.

On my Mendel and HydraRaptor I used expensive micro switches I had laying around. On my Prusa I used very cheap ones. The Z axis did seem to be a bit variable but I attributed that to the MDF I used under the bed, which warped from the heat, so it was all over the place. Then I had a filament spool jam and the extruder climbed up the filament, ripped the carriage from the X axis and ground its big gear away against the top of the frame sad smiley

Edited 3 time(s). Last edit at 09/08/2011 12:56PM by nophead.


[www.hydraraptor.blogspot.com]
VDX
Re: Optos vs Microswitches
September 08, 2011 01:19PM
... on my CNC-mill/-repstrap i use 'standard' microswitches with a repeatability of maybe 10 microns ... the axes have an accuracy of 12.5 microns (halfstep) and en overall repeatability of 25 microns.

If changinng the drivers to microstepping or for an additive mechanic with higher accuracy i'll use inductive sensors. Here i have two types - some common sensors, which i tested with 2 or 3 microns repeatability and a set of high accuracy sensors with a resolution and repeatability below 1 micron.


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Optos vs Microswitches
September 08, 2011 03:17PM
How do inductive sensors work? It seems like magnetic and inductive are inherently an analogue measurement with a threshold, so it is hard to see why they would be super accurate without very stable electronics.


[www.hydraraptor.blogspot.com]
VDX
Re: Optos vs Microswitches
September 08, 2011 05:29PM
... common inductive sensors are threshold-switches with a defined hysteresis and repeatability, but the set from Omron has special amplifiers which enhance the measuring accuracy around 10x

The (common) rod-type (WJ4-12GM40-E3-V1 from Pepperl+Fuchs: ) has a hysteresis of 150 microns and around 3 microns repeatability on the switching edges if you use stable switching conditions with a symmetric target.

The square type (NJ6-F-E2 from Pepperl+Fuchs: ) has only 50 microns hysteresis and 2 microns accuracy.

The Omron sensors (with E2CA-AL4 D proximity amplifier: ) are much more precise and can be used as threshold-switches or as analogue sensors ... here the link to a datasheet of the amplifier

Edited 1 time(s). Last edit at 09/08/2011 05:39PM by VDX.


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Optos vs Microswitches
March 23, 2013 03:24PM
Why am I not seeing much in the way of reed switches. They can be purchased for a minamal amount of money as they are used in window burgler alarms. I would like to know more about hooking them up and the ups and downs of using them.


--------------| For Everything |--------------------------
Check it out here:
[reprapsquad.wordpress.com].
---------| For Everything Prototype Related |------
Now featuring comp case mods:
[RepRapLab.wordpress.com]

--------------| Find us at Twitter|------------------------
@REPRAPSQUAD (RS Main)
[mobile.twitter.com]
@REPRAPSQUADHQ (ProtoLab)
[mobile.twitter.com]
Re: Optos vs Microswitches
March 25, 2013 04:22AM
I use miniature glass reed switches. They are extremely reliable, have exceedingly accurate resolution, are resistant to shock and vibration , humidity etc and will last millions of switching cycles.
VDX
Re: Optos vs Microswitches
March 25, 2013 04:42AM
... I've found them not precise enough, when targeting on 10 microns or better accuracy/repeatability in 'harsh' environment -- so I'm using high accurate inductive sensors or special optical sensors with Moiré-films (similar to high density optical encoders).


Viktor
--------
Aufruf zum Projekt "Müll-freie Meere" - [reprap.org] -- Deutsche Facebook-Gruppe - [www.facebook.com]

Call for the project "garbage-free seas" - [reprap.org]
Re: Optos vs Microswitches
March 25, 2013 12:12PM
That's what I have the really small glass reed switches. But I'm not sure how to hook them up for use on my reprap. I've tried to find info on them but reprap pages just refer to them and that's it.


--------------| For Everything |--------------------------
Check it out here:
[reprapsquad.wordpress.com].
---------| For Everything Prototype Related |------
Now featuring comp case mods:
[RepRapLab.wordpress.com]

--------------| Find us at Twitter|------------------------
@REPRAPSQUAD (RS Main)
[mobile.twitter.com]
@REPRAPSQUADHQ (ProtoLab)
[mobile.twitter.com]
Sorry, only registered users may post in this forum.

Click here to login