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

Endstop LED lighting, but DWC does not show them triggered

Scheduled Pinned Locked Moved
Duet Hardware and wiring
4
33
1.3k
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.
  • undefined
    Leav
    last edited by 20 Jul 2020, 04:30

    Hi,

    First time configuring Duet!

    Here are my specs:

    • Duet 2 wifi
    • Duet Web Control 3.1.1
    • Firmware: RepRapFirmware for Duet 2 WiFi/Ethernet 3.1.1 (2020-05-19b2)
    • Duet WiFi Server Version: 1.23
    • Delta printer

    My endstops are PNP(?) normally high inductive sensors, meaning untriggered=Vcc and triggered=0.
    Since Vcc is 24v, I used a voltage divider in order to bring this down to ~3.3v

    Hardware wise, the endstops work great (I think): untriggered the LED is off, and when triggered the LED turns on. So far so good!

    However in software things are for some reason not that simple. I chose "active-low" in the configurator and correctly get "not triggered" in DWC, but neither DWC nor the homing procedure recognize the endstops are hit (no indication in DWC, axis just keeps on moving).

    Here is my config.g snippet:

    M574 X2 S1 P"!xstop" ; configure active-high endstop for high end on X via pin !xstop
    M574 Y2 S1 P"!ystop" ; configure active-high endstop for high end on Y via pin !ystop
    M574 Z2 S1 P"!zstop" ; configure active-high endstop for high end on Z via pin !zstop

    Any ideas what I'm doing wrong?

    Thanks!

    undefined 1 Reply Last reply 20 Jul 2020, 10:17 Reply Quote 0
    • undefined
      fcwilt @Leav
      last edited by 20 Jul 2020, 10:17

      @Leav

      The code comments say "active high" but your post says "active low".

      Is the code correct and the comment just wrong?

      Frederick

      Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

      1 Reply Last reply Reply Quote 0
      • undefined
        Leav
        last edited by Leav 20 Jul 2020, 14:39

        This was straight from the web configuration tool.
        I just tried it again with all different combos and it always says "active-high"

        ; Endstops
        M574 X1 S1 P"xstop" ; configure active-high endstop for low end on X via pin xstop
        M574 Y1 S1 P"!ystop" ; configure active-high endstop for low end on Y via pin !ystop
        M574 Z1 S1 P"^zstop" ; configure active-high endstop for low end on Z via pin ^zstop

        I guess "Setting active high via invert(Xstop)" is meant to say "Setting active high by inverting the active-low sensor on xstop pin", which makes sense but is slightly confusing.

        1 Reply Last reply Reply Quote 0
        • undefined
          Leav
          last edited by 20 Jul 2020, 19:22

          So I probed around a bit and for some reason my voltage divider setup is only bringing the voltage down to 1.2v instead of 0v.

          Probably enough to trigger the LEDs but not the circuit.

          I'll fix this tomorrow and report back.

          1 Reply Last reply Reply Quote 0
          • ?
            A Former User
            last edited by 20 Jul 2020, 19:29

            Maybe draw us a picture, lots of seemingly contradicting bits in the posts here? Or refer to https://duet3d.dozuki.com/Wiki/Connecting_a_Z_probe#Section_PNP_output_normally_open_inductive_or_capacitive_sensor the wiring is relevant for endstops as well as probes.

            1 Reply Last reply Reply Quote 0
            • undefined
              Leav
              last edited by Leav 21 Jul 2020, 15:52

              So I traced the issue to the fact that all my endstops seem to have their pull-up resistors enabled, even though I never specified the pull-up flag.
              (I'm seeing this on all the endstop input pins)

              Any thoughts on the matter would be appreciated as I try to hunt down this issue....

              ? 1 Reply Last reply 21 Jul 2020, 15:55 Reply Quote 0
              • ?
                A Former User @Leav
                last edited by 21 Jul 2020, 15:55

                @Leav said in Endstop LED lighting, but DWC does not show them triggered:

                So I traced the issue to the fact that all my endstops seem to have their pull-up resistors enabled

                they're physical resistors on the board.

                you need to add pull down to counteract ref post above.

                undefined 1 Reply Last reply 21 Jul 2020, 15:58 Reply Quote 0
                • undefined
                  Leav @A Former User
                  last edited by Leav 21 Jul 2020, 15:58

                  @bearer said in Endstop LED lighting, but DWC does not show them triggered:

                  they're physical resistors on the board.

                  Are you sure? I was looking at the schematic and couldn't find any pull-ups and the Atmel datasheet mentions software defined pull-ups and pull-downs:

                  c89235ee-230c-4f63-a972-7ab9d6165b0c-image.png
                  e93483b2-20f1-40d7-bcd0-4692140ce81f-image.png
                  9279a360-77bf-4015-8bee-06ec0c704c31-image.png

                  undefined 1 Reply Last reply 21 Jul 2020, 16:04 Reply Quote 0
                  • undefined
                    Leav @Leav
                    last edited by 21 Jul 2020, 16:04

                    Ok this section was hiding to the side! oops!
                    dfa84d8c-cde7-4429-b20e-f122f9a6daa4-image.png

                    1 Reply Last reply Reply Quote 0
                    • ?
                      A Former User
                      last edited by 21 Jul 2020, 18:14

                      if your endstops are PNP then please try the wiring described in https://duet3d.dozuki.com/Wiki/Connecting_a_Z_probe#Section_PNP_output_normally_open_inductive_or_capacitive_sensor

                      1 Reply Last reply Reply Quote 0
                      • undefined
                        Leav
                        last edited by Leav 21 Jul 2020, 18:52

                        I don't see how that would solve it... would still result in ~1.5v on the input:
                        (This model is missing the internal pulldown resistor in the atmel, I think. But I don't know it's value)
                        c085b16b-11d2-4dc8-9793-b85803e1504d-image.png

                        edit: Looks like the internal pull-down on the Atmel is 100K nominal:
                        a7425b66-de56-4ebc-ac1c-3f1c9278b254-image.png

                        And obviously I'm in over my head here since I don't see how the duet design works with that "1k pullup" and the LED... Falstad Circuit Simulator says the voltage on the input would not be pulled down effectively...
                        2391ee7b-6ea8-4fc6-8ed0-798950be96ff-image.png

                        1 Reply Last reply Reply Quote 0
                        • ?
                          A Former User
                          last edited by A Former User 21 Jul 2020, 19:18

                          Your drawing isn't correct for a PNP sensor, it would be a swtich to 24v not to ground.

                          (edit: if your sensor switches to ground then its a NPN sensor and you can connect the output directly to the duet input and use the internal pull up, no external resistors required)

                          1 Reply Last reply Reply Quote 0
                          • undefined
                            Leav
                            last edited by Leav 21 Jul 2020, 19:36

                            First, I would like to say thanks for supporting and trying to help - very much appreciated!

                            Second, it's an NPN sensor:
                            de3e7c58-6831-4073-9c10-0e7a2dc6e2d8-image.png

                            I suppose I could try the diode design proposed here, but not sure I have any diodes. Is there anyway to make it work with resistors?

                            Also not sure I understand why it would work, but not surprising since I don't understand any of the circuit.... (how does the LED not pull up the voltage to ~1.5v? is the falstad simulation wrong? did I draw the diagram wrong?)

                            undefined ? 2 Replies Last reply 21 Jul 2020, 20:01 Reply Quote 0
                            • undefined
                              fcwilt @Leav
                              last edited by 21 Jul 2020, 20:01

                              @Leav

                              If your device has an open collector output that connects to ground when active you should be able to treat it as a switch.

                              Have you verified that there is a voltage on the output when simply powered up and the output is not connected to anything?

                              Frederick

                              Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                              undefined 1 Reply Last reply 21 Jul 2020, 20:13 Reply Quote 0
                              • undefined
                                Leav @fcwilt
                                last edited by Leav 21 Jul 2020, 20:13

                                @fcwilt Hi, Yes I can confirm that when the sensor is disconnected, I get 24v when untriggered and 0v when triggered.

                                Do you mean just connect it as is to the board? won't that dump ~24v into the endstop circuit? I seem to remember reading that the LEDs can only handle ~8v....

                                undefined 1 Reply Last reply 21 Jul 2020, 20:52 Reply Quote 0
                                • undefined
                                  fcwilt @Leav
                                  last edited by 21 Jul 2020, 20:52

                                  @Leav

                                  No don't connect to the board.

                                  I just wanted to know if the device had an pure open collector output (no pull-up resistor) - meaning it would show no voltage with the output disconnected.

                                  What you can do to limit the voltage to the Duet is to connect 4 diodes (example 1N4148) in series, with the anode of the first one connected to the Duet input and the cathode of the last one connected to the Duet ground. This would limit the voltage at the input to roughly 2.8 volts but should be high enough to not activate the Duet input.

                                  Then you would connect a 1K resistor from the output of your device to the Duet input. This resistor would limit the current to roughly 24 mA and protect the diodes but should be small enough in value to activate the Duet input.

                                  The diode listed is rated to 200 mA so you could use, say, a 512 resistor if the 1K does not activate the Duet input.

                                  Frederick

                                  Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                  undefined 1 Reply Last reply 22 Jul 2020, 20:50 Reply Quote 0
                                  • ?
                                    A Former User @Leav
                                    last edited by 22 Jul 2020, 01:42

                                    @Leav said in Endstop LED lighting, but DWC does not show them triggered:

                                    Second, it's an NPN sensor:

                                    you did start your thread saying it was a PNP sensor..

                                    i'd perhaps suggest putting up the whole model number so you can get some help checking if it does have pull ups or have been damaged. Built in pull up on a NPN sensor is both uncommon and defeats the benefit of interfacing between different voltages.

                                    undefined 1 Reply Last reply 22 Jul 2020, 07:16 Reply Quote 0
                                    • undefined
                                      Leav @A Former User
                                      last edited by Leav 22 Jul 2020, 07:16

                                      @bearer said in Endstop LED lighting, but DWC does not show them triggered:

                                      you did start your thread saying it was a PNP sensor..

                                      Yup, forgot about that... to save face I can say I wasn't sure and added a question mark, but I could have just checked. Apologies.

                                      @fcwilt said in Endstop LED lighting, but DWC does not show them triggered:

                                      What you can do to limit the voltage to the Duet is to connect 4 diodes

                                      That sounds... complicated, and I'm not sure I have any diodes. I think I'll try out alternative solutions first. might be time to just swap out to opto-endstops I have laying around somewhere.... hopefully they are 3.3v compatible...

                                      @bearer said in Endstop LED lighting, but DWC does not show them triggered:

                                      Built in pull up on a NPN sensor is both uncommon and defeats the benefit of interfacing between different voltages.

                                      Thanks you for mentioning this! i'm not an EE but the pull up in that sensor did give me lots of headaches! would be so much simple if it was just not connected!!

                                      1 Reply Last reply Reply Quote 0
                                      • undefined
                                        Leav @fcwilt
                                        last edited by Leav 22 Jul 2020, 20:50

                                        @fcwilt

                                        Hi Fredrick,

                                        So I found that I did have some 1N4148 diodes, but tried this circuit instead (link to circuit simulator) of what you suggested (since I wasn't sure I 100% understood you).

                                        In theory it should work great! in practice the voltage on the xstop pin is ~1.2v and I can't understand why!

                                        Any clues here would be appreciated!

                                        Thanks!

                                        c43d39d9-58ed-46d7-8ba5-3cab5f030813-image.png
                                        7b514ab5-e10c-4a0b-82ee-43dd96f856ac-image.png

                                        1 Reply Last reply Reply Quote 0
                                        • undefined
                                          fcwilt
                                          last edited by 22 Jul 2020, 20:55

                                          Hi

                                          What is the output voltage of your device when you are reading the -1.2?

                                          And where is the ground connection of your device connected?

                                          Frederick

                                          Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                                          undefined 1 Reply Last reply 23 Jul 2020, 03:54 Reply Quote 0
                                          4 out of 33
                                          • First post
                                            4/33
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA