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

Pause job immediately when lid opened

Scheduled Pinned Locked Moved Solved
Laser Cutters
6
23
998
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.
  • undefined
    paulg4h
    last edited by 4 Jun 2021, 11:31

    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!

    undefined 1 Reply Last reply 4 Jun 2021, 12:38 Reply Quote 0
    • undefined
      o_lampe @paulg4h
      last edited by o_lampe 6 Apr 2021, 12:45 4 Jun 2021, 12:38

      @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
      • undefined
        o_lampe
        last edited by 4 Jun 2021, 12:49

        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?

        undefined 1 Reply Last reply 4 Jun 2021, 13:20 Reply Quote 0
        • undefined
          paulg4h @o_lampe
          last edited by paulg4h 6 Apr 2021, 13:21 4 Jun 2021, 13:20

          @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
          undefined undefined 2 Replies Last reply 4 Jun 2021, 13:41 Reply Quote 0
          • undefined
            cosmowave @paulg4h
            last edited by 4 Jun 2021, 13:41

            @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, E3D MS/TC

            undefined 1 Reply Last reply 4 Jun 2021, 13:49 Reply Quote 0
            • undefined
              paulg4h @cosmowave
              last edited by 4 Jun 2021, 13:49

              @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...

              undefined 1 Reply Last reply 4 Jun 2021, 14:00 Reply Quote 0
              • undefined
                paulg4h @paulg4h
                last edited by paulg4h 6 Apr 2021, 15:01 4 Jun 2021, 14:00

                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?

                undefined 1 Reply Last reply 4 Jun 2021, 20:09 Reply Quote 0
                • undefined
                  Phaedrux Moderator @paulg4h
                  last edited by Phaedrux 6 Apr 2021, 20:10 4 Jun 2021, 20:09

                  @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

                  undefined 1 Reply Last reply 5 Jun 2021, 07:58 Reply Quote 0
                  • undefined
                    o_lampe @Phaedrux
                    last edited by 5 Jun 2021, 07:58

                    @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.

                    undefined 1 Reply Last reply 7 Jun 2021, 06:51 Reply Quote 0
                    • undefined
                      paulg4h @o_lampe
                      last edited by paulg4h 6 Jul 2021, 06:52 7 Jun 2021, 06:51

                      @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!

                      undefined 1 Reply Last reply 7 Jun 2021, 07:08 Reply Quote 0
                      • undefined
                        o_lampe @paulg4h
                        last edited by 7 Jun 2021, 07:08

                        @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.

                        undefined 1 Reply Last reply 7 Jun 2021, 07:27 Reply Quote 0
                        • undefined
                          paulg4h @o_lampe
                          last edited by 7 Jun 2021, 07:27

                          @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!

                          undefined 1 Reply Last reply 7 Jun 2021, 08:01 Reply Quote 0
                          • undefined
                            o_lampe @paulg4h
                            last edited by o_lampe 6 Jul 2021, 08:04 7 Jun 2021, 08:01

                            @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_ukundefined 1 Reply Last reply 7 Jun 2021, 08:11 Reply Quote 0
                            • jay_s_ukundefined
                              jay_s_uk @o_lampe
                              last edited by 7 Jun 2021, 08:11

                              @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

                              undefined 1 Reply Last reply 7 Jun 2021, 08:21 Reply Quote 0
                              • undefined
                                o_lampe @jay_s_uk
                                last edited by 7 Jun 2021, 08:21

                                @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_ukundefined undefined 2 Replies Last reply 7 Jun 2021, 08:22 Reply Quote 0
                                • jay_s_ukundefined
                                  jay_s_uk @o_lampe
                                  last edited by 7 Jun 2021, 08:22

                                  @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
                                  • undefined
                                    paulg4h @o_lampe
                                    last edited by 8 Jun 2021, 11:53

                                    @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.

                                    undefined 1 Reply Last reply 9 Jun 2021, 06:05 Reply Quote 0
                                    • undefined
                                      o_lampe @paulg4h
                                      last edited by o_lampe 6 Sept 2021, 06:06 9 Jun 2021, 06:05

                                      @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?

                                      undefined 1 Reply Last reply 10 Jun 2021, 05:42 Reply Quote 0
                                      • undefined
                                        paulg4h @o_lampe
                                        last edited by 10 Jun 2021, 05:42

                                        @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.

                                        undefined 1 Reply Last reply 10 Jun 2021, 05:48 Reply Quote 0
                                        • undefined
                                          o_lampe @paulg4h
                                          last edited by 10 Jun 2021, 05:48

                                          @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.

                                          undefined 1 Reply Last reply 10 Jun 2021, 12:38 Reply Quote 0
                                          1 out of 23
                                          • First post
                                            1/23
                                            Last post
                                          Unless otherwise noted, all forum content is licensed under CC-BY-SA