Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    Solved Pause job immediately when lid opened

    Laser Cutters
    6
    23
    423
    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.
    • paulg4h
      paulg4h last edited by

      How to set a switch to pause a job immediately when the lid is opened and resume it when close

      I add in config.g

      M950 J0 C"!^e0stop"                              ; Input 0 uses e0Stop pin, inverted, pullup enabled (LidSensor)
      M581 P0 T2 S1 R1                                 ; invoke trigger 2 when an inactive-to-active edge is detected on input 0, while processing
      M581 P0 T3 S0 R1                                 ; invoke trigger 3 when an active-to-inactive edge is detected on input 0, while processing
      

      Then add the trigger2.g and trigger3.g which pause and resume the job

      There are two issues with that

      • the current move finishes first
      • on resume the laser was not switched on until the next gcode move with S are send

      Many thank's in advance!

      o_lampe 1 Reply Last reply Reply Quote 0
      • o_lampe
        o_lampe @paulg4h last edited by o_lampe

        @paulg4h
        In such a dangerous case, I wouldn't rely on triggers, since it can take a while to be processed.
        I would hardwire the laser enable or even the power input with the lid switch (a relais for high current switching)
        Using it as trigger too is a bonus to pause the machine. But that would require RRF to push the current PWM status of the laser. See M120 & M121 for more.

        //edit seems you have to define a global variable with the current PWM value and restore it in resume.g

        1 Reply Last reply Reply Quote 0
        • o_lampe
          o_lampe last edited by

          I bet, it's the same for a spindle drive?
          It would be nice to have a push/pop command that reacts different according to the machine setup (FFF, laser, CNC)
          @droftarts Is that worth adding it to the firmware whishlist?

          paulg4h 1 Reply Last reply Reply Quote 0
          • paulg4h
            paulg4h @o_lampe last edited by paulg4h

            @o_lampe M120 and M121 to restore the Laser power, but when I move the head away on pause and return it on resume the laser switches on before the head reaches the last position.

            here are my files, pause.g

            M120
            G1 X0 Y220 F6000 ; go to X=0 Y=220
            

            resume.g

            G1 R1 X0 Y0          ; go back to the last print move
            M121
            
            cosmowave dc42 2 Replies Last reply Reply Quote 0
            • cosmowave
              cosmowave @paulg4h last edited by

              @paulg4h eventually helps to put an M400 between the G1 and M121 command

              G1 R1 X0 Y0          ; go back to the last print move
              M400                 ;Wait for current moves to finish
              M121
              

              Mankati FSXT+, DeltaTowerV2, CBot3D

              paulg4h 1 Reply Last reply Reply Quote 0
              • paulg4h
                paulg4h @cosmowave last edited by

                @cosmowave I tried the M400 but it do not work

                What worked was to add S0 to the G1 command like:

                G1 R1 X Y S0
                

                then the move back was done without laser...

                paulg4h 1 Reply Last reply Reply Quote 0
                • paulg4h
                  paulg4h @paulg4h last edited by paulg4h

                  When I send a M120 on pause.g the ressurrect.g will be created, but the current move will be done before it pauses.

                  Why it do not stop immediately?

                  How the power loss feature could work if the job could not be paused anytime?

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

                    @paulg4h said in Pause job immediately when lid opened:

                    Why it do not stop immediately?
                    How the power loss feature could work if the job could not be paused anytime?

                    It finishes the current move and then stops and sets the resume point to where it stopped which we now know is the next move in the queue. If it stopped immediately you wouldn't know where exactly it stopped.

                    Z-Bot CoreXY Build | Thingiverse Profile

                    o_lampe 1 Reply Last reply Reply Quote 0
                    • o_lampe
                      o_lampe @Phaedrux last edited by

                      @phaedrux
                      It's right to finish a move for pause/ressurect, but you don't want the Laser to be ON, while the lid is open.

                      @paulg4h the best way to avoid any issues would be to lock the lid (with a solenoid?) and open it with a push button. The button triggers a macro, which controls the laser and parking position, before it unlocks the lid.

                      paulg4h 1 Reply Last reply Reply Quote 0
                      • paulg4h
                        paulg4h @o_lampe last edited by paulg4h

                        @o_lampe this "issue" that the current move will be finished before pause is also very bad on a CNC...

                        So I do not understand how the power outage feature for 3D printer could work, because with this small UPS the board have will never source enough power to complete even there the whole last move.

                        All other firmware's do support this and if RRF don't do that it will be time to fill this gap!

                        o_lampe 1 Reply Last reply Reply Quote 0
                        • o_lampe
                          o_lampe @paulg4h last edited by

                          @paulg4h
                          Agreed.
                          On a CNC it would be fatal to switch off the spindle before the move has finished. On a laser cutter or engraver you would only leave the last track uncut. That's why I said we'd need different push/pop behaviour depending on the machine setup.

                          The lid open scenario is again different from a power outage.
                          Why is 'everyone' so obsessed about power outage? Is it common, where you live?
                          Simply add a LiPo battery pack in parallel to the PSU outlet. (decoupled by dual schottky diodes)
                          It's like a UPS, but also works if the PSU fails.

                          paulg4h 1 Reply Last reply Reply Quote 0
                          • paulg4h
                            paulg4h @o_lampe last edited by

                            @o_lampe the power outtage feature is some sort of feature all brands do have.

                            I think 99% of the feature is needed for mistakes user made, but it saves the current object!

                            On the laser the lid switch can easily disconnect the wire between board and laser PSU and switch off the laser immediately but then you can drop your current work sheet!

                            So this "immediately pause feature" will be useful for all kinds of machine types, printers, cnc and also laser!

                            o_lampe 1 Reply Last reply Reply Quote 0
                            • o_lampe
                              o_lampe @paulg4h last edited by o_lampe

                              @paulg4h said in Pause job immediately when lid opened:

                              So this "immediately pause feature" will be useful for all kinds of machine types, printers, cnc and also laser!

                              I haven't seen a 'resurrect.g' file lately, but IIRC it only remembers the current line number of the gcode file or the coords of the last move.
                              To pause immediately, it would have to stop mid-track and calculate the current position and remaining track.
                              Then write resurrect.g including the new track info. Not impossible, but that's actually 'slicing'. A whole new discipline for RRF.

                              What if it repeats the line of code it tried to finish? (current line number -1)
                              A laser or spindle would cut the same path twice, so what?

                              jay_s_uk 1 Reply Last reply Reply Quote 0
                              • jay_s_uk
                                jay_s_uk @o_lampe last edited by

                                @o_lampe said in Pause job immediately when lid opened:

                                A laser or spindle would cut the same path twice, so what?

                                That would be an issue if engraving with a laser as it may increase the darkness in one area.
                                Wouldn't be an issue for a through cut

                                Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                                o_lampe 1 Reply Last reply Reply Quote 0
                                • o_lampe
                                  o_lampe @jay_s_uk last edited by

                                  @jay_s_uk
                                  Good point if we talk about 'real art'. But engraving often means barcodes, serial numbers and such.

                                  I've done some plywood engraving and the wood grain had a significant influence on the darkness.
                                  I wouldn't mind having another 'miscolored' small track, when I can finish the project instead.

                                  jay_s_uk paulg4h 2 Replies Last reply Reply Quote 0
                                  • jay_s_uk
                                    jay_s_uk @o_lampe last edited by

                                    @o_lampe true.
                                    just depends if its something for you or something you're selling on I suppose

                                    Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                                    1 Reply Last reply Reply Quote 0
                                    • paulg4h
                                      paulg4h @o_lampe last edited by

                                      @o_lampe not even with a laser this is useful, also on a CNC when you see there is something in front of the current path and need to pause the move now or remove the mains (emergency stop) and lost the work piece.

                                      As jay also mentioned in engraving this would an big issue too if you use a not so cheap worksheet and a picture and not a barcode.

                                      Also with my printer I would like this feature, when there is something i like to remove before the head reaches it. My Ender 5 Plus do have long moves where I need to wait until this move is done and hope he do not pick it up before.

                                      Last but not least the power outage on all three types would need such a feature. And yes most of the power issues are made by the user but we are talking to make RRF more perfect and comparable with others.

                                      o_lampe 1 Reply Last reply Reply Quote 0
                                      • o_lampe
                                        o_lampe @paulg4h last edited by o_lampe

                                        @paulg4h
                                        I see your point, but not how it could be done?! Maybe the SBC is powerful enough to 'always keep track of the momentary position'.
                                        That would make pause immediately easier.
                                        Especially on curved moves (G2+G3) or 'vase-mode' prints it gets tricky. Closed loop motion system with index would help. Not sure if closed loop steppers offer a readout of their position or if it's all internal?

                                        paulg4h 1 Reply Last reply Reply Quote 0
                                        • paulg4h
                                          paulg4h @o_lampe last edited by

                                          @o_lampe @dc42

                                          when the RRF Firmware knows where the tool are currently and the last line of GCode which it was processing, the resume should be easily possible on a CNC or Laser.

                                          Even on a printer the remaining distance and resulting extrusion should be predictable.

                                          So I still do not understand how a power outage / resume feature can work without this.

                                          o_lampe 1 Reply Last reply Reply Quote 0
                                          • o_lampe
                                            o_lampe @paulg4h last edited by

                                            @paulg4h said in Pause job immediately when lid opened:

                                            when the RRF Firmware knows where the tool are currently

                                            It doesn't know! Except the tool arrived at the endpoint of a track, but not in between.

                                            paulg4h 1 Reply Last reply Reply Quote 0
                                            • paulg4h
                                              paulg4h @o_lampe last edited by

                                              @o_lampe RRF knows the start and target point with the path and speed it moves so it should not be rocket science to calculate the position where it is at any time.

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

                                                @paulg4h said in Pause job immediately when lid opened:

                                                M120 and M121 to restore the Laser power, but when I move the head away on pause and return it on resume the laser switches on before the head reaches the last position.

                                                You can avoid the laser turning on if you use G0 moves in pause.g and resume.g, not G1 moves.

                                                You can get a faster response to the pause by using firmware 3.3 and enabling segmentation. See the S and T parameters of the M669 command.

                                                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

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

                                                  @dc42 many thank's!

                                                  I add this line in my config.g

                                                  ; Set Cartesian type and segment interval one second and length 3mm
                                                  M669 K0 S1 T3
                                                  

                                                  In the middle of a 200mm straight cut the pause will be done within the second and move set with M669

                                                  So this works and I will add this line to my CNC too, btw. I do not see any slowness in normal cut and engrave jobs too.

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