load_filament
Feed filament to the nozzle — an AMS tray on Bambu, a manual feed elsewhere.
Instructions
Feed filament to the nozzle — an AMS tray on Bambu, a manual feed elsewhere.
On Bambu Lab the firmware's own change-filament routine runs (retract,
feed, purge) and the answer is read from the AMS: ``extrusion_verified``
is ``True`` once ``tray_now`` reports the tray feeding the nozzle,
``False`` with the fault code in plain language if the routine raised
one (the same HMS codes the touchscreen shows), ``None`` if neither
arrived in ``wait_seconds``. On Klipper a ``LOAD_FILAMENT`` / ``M701``
macro from the printer's own config is used when it exists; otherwise,
and on OctoPrint / Duet / serial, the hotend is heated and
``length_mm`` is fed at 3 mm/s — push the filament into the extruder
first.
Temperature is checked against the printer's safety profile, the
spool's own ``nozzle_temp_min/max`` (AMS) or Kiln's material table,
and the 170 °C cold-extrusion floor; refused outside any of them.
Refused while a print is running (paused is fine).
Branch on ``outcome`` — one field, three values, the same shape
``set_temperature`` and ``start_print`` use:
- ``"confirmed"``: the printer showed the effect (the AMS reports the
tray feeding the nozzle).
- ``"accepted"``: the command was sent and not refused, and the printer
has not shown the effect yet. A Bambu load takes a minute or two
and a tool call cannot wait that long, so this is the normal answer
when the watch runs out: the routine is still running. Do NOT send
the load again — read ``next_read`` (``ams_status`` for ``tray_now``,
``printer_status`` for ``print_error``) to finish the answer.
- ``"failed"``: the gate or the printer refused, or a fault was raised
(``error_code`` / ``error_hint``).
On Bambu Lab that check binds what Kiln sends, not what the routine
does: the firmware heats to its own flush temperature for a filament
change (250 °C observed on an A1 asked for 215, the ``M109 S250`` its
own start sequence sets) and drops to the requested target only when
the routine finishes. The answer reports the temperature the firmware
actually used (``firmware_hotend_target_c``) beside the one Kiln
validated; the gate is not widened to match it.
Where the declared model's own purge position is served one plan at a time through Kiln's hosted service for a printer paired to your Kiln sign-in, free, and kept on your machine so it works offline, the head is parked over the purge chute
before the routine runs, so its purge falls into the chute instead of
hanging off the nozzle at home; the answer says where the head was
either way.
Args:
slot: The printer's own tray id, as ``ams_status`` lists it in
``tray_id`` (0–3 on unit A, 4–7 on unit B, 128 for the AMS HT
named HT-A). Omit for the external / single spool.
material: e.g. ``"PLA"`` — picks a temperature when none is given
and no spool report supplies one.
temperature: Hotend target in °C. Omit to use the middle of the
spool's or material's window.
length_mm: Feed distance for the generic G-code path (default 60;
bowden machines need more). Ignored where the firmware's own
routine decides.
wait_seconds: How long to watch for the AMS to confirm. Bounded to
what a tool call can wait inside the client's request window
(40 s unless ``KILN_FILAMENT_WAIT_BUDGET_S`` says otherwise); a
longer ask is applied at the bound and the response says so.
keep_hot: Leave the heater ON afterwards, for a caller about to do
something else hot. Off by default: every op ends with the
heater off and says so; where the machine's own cool-down is
served, the part fan goes on and Kiln turns it off on its own
once the nozzle reads the hand-off temperature -- the answer
does not wait for that, and ``printer_status`` shows it.
printer_name: Which printer. Omit for the default one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slot | No | ||
| keep_hot | No | Default: false. | |
| material | No | ||
| length_mm | No | ||
| temperature | No | ||
| printer_name | No | ||
| wait_seconds | No |