Confirmation required for wiring end stop switch with led

Avatar

By deckingman 15 February 2017 13:25

Member · 715 comments

I've just taken delivery of a Metrol contact switch via Misumi EU for use with my proposed sliding mount (claimed repeatability 0.001mm at switch point of 0.3mm). I didn't particularly want an LED but that's how it came. There is no board or other components and as near as I can make out (the instructions are in Japanese), the LED is just in series with the switch contacts (normally open I'm afraid). So I'm guessing that I'd just connect the brown wire to 3.3v and the blue to Stp and set M574 to active low. Is that correct?

Also, there are some Japanese characters that seem to indicate that a series resistor is needed but I think that's only for 24v systems and I'm safe to ignore that with 3.3v logic. Is that also a safe assumption?

Thanks

Ian


Avatar

By deckingman 15 February 2017 15:58

Member · 715 comments

Quick update to this. I've got some English info from Misumi. The contact rating is 5 to 24v 10mA max (with LED) resistive load. Then a bit further on I have " For load within the switch rating or installation onto a PLC, current limiting resistors are not necessary
as long as the current is about 7mA"

So am I OK to connect this directly to the Duet as detailed above?

Thanks


Avatar

By dc42 15 February 2017 17:41

Administrator · 2,297 comments

Can you bypass the LED? If so then you can just connect the contacts to the E0 endstop pins in the usual way. Otherwise, I suggest you connect it between the In and Gnd pins of the Z probe connector, with a pullup resistor of about 220 ohms to 1K between In and +3.3V, use Z probe type 1, use the I1 parameter in the M558 command, and set a suitable trigger level using G31.


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By deckingman 15 February 2017 17:50

Member · 715 comments

Thanks David. The LED is kind of moulded in to the lead so the only way to bypass it would be to cut it out which no doubt would invalidate any warrantee. I'm a bit reluctant to do that as it cost me 34 quid. I'll try your plan B. Ian


Avatar

By deckingman 15 February 2017 18:14

Member · 715 comments

David,

Sorry to be a pain again. I was rather hoping that I could retain your IR probe in case my sliding mount doesn't work out. What I had in mind was to leave that connected to the Z probe input but connect this switch to the E0 input and select mode 4. That is to say, it'd be cool if I could have them both wired and switch between them in my config. I'm assuming from you reply that this is not possible but can you just confirm that that is the case please.

Thanks.


Avatar

By deckingman 21 February 2017 10:47

Member · 715 comments
dc42 wrote

Can you bypass the LED? If so then you can just connect the contacts to the E0 endstop pins in the usual way. Otherwise, I suggest you connect it between the In and Gnd pins of the Z probe connector, with a pullup resistor of about 220 ohms to 1K between In and +3.3V, use Z probe type 1, use the I1 parameter in the M558 command, and set a suitable trigger level using G31.

David,

Did you really mean probe type 1? Reading the Wiki instructions, it says that type 1 is for analogue inputs whereas type 5 is for a switch or digital output.


Avatar

By dc42 21 February 2017 12:19

Administrator · 2,297 comments

If there is a LED in series with the switch and you can't bypass it, then I do mean type 1.


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By deckingman 21 February 2017 13:01

Member · 715 comments

OK thanks David. With it wired and configured as you suggest, the led on the switch illuminates when the switch makes but I see no change in the state of any of the LEDS on the board. Is that expected behaviour? And one final question, I had set up E0 to be used as an emergency stop using a second micro switch and M581. I have temporarily disconnected and disabled this. Can I reinstate it as is or should I use one of the other estops on the Duex5 instead of E0? Thanks


Avatar

By deckingman 21 February 2017 15:23

Member · 715 comments

Update on this. If I try to home Z with the switch wired like this, when I trigger the switch, the bed rises slowly but continues to rise. Fortunately I had the bed well down which gave me enough time to kill the power before anything got mangled. What to do now?


Avatar

By dc42 21 February 2017 17:05

Administrator · 2,297 comments

Endstops and Z probes should always be tested using M119 or the DWC machine properties page before relying on them.


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By deckingman 21 February 2017 17:34

Member · 715 comments

Yes OK but what can I try next to get this working? It sort of triggers because the in built LED illuminates and the bed rises at a slower rate. Like it does with your IR probe but the bed doesn't stop - it just carries on at a slower rate. For info I'm using a 550 ohm resistor because it is more or less in the middle of the 220 ohm to 1k ohm you suggested. Would a lower/higher value work?

What about my other questions? i.e. should the LED on the duet board change state with this configuration and can still use E0 as and emergency stop or should I reconfigure it?

I tried Misumi's site to see if I could buy a non LED version of this switch but it's been discontinued. The only version available is the LED version. It's a precision positioning switch, designed for homing machinery so I'd be disappointed if there is no way to get such a switch to work with the Duet.


Avatar

By dc42 21 February 2017 18:05

Administrator · 2,297 comments

What is the Z probe value shown in DWC when the switch is/isn't closed?


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By deckingman 21 February 2017 18:28

Member · 715 comments

In it's "normal" state, the value is 0. When it is made (as in if the end stop limit was triggered), it is 474. According to the data sheet, it's a normally open switch.

Edit. Didn't know about the M119 command. Just tried it and with the switch triggered I get "Endstops - X: not stopped, Y: not stopped, Z: near min stop, Z probe: near min stop"

Last edited by deckingman (21 February 2017 19:48)


Avatar

By deckingman 21 February 2017 20:04

Member · 715 comments

Got impatient so I tried a 1.2k ohm resistor and the probe value went up to 484. Tried a 4k7 and it went up to 500 and M119 now reports Z at min end stop. So seems to work with that value resistor. Is it safe to leave it like that?

Further edit. Just realised that I can change the trigger value in G31, as well as the trigger height. I've only ever used the mini height sensor so always had it set to 500 and completely forget that it can be set to any other value. So back to the 500 ohm resistor and setting a trigger value of 450 works. Given that the value changes between O and 474, is 450 a reasonably safe number to use?

Last edited by deckingman (21 February 2017 20:26)


Avatar

By iDevelo 21 February 2017 20:07

Member · 184 comments

So it was just the trigger level? You could in theory just lower that?

Also I'm interested in the outcome of this. I've got issues with 3Dlac and the IR sensor.

Avatar

By dc42 21 February 2017 20:24

Administrator · 2,297 comments
deckingman wrote

Got impatient so I tried a 1.2k ohm resistor and the probe value went up to 484. Tried a 4k7 and it went up to 500 and M119 now reports Z at min end stop. So seems to work with that value resistor. Is it safe to leave it like that?

I suggest you lower the trigger level (G31 P parameter) to 250.


Duet WiFi hardware designer and firmware engineer
http://www.escher3d.com
https://miscsolutions.wordpress.com

Avatar

By deckingman 21 February 2017 20:29

Member · 715 comments

Sorry guys, we were all typing at the same time. I've just edited my post having remembered that I can edit the trigger value. I've only ever used DCs probe so it's always been 500 and I've never changed it - completely forgot that it was editable.


Avatar

By deckingman 21 February 2017 20:40

Member · 715 comments
iDevelo wrote

So it was just the trigger level? You could in theory just lower that?

Also I'm interested in the outcome of this. I've got issues with 3Dlac and the IR sensor.

Well I'm pretty confident that the switch will work - that's what it's designed to do. However, it is a contact switch so you can't use it directly on the bed unless you use some mechanism to deploy it. That is to say, you can't have it permanently lower than the nozzle because it will be scraping on the printed part, and you can't have it higher because the nozzle will touch the bed before the probe does. My plan is to use it above the hot end mount with the nozzle itself being the probe. Check my sliding mount thread to see what I mean.

So it's the sliding mount part that could screw up the repeatability. I've nearly got a working prototype but I have to change the entire XY carriages to test it. 

Ian