2-wire Mechanical N/O endstop switches



  • Nearly through with installing my new Duet 3 control board to the AON-M1. Pre-installed by manufacturer to the printer are an X-min, X-max, Y-max, and redundant (2) Z-min switches. In total there are 5 switches, all are 2 wire, with red running to NO and black running to C.

    The goal here is to be able to home the machine, which has two independent carriages on the X-Axis. The left extruder (defined as X axis) should touch off to the X-min and the right extruder (defined as U axis) to touch off to the X-max switches. And the Y & Z to home as they normally do.

    According to supporting articles, this type of switch should be connected black and red wires to GND and 3.3V respectively on the IO_x pins.

    here is the code:

    ; ======={ Endstops } ================
    M574 X1 S0 P"io1.in"                     ;X-Min switch active-low
    M574 X2 S0 P"io2.in"                     ;X-Max switch active-low
    M574 Y2 S0 P"io3.in"                     ;Y-Max switch active-low
    M574 Z1 S0 P"io4.in"                     ;Z-Min switch active-low
    M574 Z1 S0 P"io5.in"                     ;Z-Min switch active-low
    

    I am still getting an error:
    "G28 X... Error: Failed to enable endstops"

    I feel that the problem here is either in wiring or in coding.

    Any common pitfalls or clever insights?



  • Hi,

    From the documentation:

    Endstop type S0 (active low switch) is no longer supported in M574 commands. Instead, use type S1 and invert the input by prefixing the pin name with '!'. Ex: M574 X1 S1 P"!xstop". Invert the input when using an NPN output inductive or capacitive sensor, or using a NO switch (not recommended, use a NC switch instead).

    Frederick



  • @fcwilt said in 2-wire Mechanical N/O endstop switches:

    Hi,

    From the documentation:

    Endstop type S0 (active low switch) is no longer supported in M574 commands. Instead, use type S1 and invert the input by prefixing the pin name with '!'. Ex: M574 X1 S1 P"!xstop". Invert the input when using an NPN output inductive or capacitive sensor, or using a NO switch (not recommended, use a NC switch instead).

    Frederick

    I had the inverted:

    M574 X1 S0 P"!io1.in"
    

    at first and removed it to see if that would be a quick fix, I have yet to edit it back in.

    I am trying to work with what I got (switch: ss-3gl13pt NO & C connected), not necessarily trying to rewire the manufacturers work unless absolutely necessary.



  • Hi,

    When you had the ! did you also change the S0 to S1?

    Frederick



  • Some progress made.

    I swapped to S1 and now the DWC is registering 4 out of 5 endstops. Where 3 of the 4 registered read as being not triggered and the 4th registered being read as n/a.

    I tried tapping all of the endstops monitoring if DWC would see if they got triggered to which it did not.


  • Moderator

    @kroybal said in 2-wire Mechanical N/O endstop switches:

    M574 Z1 S0 P"io4.in" ;Z-Min switch active-low M574 Z1 S0 P"io5.in" ;Z-Min switch active-low

    This should be formatted as M574 Z2 S1 P"io4.in+io5.in"

    Plus inverting with ! if necessary.



  • @Phaedrux said in 2-wire Mechanical N/O endstop switches:

    This should be formatted as M574 Z S1 P"io4.in+io5.in"

    Formatting this way is to combine redundant switches?

    After implementing this, my endstop status column on the DWC lists 4 out of 5 endstops (indexing 0-3) Keeping the inverted "!" indicator across all endstops results in index 0,1 & 2 as not triggered and index 3 as n/a.


  • Moderator

    https://duet3d.dozuki.com/Wiki/Gcode#Section_M574_RepRapFirmware_Num_3

    Do you have dual z motors? What is the reason for redundant switches?



  • @kroybal you should be wiring the endstops between ioX.in and ground, not 3.3v and ground.
    Can you post a photo of your wiring of one of the plugs?



  • @Phaedrux The machine came with the switches pre-installed I do not see any obvious reasons for redundant Z switches. My lab manager did buy a modulated IR Z probe which will certainly effect the setup down the line once its installed.



  • UPDATE:

    @jay_s_uk & @Phaedrux

    I got the switches running. I will probably just recognize only one of the redundant switches, since they seem to be coplanar and serve no obvious purpose. I am working with some juiced up motors for the z-axis and the only reason I can think of for redundant switches in to be safe not to damage the machine in the event of a signal failure.

    I could post a photo if you are interested however, doesn't seem to be necessary at this point!

    Thanks for your help.



  • @kroybal said in 2-wire Mechanical N/O endstop switches:
    ...the only reason I can think of for redundant switches in to be safe not to damage the machine in the event of a signal failure.

    I could post a photo if you are interested however, doesn't seem to be necessary at this point!

    I would like to see a picture of the two Z end stop switches.

    I had two on a printer at one time when I was experimenting with homing Z at a very high speed until it triggered the first end stop switch. Then the homing continued at a safer speed until the second end stop switch triggered.

    Thanks.

    Frederick





  • It looks like they planned to have a endstop for each Z stepper so homing would also get the two steppers back in sync if they happened to get out of sync for some reason.

    So you may want to implement that.

    Frederick


  • Moderator

    @Phaedrux said in 2-wire Mechanical N/O endstop switches:

    @kroybal said in 2-wire Mechanical N/O endstop switches:

    M574 Z1 S0 P"io4.in" ;Z-Min switch active-low M574 Z1 S0 P"io5.in" ;Z-Min switch active-low

    This should be formatted as M574 Z2 S1 P"io4.in+io5.in"

    Plus inverting with ! if necessary.

    This would get you the releveling with dual endstops.


Log in to reply