Hi there!
I’m trying to make chatgpt write simple gcode for plots for me. I’m sorry for a LONG wall of nonsense, but I find this possibility quite fascinating. I’m going to try to make it draw SVGs, perhaps that works better.
T:
Can you make a gcode for a Smiley Face to use on a pen plotter? The smiley should be 15x15cm. The z depth is 5mm and clearance is 0.5mm.
ChatGPT
Certainly, here’s a G-code program for a smiley face that you can use on your pen plotter:
cssCopy code
G90 ; set absolute positioning mode
G21 ; set units to millimeters
G1 Z0.5 ; move to clearance height
G0 X75 Y75 ; move to the center of the smiley face
G1 Z-5 F200 ; lower the pen to the drawing surface
G2 X60 Y75 I-15 J0 F200 ; draw the left eye
G2 X90 Y75 I15 J0 ; draw the right eye
G2 X75 Y90 I0 J15 ; draw the mouth
G1 Z0.5 ; lift the pen to the clearance height
Here’s what each line of the program does:
-
G90
: sets absolute positioning mode, so that all subsequent coordinates are interpreted as absolute positions from the origin. -
G21
: sets the units to millimeters. -
G1 Z0.5
: moves the pen to a clearance height of 0.5mm. -
G0 X75 Y75
: moves the pen to the center of the smiley face, which is located at (75,75). -
G1 Z-5 F200
: lowers the pen to a depth of 5mm at a feed rate of 200mm/min. -
G2 X60 Y75 I-15 J0 F200
: draws the left eye of the smiley face using a clockwise arc with a radius of 15mm centered at (60,75), at a feed rate of 200mm/min. -
G2 X90 Y75 I15 J0
: draws the right eye of the smiley face using a clockwise arc with a radius of 15mm centered at (90,75). -
G2 X75 Y90 I0 J15
: draws the mouth of the smiley face using a clockwise arc with a radius of 15mm centered at (75,90). -
G1 Z0.5
: lifts the pen back to the clearance height.
Note that the I
and J
parameters in the G2
commands specify the center point of the arc, relative to the starting position of the pen. So for example, in the G2 X60 Y75 I-15 J0
command, the center of the left eye is at (60-15,75), which is 15mm to the left of the starting position of the pen.
can you please redo the code without I and J axises? The code is not complete, how can I help you to get a useable output?
ChatGPT
Sure, here’s the updated G-code program without the I
and J
parameters:
cssCopy code
G90 ; set absolute positioning mode
G21 ; set units to millimeters
G1 Z0.5 ; move to clearance height
G0 X75 Y75 ; move to the center of the smiley face
G1 Z-5 F200 ; lower the pen to the drawing surface
G1 X60 Y75 ; draw the left eye
G1 X90 Y75 ; draw the right eye
G1 X75 Y90 ; draw the mouth
G1 Z0.5 ; lift the pen to the clearance height
This code uses the G1
command for linear movement to draw the smiley face. The X
and Y
parameters specify the absolute positions of the pen in millimeters.
You can copy and paste this code into a text editor, save it with a .gcode
extension, and then load it onto your pen plotter software to run it.
If you would like to add any modifications or other details to the smiley face, please let me know and I’ll be happy to assist you.
Thank you so much for trying, but the code is very incomplete. The face needs details. The gcode is only creating a few points
ChatGPT
I apologize for the previous code not meeting your needs. Here is an updated G-code program that should create a more detailed smiley face:
cssCopy code
G90 ; set absolute positioning mode
G21 ; set units to millimeters
G1 Z0.5 ; move to clearance height
G0 X75 Y75 ; move to the center of the smiley face
G1 Z-5 F200 ; lower the pen to the drawing surface
; draw the face outline
G1 X60 Y60
G1 X90 Y60
G1 X90 Y90
G1 X60 Y90
G1 X60 Y60
; draw the left eye
G1 X65 Y70
G1 X70 Y70
G1 X70 Y75
G1 X65 Y75
G1 X65 Y70
; draw the right eye
G1 X85 Y70
G1 X90 Y70
G1 X90 Y75
G1 X85 Y75
G1 X85 Y70
; draw the mouth
G1 X67.5 Y85
G3 X75 Y92.5 I0 J7.5
G3 X82.5 Y85 I7.5 J0
G1 Z0.5 ; lift the pen to the clearance height
This code uses a series of G1
and G3
commands to create the smiley face. The G3
command is used to create a clockwise arc with a specified center point and radius.
In this program, the face outline is drawn first, followed by the left and right eyes, and then the mouth. You can modify the X and Y coordinates of each point to adjust the size and position of the smiley face as needed.
Again, I apologize for any inconvenience caused by the previous code. Please let me know if you have any other questions or concerns.
Thank you, this is better - but the outline is a square, not a circle. Can you redo it as a circle?
ChatGPT
Certainly! Here is the updated code with a circular outline:
cssCopy code
G90 ; set absolute positioning mode
G21 ; set units to millimeters
G1 Z0.5 ; move to clearance height
G0 X75 Y75 ; move to the center of the smiley face
G1 Z-5 F200 ; lower the pen to the drawing surface
; draw the face outline
G1 X75 Y60
G2 X60 Y75 I0 J15
G2 X75 Y90 I15 J0
G2 X90 Y75 I0 J-15
G2 X75 Y60 I-15 J0
; draw the left eye
G1 X65 Y70
G1 X70 Y70
G1 X70 Y75
G1 X65 Y75
G1 X65 Y70
; draw the right eye
G1 X85 Y70
G1 X90 Y70
G1 X90 Y75
G1 X85 Y75
G1 X85 Y70
; draw the mouth
G1 X67.5 Y85
G3 X75 Y92.5 I0 J7.5
G3 X82.5 Y85 I7.5 J0
G1 Z0.5 ; lift the pen to the clearance height
This code uses the G2
command to create circular arcs with a specified center point and radius. The I
and J
parameters in the G2
commands specify the distance from the current position to the center point of the arc.
In this program, the face outline is drawn with four G2
commands to create a circular shape. The rest of the code is the same as the previous version.
I hope this updated code meets your needs. Please let me know if you have any further questions or modifications.