Skip to content

Generate native multiACE source-change G-code for the U1 #3

Description

@physicsG

Summary

Generate correct U1 + multiACE G-code directly from the frozen routing plan, without relying on a post-processing rewrite step.

Logical project filaments may exceed four, but final physical tool commands must remain limited to the U1's four heads: T0 through T3.

Scope

  • Resolve source and physical-head routing before final tool ordering and wipe-tower generation.
  • Emit native source-change macros such as ACE_SWAP_HEAD when the required source is not already loaded.
  • Preserve normal T0T3 physical tool selection.
  • Generate correct park, unload/load, tool-select, purge, and resume ordering.
  • Avoid unnecessary source swaps when the requested source is already loaded.
  • Integrate source transitions with purge and wipe-tower accounting.
  • Define failure/cancellation-safe macro boundaries.
  • Remove the need for the existing external multiACE G-code postprocessor for supported workflows.

Example behavior

PARK_TOOLHEAD TOOL=2
ACE_SWAP_HEAD HEAD=2 ACE=1 SLOT=2
T2
PURGE_FOR_SOURCE_CHANGE FROM=3 TO=6

Exact printer mechanics remain implemented in Klipper/multiACE macros; the slicer determines the route, command sequence, temperatures, purge, and accounting.

Acceptance criteria

  • Final generated G-code never emits a physical tool command greater than T3.
  • Source changes use structured route data from Add persistent filament-source and U1 toolhead routing model #2.
  • No ACE_SWAP_HEAD command is emitted when the correct source is already loaded.
  • Park/swap/select/purge order is deterministic and documented.
  • Wipe-tower and purge behavior remains valid after physical-head assignment.
  • Cancellation and macro failure points are clearly bounded.
  • Generated files no longer require an external rewrite step.
  • Golden tests cover same-head swaps, head-plus-source changes, already-loaded sources, repeated returns, and invalid routes.
  • Integration tests verify all physical tool commands remain T0T3.

Dependencies

Design references

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions