Setting up a Metrol positioning switch

This is a very quick post on how I installed a Metrol positioning switch for Z homing with my sliding hot end mount using the Duet Wifi electronics.

Metrol are a Japanese company who make high precision switches for industrial applications. Here is a link to their web site http://www.metrol.co.jp/en/. They seem to have a direct sales site called Toolsensor.com which is here http://toolsensor.com/. It looks like you can buy from ToolSensor via their Amazon.com outlet too.

I couldn’t find a UK source so ended up going to Misumi  UK and buying one of their contact switches. It wasn’t until it was delivered that I discovered that it was in fact a Metrol switch. Misumi only sell to businesses but they don’t seem to care if the business is VAT registered (mine isn’t) and there are no  minimum order quantities. So how and where you source these Metrol switches will depend on what part of the world you live in.

These switches come in numerous configurations. The one I chose has a smooth body but there are threaded versions available too. If you can, buy one without the LED as then it can be connected to the E0 end stop connector in the normal way – i.e. just like any other micro switch. The instructions for connecting end stop switches are here  https://duet3d.com/wiki/Connecting_endstop_switches.

Unfortunately, the non-LED version was not available from Misumi so I had to buy the LED version. The Misumi part number of the one I chose was N-MSTK-ASD. The non LED version is the same part number but without the “D” on the end. There is a sleeve on the switch with the word “Metrol” (that’s how I know it is a Metrol switch) and then “CS06A -L” which I assume is the Metrol part number and I would hazard a guess that the hyphenated “L” denotes LED version.

The data sheet for this switch shows a stroke of 2.0mm, the switching point as being 0.3mm from tip and the repeatability to be 0.005 mm. Metrol do make switches with claimed repeatability of 0.001mm but IMO that would be overkill even for our Z axes.One down side is that the switch is normally open rather than normally closed so if a wire falls off, it won’t fail “safe”. As I mentioned in my other post, I installed a backup micro switch to trigger 1mm higher than the Metrol switch and initiate an emergency stop should the primary switch fail.

If you’ve managed to find a non-LED version of this switch, then you can stop reading now as the rest of this post is on how to install the LED version.

Because this switch has a series LED and the Duet electronics also has an LED with a pull up resistor, it has to be treated as an analogue switch rather than a digital switch (this was what confused me at first). So following David Crocker’s advice (DC42) I connected the switch between the In and Gnd pins of the Z probe connector, with a pull up resistor (about 220 ohm to 1 K) between in and +3.3V. The resistor value isn’t critical as long as it is within that range – lower makes the series LED shine brighter when the switch is triggered.

Here is a link to the Duet Wiring diagram. https://duet3d.com/wiki/Duet_WiFi_wiring_diagrams. NOTE. Unless you have a very early prototype board, the diagram to use is the one at the top entitled “………v1.0, v1.01,v1,02” The lower diagram is for PROTOTYPE – don’t let the “V2” fool you into thinking that its is later than the production V1.0 versions. This is important because the Z probe pins are different.

Having got the switch connected, we now need to “tell” the Duet board what type of switch it is. In this case, it is probe type 1. The relevant gcode command is M558 and the settings can be found here https://duet3d.com/wiki/G-code#M558:_Set_Z_probe_type. So my M558 line looks like this. M558 P1 X0 Y0 Z1 F180 T6000 I1. I don’t use and form of bed probing other than for homing so the “T” parameter is irrelevant in my case.

Note that unlike the mini height sensor, the “analogue” voltage from the Metrol switch does not change gradually as the sensor gets close to the bed. Instead it simply switches from one value(zero) to another. So you cannot use the facility whereby the probing speed will slow down as the sensor gets closer to the bed so you may need to drop the Z homing speed (180 mm/min works well for me).

The last thing to do is check that the switch is working and set the trigger value and trigger height.Again, it should be noted that I don’t use any form of bed compensation so I’ve only ever used G31 for homing. If you do detailed probing, you may be using G30 or G32 but the principle will be the same.

I currently have a problem with my printer and am unable to connect using the web interface so I’ll have to do the rest of this post from memory. Apologies in advance if what you see is not what I say you will see.

This is where I discovered another command that I wasn’t previously aware of. One can use M119 to report the end stop status. With the switch open as normal, send M119 via the web control and observe the switch status in the console. Then manually close the switch and send M119 again to check that it is closed. The console on the web interface may indicate that the probe is close to the bed but not actually at the bed. This is because the trigger value may not be correct, especially if you have previously been using the IR probe. So, with the switch open, observe the probe value (top right hand corner of DWC) and should read zero. Then with the switch closed, observe the probe value again. With a 500 Ohm resistor, I had a reading of 474 and my G31 was still set for the mini IR probe with a trigger value set to 500 which is why the web interface console showed that the probe was close to the bed. The actual value will depend on the resistor you used, so set the trigger value to be about half way between zero (when the switch is open)  and the reported value when the switch is closed. In my case I used 250 so my G31 ended up as “G31 P250 X0 Y0 Z-0.8”. The “Z” value is the trigger height and is set in the usual way by using a thin piece of paper between the probe and the bed or whichever method works best for you.

HTH

Ian

 

 

 

Advertisements

Author: deckingman

Just an old guy who likes to make things.

1 thought on “Setting up a Metrol positioning switch”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s