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

    Laser turns off after following code is sent after M3

    Scheduled Pinned Locked Moved
    Laser Cutters
    9
    42
    3.6k
    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.
    • dc42undefined
      dc42 administrators @morokolli
      last edited by

      @morokolli said in Laser turns off after following code is sent after M3:

      Reload of sample and config.g.
      config.g.txt
      peukku.nc.txt

      M452 C"exp.heater5" Q200 ; laser uses heater3 pin, PWM frequency 100Hz

      You didn't select sticky laser power. https://duet3d.dozuki.com/Wiki/Gcode#Section_M452_Select_Laser_Printer_Mode

      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
      • morokolliundefined
        morokolli
        last edited by

        Still same thing while using:
        M452 C"exp.heater5" Q200 S1
        Here's video:
        https://www.youtube.com/watch?v=2FMmwe_Vmpk

        1 Reply Last reply Reply Quote 0
        • morokolliundefined
          morokolli
          last edited by

          More debug info:
          If F value in G1 F300 is more than F1015 All lines are done as they should. If i's lower, piece is missing. And if speed is added over F1200, next line starts to suffer. Hopefully picture explains better:
          error_finding.jpg

          1 Reply Last reply Reply Quote 0
          • craigb244undefined
            craigb244
            last edited by

            any update on this? im having the same issue.

            M452 is set to sticky in the config but (quite randomly) it forgets the Gcode "stickiness" and only restores after it hits the next G1 Sxxx

            1 Reply Last reply Reply Quote 0
            • craigb244undefined
              craigb244
              last edited by

              settings in my config file:

              M307 H2 A-1 C-1 D-1       ; Disable Heater output on H2
              M452 P2 I1 S1 R255 F200         ; Enable Laser mode, on output 2 (heater 2), with max intensity being 255, and a PWM frequency of 200
              

              example of some gcode that causes issues (a simple square being cut)

              ;
              ; Operation:    2
              ; Type:         Laser Cut
              ; Paths:        1
              ; Passes:       2
              ; Cut rate:     5 mm/s
              ;
              
              
              ; Pass 0
              
              ; Pass 0 Path 0
              G0 X57.57 Y76.11
              ; Pass Z Height 5mm (Offset: 0mm)
              G0 Z5.00
              
              M3
              G1 X7.57 Y76.11 S255.00 F300
              G1 X7.57 Y9.42
              G1 X57.57 Y9.42
              G1 X57.57 Y76.11
              G1 X57.57 Y76.11
              M5
              
              
              ; Pass 1
              
              ; Pass 1 Path 0
              G0 X57.57 Y76.11
              ; Pass Z Height 4.8mm (Offset: 0mm)
              G0 Z4.80
              
              M3
              G1 X7.57 Y76.11 S255.00 F300
              G1 X7.57 Y9.42
              G1 X57.57 Y9.42
              G1 X57.57 Y76.11
              G1 X57.57 Y76.11
              M5          ; Disable Laser/Spindle
              M106 P2 S0 ;turn off laser power
              

              It seems quite random.
              in the above case it did the first two lines of the cut before turning the laser off, restarted on the second pass and completed all 4 lines,

              I ran the code again straight away and it did all four lines of the first pass, and turned off after the 3rd line of the second pass.

              Im running the latest firmware RC4

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

                @craigb244 said in Laser turns off after following code is sent after M3:

                Im running the latest firmware RC4

                The latest full release is 2.04. What RC4 are you using? It's definitely not the latest.

                Z-Bot CoreXY Build | Thingiverse Profile

                craigb244undefined 1 Reply Last reply Reply Quote 1
                • craigb244undefined
                  craigb244 @Phaedrux
                  last edited by

                  @Phaedrux sorry I was half asleep when I wrote that and been playing with a lot of firmwares (on other stuff)

                  I have the lastest firmware downloaded 2weeks ago, so what ever that is... I'll report back later when I'm home .

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

                    I'll test that square file on 2.05RC2 which is ready to go out. But I recommend RRF3 for laser cutters/engarvers because it implements velocity ramping.

                    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
                      last edited by

                      @craigb244 said in Laser turns off after following code is sent after M3:

                      ;
                      ; Operation: 2
                      ; Type: Laser Cut
                      ; Paths: 1
                      ; Passes: 2
                      ; Cut rate: 5 mm/s
                      ;

                      ; Pass 0

                      ; Pass 0 Path 0
                      G0 X57.57 Y76.11
                      ; Pass Z Height 5mm (Offset: 0mm)
                      G0 Z5.00

                      M3
                      G1 X7.57 Y76.11 S255.00 F300
                      G1 X7.57 Y9.42
                      G1 X57.57 Y9.42
                      G1 X57.57 Y76.11
                      G1 X57.57 Y76.11
                      M5

                      ; Pass 1

                      ; Pass 1 Path 0
                      G0 X57.57 Y76.11
                      ; Pass Z Height 4.8mm (Offset: 0mm)
                      G0 Z4.80

                      M3
                      G1 X7.57 Y76.11 S255.00 F300
                      G1 X7.57 Y9.42
                      G1 X57.57 Y9.42
                      G1 X57.57 Y76.11
                      G1 X57.57 Y76.11
                      M5 ; Disable Laser/Spindle
                      M106 P2 S0 ;turn off laser power

                      I just tested that file on 2.05RC2. It runs OK except that it turns the laser off at the start of the 4th side of the 2nd square. I will look into it.

                      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
                        last edited by

                        On further investigation:

                        • You are using both M3/M5 and G1 S parameters, which I wasn't expecting;
                        • If I delete the M3/M5 commands so that it uses just G1 S oarameters, it works correctly
                        • If I delete the G1 S parameters so that it uses just the M3/M5 commands, it fails

                        So G1 S parameters appear to be wrking correctly. but M3/M5 commands are not.

                        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
                          last edited by

                          I found the issue with M3/M5 in laser mode. I am postponing the 2.05RC2 release until I have fixed it.

                          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

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

                            @dc42 thanks for looking into this and glad my info helped find the issue (even more glad it's not something I've done my end!)

                            By the way my firmware is 2.04RC4 (2019-10-19b1)

                            Quick question...
                            You say "You are using both M3/M5 and G1 S parameters, which I wasn't expecting;"

                            Is using M3/M5 not the "correct" way to control the laser?

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

                              @craigb244 said in Laser turns off after following code is sent after M3:

                              You say "You are using both M3/M5 and G1 S parameters, which I wasn't expecting;"
                              Is using M3/M5 not the "correct" way to control the laser?

                              I was expecting user to either use M3/M5 to control the laser, or (preferably) use the G1 S parameter.

                              To fix this, what I plan to do is to make M3 set the default laser power for the start of the next G1 move, but not turn the laser on immediately. Likewise, M5 would set the default laser power to zero for the start of the next G1 move, but not turn the laser off immediately if it is moving. In both cases, an S parameter on that G1 move would override the power set by M3/M5.

                              Does this sound reasonable? It means that the laser will never be on when the machine is not moving. In one way, this is safe because it avoids accidentally burning a hold in the bed. However, it means you could leave the machine in a state in which the laser has been "primed" by M3, so that it turns on (perhaps unexpectedly) when you next do a G1 move.

                              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
                                last edited by dc42

                                I have now made this change and released firmware 2.05RC2. Please note, your original file included M3 commands with no S parameter. This is not correct, because the M3 command requires the S parameter to specify the required laser power. However, as your code includes S parameters on G1 commands, the M3 commands are not needed.

                                I note from https://reprap.org/wiki/G-code#M3:Spindle_On.2C_Clockwise.28CNC_specific.29 that Repetier firmware also does not fire the laser except during G1/G2/G3 commands.

                                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
                                • craigb244undefined
                                  craigb244
                                  last edited by

                                  Thanks,
                                  The code is what came directly out of laserweb 4, I might message them and see how I can change the way the gcode is produced,

                                  I'll update my firmware tonight and let you know how it goes.

                                  Thanks again.

                                  Craig

                                  1 Reply Last reply Reply Quote 0
                                  • morokolliundefined
                                    morokolli
                                    last edited by

                                    Hi,
                                    Updated to 3.0RC1, similar errors.
                                    In my earlier example (peukku.nc) error have moved to another location (bottom line).
                                    And while lasering star last line fails.
                                    Gcode used for star:

                                    ;Project taehti
                                    ; *** START begin ***
                                    G90
                                    G21
                                    M84 S0
                                    G92 X0 Y0 Z0
                                    ;No. 1: Engraving 1
                                    M3
                                    G00 X15.2204 Y25.2874 F1200
                                    G01 X10.3421 Y17.0845 F1200 S255
                                    G01 X1.3756 Y19.1117 S255
                                    G01 X7.3967 Y12.1317 S255
                                    G01 X2.4490 Y3.8119 S255
                                    G01 X11.2939 Y7.6139 S255
                                    G01 X17.5111 Y0.4065 S255
                                    G01 X16.6361 Y9.9102 S255
                                    G01 X25.4043 Y13.6792 S255
                                    G01 X16.0954 Y15.7838 S255
                                    G01 X15.2204 Y25.2874 S255 ; this line fails to laser. 
                                    M5
                                    G00 X0.0000 Y0.0000
                                    M05
                                    
                                    
                                    dc42undefined 1 Reply Last reply Reply Quote 0
                                    • dc42undefined
                                      dc42 administrators @morokolli
                                      last edited by

                                      Did you try 2.05 ?

                                      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

                                      morokolliundefined 1 Reply Last reply Reply Quote 0
                                      • morokolliundefined
                                        morokolli
                                        last edited by

                                        No, update fails:
                                        94188db9-d0e2-4d82-8377-f24c9faf92df-image.png

                                        T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
                                        • T3P3Tonyundefined
                                          T3P3Tony administrators @morokolli
                                          last edited by

                                          @morokolli see this thread about downgrading: https://forum.duet3d.com/topic/13401/cant-change-from-v3-0-to-v2-05-missing-file/9

                                          www.duet3d.com

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

                                            @dc42 I'll rather stay at V3 codebase.
                                            Reverting back to 2.05 requires re-setting too many things (endstops, laser control, etc..)

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