ChatGPT Gcode Generator
-
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
-
@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. -
@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.
-
@T3P3Tony yeah it seems sweet at first glance but then has some big errors. but still impressive and will likely improve to be useful
-
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:
-
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)
-
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.
-
-
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.
-
@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.
-
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.