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

    Obey hard limit switches?

    Scheduled Pinned Locked Moved Unsolved
    CNC
    9
    31
    1.7k
    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.
    • Gerrardundefined
      Gerrard @fcwilt
      last edited by Gerrard

      @fcwilt

      I don't wan't to E-stop on a travel limit for a few reasons - Keeping in mind this is a CNC application:

      • Z up travel limit can easily be trivial - i.e. user has defined a tool lift of 20mm between moves, which works fine on some jobs, but others (different Z=0 height) it might be too much - and I would need to adjust my programming to compensate - whereas if the Z limit switch just stopped FURTHER travel it would continue the program without error. Soft limits (work boundary) already has this effect.

      • E-stop causes the home (G10) position to be lost.

      What I expect is either:

      • Replicate the effect of the soft limits - i.e. continue with program, no further movement in that axis until coordinates come back within limits. (This also has negative effects, but it's a lesser impact).
      • Pause program completely (stop in place - do not use pause.g) wait for operator input

      Ignoring the endstop (current practice) is the worst possible action.

      1 Reply Last reply Reply Quote 0
      • fcwiltundefined
        fcwilt
        last edited by

        Hi,

        Thanks for the feedback. I think I understand.

        A couple of thoughts.

        • End stop inputs don't do anything special unless they are configured to do so.

        • Inputs can be configured to run specific chunks of code called triggers. Have you investigated them?

        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

        Gerrardundefined 1 Reply Last reply Reply Quote 0
        • Gerrardundefined
          Gerrard @fcwilt
          last edited by

          @fcwilt

          Thanks for the reply.

          • How can I configure end stops to do what I want? What are my options for configuring?
          • I haven't looked into triggers, but I will.
          fcwiltundefined 1 Reply Last reply Reply Quote 0
          • fcwiltundefined
            fcwilt @Gerrard
            last edited by

            @Gerrard

            Regards triggers: You use M581 to configures triggers.

            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
            • Phaedruxundefined
              Phaedrux Moderator
              last edited by

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

              Because RRF is configured on the fly you can define a piece of hardware at the time of usage. So in your homing files you can define the endstops as endstops, and then your G1 H1 moves will trigger the endstop and set the axis position limits. Then you can configure the endstops as triggers at the start of the job. The trigger could be an e stop, or it could execute whatever gcode you want to put in the trigger file. You could pause the job, for instance.

              Z-Bot CoreXY Build | Thingiverse Profile

              1 Reply Last reply Reply Quote 0
              • Gerrardundefined
                Gerrard
                last edited by

                OK, thanks for that, I think we're getting somewhere... If I'm reading this right, there are 32 available triggers on the Duet3, the event that occurs is defined in a gcode file - triggerX.g (X for trigger number) and it's called by the T parameter of M581.

                So that takes care of the triggers during jobs, but what about other Macros or manual movement (jogging etc)? Is there an overriding default behaviour? Should it be defined as a trigger in config.g, then configured as an endstop for the homing operations and a trigger again after homing?

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

                  @Gerrard said in Obey hard limit switches?:

                  So that takes care of the triggers during jobs, but what about other Macros or manual movement (jogging etc)? Is there an overriding default behaviour? Should it be defined as a trigger in config.g, then configured as an endstop for the homing operations and a trigger again after homing?

                  Since it's configure on the fly, the last configuration will stand, so it's probably best to have the endstops defined in config.g as you normally would. Then in your homing files define them again as endstops for homing, since you don't know exactly what state might be in place before homing. Then if you want it defined as triggers before a job, you can use the macro file start.g which gets run before a job starts.

                  Z-Bot CoreXY Build | Thingiverse Profile

                  maxspongebobundefined 1 Reply Last reply Reply Quote 0
                  • psychotik2k3undefined
                    psychotik2k3
                    last edited by psychotik2k3

                    personnally here is what i do and i use G54 and G55

                    I have an end stop to the max Z height, i use it to home Z
                    i also have a simple probe
                    i use it with G31 so when the prob is done i have the z position of the tip of my endmill from the spoil board.

                    after that what i do is a G0 Z67 F400 H3 (z67 is my maximum z height)
                    so the z carriage will go up trigger the zstop and replace the actual z value as z limit

                    and about the G54 G55, what i do is i always configure my origine point as teh bottom left down point of either my stock or my object in fusion 360

                    then on my cnc i go in X and Y to what i want to be the 0,0 position (d'ont care about the Z as i allways know my hieght from the spoil board) then i do
                    G10 L20 P2 X0 Y0
                    G54
                    go to my tool change position perform the tool change it's a manual one) then do the z probe as explained earlier
                    do a G55 and go to 0,0
                    and start the milling operations

                    the only thing i have to do is to reset the z limit height at 67 at the end and do a zhome and a G54.

                    1 Reply Last reply Reply Quote 0
                    • psychotik2k3undefined
                      psychotik2k3
                      last edited by

                      i knwo there is a lot oof redundancy with G54 G55 then G54 without doing anything but my code is generated by a post processor.

                      G90
                      G21
                      M84 S0
                      M451
                      ;Switching to G54 workspace
                      G54
                      M291  P"using current X and Y coordinates as X0 and Y0 for G55 workspace" R"XY origins" S3 X1 Y1 Z1
                      G54
                      ;Saving machine coordinates to slot 0, use G0 R0 X0 Y0 to return
                      G60 S0
                      ;using current X and Y coordinates as X0 and Y0 for G55 workspace
                      G10 L20 P2 X0 Y0
                      ;Switching to G55 workspace
                      G55
                      G54
                      G28 Z10
                      G0 Z67 F400
                      G0 X550 Y30 F10000
                      M291  P"Tool 24 D=2 CR=0 " R"Tool change" S3 X1 Y1 Z1
                      ; COMMAND_TOOL_MEASURE
                      M291  P"Attach ZProbe" R"Probe" S3
                      ;Switching to G54 workspace
                      G54
                      ;Z probe at current position
                      G30
                      ;Switching to G55 workspace
                      G55
                      G0 Z67 F400 H3
                      M400
                      M291  P"Detach ZProbe" R"Probe" S3
                      ;Returning to S0 position
                      G0 R0 X0 Y0 F10000
                      M114
                      ;Switching to G55 workspace
                      ; *** START end ***
                      
                      
                      1 Reply Last reply Reply Quote 0
                      • maxspongebobundefined
                        maxspongebob @Phaedrux
                        last edited by

                        @Phaedrux
                        For the life of me I can't understand why end-stops would be ignored EVER.

                        On a 3D printer reaching an endstop simply means that maybe some steps were skipped and you get a bad print. Not a big problem. On a CNC subtractive machine when you reach an endstop things break. Heaven forbid that you have a carbide tool running an 24000 RPM and it goes past an endstop. When that happens stuff goes flying at projectile speeds. Someone is going to get seriously hurt.

                        Honestly, telling a customer that they need to write their own macros to make end-stops function the way that every other CNC motion controller works already is not right. I think you should REALLY think about limiting your liability and include the capability to use hardware end-stops ALL THE TIME. As your product is applied more and more in the CNC realm your solution needs to keep up.

                        1 Reply Last reply Reply Quote 0
                        • kazolarundefined
                          kazolar
                          last edited by kazolar

                          @maxspongebob I made a small tweak to the firmware to add a support for my own M113 command -- I tested it and using a trigger option when an endstop is triggered, the command runs and the duet stops immediately and reboots -- exactly how mach3 handles this condition. Yes I don't understand why there is no such similar behavior in duet by default, and I totally don't understand why have have hard limit switches if the machine is allowed to blow past them, CNC or 3D printer, but my solution is 4 lines of code in the firmware and a few lines in gcode scripts.
                          To be honest -- I thought this was baked in by default. I was sorta confused when I started doing my mill cnc conversion using duet 3 to find that there is no way to even do it. There is actually no way. If you setup a eStop trigger you have to reset or powercycle the board, no good. My custom M113 does exactly what eStop button in the webui / panel due does-- stop the world (immediately) and reboot. Works perfectly

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

                            @maxspongebob I'm not saying this is how it should be, I'm simply explaining how it is currently. Having the option to obey endstops at all times when in CNC mode may be possible and is a valid firmware request. I'll raise that.

                            You can also make a thread in the firmware wishlist forum explaining how and why you think it should work if you want.

                            Z-Bot CoreXY Build | Thingiverse Profile

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

                              @Gerrard said in Obey hard limit switches?:

                              So that takes care of the triggers during jobs, but what about other Macros or manual movement (jogging etc)? Is there an overriding default behaviour? Should it be defined as a trigger in config.g, then configured as an endstop for the homing operations and a trigger again after homing?

                              You can configure a trigger to be active only when running a job from SD card.

                              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
                              • dc42undefined
                                dc42 administrators @kazolar
                                last edited by

                                @kazolar said in Obey hard limit switches?:

                                There is actually no way. If you setup a eStop trigger you have to reset or powercycle the board, no good. My custom M113 does exactly what eStop button in the webui / panel due does-- stop the world (immediately) and reboot.

                                Would it be better if emergency stop (M112) rebooted the board automatically?

                                The disadvantage i can see with doing that is that if the board is being fed GCodes via USB or from an attached SBC, it may start executing commands again immediately. I think that's why M122 was defined originally to require a manual reset. Similar how a proper Emergency Stop switch has be reset before you can run the machine again.

                                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

                                maxspongebobundefined 1 Reply Last reply Reply Quote 1
                                • maxspongebobundefined
                                  maxspongebob
                                  last edited by

                                  In my travels I have come across M564. Would a M564 H1 S1 at the start of my print, or just after the first layer keep the motion within the end-stops?

                                  1 Reply Last reply Reply Quote 0
                                  • A Former User?
                                    A Former User
                                    last edited by

                                    No, but if you set your maximum travel range the firmware will stay within that regardless of end stops. So if your motion system is dimensioned to not skip steps you'll be fine.

                                    Otherwise add the macro to pause or e-stop if end stops are tripped.

                                    maxspongebobundefined 1 Reply Last reply Reply Quote 0
                                    • maxspongebobundefined
                                      maxspongebob @dc42
                                      last edited by

                                      @dc42 In answer you your question, I believe that a E-Stop signal should just stop all motion. It should not reboot the board as that would clear any of the events or activity that caused the problem and hamper investigation of the cause. On a CNC machine the E-Stop should also turn off the power to the servo's and spindle. That is unless they are equipped with a braking mechanism and in that case the brake should be applied first then power off.

                                      The point is SAFETY. E-Stop is what you press if a problem exists that is going to cause damage to you or the machine. The stop or feed hold button is what you press if you think there may be a problem.

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

                                        @maxspongebob said in Obey hard limit switches?:

                                        @dc42 In answer you your question, I believe that a E-Stop signal should just stop all motion. It should not reboot the board as that would clear any of the events or activity that caused the problem and hamper investigation of the cause. On a CNC machine the E-Stop should also turn off the power to the servo's and spindle. That is unless they are equipped with a braking mechanism and in that case the brake should be applied first then power off.

                                        Thanks. I guess we'll need a separate mechanism to reset the E-stop without resetting the board, possibly M999 S0 or else a new M-code.

                                        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
                                        • maxspongebobundefined
                                          maxspongebob @A Former User
                                          last edited by

                                          @bearer So lets say that a print is dislodged from the bed and gets wedged such that the steppers skip some steps. Then every time the head travels to the opposite side it will bash up against whatever is in the way beyond the end-stop until the job is complete.

                                          Doesn't sound like a good plan to me.

                                          Why not just pay attention to the end-stop signal and stop if it is tripped?

                                          1 Reply Last reply Reply Quote 0
                                          • A Former User?
                                            A Former User
                                            last edited by

                                            Is that a fault of the board or the printer? The board allows you compensate for that by using the macro to pay attention to the end stops and take whatever action you desire, just like it allows you to not configure end stops at all if thats your cup of tea.

                                            The better plan would be to use stall guard to detect the lost steps if you want to get pedantic.

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