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

    ChatGPT Gcode Generator

    Scheduled Pinned Locked Moved
    General Discussion
    6
    8
    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.
    • Adamfilipundefined
      Adamfilip
      last edited by

      Havent actually tested it but i asked ChatGPT

      "Can you write Gcode for a 3d printer with a 0.6nozzle size that printing 0.3mm layers. on a bed thats 250mm x 250mm. to print a retraction tower test that is 50mm tall where every 5mm the retraction amount increases by 0.1mm. starting from 0mm retraction to 1mm retraction"

      its response is

      "Sure, here's an example G-code script for a 3D printer with a 0.6mm nozzle size printing 0.3mm layers on a 250mm x 250mm bed, with a retraction tower test that is 50mm tall, where every 5mm the retraction amount increases by 0.1mm, starting from 0mm retraction to 1mm retraction:"

      ; Retraction Tower Test
      ; Nozzle size: 0.6mm
      ; Layer height: 0.3mm
      ; Bed size: 250mm x 250mm
      
      G28 ; Home all axes
      G1 Z15.0 F9000 ; Move the platform down 15mm
      G92 E0 ; Reset extruder position
      G1 F140 E30 ; Extrude 30mm of filament to prime the nozzle
      G92 E0 ; Reset extruder position
      
      ; Start printing the tower
      G1 X0 Y0 Z0.3 F9000 ; Move to start position and set Z height
      G1 F360 E20 ; Extrude 20mm of filament
      
      ; Loop for tower height
      for (int i=0; i<=50; i+=5) {
        G1 Z0.3 F360 ; Move to next layer
        G1 E-0.1*(i/5) F1800 ; Retract 0.1mm per layer, up to 1mm
        G1 E0.1*(i/5) ; Un-retract
        G92 E0 ; Reset extruder position
      }
      
      G28 X0 Y0 ; Home X and Y axis
      
      o_lampeundefined T3P3Tonyundefined zaptaundefined 3 Replies Last reply Reply Quote 0
      • o_lampeundefined
        o_lampe @Adamfilip
        last edited by

        @Adamfilip
        pretty useless macro... don't try to run it.
        It's wrong in so many places, it would be easier to write a new one.

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

          @Adamfilip I think @Phaedrux was playing with this as well. The issue is it does not have a concept of correctly using our meta gcode, and randomly throws in C? code.

          www.duet3d.com

          Adamfilipundefined 1 Reply Last reply Reply Quote 1
          • Adamfilipundefined
            Adamfilip @T3P3Tony
            last edited by

            @T3P3Tony yeah it seems sweet at first glance but then has some big errors. but still impressive and will likely improve to be useful

            1 Reply Last reply Reply Quote 0
            • sebkritikelundefined
              sebkritikel
              last edited by sebkritikel

              Tangentially related, but this weekend I figured I’d try giving it a few prompts for a Python post-processing script - all of which I could have written myself. I had two goals main goals:

              1. Create a combined retraction/unretraction and z-hop move (rather than a retraction followed by a z-hop, or a z-hop followed by an unretraction)

              2. Remove extraneous Z movement during layer changes - https://github.com/Ultimaker/Cura/issues/7320#issuecomment-603871603

              Goal 1 worked immediately, goal 2 took some massaging on how to pass my intent along. ChatGPT seriously stumbled with layer change comments between the two G0 commands of interest, with the code it generated never quite working right. I ended up correcting a set of code it generated, using the assumption that there is always 2 lines of comments between the G0 commands of interest. I sent it back to ChatGPT, and it was able to adapt that to a more generic implementation (if I recall correctly).

              Might be interesting to share some transcripts, overall was pretty fascinating.

              jcwebber93 created this issue in Ultimaker/Cura

              closed [4.5.0] Layer height Z-move change applied after "Z-Hop When Retracted" move #7320

              Large(ish?) IDEX - 6HC, 1HCL
              Stratasys Dimension 1200es to 6HC Conversion

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

                Yes I played around with it for a bit. It definitely has potential and with some more specific training would be pretty useful potentially. Imagine a helper bot that could take your existing RRF2 config set and help you convert it to RRF3. Or asking it to create an automated task using conditional gcode. Even as it is, I thought it was useful to get a starting point on how to approach something even if it wasn't 100% correct.

                I've used it with some other languages that it is better trained in and it's quite interesting going back and forth with it to improve and iterate on a solution.

                Z-Bot CoreXY Build | Thingiverse Profile

                o_lampeundefined 1 Reply Last reply Reply Quote 1
                • o_lampeundefined
                  o_lampe @Phaedrux
                  last edited by

                  @Phaedrux It's all about asking the exact right question, I guess. A bot doesn't have any intuition or asks back when it's uncertain about the answer.

                  One day, we only have to ask google: "what's wrong with my 3D printer?", and some sparepart-links pop up.

                  1 Reply Last reply Reply Quote 0
                  • zaptaundefined
                    zapta @Adamfilip
                    last edited by

                    I asked ChatGPT how to roast chestnuts and it gave me very nice looking instructions but didn't mention that I need to score the chestnuts with a knife so they don't explode.

                    At this point ChatGPT and the likes are amazing, but are still toys. I wouldn't trust them as source of information.

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