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

    M574 am i allowed to change endstop type on the fly?

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    3
    11
    1.2k
    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.
    • gavatron3000undefined
      gavatron3000
      last edited by

      my b axis is configured to be a sensorless endstop for homing and this works well as it loads filament during a tool change, on unloading id like it to home in reverse to a physical switch by changing M574 from sensorless to using a switch, then revert back to sensorless for the rest of the tool change.

      is this allowed by the firmware?

      or am i able to configure sensorless for max endstop and switch for minimum?

      cheers

      1 Reply Last reply Reply Quote 0
      • Phaedruxundefined
        Phaedrux Moderator
        last edited by

        You can configure the firmware in real time. So any gcode commands you issue will be in effect when you issue them and in the order you issue them. In other words, you can do pretty much anything you want in a macro.

        Z-Bot CoreXY Build | Thingiverse Profile

        1 Reply Last reply Reply Quote 0
        • gavatron3000undefined
          gavatron3000
          last edited by

          ok cheers, thanks mate

          1 Reply Last reply Reply Quote 0
          • gavatron3000undefined
            gavatron3000
            last edited by

            hmmm, i dont think it sticks during macro, i cant get this to reliably change endstop config on the fly. does it only work within config.g?

            Phaedruxundefined dc42undefined 2 Replies Last reply Reply Quote 0
            • Phaedruxundefined
              Phaedrux Moderator @gavatron3000
              last edited by

              Can you post your files?

              Z-Bot CoreXY Build | Thingiverse Profile

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

                @gavatron3000 said in M574 am i allowed to change endstop type on the fly?:

                hmmm, i dont think it sticks during macro, i cant get this to reliably change endstop config on the fly. does it only work within config.g?

                You can use M574 at any time. If you need it to be delayed until all previous moves have completed, you might need to use M400 before it. I'm out if the office so I can't easily check right now.

                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
                • gavatron3000undefined
                  gavatron3000
                  last edited by

                  Here's one of the macro's that I switch the endstops, I'll add M400 hopefully tomorrow when I get a chance and see if that improves things

                  M591 D0 P2 C3 S0 ; deactivate filament sensor
                  M574 B2 S0 ; set B axis max endstop to switched low
                  G91 ; relative moves
                  G1 B30 S1 F3000 ; feed filament to filament sensor
                  G92 B0 ; force B to 0mm
                  G1 B20 F3000 ; feed a bit more to reliably switch sensor and reach tube
                  M400 ; wait till moves finish
                  M574 B2 S3 ; set B axis max endstop to sensorless
                  M581 E0 S0 T2 C0 ; activate trigger 2 on falling edge
                  M582 T2 ; check filament sensor to confirm loading successful
                  G4 P4000 ; trial wait to signify it progress
                  M913 B50 ; reduce motor current to 50% to prevent grinding
                  M915 B S5 F0 ; set stall guard parameters
                  G1 S1 B550 F3600 ; fast feed filament into extruder
                  M591 D0 P2 C3 S1 ; activate filament sensor
                  G92 B0 ; force B to 0mm
                  G90 ; absolute moves

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

                    I've checked, and you do need to use M400 before M574 if you need to guarantee that any regular moves have completed before the M574 takes effect. But endstop configuration doesn't affect regulator moves, and any homing move causes a pipeline stall anyway. So at present I can't think of a case where the M400 would actually be essential.

                    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
                    • gavatron3000undefined
                      gavatron3000
                      last edited by

                      Ok no worries. I assume as soon as the m574 is issued the effect is instant?

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

                        @gavatron3000 said in M574 am i allowed to change endstop type on the fly?:

                        Ok no worries. I assume as soon as the m574 is issued the effect is instant?

                        Yes.

                        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
                        • gavatron3000undefined
                          gavatron3000
                          last edited by

                          thought id report back....

                          so i had my offending B-axis playing up as described by not conforming to the on the fly M574 commands. originally it was connected to the E2 driver on my duex2. i read on the wiki in regards to M591 not being able to be used on these pins so i thought id see if it affected the endstops too. so i changed A and B around so the B axis is now on the E1 driver on the duet main board and it works as intended!

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