Description
When using a rotary module in Axis Replacement mode with Axis Y, Rayforge generates G-code containing the Y word twice in the same block.
GRBL rejects these commands with:
GRBL error 25 means that a G-code word was repeated in the same block.
Environment
- Rayforge version: 1.8.2
- Operating system: Linux/CachyOS
- Machine: Atomstack A10 Pro V1
- Controller firmware: GRBL 1.1h
- Rotary connection: Rotary module connected instead of the physical Y-axis motor
- Rotary connection mode: Axis Replacement
- Replacement axis: Y
- Rotary type: Rollers
Steps to reproduce
- Configure a GRBL machine.
- Add a rotary module.
- Set the rotary module connection mode to Axis Replacement.
- Set the replacement axis to Y.
- Set the rotary type to Rollers.
- Enable the rotary module for a layer.
- Add or import simple geometry, such as a rectangle.
- Generate or run the G-code.
Actual result
Rayforge generates commands such as:
T0
G0 X455.603 Y143.374 Y322.591
M4 S244
G1 Y13.531 Y30.446 F500
G1 X599.189 Y13.531 F500
G1 Y143.374 Y322.591 F500
G1 X455.603 Y143.374 F500
The first movement command contains:
The following cutting command contains:
GRBL consequently reports:
[MSG:Tool No: 0]
error:25
ERROR GRBL error during job: error:25. Halting stream.
ALARM:3
Expected result
When Y is used as an axis replacement, the rotary coordinate should replace the normal Cartesian Y coordinate.
Each G-code block must contain no more than one Y word, for example:
G0 X455.603 Y322.591
G1 Y30.446 F500
The exact value depends on the rotary transformation, but the original Cartesian Y value and the rotary replacement value must not both be emitted.
Additional observations
The issue remains after:
- selecting Axis Replacement instead of True 4th Axis
- selecting Y as the replacement axis
- recreating the rotary module configuration
- regenerating the job
The generated output suggests that the original Cartesian value is emitted through y_cmd, while the rotary replacement value is additionally emitted through extra_cmd.
Possible technical cause
This is only a hypothesis based on the generated output:
KinematicMapping.apply() stores the rotary coordinate as an extra axis.
Machine._apply_replacement_downstream() is expected to move that value into the replaced Cartesian axis.
- The G-code encoder later renders both
{y_cmd} and {extra_cmd}.
- For Y-axis replacement, the extra
Axis.Y value appears to remain present during encoding, producing two Y words.
A regression test should verify that an Axis Replacement rotary configured for Y never produces more than one Y word per G-code block.
Safety impact
The generated G-code is invalid and cannot be executed by GRBL. Rayforge begins streaming the job, receives error:25, halts the stream, and resets or aborts the controller state.
Description
When using a rotary module in Axis Replacement mode with Axis Y, Rayforge generates G-code containing the
Yword twice in the same block.GRBL rejects these commands with:
GRBL error 25 means that a G-code word was repeated in the same block.
Environment
Steps to reproduce
Actual result
Rayforge generates commands such as:
The first movement command contains:
The following cutting command contains:
GRBL consequently reports:
Expected result
When Y is used as an axis replacement, the rotary coordinate should replace the normal Cartesian Y coordinate.
Each G-code block must contain no more than one
Yword, for example:The exact value depends on the rotary transformation, but the original Cartesian Y value and the rotary replacement value must not both be emitted.
Additional observations
The issue remains after:
The generated output suggests that the original Cartesian value is emitted through
y_cmd, while the rotary replacement value is additionally emitted throughextra_cmd.Possible technical cause
This is only a hypothesis based on the generated output:
KinematicMapping.apply()stores the rotary coordinate as an extra axis.Machine._apply_replacement_downstream()is expected to move that value into the replaced Cartesian axis.{y_cmd}and{extra_cmd}.Axis.Yvalue appears to remain present during encoding, producing twoYwords.A regression test should verify that an Axis Replacement rotary configured for Y never produces more than one Y word per G-code block.
Safety impact
The generated G-code is invalid and cannot be executed by GRBL. Rayforge begins streaming the job, receives
error:25, halts the stream, and resets or aborts the controller state.