Skip to content

Implement support for RatOS#48

Open
depau wants to merge 6 commits into
AndrewEllis93:masterfrom
depau:ratos-support
Open

Implement support for RatOS#48
depau wants to merge 6 commits into
AndrewEllis93:masterfrom
depau:ratos-support

Conversation

@depau
Copy link
Copy Markdown

@depau depau commented Jun 19, 2025

(note: set to draft since I noticed some issues after submitting, sorry about that!)

RatOS is a distribution of Klipper with some heavy customizations, used for RatRig V-Core printers, also compatible with some Vorons and Prusas.

With RatRig V-Core 4 printers in particular it's really not possible to use stock Klipper since a lot of features are missing, such as the IDEX functionality and tuning helpers.

I use this tool regularly with my V-Core 4, but each time I use it I need to edit the G-Code manually to make sure RatOS is happy.

This is what needs to happen for RatOS to be happy:

  • The G-Code must start with a comment declaring the generator version. RatOS will only accept G-Code from Prusa Slicer, SuperSlicer and Orca Slicer, as well as G-Code that declares to be made for RatOS. This is because RatOS post-processes G-Code to support IDEX copy and mirror modes (and possibly more reasons).
    • A generator that reports compatibility with RatOS must report v0.1 due to an oversight: Parse RatOS dialect version when used Rat-OS/RatOS-configurator#91
    • EDIT: it turns out that while the oversight is real, this still doesn't work since RatOS tries to parse the version number as SemVer, and 0.1 is not valid SemVer. Instead, I implemented simply spoofing a Prusa Slicer version.
  • The version header must be at the beginning of the file, it can't be placed in the start gcode.
  • Unlike regular Klipper, RatOS uses T0/T1 to select the toolhead.
  • T1 should appear after the start g-code since START_PRINT does a lot of stuff; the pre-processor decides which heaters to turn on based on its understanding of the G-Code.
  • T1 must not be followed by a comment, or else some regex in the pre-processor will blow up
  • The start macro should have a TOTAL_LAYER_COUNT parameter or else it will complain.
  • The start macro must report the min/max X/Y coordinates of the print: newer RatRig printers use a Beacon Contact probe; to speed up print setup times RatOS will only scan the build plate over the print area.

Additionally, this PR:

  • Fixes a simple syntax issue with selectors
  • Forcefully disables homing/heating G-Codes in the preamble for RatOS since START_PRINT takes care of that with over-complicated logic.

Let me know if you need any changes, and thanks for this tool!

@depau depau marked this pull request as draft June 19, 2025 20:57
@depau depau marked this pull request as ready for review June 19, 2025 21:17
@depau depau marked this pull request as draft June 19, 2025 21:19
depau added 4 commits June 19, 2025 23:26
Note that due to Rat-OS/RatOS-configurator#91 the tool version needs to be
set to 0.1, otherwise RatOS will refuse to print the G-Code unless the user
overrides it in their Klipper config (unlikely to do so since it's undocumented)
@depau depau marked this pull request as ready for review June 19, 2025 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant