Can unsupported GCode lead to position error?

I am having emergency stop trouble, caused by Position errors, caused by Encoder read failures. I noticed in the log file that these errors occur right after Unsupported GCode command:

[MSG:INFO: FluidNC v0.74 (Maslow-Main-dddcbc15-dirty)]
[MSG:INFO: Compiled with ESP32 SDK:v4.4.4]
[MSG:INFO: Local filesystem type is littlefs]
[MSG:INFO: Configuration file:maslow.yaml]
[MSG:INFO: Machine Maslow S3 Board]
[MSG:INFO: Board Maslow]
[MSG:INFO: UART1 Tx:gpio.1 Rx:gpio.2 RTS:NO_PIN Baud:115200]
[MSG:INFO: SPI SCK:gpio.12 MOSI:gpio.11 MISO:gpio.13]
[MSG:INFO: SD Card cs_pin:gpio.10 detect:NO_PIN freq:8000000]
[MSG:INFO: Stepping:Timed Pulse:4us Dsbl Delay:0us Dir Delay:0us Idle Delay:240ms]
[MSG:INFO: Axis count 3]
[MSG:INFO: Axis X (-2438.400,0.000)]
[MSG:INFO:   Motor0]
[MSG:INFO: Config messages ran]
[MSG:INFO: Axis Y (-1219.200,0.000)]
[MSG:INFO:   Motor0]
[MSG:INFO: Axis Z (-100.000,0.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     tmc_2209 UART1 Addr:0 Step:gpio.15 Dir:gpio.16 Disable:NO_PIN R:0.110]
[MSG:INFO:   Motor1]
[MSG:INFO:     tmc_2209 UART1 Addr:1 Step:gpio.46 Dir:gpio.38 Disable:NO_PIN R:0.110]
[MSG:INFO: Z Axis driver test passed]
[MSG:INFO: Z2 Axis driver test passed]
[MSG:INFO: Kinematic system: Cartesian]
[MSG:INFO: Using spindle NoSpindle]
[MSG:INFO: STA SSID is not set]
[MSG:INFO: AP SSID maslow IP 192.168.0.1 mask 255.255.255.0 channel 1]
[MSG:INFO: AP started]
[MSG:INFO: WiFi on]
[MSG:INFO: Captive Portal Started]
[MSG:INFO: HTTP started on port 80]
[MSG:INFO: Telnet started on port 23]
[GC:G0 G54 G17 G21 G90 G94 M5 M9 T0 F0 S0]
[MSG:INFO: Caution: Unlocked]
[MSG:INFO: Set to comply]
Index.html Version: 0.75
[MSG:INFO: Firmware Version: 0.75]
[MSG:INFO: Motor detected on Top Left]
[MSG:INFO: Encoder connected on Top Left]
[MSG:INFO: Magnet detected on Top Left]
[MSG:INFO: Motor detected on Top Right]
[MSG:INFO: Encoder connected on Top Right]
[MSG:INFO: Magnet detected on Top Right]
[MSG:INFO: Motor detected on Bottom Left]
[MSG:INFO: Encoder connected on Bottom Left]
[MSG:INFO: Magnet detected on Bottom Left]
[MSG:INFO: Motor detected on Bottom Right]
[MSG:INFO: Encoder connected on Bottom Right]
[MSG:INFO: Magnet detected on Bottom Right]
[MSG:INFO: Retracting all belts]
[MSG:INFO: Top Left pulled tight with offset -1767.814]
[MSG:INFO: Bottom Left pulled tight with offset -1802.513]
[MSG:INFO: Top Right pulled tight with offset -2010.160]
[MSG:INFO: Bottom Right pulled tight with offset -2036.195]
[MSG:INFO: Extending all belts]
[MSG:INFO: All belts extended to center position]
[MSG:INFO: Measured waypoint 0]
[MSG:INFO: Center point deviation: TL: 0.236 TR: 0.304 BL: -4.113 BR: -3.378]
[MSG:INFO: Center point deviation: TL: 0.236 TR: 0.304 BL: -4.113 BR: -3.378]
[MSG:INFO: Center point deviation within 15.000mm, your coordinate system is accurate]
[MSG:ERR: 20 (Unsupported GCode command) in /sd/zaagtafeltest.nc at line 66]
[MSG:ERR: 20 (Unsupported GCode command) in /sd/zaagtafeltest.nc at line 68]
[MSG:ERR: 20 (Unsupported GCode command) in /sd/zaagtafeltest.nc at line 70]
[MSG:WARN: Encoder read failure on Bottom Left]
[MSG:WARN: Bad connection on Bottom Left encoder, failed to read 5 times in the last second]
[MSG:WARN: Encoder read failure on Bottom Left]
[MSG:WARN: Bad connection on Bottom Left encoder, failed to read 1 times in the last second]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 27.285mm Counter: 1]
[MSG:WARN: Previous error was 27.285mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 27.278mm Counter: 2]
[MSG:WARN: Previous error was 27.278mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 27.270mm Counter: 3]
[MSG:WARN: Previous error was 27.270mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 27.263mm Counter: 4]
[MSG:WARN: Previous error was 27.263mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 27.255mm Counter: 5]
[MSG:WARN: Previous error was 27.255mm]
[MSG:WARN: Encoder read failure on Top Left]
[MSG:WARN: Bad connection on Top Left encoder, failed to read 1 times in the last second]
[MSG:INFO: Reset during file job at line: 139]
[MSG:ERR: Emergency stop. Update function not being called enough.1002ms since last call]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 20.309mm Counter: 1]
[MSG:WARN: Previous error was 20.309mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 20.301mm Counter: 2]
[MSG:WARN: Previous error was 20.301mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 20.293mm Counter: 3]
[MSG:WARN: Previous error was 20.293mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 20.276mm Counter: 4]
[MSG:WARN: Previous error was 20.276mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is 20.268mm Counter: 5]
[MSG:WARN: Previous error was 20.268mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is -25.439mm Counter: 1]
[MSG:WARN: Previous error was -25.439mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is -25.446mm Counter: 2]
[MSG:WARN: Previous error was -25.446mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is -25.454mm Counter: 3]
[MSG:WARN: Previous error was -25.454mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is -25.462mm Counter: 4]
[MSG:WARN: Previous error was -25.462mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is -25.469mm Counter: 5]
[MSG:WARN: Previous error was -25.469mm]
[MSG:WARN: Position error on Bottom Right axis exceeded 15mm while running. Error is -25.477mm Counter: 6]
[MSG:WARN: Previous error was -25.477mm]
[MSG:ERR: Emergency stop! Stopping all motors]
[MSG:WARN: The machine will not respond until turned off and back on again]
[MSG:ERR: Position error > 15mm while running. E-Stop triggered.]

