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

    Trying to figure out what is giving the Bad Command error

    Scheduled Pinned Locked Moved
    Duet Web Control
    5
    40
    2.2k
    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.
    • Phaedruxundefined
      Phaedrux Moderator
      last edited by

      Can you upload the file itself so we could check it in a text editor?

      Another thing you can try is to send each command copy and pasted from the file in the gcode console and see if any give an error.

      M572 S0.000000

      Maybe try fewer zeroes?

      Z-Bot CoreXY Build | Thingiverse Profile

      Dragonundefined 1 Reply Last reply Reply Quote 0
      • Dragonundefined
        Dragon
        last edited by

        Here:

        30min Benchy.gcode

        It doesn't seem to cause any problems other than driving me nuts not knowing what's causing it.

        Phaedruxundefined 1 Reply Last reply Reply Quote 0
        • Dragonundefined
          Dragon
          last edited by

          Bed file:

          ; bed.g
          ; called to perform automatic bed compensation via G32
          ;
          ; generated by RepRapFirmware Configuration Tool v2.1.8 on Tue May 26 2020 00:51:15 GMT-0700 (Pacific Daylight Time)
          ;M561 ; clear any bed transform
          G30 X20 Y20
          G29 S1 ; probe the bed and enable compensation

          ; bed.g file for RepRapFirmware, generated by Escher3D calculator
          ; 16 points, 6 factors, probing radius: 115, probe offset (-42, -12)
          ;M98 Pdeployprobe.g
          ;G30 P0 X0.00 Y115.00 Z-99999 H0
          ;G30 P1 X57.50 Y99.59 Z-99999 H0
          ;G30 P2 X99.59 Y57.50 Z-99999 H0
          ;G30 P3 X115.00 Y0.00 Z-99999 H0
          ;G30 P4 X99.59 Y-57.50 Z-99999 H0
          ;G30 P5 X57.50 Y-99.59 Z-99999 H0
          ;G30 P6 X0.00 Y-98.87 Z-99999 H0
          ;G30 P7 X-44.23 Y-76.60 Z-99999 H0
          ;G30 P8 X-72.61 Y-41.92 Z-99999 H0
          ;G30 P9 X-83.99 Y-0.00 Z-99999 H0
          ;G30 P10 X-77.01 Y44.46 Z-99999 H0
          ;G30 P11 X-49.88 Y86.40 Z-99999 H0
          ;G30 P12 X0.00 Y53.39 Z-99999 H0
          ;G30 P13 X49.80 Y-28.75 Z-99999 H0
          ;G30 P14 X-28.51 Y-16.46 Z-99999 H0
          ;G30 P15 X0 Y0 Z-99999 S6
          ;M98 Pretractprobe.g

          Again this only happens with files from Cura files from Prusa Slicer don't give the error.

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

            @Phaedrux said in Trying to figure out what is giving the Bad Command error:

            Can you upload the file itself so we could check it in a text editor?

            Another thing you can try is to send each command copy and pasted from the file in the gcode console and see if any give an error.

            M572 S0.000000

            Maybe try fewer zeroes?

            I have tried commenting that line out and it did not fix the error.

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

              Upload the homeall. and bed.g as well.

              Z-Bot CoreXY Build | Thingiverse Profile

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

                M104 S215 T0 ; start preheating hotend

                I don't think M104 takes a T parameter, but I don't think it would complain about it...

                Z-Bot CoreXY Build | Thingiverse Profile

                Phaedruxundefined 1 Reply Last reply Reply Quote 0
                • Dragonundefined
                  Dragon
                  last edited by

                  Bed is above here is home:

                  ; homeall.g
                  ; called to home all axes
                  ;
                  ; generated by RepRapFirmware Configuration Tool v2.1.8 on Tue May 26 2020 00:51:15 GMT-0700 (Pacific Daylight Time)
                  G91 ; relative positioning
                  G1 H2 Z5 F6000 ; lift Z relative to current position
                  G1 H1 X-240 Y-240 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
                  G1 H2 X5 Y5 F6000 ; go back a few mm
                  G1 H1 X-240 Y-240 F360 ; move slowly to X and Y axis endstops once more (second pass)
                  G90 ; absolute positioning
                  G1 X117 Y117 F6000 ; go to first bed probe point and home Z
                  G30 ; home Z by probing the bed
                  G29 S1

                  ; Uncomment the following lines to lift Z after probing
                  ;G91 ; relative positioning
                  ;G1 Z5 F100 ; lift Z relative to current position
                  ;G90 ; absolute positioning

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

                    I meant the actual file so we can check for bogus characters.

                    Z-Bot CoreXY Build | Thingiverse Profile

                    1 Reply Last reply Reply Quote 0
                    • Dragonundefined
                      Dragon
                      last edited by

                      OK,
                      But as I said it only gives an error with files from Cura.

                      bed.g
                      homeall.g

                      Thanks for your help!

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

                        @Phaedrux said in Trying to figure out what is giving the Bad Command error:

                        M104 S215 T0 ; start preheating hotend

                        I don't think M104 takes a T parameter, but I don't think it would complain about it...

                        Were you able to test this one?

                        Z-Bot CoreXY Build | Thingiverse Profile

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

                          Do you get the Bad Command error just once, or multiple times during the print? If it's multiple times then we probably need to see the whole file.

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

                            @Dragon said in Trying to figure out what is giving the Bad Command error:

                            Here:

                            30min Benchy.gcode

                            It doesn't seem to cause any problems other than driving me nuts not knowing what's causing it.

                            @dc42 There's the whole file.

                            Z-Bot CoreXY Build | Thingiverse Profile

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

                              aea32488-8705-43a5-ba4f-1c4848d417fe-image.png

                              HxD revealed that yout GCode file has some non-printing characters in it at the start of what appears to be a blank line when viewed in a standard text editor. It's the line after "M109 S205 T0 ; heat to Cura Hotend". Possibly this was in your slicer start script?

                              PS - there are some more earlier in the file, the EF BB BF sequence. Neither of them is a valid UTF-8 character sequence.

                              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

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

                                Are you using the Cura plugin to upload the gcode file directly to the printer or are you uploading via the DWC?

                                What version of DWC are you using?

                                Z-Bot CoreXY Build | Thingiverse Profile

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

                                  @dc42

                                  OK, Thanks! I believe that was it. It would only pop up once when starting but didn't affect the print.

                                  Thanks everyone for the help!

                                  Cheers. 😊

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