Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    NPN proximity sensor SUN GL-8F on all 5 axes with Duet3 6XD

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    2
    6
    138
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • lei2vaegh6undefined
      lei2vaegh6
      last edited by

      Hi everyone, I have a machine (actually a 5-axis CNC, but I don't think that matters at this stage) which has 5 SUN GL-8F inductive Normally Open proximity sensors. I'm using a Duet3 6XD. I'd like to not have to replace the sensors so I'm trying to get them working, which AFAICT should be possible but things don't seem to be working like I would expect.

      According to the docs I can connect the 12-24v input of the sensor to any of the 24v sources on the board. This is working fine, and if I put a meter on the sensor between it's signal pin and ground I see a change in voltage from 0.5v to 0v when I put metal over the sensor. So all is well.

      The problems start when I try to connect it to an IO input. For now I simply tried to use it as a Z probe with the following, as the sensor I chose to test with first is on the Z axis.

      M558 P5 C"!io3.in" F120 T1000
      

      Unfortunately placing a piece of metal over the sensor after putting that in my configuration does not activate or deactivate the Z probe in the GUI. I didn't try homing because there's a risk of crashing, but I expect if I can't see the sensor status in the GUI homing won't work either.

      I read in the docs that there is a pull-up resistor which can be enabled with C"^!<port>. I thought maybe this was necessary because the change in current on the signal pin is so small, but this didn't make any difference.

      Does anyone know a way to make these sensors work, or why they are different from other NPN NO sensors I've read about people using as those all seem to work without much effort.

      Thanks!

      Here's a datasheet on the sensor. Picture, because the PDF is behind a login wall:
      Screenshot_2025-05-10_16-40-50.jpg

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @lei2vaegh6
        last edited by

        @lei2vaegh6 does the orange LED on the sensor turn on when you hold a piece of metal close to it to trigger it?

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        lei2vaegh6undefined 1 Reply Last reply Reply Quote 0
        • lei2vaegh6undefined
          lei2vaegh6 @dc42
          last edited by

          @dc42 Yes it lights up, AFAICT the sensor is working correctly.

          1 Reply Last reply Reply Quote 0
          • lei2vaegh6undefined
            lei2vaegh6
            last edited by lei2vaegh6

            I made some progress. If I set M558 P1 C"^io3.in" (EDIT: turns out the pull-up doesn't do anything here, it's the same if I leave it off) and watching the "P<value>" readout on the right side of the paneldue home screen I see the value change from P162 with no trigger to P9 when triggering the sensor with a piece of metal. I don't know how to read this value any other way (it's some kind of raw value I guess?), and this does not seem to be considered a probe trigger because M119 doesn't report a change to the Z probe status.

            I believe I should be calibrating it? But as I'm going to use these for endstops, not a zprobe, it's unclear which documentation path I should be taking in M558.1 and M558.2. Or if this is even the right approach.

            I feel like it should be possible to read this value directly in M574 but I can't get that to work since it's not a "switch".

            1 Reply Last reply Reply Quote 0
            • lei2vaegh6undefined
              lei2vaegh6
              last edited by

              image.jpg image-1.jpg

              dc42undefined 1 Reply Last reply Reply Quote 0
              • dc42undefined
                dc42 administrators @lei2vaegh6
                last edited by dc42

                @lei2vaegh6 I suspect that your sensor a has high output leakage current, which is limiting the output voltage to 0.5V when it should be at least 3V. You can fix this in either of the following ways:

                1. Keep your current connections but add an external pullup resistor between the IO_IN pin and the 5V pin of the port you are using on the Duet. I suggest a resistor value of 1K to 2.2K.

                2. As you are using a 6XD board, you have 4 input ports (IO5 thru IO8) that provide alternative isolated inputs designed for connecting to 24V PLCs etc. See https://docs.duet3d.com/Duet3D_hardware/Duet_3_family/Duet_3_Mainboard_6XD_Hardware_Overview#opto-isolated-inputs. For example, you could connect the sensor output to IO5_ISO_NEG and connect IO5_ISO_POS to +24V. Then change your configuration to use port "!io5.in".

                Duet WiFi hardware designer and firmware engineer
                Please do not ask me for Duet support via PM or email, use the forum
                http://www.escher3d.com, https://miscsolutions.wordpress.com

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Unless otherwise noted, all forum content is licensed under CC-BY-SA