core icon indicating copy to clipboard operation
core copied to clipboard

Intermittent feedrate validation errors and G1 motion with F0 – ESP32 build 20261123

Open 109JB opened this issue 4 days ago • 4 comments

I am currently developing a Windows-based CNC sender called GRBL Gooey, supporting both GRBL 1.1h and grblHAL.

During bench testing of grblHAL on an ESP32, I encountered two intermittent problems:

  1. G1 axis movement is accepted and executed with a programmed feedrate of F0. Status reports show changing machine coordinates while reporting zero feedrate.

  2. Valid standalone commands, including F10, G0, G20, G21 and work coordinate system selections, are intermittently rejected with error:22 (undefined feedrate).

Firmware details:

  • grblHAL version: 1.1f.20261123
  • Processor: ESP32 @ 240 MHz
  • Driver version: 261103
  • Driver options: 4.4.2
  • Firmware generated using the Web Builder
  • Backlash compensation enabled
  • USB serial communication at 115200 baud

I have attached a detailed bug report and two filtered communication logs containing the recorded commands sent to the controller and its responses.

The first problem was discovered before all communication logging filters were enabled. This limitation is explained in the attached report.

Both problems are intermittent. I have not yet established a consistently repeatable minimal command sequence or independently reproduced them using another sender.

I do not know whether these problems share a common cause.

Any assistance in investigating these behaviors would be appreciated.

grblHAL_Bug_Report_Package_Rev2.zip

109JB avatar Nov 29 '26 05:11 109JB

Intermittent feedrate validation and reporting

grblHAL ESP32 • Bench issue report • Revision 2 • 28 November 2026

Summary

Two intermittent behaviors were observed while testing grblHAL with the GRBL Gooey serial host: (1) feed motion accepted and reported at zero feedrate; (2) valid non-motion commands rejected with error:22 (undefined feedrate). A shared cause is possible but not established. Independent serial-terminal reproduction and firmware source diagnosis are pending.

Test environment

grblHAL 1.1f.20261123; ESP32 @ 240 MHz; driver 261103; driver options 4.4.2; XYZ; serial COM6 at 115200 baud. Host: GRBL Gooey V2.95b (reported development version). Backlash compensation configured: $160=0.25400, $161=0.12700, $162=0.05080 mm. $10=511; $100–102=250 steps/mm; $110–112=5080 mm/min; $120–122=4000 mm/s². Full settings and firmware identification are in both transcripts.

Problem 1 — Feed motion with F0

On connection, $G reported G0 G20 G90 G94 G54 G43.1 F0 and $# reported zero TLO. No reset is recorded. The host sent G20 and queried settings and offsets, then loaded a 2-inch Z tool length using G20 G43.1 Z2. The offset was verified. The following commands were then accepted:

TX: g1
RX: ok
TX: $G
RX: [GC:G1 G54 G17 G20 G90 G94 G40 G43.1 G98 G50 M5 M9 T0 F0 S0.]
RX: ok
TX: g1x0.1
RX: ok
TX: g1x0
RX: ok

Problem 1 transcript lines 248–256. A subsequent g1x0.1 (line 387) also returned ok. Status reports show X advancing while FS remains 0,0, for example:

RX: <Run|MPos:0.0099,0.0000,2.0000|Bf:99,1023|FS:0,0|Pn:YZP>
RX: <Run|MPos:0.0529,0.0000,2.0000|Bf:99,1023|FS:0,0|Pn:YZP>

Expected: reject actual G1 motion when no valid positive feedrate is established. Observed: operator reported motion and firmware coordinates changed to the commanded endpoint; FS remained zero. Exact physical speed is not established.


 

Problem 2 — Valid commands rejected

The replacement capture starts in G21 with $13=0 and an existing Z TLO of 50.8 mm. The host switches to inches ($13=1, G20), clears TLO with G20 G43.1 Z0, and verifies zero. A Ctrl-X reset follows, with host recovery restoring G20 and zero TLO. After another settings query, G20 G43.1 Z2 is accepted and the 2-inch TLO verified. The first g1 then returns error:22, followed by f10 and G21 also returning error:22.

Expected: positive standalone F words and non-motion mode selections (G0, G20/G21, G54–G59) should not require an already established positive feedrate. Rejection of actual feed moves with F0 is expected; bare G1 and F0 are included as context rather than treated as definitive defects.

Command Response Transcript lines
g1 error:22 923–924
f10 error:22 1017–1018
G21 error:22 1113–1114
f10 (accepted) ok 1250–1251
f10 error:22 1478–1479
G20 error:22 2056–2057
g0 error:22 2950–2951
g55 error:22 3118–3119
g56 error:22 3176–3177
g57 error:22 3226–3227
g58 error:22 3276–3277
g59 error:22 3302–3303
g54 error:22 3396–3397
g0 (accepted) ok 3594–3595
f10 (accepted) ok 3642–3643
f1 error:22 4318–4319
g0 error:22 4484–4486

