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

    G-code Viewer G2/G3 arc preview

    Scheduled Pinned Locked Moved
    Duet Web Control
    4
    10
    496
    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.
    • MikeSundefined
      MikeS
      last edited by MikeS

      Hi all,
      i'm facing some issues in previewing own made g-code for a cnc foam cutting machine i'm making.

      Machine is made of 4 axis named X,Y,U,V. X is right X carriage, Y is right Y carriage, U is X left carriage and V is left Y carriage. Between the carriage there is a hotwire that i use for cutting foam.

      I've written a small Autocad macro for outputting custom G-Code from a closed polyline to allow machine control. Since now i've used https://ncviewer.com/ for checking the output g-code and bugfixing the macro.
      Now i've tried uploading a sample code to DWC and preview it. The result is different from what i would have expected and from what the ncviewer is showing. Anyone could replicate it? i'm doing something wrong? X Y U V and I,J values seems to be correct checking them against cad drawing.

      PS: i didn't run the code on the machine so i still don't now if this is only related to the preview or to the duet motion too.

      I attach here the result and the gcode:

      Gcode:

      G0 Y7.67669351816836 V7.67669351816836
      G1 X10.460086722869 Y7.67669351816836 U10.460086722869 V7.67669351816836
      G2 X111.312729233058 Y56.8157257089499 U111.312729233058 V56.8157257089499 I83.5083390409037 J-43.3278104191889
      G2 X103.316129299667 Y28.9066637370007 U103.316129299667 V28.9066637370007 I19.773679663431 J-20.7657599308204
      G1 X104.906216011594 Y47.7466616126872 U104.906216011594 V47.7466616126872
      G1 X66.0782304671486 Y39.7601877983511 U66.0782304671486 V39.7601877983511
      G1 X78.6102154332631 Y24.0166143731538 U78.6102154332631 V24.0166143731538
      G1 X101.406493263683 Y11.6125868744677 U101.406493263683 V11.6125868744677
      G1 X57.365517020264 Y7.55742399224854 U57.365517020264 V7.55742399224854
      G1 X49.3689168105043 Y22.2275719838839 U49.3689168105043 V22.2275719838839
      G1 X25.0210598390317 Y9.22719695550413 U25.0210598390317 V9.22719695550413
      G1 X10.460086722869 Y7.67669351816836 U10.460086722869 V7.67669351816836
      G1 X0 U0
      G0 Y0 V0
      

      NCViewer preview:
      NC preview.png

      DWC Preview:
      DWC Preview.png

      MJLewundefined 1 Reply Last reply Reply Quote 0
      • MJLewundefined
        MJLew @MikeS
        last edited by

        @MikeS I can confirm that the code generates the first shape in NC Viewer (although I default to mm instead of inches and so mine looked smaller than yours).

        There are not enough lines of code to generate the second shape, so you must have lost a couple at some stage.

        MikeSundefined 1 Reply Last reply Reply Quote 0
        • MikeSundefined
          MikeS @MJLew
          last edited by MikeS

          @MJLew thank you for the feedback. The second image is the same gcode as posted previewed in dwc. I saw the same behaviour with other tests when g2 and g3 are used. The arcs does not always start from the correct point and linear movement are shown.
          I tried launching "print" without motors connected and the extruder in the simulation seems to follow the correct path altought it is difficult to reliably say it because arc are not previewed. However these added lines are not followed for sure so i really think that it is the viewer that is not showing the correct path or my codes are somewhat correctly iterpreted by duet firmware and ncviewer but not from the preview.

          Sindariusundefined droftartsundefined 2 Replies Last reply Reply Quote 0
          • Sindariusundefined
            Sindarius @MikeS
            last edited by

            @MikeS I'll need to take a deeper look into what is going on with the viewer but it is upset with the U and V params. If you remove them the rendered matches NCViewer.

            905a1ddd-e7de-4072-9591-a0fa425029e3-image.png

            MikeSundefined 2 Replies Last reply Reply Quote 0
            • MikeSundefined
              MikeS @Sindarius
              last edited by

              @Sindarius nice! When i get back from work i'll try to export some gcodes without the u and v axes. I'll get back with the results.

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

                @MikeS Can you post what firmware version, DWC version and Duet hardware you are using? Send M115 from the console and post the response. For DWC, look on the Settings > General tab.

                I would expect that the Gcode would be interpreted correctly by the firmware, and this is a viewer bug. @Sindarius is on it!

                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

                MikeSundefined 1 Reply Last reply Reply Quote 0
                • MikeSundefined
                  MikeS @droftarts
                  last edited by

                  @droftarts

                  M115
                  FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 3.4.6 ELECTRONICS: Duet WiFi 1.02 or later FIRMWARE_DATE: 2023-07-21 14:08:28
                  
                  Duet Web Control 3.4.6
                  
                  1 Reply Last reply Reply Quote 1
                  • MikeSundefined
                    MikeS @Sindarius
                    last edited by

                    @Sindarius said in G-code Viewer G2/G3 arc preview:

                    @MikeS I'll need to take a deeper look into what is going on with the viewer but it is upset with the U and V params. If you remove them the rendered matches NCViewer.

                    905a1ddd-e7de-4072-9591-a0fa425029e3-image.png

                    I can confirm that code without U and V axis is previewing fine. I attach a more elaborated g-code with more arcs that works well with only X and Y but causes a lot of problems for the preview if U and V are present. I hope this can help you troubleshoot the problem and test a future fix. Unfortunately arcs are not so common on current slicers.

                    X and Y only
                    Sofia 2Axis.g
                    Sofia 2Axis.png

                    X,Y,U and V
                    Sofia 4Axis.g
                    Sofia 4Axis.png

                    Sindariusundefined 1 Reply Last reply Reply Quote 0
                    • Sindariusundefined
                      Sindarius @MikeS
                      last edited by

                      @MikeS the problem is that the current code in the viewer for arcs is not properly tokenizing out the U and V axes so it is ending up with a bad value. I’ll get a fix in place to make sure the extra axes get tokenized properly.

                      MikeSundefined 1 Reply Last reply Reply Quote 0
                      • MikeSundefined
                        MikeS @Sindarius
                        last edited by

                        @Sindarius any news on that? In the meantime i moved my script to inkscape that has advanced scripting functionality and i can convert all the curves to lines so I don't have issues.

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