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

    Help with Gcode needed

    Scheduled Pinned Locked Moved
    General Discussion
    3
    15
    511
    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 @mattyd
      last edited by dc42

      @mattyd I'm not a CNC expert, however the GCode in your post looks OK to me for RRF to execute provided that you have commanded RRF to execute in CNC mode. To do this, send command M453 (see https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m453-select-cnc-device-mode). You can do this in your config.g file.

      The GCode you need to plot a 50x50mm square depends on where you set the bed origin. If you set it so that X0 Y0 is at one corner of the bed, and all reachable X and Y coordinates are positive, and the bed size is at least 100x100mm, then the following should work after you have homed the axes.

      G0 X25 Y25        ; move to X25 Y25 at maximum speed
      G1 X75 F3000      ; move to X75 Y25 at 3000mm/min
      G1 Y75            ; move to X75 Y75
      G1 X25            ; move to X25 Y75
      G1 Y25            ; move to X25 U25
      

      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

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

        @dc42 said in Help with Gcode needed:

        however the GCode in your post looks OK

        thank you for your help! I'm going to look at this today

        I did try that Gcode for the square and it through up a load of errors again. So I'm hoping the issue is with "RRF/CNC mode"

        2023-08-18 09_42_50-WorkBee.png

        mattydundefined dc42undefined 2 Replies Last reply Reply Quote 0
        • mattydundefined
          mattyd @mattyd
          last edited by

          Just found this - Im guessing the "M453" is in the incorrect place and needs to be moved to "configuration files"

          2023-08-18 10_07_38-WorkBee.png

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

            @mattyd said in Help with Gcode needed:

            @dc42 said in Help with Gcode needed:

            however the GCode in your post looks OK

            thank you for your help! I'm going to look at this today

            I did try that Gcode for the square and it through up a load of errors again. So I'm hoping the issue is with "RRF/CNC mode"

            2023-08-18 09_42_50-WorkBee.png

            That's very odd, it's as if you inserted a newline after each character.

            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

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

              @dc42 said in Help with Gcode needed:

              That's very odd, it's as if you inserted a newline after each character.

              I'm debating resetting and reinstalling the software. is there a process to reset everything and starting a fresh?

              droftartsundefined 1 Reply Last reply Reply Quote 0
              • droftartsundefined
                droftarts administrators @mattyd
                last edited by

                @mattyd said in Help with Gcode needed:

                I'm debating resetting and reinstalling the software. is there a process to reset everything and starting a fresh?

                I doubt doing that will help. Please post the gcode file you posted above as a file, not as text. I suspect there are invisible characters between each character in the file.

                Also, please post the output from M115, so we know what firmware version you are using.

                Ian

                Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

                mattydundefined 1 Reply Last reply Reply Quote 0
                • mattydundefined
                  mattyd @droftarts
                  last edited by

                  @droftarts said in Help with Gcode needed:

                  M115

                  FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 3.3 ELECTRONICS: Duet Ethernet 1.02 or later FIRMWARE_DATE: 2021-06-15 21:45:03<LF>ok<LF>

                  the Qcode is copied directly from @dc42 code above

                  G0 X25 Y25        ; move to X25 Y25 at maximum speed
                  G1 X75 F3000      ; move to X75 Y25 at 3000mm/min
                  G1 Y75            ; move to X75 Y75
                  G1 X25            ; move to X25 Y75
                  G1 Y25            ; move to X25 U25
                  

                  Im pretty sure it's good because I can load the code into the G-Code Viewer and it shows up just fine (I can't upload the actual file as its an unsported format ".nc" )

                  2023-08-18 14_08_04-WorkBee.png

                  Here is the full error, and thank you for your help!

                  M32 "0:/gcodes/Square from forum.nc"
                  File 0:/gcodes/Square from forum.nc selected for printing
                  Error: Bad command: ��G
                  Error: Bad command: 0
                  Error: Bad command: X
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Error: Bad command: Y
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Error: Bad command: m
                  Error: Bad command: o
                  Error: Bad command: v
                  Error: Bad command: e
                  No tool is selected
                  Error: Bad command: o
                  Error: Bad command: X
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Error: Bad command: Y
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Error: Bad command: a
                  No tool is selected
                  Error: Bad command: m
                  Error: Bad command: a
                  Error: Bad command: x
                  Error: Bad command: i
                  Error: Bad command: m
                  Error: Bad command: u
                  Error: Bad command: m
                  Error: Bad command: s
                  Error: Bad command: p
                  Error: Bad command: e
                  Error: Bad command: e
                  Error: Bad command: d
                  Error: Bad command: G
                  Error: Bad command: 1
                  Error: Bad command: X
                  Error: Bad command: 7
                  Error: Bad command: 5
                  Error: Bad command: F
                  Error: Bad command: 3
                  Error: Bad command: 0
                  Error: Bad command: 0
                  Error: Bad command: 0
                  Error: Bad command: m
                  Error: Bad command: o
                  Error: Bad command: v
                  Error: Bad command: e
                  No tool is selected
                  Error: Bad command: o
                  Error: Bad command: X
                  Error: Bad command: 7
                  Error: Bad command: 5
                  Error: Bad command: Y
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Error: Bad command: a
                  No tool is selected
                  Error: Bad command: 3
                  Error: Bad command: 0
                  Error: Bad command: 0
                  Error: Bad command: 0
                  Error: Bad command: m
                  Error: Bad command: m
                  Error: Bad command: /
                  Error: Bad command: m
                  Error: Bad command: i
                  Error: Bad command: G
                  Error: Bad command: 1
                  Error: Bad command: Y
                  Error: Bad command: 7
                  Error: Bad command: 5
                  Error: Bad command: m
                  Error: Bad command: o
                  Error: Bad command: v
                  Error: Bad command: e
                  No tool is selected
                  Error: Bad command: o
                  Error: Bad command: X
                  Error: Bad command: 7
                  Error: Bad command: 5
                  Error: Bad command: Y
                  Error: Bad command: 7
                  Error: Bad command: 5
                  Error: Bad command: G
                  Error: Bad command: 1
                  Error: Bad command: X
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Error: Bad command: m
                  Error: Bad command: o
                  Error: Bad command: v
                  Error: Bad command: e
                  No tool is selected
                  Error: Bad command: o
                  Error: Bad command: X
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Error: Bad command: Y
                  Error: Bad command: 7
                  Error: Bad command: 5
                  Error: Bad command: G
                  Error: Bad command: 1
                  Error: Bad command: Y
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Error: Bad command: m
                  Error: Bad command: o
                  Error: Bad command: v
                  Error: Bad command: e
                  No tool is selected
                  Error: Bad command: o
                  Error: Bad command: X
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Error: Bad command: U
                  Error: Bad command: 2
                  Error: Bad command: 5
                  Finished printing file 0:/gcodes/Square from forum.nc, print time was 0h 0m
                  
                  dc42undefined 1 Reply Last reply Reply Quote 0
                  • dc42undefined
                    dc42 administrators @mattyd
                    last edited by

                    @mattyd how did you enter the GCode, and how are you sending it to the Duet or otherwise getting the Duet to execute 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

                    mattydundefined 1 Reply Last reply Reply Quote 1
                    • mattydundefined
                      mattyd @dc42
                      last edited by

                      @dc42 said in Help with Gcode needed:

                      @mattyd how did you enter the GCode, and how are you sending it to the Duet or otherwise getting the Duet to execute it?

                      Via the dashboard (which is a workbee version/skin) I go to Jobs/Upload G-Code and execute it.

                      Duet2.jpg

                      Once I hit "yes" I get this error

                      2023-08-19 09_32_59-.png

                      Followed by the error I posted that's copied from the Consol.

                      the actual file that Im uploading and using is this one

                      https://we.tl/t-5PxO8VPyPI

                      mattydundefined 1 Reply Last reply Reply Quote 0
                      • mattydundefined
                        mattyd @mattyd
                        last edited by

                        @dc42 A Little update that I think is encouraging.

                        I copied your code (the one that you supplied) into the "send" tab at the top, and hit "Send"

                        the error I got back is written at the bottom - this looks encouraging

                        Untitled-2.jpg

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

                          @mattyd it looks to me that either you have very large tool offsets, or you are running in a workplace coordinate system with a large offset. As your initial tool position is (-50,-50) you could try this:

                          G1 X-50 Y0 F3000
                          G1 X0 Y0
                          G1 X0 Y-50
                          G1 X-50 Y-50
                          

                          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

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

                            @dc42 said in Help with Gcode needed:

                            G1 X-50 Y0 F3000
                            G1 X0 Y0
                            G1 X0 Y-50
                            G1 X-50 Y-50

                            That worked! omg!

                            So with this in mind what was I missing originally, have I missed a step in correctly setting this up?

                            mattydundefined 1 Reply Last reply Reply Quote 0
                            • mattydundefined
                              mattyd @mattyd
                              last edited by

                              @dc42
                              Hi again! I was wondering if you could help with something else....In you Gcode you gave me for the simple square to get it to work you had to change everything to negative/minus figures.

                              whats the best way to flip my Cnc work area to work with positive numbers? Logically this makes more sense I think, esp when dealing with other peoples files

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

                                @mattyd it sounds to me that you might have the wrong movement directions or the wrong endstop configuration. I suggest you do the following:

                                1. Decide where you want X0 Y0 to be. Popular choices are the front left corner of the bed, or the centre of the bed.
                                2. Decide which direction you want to be positive X and which direction should be positive Y. Usually positive X is to the right and positive Y is away from you. Other directions are possible but be sure to choose a right hand coordinate system.
                                3. Adjust the motor directions in config.g to get positive X and Y movements in the desired direction.
                                4. Establish whether your endstop switches are high end (at axis maximum) or low end (at axis minimum) and configure the endstops accordingly in the M574 commands in config.g.

                                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 1
                                • First post
                                  Last post
                                Unless otherwise noted, all forum content is licensed under CC-BY-SA