The offending GCodes are G98 and G81 in this piece of code:

(Begin Drilling)
G0 Z5.000
G90
G98
G0 X33.482 Y76.704
G81 X33.482 Y76.704 Z-2.000 R3.000
G0 X86.170 Y76.704
G81 X86.170 Y76.704 Z-2.000 R3.000
G80
G0 Z3.000
G0 Z5.000
(Finish operation: Drilling)

Could the unsupported codes have anything to do with the emergency stop or is this just a coincidence?

willemx wrote:

(Begin Drilling)
G0 Z5.000
G90
G98
G0 X33.482 Y76.704
G81 X33.482 Y76.704 Z-2.000 R3.000
G0 X86.170 Y76.704
G81 X86.170 Y76.704 Z-2.000 R3.000
G80
G0 Z3.000
G0 Z5.000
(Finish operation: Drilling)

The maslow does not support g98 and G81, you need to change the machine
definition in your CAM program

There’s also the oddity that you tell it to move Z 5 before you tell it that you
are giving it absolute coordinates, also a bad thing to do.

Could the unsupported codes have anything to do with the emergency stop or is this just a coincidence?

probably not (given that you are getting encoder errors), but if it’s trying to
do a G0 move with the bit in the wood, that could cause it to struggle and do
odd things.

David Lang

1 Like

It’s possible, if FluidNC gets stuck on an unsupported gcode command it could lead to it not reading from the encoders often enough. The answer would be is it reproducible, like does the issue happen in the same place every time?

Sadly, it is not reproducible, I tried to cut this piece 3 times and it crashed at different places. The last time, it crashed even though I had removed the part with the unsupported GCodes.
Before I tried to cut this piece, I cut several smaller test pieces which all produced nice results.
I consider myself now also a victim of the 15 mm error bug.
I fear that I cannot start cutting real projects until this bug is squashed…

1 Like

This seems to be RF interference, @bar, we should start a new thread for that
topic (with a clear title) where we list all the things that people have been
doing to address the issue.

David Lang

1 Like