Error code help

That’s what I’ve come to realize. I’ve been using chatGPT to help me as well. It gave me a line of code to try in my post. I’ll try that this morning.

if (isCircle) {
// Get the center and radius from the circle definition
centerX = circleCenter.x;
centerY = circleCenter.y;
radius = circleRadius;

// Calculate the start and end points for half circles
startX = centerX + radius; // Starting at the rightmost point
startY = centerY;

endX = centerX + radius; // Ending back at the starting point
endY = centerY; // Y remains the same

// Output the first half-circle
output("G03 X" + centerX + " Y" + centerY + " I-" + radius + " J0");

// Output the second half-circle
output("G03 X" + startX + " Y" + startY + " I" + radius + " J0");

}

1 Like

Give it a try. I suspect the output will be wrong, but it may get you past the “No Axis Words” error.

I also suspect the line output here will give you the Circle Endpoint error.
I’m curious why it starts at the rightmost point on the circle. What if the circle doesn’t start there?
Or is this just for cutting full circles that aren’t connected to other moves?
Also curious about calculating endX & endY, but not using it??

I would modify to

if (isCircle) {
// Get the center and radius from the circle definition
centerX = circleCenter.x;
centerY = circleCenter.y;
radius = circleRadius;

// Calculate the start and end points for half circles
startX = centerX + radius; // Starting at the rightmost point
startY = centerY;

endX = centerX - radius; // Cutting to the leftmost point
endY = centerY; // Y remains the same

// Output the first half-circle
output("G03 X" + endX + " Y" + endY + " I-" + radius + " J0");

// Output the second half-circle
output("G03 X" + startX + " Y" + startY + " I" + radius + " J0");

}

So the code that Chat GPT suggested didn’t work. It’s too complicated for my post. Eventually it suggested this
EX_CIRCLE:
: G17 CIRCLEDIRECTION X* Y* Z* I* J* F*
and now esprit outputted this g-code

%
(SHAPEOKO.ASC 23/05/21)

( ******** PART PROGRAM ********* )

N0066 G53G0Z-5.00
T66 M06
G00 G90 X0 Y0 S18000 M03
Z5.0
G01 Z-5.0 F90.0
G01 X15.0 F1000.0
G03 X15.0 Y0 Z-5.0 I-15.0 J0 F1000.0
G01 X0 F1000.0
G01 Z5.0 F90.0
G28 M05
G90 M30
%
Which is pretty much what you said was the problem. Again, I’ll have to wait until I’m home to actually try it on the Machine. I think I’m finally in the right direction.

So all my test have worked. I just need to make a more complex program and see if it can handle that.
Thanks again for your help.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.