Can this sensor be used as zprobe?
-
Hi,
As this relates to Dave’s excellent firmware I am tagging him, but if the sensor is usable it might be of interest to others (as it is a very precise sensor, can handle the full color range, can be found for a decent price, and might be a fairly easy drop in mod - main downside is that it has a max working temp of 65ºC. It’s mostly polycarbonate, but I think the lense is acrylic)
@dc42I believe this is my first time posting (might be second), but have been using this resource for quite some time now.
Currently I have a RailCore & have been using the various Duet accessory sensors quite happily (Duet IR sensor & magnetic filament sensor), but have been passively looking for a possible replacement sensor. The Duet IR sensor has been working quite well for me, but as I have a few different build plate/plate materials & my favorite are white/other colors/transparencies that the IR sensor may not work quite so well with + given the nature of my printer hardware/type of printing I (attempt) to do I have been plagued by extremely slight dimples in the build surface that normally aren’t an issue, but when dealing with very low layer heights or sensitive filament types can cause annoying problems.Recently I came across an Omron sensor that is normally about $80, but is/was for sale on a couple sites for about $24 so I jumped on it. The sensor I’m referring to (Z4D-C01) is extremely accurate (it’s meant to be used for things such as detecting if 2 sheets of paper, rather than 1, is pulled by a printer. So it has a very high resolution and linearity). In addition while there is a difference in when the sensor would be triggered via white vs black surfaces, that difference is consistent. So it seems as though it would be usable with any color surfaces (transparent ones are probably an issue, thus depending on the color under the transparent surface). Ditto with temperature.
I did my research and it seems as though it should work with the duet hardware/firmware just fine - I think. The sensor is activated by sending a PWM signal and when it detects proximity it sends out a signal ranging from 2-3 volts, I believe. The closer the item is the higher the voltage output.
From what I’ve read this should work fine with what the duet fw expects from those z-probe types (I did the test with a 50hz pwm signal & it can operate with a faster one. I’ll have to circle back to this assuming the rest is OK to move forward with). The main question that I have is regarding the output from the sensor before it detects proximity - while when detecting proximity it outputs a steady signal, when not triggered (but still ‘searching’ w/ the pwm signal enabled) it seems to output a bunch of ‘noise’. The noise being sporadic voltage output from 0 to the signal level V.I have included a link to a video showing the output from an oscilloscope attached to the output pin on the sensor. You can see me raise/lower the sensor and the corresponding readout from the scope.
Hopefully this is enough information to be able to determine if this ‘noise’ would be an issue or not (I’m guessing that if the noise is an issue a capacitor/resistor/food could be used to clean things up, but I’m not very well versed in these things).Link:
https://www.dropbox.com/s/wlouww8ljnulmqb/Omron Proximity Sensor.mov?dl=0Duet board version:
- Duet WiFi (about 2 years old)
- Using the latest few
If any other info is needed I am sure I can fill in any blanks.
Many thanks in advanced for any help that you can provide! -
@appoli13 At first check looks like it would be possible, you could test with the Z probe type 2;
https://duet3d.dozuki.com/Wiki/Connecting_a_Z_probe#Section_Mode_Num_2Couple of points
- its 5V, the Z probe header on the Duet 2 has 3.3V on it so you need to get 5V from another point on the Duet 2 (e.g. expansion header.
- The output is characterised as swinging between 0.2V and VCC-0.3V so 4.7V if you feed it 5V . Assuming you have a v1.4 or later Duet 2 the Z probe pin will be fine getting 4.7V, but the fullscale is still ~3.3V so it will hit maximum reading before its at its closest. I don't think this is an issue in and of itself because you can set the trigger value to be anwhere in the range.
- The default settings for a modulated Z probe may not work out the box "The Duet drives the control signal with a 250Hz square wave. The firmware extracts that part of the analog signal received on the IN pin that is in phase with the modulation." So you will need to experiment to see if the setup time the probe expects impacts the duet's extraction of the analog voltage.
-
@t3p3tony
Thanks for the feedback!That’s exactly how I was planning on configuring the GCode, so it’s good to know I was on the right track. A little bit of info I didn’t previously provide: I was powering the sensor with 5v, for the pwm signal I chose 4.5V as an arbitrary number (based on the info file I believe you saw), & looking over the video I included the output would start at about 0v and go up to almost 3V depending on how close the sensor would get (I was expecting it would go higher based on the spec doc as well, but wasn’t worried as I assumed the duet would register a ‘contact’ at whatever voltage it is configured for preventing it from moving even closer & receiving too much voltage).
Going over the documentation I saw that the default pwm signal is 250hz, that should work based on the data sheet. Per chance would you know what duty cycle the duet defaults to? It seems as though the sensor prefers 0-30%, but Is dependent on the carrier frequency (I had chosen 50hz with a 20% duty cycle for my test).
Thanks again for the help!
If all goes well I hope to test this out on the duet soon (& as mentioned this seems as a solid z probe option for others looking for a high precision sensor that can work with both white & black surfaces. Only thing that is ‘annoying’ is that temp seems to cause a significant enough drift so calibration would need to be done at print temp) -
@appoli13 said in Can this sensor be used as zprobe?:
Per chance would you know what duty cycle the duet defaults to?
AFAIK 50% but @dc42 will need to confirm