Skip to content

FDM mode Loop Count generating off-by-one M808 command #482

Description

@rexit1982

When using fdm mode with a belt printer and populating the loop count box in the expert section the generated gcode file's M808 L ends up being M808 L-1. So loop count 2 ends up with M808 L1, etc. Originally I assumed this was because the firmware did not consider the first pass a loop count but when implementing and testing this is not the case.

Looking into the background I found https://marlinfw.org/docs/gcode/M808.html. Where the example from the Marling docs calls out that M808 L5 would result in 5 "Hello World" messages, indicating that every loop is counted starting with 1.

Also in the klipper sample macro implementation https://github.com/Klipper3d/klipper/blob/master/config/sample-macros.cfg the logic and the underlying SDCARD_LOOP_BEGIN doc https://www.klipper3d.org/G-Codes.html#sdcard_loop_begin specifically call the L value the count.

The expected behavior is that the M808 L is generated with the entered number in the field.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions