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

    Saftey Door Switches for BIG printers

    Scheduled Pinned Locked Moved Unsolved
    General Discussion
    6
    26
    1.4k
    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.
    • CR3Dundefined
      CR3D
      last edited by

      I'm back ... but I have a few important issues to solve ...

      I am currently building a large 3D printer with large motors (NEMA23) an DUET3 with RRF 3.1.1

      Since I am obliged to comply with the "Maschinenrichtlinie" when selling printers in Germany, I have to come up with something how I can secure access to the danger area of ​​the printer ...

      I have installed 3 doors on this printer (I can also connect them in series), at the moment I only queried the switches with M581 and then switched a respective trigger. So far so good ... but so far it has always been possible to simply leave the printer door open before starting and then start it, since the switch only reacts to a rising and a falling edge.

      ; Open Door Switch
      M581 T0 C"1.io3.in"  S0 C0		;trigger #2 (calls trigger2.g)
      

      What I would need now would be the following:

      when you start the printer, you should immediately check the status of the doors.
      Homing should only be possible when all doors are closed, as is the start of a print job.
      It would be conceivable to let the printer move anyway, but only with reduced speed when the door is open.

      During printing, if someone opens the door, they could pause or carry out an emergency stop, it already works. Alternatively, it would also be conceivable to reduce the speed of the print ... that would also be permissible according to the standard.

      So for me the most important thing would be to query the sensor ...

      I already have a few approaches, but I wanted to ask if someone had a better idea.

      I thought I would create another axis e.g. "V" which use the door switches (connected in series) as an end stop. So it would be conceivable that a pressure start would only be possible after "homing" the door switch.

      Or with the IF conditions ... but I haven't dealt with this yet ...

      I hope someone can help me ... would be really great! πŸ™‚

      Thank you in Advance
      Christian (CR-3D)

      1 Reply Last reply Reply Quote 0
      • nhofundefined
        nhof
        last edited by

        Hello Christian,

        The M582 command should do what you need. This code allows you to poll the switches to see if they're in a triggered state already, rather than only activating on an edge.

        CR3Dundefined 1 Reply Last reply Reply Quote 0
        • CR3Dundefined
          CR3D @nhof
          last edited by CR3D

          @nhof

          Yes, I know this command ... I have already used it in RR2, but unfortunately he didn't do that ... 😞

          1 Reply Last reply Reply Quote 0
          • CR3Dundefined
            CR3D
            last edited by

            I plan to do it this way.

            I send the M582 command before homing and in the start script to see the current status.

            I would now like to query the whole thing with the META commands. Say ask if door 1, door 2 and door 3 are closed, do homing or print start, otherwise wait.

            I use the META command to check the homing state:

            if !move.axes[0].homed || !move.axes[1].homed || !move.axes[2].homed || !move.axes[3].homed
              G28
            

            @dc42 But is there a Object Model for the inputs at itself?

            dc42undefined 1 Reply Last reply Reply Quote 0
            • CR3Dundefined
              CR3D
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • CR3Dundefined
                CR3D
                last edited by

                @dc42 can you help me at this point?

                In any case, I have to make sure that the printer cannot be operated with the doors open.

                Do you have an idea how?

                1 Reply Last reply Reply Quote 0
                • jay_s_ukundefined
                  jay_s_uk
                  last edited by

                  Why not use daemon.g and conditional gcode?
                  You could then monitor for when the printer is printing and check the state of some door switches.
                  Then, if they are open rather than closed, or vice versa, the print is paused.

                  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

                  CR3Dundefined 1 Reply Last reply Reply Quote 1
                  • CR3Dundefined
                    CR3D @jay_s_uk
                    last edited by

                    @jay_s_uk said in Saftey Door Switches for BIG printers:

                    Why not use daemon.g and conditional gcode?
                    You could then monitor for when the printer is printing and check the state of some door switches.
                    Then, if they are open rather than closed, or vice versa, the print is paused.

                    Yes, I would like to do that ... so far I have queried the doors with M581, but this only evaluated the rising flank.

                    How could I solve that? do you have a concrete solution?

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

                      M582 would should run the trigger again if the state is still triggered.

                      But I suspect the suggestion was to use the object model, don't have the specific node to use, but if noone comes up with it I'll have some time to poke it tomorrow

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

                        or we could go down the "teach a man to fish" road?

                        M409 F"v" K"sensors"
                        and
                        https://forum.duet3d.com/topic/14878/conditional-gcode-expressions?_=1593546611563

                        where you find it under sensors will depend on how the sensor is defined, endstop or gpIn maybe?

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

                          @CR3D said in Saftey Door Switches for BIG printers:

                          @dc42 But is there a Object Model for the inputs at itself?

                          Yes, in RRF 3.1 they can be found in sensors.gpIn[x] where x is the GpIn number you assigned in M950 (the J parameter).

                          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

                          FS-TOOLSundefined 1 Reply Last reply Reply Quote 0
                          • CR3Dundefined
                            CR3D
                            last edited by

                            Solved!

                            I created the switches like following in the config.g:

                            ; Custom Safety Settings 
                            
                            ; Open Door Switch
                            
                            M950 J0 C"!1.io0.in" 
                            M950 J1 C"!1.io1.in"
                            M950 J2 C"!1.io2.in"
                            
                            ; Emergency Stop
                            M950 J3 C"!1.io3.in"
                            

                            And at the homeall.g I used the conditional commands:

                            ; homeall.g
                            ; called to home all axes
                            
                            if sensors.gpIn[0].value==1 & sensors.gpIn[1].value==1 & sensors.gpIn[2].value==1 & sensors.gpIn[3].value==1  ;If the Doors are closed and the emergency stop is released -> Homing
                            
                            
                            	M106 P0 S0		; Part cooling Fan off 
                            	G91                    ; relative positioning
                            
                            	G1 H2 Z10 F6000         ; lift Z relative to current position
                            	G1 H1 X-650 Y550 U650 F5000 ; first pass XYU
                            	G1 H2 X5 Y-5 U-5 F6000     ; go back a few mm
                            	G1 H1 X-20 Y20 U20 F360  ; second pass XY
                            
                            
                            	G90                   ; absolute positioning
                            	G1 X270 Y170 U460 F20000    ; first bed probe point -> move X to the middle of the Bed, U outside and home Z
                            
                            	G30
                            

                            Now if the doors are open or the emergency stop is active the printer will not move πŸ˜‰

                            Thank you for your help!

                            Regards Christian (CR-3D)

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

                              are you still having a trigger to react to the doors being opend mid-print, or is that wired together with the e-stop?

                              CR3Dundefined 1 Reply Last reply Reply Quote 0
                              • CR3Dundefined
                                CR3D @A Former User
                                last edited by

                                @bearer

                                In RRF2.05 I made this with M581 to call Trigger 0:

                                I planned like this:

                                ; Open Door Switch
                                
                                M950 J0 C"!1.io0.in" 
                                M950 J1 C"!1.io1.in"
                                M950 J2 C"!1.io2.in"
                                
                                M581 P"!1.io0.in" T0 C0
                                M581 P"!1.io1.in" T0 C0
                                M581 P"!1.io2.in" T0 C0
                                
                                
                                ; Emergency Stop
                                
                                M950 J3 C"!1.io3.in"
                                M581 P"!1.io3.in" T0 C0
                                
                                1 Reply Last reply Reply Quote 0
                                • A Former User?
                                  A Former User
                                  last edited by

                                  gotcha, was wondering if you went with the slow down option and if so how you approached it - and if the time delay between the trigger and the speed reduction was acceptable with feed rate override f.ex.

                                  CR3Dundefined 1 Reply Last reply Reply Quote 0
                                  • CR3Dundefined
                                    CR3D @A Former User
                                    last edited by

                                    @bearer

                                    before I have not found a way to listen to the protected ...

                                    how do I then implement it?

                                    Right now I'm opposing to stop everything. The reduction of the protected would be the best solution!

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

                                      I'm not sure how you'd go about it but I supect you'd set a M581 trigger for one flank to say trigger1.g that include

                                      ;trigger1.g - called when doors open
                                      M220 S20 
                                      ;cancel T1 
                                      M581 P"nil" T1 C0
                                      ;and arm T2
                                      M581 P"1.io0.in" T2 C0
                                      M581 P"1.io1.in" T2 C0
                                      M581 P"1.io2.in" T2 C0
                                      

                                      and in trigger2.g you set it back to 100 and change the trigger back to the original

                                      ;trigger2.g - called when doors close
                                      M220 S100 
                                      ;cancel T2 
                                      M581 P"nil" T2 C0
                                      ;and arm T1
                                      M581 P"!1.io0.in" T1 C0
                                      M581 P"!1.io1.in" T1 C0
                                      M581 P"!1.io2.in" T1 C0
                                      

                                      or something to that effect that causes the trigger to change function so it can respond differently to opening and closing.

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

                                      I suppose you could refactor it to use only trigger1.g and use conditional logic to check if the sensors.GpIn[n] is high or low as well.

                                      CR3Dundefined 1 Reply Last reply Reply Quote 0
                                      • CR3Dundefined
                                        CR3D @A Former User
                                        last edited by

                                        @bearer

                                        Ok this sounds good! πŸ™‚ Thank you

                                        But this will work for a running Print or always?
                                        For example if the printer is homed, someone opens the door and moves the axes manually. Will this also be slowed down?

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

                                          hmm, docs doesn't specify so I'd presume its valid for all moves, but it'll probably be some amount of time between the switch triggering and command getting applied to the moves in the queue.

                                          if you test it and find M220 to not do the trick, you could also look into changing the actual speed limit with M203.

                                          1 Reply Last reply Reply Quote 0
                                          • CR3Dundefined
                                            CR3D
                                            last edited by CR3D

                                            Hi all...

                                            I tested the example from @bearer and it works for the first step...

                                            There are still a few small things:

                                            1). I get an error message when I call trigger2.g and trigger3.g! Shown here in the picture

                                            90b109fe-a588-4bc5-a54e-86937eb6c277-image.png

                                            Here the code:

                                            ; trigger2.g
                                            ;called wenn door was closed and gets opend
                                            
                                            M220 S20 
                                            ;cancel T2 
                                            M581 P"nil" T2 
                                            ;and arm T3
                                            M581 P1 S0 T3 R0
                                            M581 P2 S0 T3 R0
                                            M581 P3 S0 T3 R0
                                            
                                            ;trigger3.g - called when doors close
                                            
                                            M220 S100 
                                            ;cancel T3 
                                            M581 P"nil" T3 
                                            ;and arm T1
                                            M581 P1 S1 T2 R0
                                            M581 P2 S1 T2 R0
                                            M581 P3 S1 T2 R0
                                            

                                            it seems to have something to do with the "nile". Why does this error appear?

                                            as I said but it currently works when I open the door the speed decreases and when I close the door it increases again

                                            2). can you improve the response time? That he does this immediately and not only when the buffer is empty? similar to the emergency stop?

                                            Thank you! πŸ™‚

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