26 error:22 responses occur in this capture, including expected or ambiguous rejections. After rejected G20/G21 commands, the host sometimes sends $13 and repeats the units command successfully. Later $G reports F254 in G21 after F10 in G20, consistent with unit conversion. All recorded status reports remain Idle; no motion is claimed in this capture.


 

Evidence and reproduction limitations

Both transcripts are filtered host communication logs, not byte-level serial captures. Host annotations and original numbering were removed; all recorded TX/RX entries remain in their original order and spelling. TX: ? denotes byte 0x3F; TX: <0x18> denotes the single Ctrl-X byte, not literal text. Line references in this report refer to the cleaned transcripts, counting from line 1.

Problem 1: the communication monitor did not have all filters enabled at the beginning of the test. Automatic status requests are absent, and status responses were enabled only partway through the test. Missing traffic cannot be reconstructed. The recorded $G, acknowledgments and changing positions with FS:0,0 are preserved. No timestamps are available to establish exact speed.

Problem 2: all communication filters were enabled. This is the newer capture, replacing the earlier rejection-only log. It includes automatic status requests and responses, initialization, reset and recovery, settings, offsets and command results. No byte-level timing or line terminator information is available.

Suggested developer investigation

On an isolated bench with drives and spindle disconnected, replay the initialization and tool-offset sequences in the attached transcripts using an independent serial terminal. Compare a fresh reset against reconnecting without reset; test G43.1 Z0 versus a nonzero Z offset, with G20/G21 and F0. Check whether positive F words and non-motion mode commands are accepted, and whether an actual feed move with F0 is rejected. Preserve $G, $# and status reports. The exact triggering condition remains unknown; neither backlash compensation nor tool length compensation has been established as causal.

Attachments

grblHAL_Problem_1_Serial_Log_Rev2.txt

grblHAL_Problem_2_Serial_Log_Rev2.txt

Original source captures: grblHAL problem.txt (Problem 1); grblHAL Problem 3.txt (replacement evidence for Problem 2). Originals should be retained separately.

terjeio avatar Nov 29 '26 06:11 terjeio

Two intermittent behaviors were observed...

Once in a blue moon? Every second run? Tenth?

Problem 2 — Valid commands rejected

Unlike Grbl, grblHAL does not blindly accept new gcode after an error has occured, it has to be acknowledged, either with a blank line or a $-command. See this.

On an isolated bench with drives and spindle disconnected, replay the initialization and tool-offset sequences in the attached transcripts using an independent serial terminal.

How to replay the logs? Just copy/paste the log into a terminal? If so, which one?

terjeio avatar Nov 29 '26 06:11 terjeio

Thank you for explaining the error acknowledgment behavior. I was unaware of this difference between GRBL and grblHAL. I will investigate and test the acknowledgment mechanism to determine whether it fully explains the second reported problem.

My greater concern is the first problem, where G1 movement occurred with a programmed feedrate of zero and the status reports continued to indicate zero feedrate while the reported machine position was changing.

I have not yet established a repeatable sequence or a meaningful frequency of occurrence.

Rather than asking you to manually replay the communication logs, I am developing a small standalone serial testing utility, completely independent of my CNC sender. It will execute scripted test files containing G-code, system commands, realtime commands, connection and initialization instructions, delays, and response checks.

This should allow me to reproduce the original initialization and command sequences automatically, repeat the tests, and capture complete communication logs.

Once I have additional results, I will provide the test utility, its source code, and the applicable test files so that you can easily reproduce the same tests on your hardware.

Thank you for your assistance.

109JB avatar Nov 29 '26 15:11 109JB

Thank you again for explaining the error acknowledgment feature. After further experimentation, I believe the documented error handling behavior explains the second reported problem. I was previously unaware of this feature, and I actually think it is a good safety improvement over standard GRBL. I will incorporate appropriate handling of it into my CNC sender.

I have now developed a standalone scripted serial communication utility that is completely independent of my CNC sender. It allows me to execute repeatable command sequences with explicit control over transmitted characters, line endings, realtime commands and timing, while recording all transmitted and received communication.

The utility is working well, but so far I have been unable to reproduce the first problem involving movement with a programmed feedrate of zero.

Would you mind leaving this issue open for a few more days while I continue trying to reproduce that behavior? I would like to establish a repeatable test sequence before asking you to spend any more time investigating it.

If I can reproduce the problem, I will provide the test utility, source code, test script and resulting communication log.

In the interest of transparency, I am using ChatGPT to assist me with software development, analyzing test results, preparing bug reports and composing these responses. However, there is a real human behind all of this. I am personally performing the hardware and software testing, making the design decisions and reviewing the results. The reported observations are from actual tests that I have conducted, not hypothetical scenarios generated by AI.

Thank you for your time and assistance.

109JB avatar Nov 29 '26 18:11 109JB