M581 with multiple endstops: does anyone use it?


  • administrators

    I am currently refactoring all the code that handles endstops, including the code that manages triggers set up by M581. The new code will take an "input number" instead of an endstop designation.

    It's going to be tricky to continue to support M581 commands that refer to multiple endstops. For example, currently you can write this:

    M581 T3 X Y E2 S1

    which means that a positive going edge on any of X, Y or E2 will run trigger3.g. Then you can canel all of these using:

    M581 T3 S-1

    What I would prefer to do is to base triggers on input ports. For example, you would be able to use the following to achieve the same effect:

    M581 C40 T3 S1
    M581 C41 T3 S1
    M581 C45 T3 S1

    and then you would need to cancel them individually.

    Do any of you use the facility to declare multiple inputs to a trigger in a single command, and if so, would this proposed approach be problematic to you?



  • I planned on using M581 as a backup Emergency Stop in case of BLTouch failure.

    I'm configured with Z and U dual steppers for Z on a CR-10S. I have endstops on both. Hadn't gotten to configuring yet ... Will I be able to use it for that after the change?

    EDIT: BTW - any chance you could take a quick peek at:
    https://forum.duet3d.com/topic/9889/upgrading-cr-10s-steppers-ps-to-24v-suggested-z-replacement/11

    I asked you some Q's and am stuck until you answer ... 😉


  • administrators

    @puterpro said in M581 with multiple endstops: does anyone use it?:

    I'm configured with Z and U dual steppers for Z on a CR-10S. I have endstops on both. Hadn't gotten to configuring yet ... Will I be able to use it for that after the change?

    Yes, but you will need to set up 2 separate triggers.



  • @dc42 said in M581 with multiple endstops: does anyone use it?:

    @puterpro said in M581 with multiple endstops: does anyone use it?:

    I'm configured with Z and U dual steppers for Z on a CR-10S. I have endstops on both. Hadn't gotten to configuring yet ... Will I be able to use it for that after the change?

    Yes, but you will need to set up 2 separate triggers.

    Or, @PuterPro could do what I do and that is wire all the "extra" switches in series (normally closed) and connect them to a single end stop. Then use a single trigger which will work if either switch changes state.



  • @dc42 - Easy enough.

    @deckingman - That's clever, but I use them to independently home my dual Z, then pass control to a BLTouch to find Z Home. Need them independent at this point.

    I've pondered slaving the Z's with a belt and pulley setup, if I do it I'll use your idea.



  • For my part, I use one at a time.
    It smells good the fix



  • I use it like this:

    M581 E2:3 X1:0 Y1:0 S1 T0 C0

    But don't ask me what this means - it's been over a year since I set it up. There's basically two endstops for X and Y and I need the machine to stop if it reaches them. Do what you need to, just let us know how to keep functionality.



  • I use M581 with multiple endstops but would be perfectly fine with using multiple commands in the interest of decoupling the logical axis assignment from the physical input.



  • @dc42 When you're done, will I be able to do the following...

    With 7 endstop switches, say 0-6...
    Home X with 0, Y with 1, Z with Probe
    Calculate max X with 2, Y with 3 and Z with 4,5,6
    THEN
    set 2,3,4,5,6 as emergency stop switches?

    (all without having to wire in series, etc)


  • administrators

    Looks like the main reason to use multiple inputs to a trigger is to have all the endstops trigger an emergency stop. Maybe we should use a separate GCode command for that.



  • Looks like the main reason to use multiple inputs to a trigger is to have all the endstops trigger an emergency stop. Maybe we should use a separate GCode command for that.

    And then there's this idea ... Sounds like the real solution, then you can rework M581 to your heart's content.


Log in to reply