The project is an XY plotter.
Hardware:
Arduino Mega
SD Reader
Arduino Uno
CNC Shield
2x Steppers
Servo
(In this case, the software doesn't really seem to be the issue. Explained later)
Software:
G-Code sender from Mega to Uno running GRBL:
The Problem:
A G-Code file can be sent from my computer to the plotter via Universal G-Code Sender without issue. The same file fails when saved to an SD card and sent by the Arduino Mega. On almost all of the G2/G3 commands I receive error: Invalid gcode ID:33.
As a way to test this I have sent the code line by line directly into the Uno running GRBL from a serial monitor and from putty, both resulted in the same error. When I enter the code line by line in UGS, the plotter happily executes each line.
Any idea why a G-Code command can be sent to GRBL using UGS but can't be sent directly over these other serial communications?
if (value_words & bit(WORD_R)) { // Arc Radius Mode
bit_false(value_words,bit(WORD_R));
if (isequal_position_vector(gc_state.position, gc_block.values.xyz)) { FAIL(STATUS_GCODE_INVALID_TARGET); } // [Invalid target]
It looks like Error 33 means it can't calculate a unique center of the required circle given the current position and the target position are the same and an infinite number of circles pass through that point with the specified radius.