New backup from 18/04/25 - 08:36:31

This commit is contained in:
pi committed 2025-04-18 08:36:31 +01:00
1 parent 4b8cb5e9ec
commit 776f43b3f4
14 files changed
+2458

No files matched your search

+696
View File
@@ -0,0 +1,696 @@
[gcode_macro SET_MATERIAL]
description: Dynamically adjust chamber temps, fans, and behavior based on material
# === OVERVIEW ===
# This macro sets print parameters based on the selected filament type.
# It includes logic for fan control, pressure advance tuning, and chamber temperature management.
# Each material is uniquely handled with comments, proper defaults, and warnings where applicable.
#
# === WHY USE THIS ===
# - Ensures consistent print settings per material
# - Automatically adjusts temperature and environment conditions
# - Reduces manual tuning between material changes
# - Helps enforce safety (drying warnings, chamber heat warnings, etc.)
#
# === HOW TO USE ===
# Call the macro with:
# SET_MATERIAL MATERIAL=<your_material>
#
# Example:
# SET_MATERIAL MATERIAL=ABS
#
# === SETUP REQUIREMENTS ===
# You MUST configure:
# - A chamber temperature sensor (e.g., temperature_sensor chamber_combined_mean)
# - A bed heater (e.g., heater_bed)
# - Optionally, a chamber heater (e.g., heater_generic chamber_heater)
# - A chamber circulation fan (e.g., nevermore_fan)
#
# === PARAMETERS ===
# MATERIAL: Name of the filament material preset to apply
# Supported: PLA, ABS, PETG, ASA, PC, PA, PEEK, PEK, TPU, etc.
# Extended support for exotic blends like ESD-ABS, PVDF, MetalFill, Foam PLA
#
# === NOTES ===
# - Each material includes chamber temp, fan speed, PA, and smoothing settings
# - Some materials apply Z offset compensation or recommend special nozzle/hardware
# - Certain blocks include warnings (e.g., "dry before use" or "use hardened nozzle")
# - If you do not have a chamber heater, set `ACTIVE_CHAMBER_HEATING = False`
# - You can expand this macro to include more materials as needed
# - Unknown materials fall back to a safe PLA-like default
#
# === ADVANCED ===
# This macro can be tied into slicer startup G-code or multi-material toolchanging macros.
# You can also use it in combination with filament sensors or manual menu macros.
gcode:
{% set CHAMBER_SENSOR = "temperature_sensor chamber_combined_mean" %}
{% set BED_HEATER = "heater_bed" %}
{% set BED_FAN = "nevermore_fan" %}
{% set ACTIVE_CHAMBER_HEATING = False %} # Set to True if you have a dedicated chamber heater configured
{% set CHAMBER_HEATER = "chamber_heater" if ACTIVE_CHAMBER_HEATING else "" %}
{% set MATERIAL = params.MATERIAL|default("PLA")|string %}
SET_HEATER_TEMPERATURE HEATER={BED_HEATER} TARGET=0
SET_HEATER_TEMPERATURE HEATER=extruder TARGET=0
{% if MATERIAL in ['PLA', 'PLA-CF', 'PE', 'PE-CF'] %}
# PLA: Easy to print, low warping, no chamber needed. CF = carbon fiber, stiffer and more abrasive.
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.035 | Chamber: 25°C" %}
RESPOND MSG="{message}"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.035 SMOOTH=0.04
{% elif MATERIAL in ['PLA+', 'SILK-PLA'] %}
# PLA+: Stronger, tougher PLA. Silk PLA has glossy finish but may string more.
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.038 | Chamber: 25°C" %}
RESPOND MSG="{message}"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.038 SMOOTH=0.04
{% elif MATERIAL in ['PVDF', 'PVDF-CF', 'PVDF-GF'] %}
# PVDF: Chemical-resistant and strong. Requires high chamber temps and dry storage.
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.055 | Chamber: 90°C | ⚠️ Moisture-sensitive. Dry before use." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET=90 SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.055 SMOOTH=0.045
{% elif MATERIAL in ['ESD-PLA', 'ESD-ABS', 'ESD-PC', 'ESD-PEEK'] %}
# ESD-safe filaments for sensitive electronics. Can be brittle, dry before use.
{% set chamber_temp = 60 if 'PLA' in MATERIAL else 80 %}
{% set pa_val = 0.04 if 'PLA' in MATERIAL else 0.05 %}
{% set message = "Material: " ~ MATERIAL ~ " | PA: " ~ pa_val|string ~ " | Chamber: " ~ chamber_temp|string ~ "°C | ⚠️ Dry before use for best performance." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={chamber_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA={pa_val} SMOOTH=0.045
{% elif MATERIAL == 'LW-PLA' %}
# LW-PLA: Lightweight PLA expands with heat. MUST reduce flow to ~65% manually.
{% set message = "Material: LW-PLA | PA: 0.03 | Chamber: 25°C | Reminder: Set flow to ~65%" %}
RESPOND MSG="{message}"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.2
SET_PA PA=0.03 SMOOTH=0.04
{% elif MATERIAL == 'PLA-FOAM' %}
# PLA-FOAM: Similar to LW-PLA, foams up at extrusion temps. Lower flow ~60%.
{% set message = "Material: PLA-FOAM | PA: 0.03 | Chamber: 25°C | Reminder: Set flow to ~60%" %}
RESPOND MSG="{message}"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.3
SET_PA PA=0.03 SMOOTH=0.04
{% elif MATERIAL in ['PETG', 'PETG-GF', 'PETG-CF', 'PET-CF'] %}
# PETG: Good strength/flexibility, more durable than PLA. May string. CF/GF are abrasive.
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.03 | Chamber: 40°C" %}
RESPOND MSG="{message}"
M141 S40
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.03 SMOOTH=0.05
SET_GCODE_OFFSET Z=0.02 # PETG can be sticky; lift Z slightly to prevent nozzle drag
{% elif MATERIAL in ['ABS', 'ABS+', 'ABS-GF', 'ABS-CF'] %}
# ABS: Tough and heat-resistant, good for functional parts. Warps easily—requires enclosed chamber.
# CF (Carbon Fiber) / GF (Glass Fiber) versions are more rigid and very abrasive.
{% set target_temp = 60 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.05 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.05 SMOOTH=0.045
{% elif MATERIAL in ['ASA', 'ASA+', 'ASA-GF', 'ASA-CF', 'ASA-Aero'] %}
# ASA: UV-resistant alternative to ABS. Great for outdoor parts. Needs similar chamber temps to ABS.
# ASA-GF and ASA-CF are even more rigid and more abrasive.
{% set target_temp = 60 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.05 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.05 SMOOTH=0.045
{% elif MATERIAL == 'HIPS' %}
# HIPS: Used primarily as a dissolvable support for ABS. Requires similar chamber temps.
# ⚠️ Requires limonene bath for dissolution. Keep dry. May warp without chamber.
{% set target_temp = 60 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: HIPS | PA: 0.045 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Dissolves in limonene. Keep dry." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.045 SMOOTH=0.045
{% elif MATERIAL == 'BVOH' %}
# BVOH: Superior water-soluble support material. Less stringy than PVA but still moisture sensitive.
# ⚠️ Store in drybox. Dissolves faster in warm water. Do not overcool during print.
{% set message = "Material: BVOH | PA: 0.035 | Chamber: 25°C | ⚠️ Store dry. Dissolves in water." %}
RESPOND MSG="{message}"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.2
SET_PA PA=0.035 SMOOTH=0.04
{% elif MATERIAL == 'PP' %}
# PP: Light and chemical-resistant. Warps easily and has poor adhesion. Needs chamber and special bed surface.
# ⚠️ Use PP-specific bed surface. Avoid cooling drafts. May require brim or raft.
{% set target_temp = 55 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: PP | PA: 0.04 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Warps easily. PP bed surface recommended." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.04 SMOOTH=0.045
{% elif MATERIAL == 'PPSU' %}
# PPSU: High-performance thermoplastic. Chemical and heat-resistant. Needs very hot chamber and drying.
# ⚠️ Print with hardened nozzle. Needs chamber and high temps. Store dry.
{% set target_temp = 100 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: PPSU | PA: 0.055 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Needs high temp & dry storage" %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.055 SMOOTH=0.045
{% elif MATERIAL == 'ULTEM' or MATERIAL == 'PEI' %}
# ULTEM / PEI: Extremely strong. High temp aerospace/engineering plastic. Needs chamber + hardened nozzle.
# ⚠️ Only for high-end printers. Dry thoroughly. Print hot.
{% set target_temp = 120 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: ULTEM/PEI | PA: 0.06 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Industrial use only. Dry & hot." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.06 SMOOTH=0.05
{% elif MATERIAL == 'POLYMAX-PC' %}
# Polymaker PolyMax PC: Easier-to-print Polycarbonate blend. Good strength and clarity. Less prone to warping.
# ⚠️ Still requires chamber and hardened nozzle for long-term use.
{% set target_temp = 60 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: PolyMax PC | PA: 0.05 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Tough and clear. Handle like PC." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.05 SMOOTH=0.045
{% elif MATERIAL == 'ULTRAFUSE-PAHT-CF15' %}
# BASF Ultrafuse PAHT CF15: High-temp nylon, 15% carbon fiber. Stiff, light, durable.
# ⚠️ Dry thoroughly. Use hardened nozzle. Requires chamber.
{% set target_temp = 70 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: Ultrafuse PAHT CF15 | PA: 0.06 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ High strength & very abrasive." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.06 SMOOTH=0.045
{% elif MATERIAL == 'PRUSAMENT-PETG-CF' %}
# Prusament PETG CF: Stiffer than normal PETG, reduced warping, excellent layer adhesion.
# ⚠️ Abrasive. Use hardened nozzle. Watch for brittle breakages if overcooled.
{% set message = "Material: Prusament PETG-CF | PA: 0.04 | Chamber: 45°C | ⚠️ Abrasive. Great dimensional stability." %}
RESPOND MSG="{message}"
M141 S45
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.4
SET_PA PA=0.04 SMOOTH=0.045
{% elif MATERIAL == 'PRUSAMENT-PLA-TOUGH' %}
# Prusament PLA Tough: Improved impact resistance vs. standard PLA. Still easy to print.
{% set message = "Material: Prusament PLA Tough | PA: 0.038 | Chamber: 25°C | Tougher than normal PLA." %}
RESPOND MSG="{message}"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.038 SMOOTH=0.04
{% elif MATERIAL in ['TPU-SOFT', 'TPU-85A'] %}
# TPU-Soft: Ultra-flexible variant. Requires extremely slow printing and short retractions.
# ⚠️ Direct drive required. Reduce speed to <20mm/s. Keep dry to avoid stringing.
{% set message = "Material: TPU-SOFT | PA: 0.055 | Chamber: 30°C | ⚠️ Print very slowly. Direct drive only." %}
RESPOND MSG="{message}"
M141 S30
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.3
SET_PA PA=0.055 SMOOTH=0.035
SET_GCODE_OFFSET Z=0.02
{% elif MATERIAL == 'PA12-GF' %}
# PA12-GF: Glass-fiber filled Nylon 12. High strength, dimensional stability, very abrasive.
# ⚠️ Requires dry storage. Use hardened nozzle. Enclosure strongly recommended.
{% set target_temp = 70 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: PA12-GF | PA: 0.06 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Dry thoroughly, very abrasive." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.06 SMOOTH=0.045
{% elif MATERIAL == 'BREAKAWAY' %}
# Breakaway: Rigid support material that peels away instead of dissolving. Great with ABS, ASA, PETG.
# ⚠️ Store dry. Avoid excessive cooling. Easy to print, good layer adhesion.
{% set message = "Material: Breakaway | PA: 0.035 | Chamber: 35°C | ⚠️ Peel-away support. Store dry." %}
RESPOND MSG="{message}"
M141 S35
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.3
SET_PA PA=0.035 SMOOTH=0.045
{% elif MATERIAL == 'NGEN' %}
# ColorFabb nGen: Easy-to-print PETG-like with smoother finish and less stringing. Based on Amphora AM3300.
{% set message = "Material: nGen | PA: 0.035 | Chamber: 30°C | Smoother than PETG, low stringing." %}
RESPOND MSG="{message}"
M141 S30
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.035 SMOOTH=0.045
{% elif MATERIAL == 'COLORFABB-HT' %}
# ColorFabb HT: High-temp, semi-crystalline Amphora-based copolyester. Tough and heat-resistant.
{% set target_temp = 60 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: ColorFabb HT | PA: 0.045 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | Tough and heat-tolerant. Dry before use." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.045 SMOOTH=0.045
{% elif MATERIAL == 'PPS' %}
# PPS: Exceptional chemical resistance, dimensional stability, and flame retardance. Used in automotive/aerospace.
{% set target_temp = 95 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: PPS | PA: 0.06 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Industrial. Dry thoroughly. Print hot." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.06 SMOOTH=0.05
{% elif MATERIAL in ['PVDF-BLEND', 'KYNAR', 'SOLEF'] %}
# PVDF Blend: Enhanced versions of PVDF for strength/flexibility. Used in semiconductors, chemical labs.
{% set target_temp = 85 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: PVDF Blend | PA: 0.055 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Chemical resistant. Dry required." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.055 SMOOTH=0.045
{% elif MATERIAL == 'CARBONX-PC' %}
# CarbonX CFR-PC+: Carbon fiber-reinforced PC with excellent stiffness and heat performance.
# ⚠️ Use hardened nozzle. Dry before use. Requires enclosure.
{% set target_temp = 65 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: CarbonX PC+ | PA: 0.055 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ High stiffness, abrasive." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.055 SMOOTH=0.045
{% elif MATERIAL == 'ESUN-ABS+' %}
# eSun ABS+: Modified ABS with lower warping and easier layer adhesion. Still benefits from chamber heat.
{% set target_temp = 55 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: eSun ABS+ | PA: 0.045 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | Easier than regular ABS." %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.045 SMOOTH=0.045
{% elif MATERIAL == 'RAISE3D-PLA+' %}
# Raise3D PLA+: Tougher PLA variant optimized for layer adhesion and strength.
{% set message = "Material: Raise3D PLA+ | PA: 0.038 | Chamber: 25°C | Tougher PLA with good printability." %}
RESPOND MSG="{message}"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.038 SMOOTH=0.04
{% elif MATERIAL in ['PA', 'PA-GF', 'PA-CF', 'PAHT-CF', 'PA12-CF'] %}
# Nylon (PA): Strong, flexible, and wear-resistant. Extremely moisture-sensitive — dry before printing!
# CF = Carbon Fiber, GF = Glass Fiber, PAHT = high-temp nylon. Abrasive: use a hardened nozzle.
{% set target_temp = 65 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.06 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Dry thoroughly before use" %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.06 SMOOTH=0.045
{% elif MATERIAL in ['PC', 'PC-CF', 'PCTG'] %}
# PC (Polycarbonate): Very strong and heat resistant. Needs hot chamber. Tends to warp and absorb moisture.
# PC-CF is stiffer and more rigid. PCTG is a more forgiving blend.
{% set target_temp = 60 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.055 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.055 SMOOTH=0.045
{% elif MATERIAL in ['PC-ABS', 'PCABS'] %}
# PC-ABS: Blend of PC and ABS. Easier to print than pure PC. Still wants a hot chamber and enclosure.
{% set target_temp = 70 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.055 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.055 SMOOTH=0.045
{% elif MATERIAL == 'PEEK' %}
# PEEK: Ultra high-performance. Requires extremely hot chamber (110°C+). Dry thoroughly before use.
# Used in aerospace, medical, and industrial applications. Hardened nozzle & all-metal hotend required.
{% set target_temp = 110 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: PEEK | PA: 0.06 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL %}
RESPOND MSG="{message}"{% set message = "⏳ Waiting on heat | Chamber: " ~ chamber_waiting|string ~ " | Bed: " ~ bed_waiting|string %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.06 SMOOTH=0.05
{% elif MATERIAL == 'PEK' %}
# PEK: Slightly lower-temp cousin of PEEK. Still high performance and needs special hardware.
{% set target_temp = 90 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: PEK | PA: 0.055 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.055 SMOOTH=0.05
{% elif MATERIAL == 'TPU' %}
# TPU: Flexible filament. Needs slow print speed. Watch for oozing. Can stretch during retraction.
# ⚠️ Tips: Print very slowly (15-30mm/s). Use direct drive. Avoid long Bowden tubes. Dry before use if soft or stringy.
{% set message = "Material: TPU | PA: 0.055 | Chamber: 35°C | ⚠️ Go slow, direct drive recommended" %}
RESPOND MSG="{message}"
M141 S35
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.055 SMOOTH=0.04
SET_GCODE_OFFSET Z=0.02
{% elif MATERIAL == 'TPE' %}
# TPE: Very soft rubber-like filament. Print slowly. Use direct drive extruder.
# ⚠️ Tips: Reduce retraction. Very flexible – print <25mm/s. May require increased nozzle temp. Dry before use.
{% set message = "Material: TPE | PA: 0.05 | Chamber: 30°C | ⚠️ Slow speed, direct drive only" %}
RESPOND MSG="{message}"
M141 S30
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.05 SMOOTH=0.04
SET_GCODE_OFFSET Z=0.02
{% elif MATERIAL in ['NINJAFLEX', 'NINJA-FLEX'] %}
# NinjaFlex: Ultra-flexible. Print extremely slow. Hard to control extrusion. Direct drive required.
# ⚠️ Tips: Dry well. No retraction if possible. Tight filament path. Print 10–20mm/s.
{% set message = "Material: Ninjaflex | PA: 0.045 | Chamber: 30°C | ⚠️ Print <20mm/s. No Bowden setups." %}
RESPOND MSG="{message}"
M141 S30
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.3
SET_PA PA=0.045 SMOOTH=0.035
SET_GCODE_OFFSET Z=0.02
{% elif MATERIAL in ['METALFILL', 'BRONZEFILL', 'COPPERFILL'] %}
# MetalFill: PLA blended with metal powder. Heavy, beautiful finish. Extremely abrasive—use hardened nozzle.
# ⚠️ Tips: Slower speed, hardened nozzle, check for settling in filament spool.
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.04 | Chamber: 35°C | ⚠️ Abrasive – use hardened nozzle" %}
RESPOND MSG="{message}"
M141 S35
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.04 SMOOTH=0.045
{% elif MATERIAL in ['IRONFILL', 'MAGNETICFILL'] %}
# Magnetic/iron PLA: Similar to MetalFill but can rust. Very abrasive. Hardened steel nozzle recommended.
# ⚠️ Store dry to avoid rust. May interfere with inductive sensors.
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.04 | Chamber: 35°C | ⚠️ Abrasive. Keep dry." %}
RESPOND MSG="{message}"
M141 S35
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.04 SMOOTH=0.045
{% elif MATERIAL in ['WOODFILL', 'CARBONFILL', 'KEVLARFILL'] %}
# Filled composites: Can clog if retracted too much. Lower print speeds. Use wider nozzle (0.6mm+) and hardened tip.
# ⚠️ Avoid retraction-heavy prints. Watch for clogs. WoodFill can scorch – keep nozzle temp moderate.
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.045 | Chamber: 40°C | ⚠️ Composite: Use 0.6mm+ hardened nozzle" %}
RESPOND MSG="{message}"
M141 S40
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.045 SMOOTH=0.045
{% elif MATERIAL in ['MOLDLAY', 'CASTFIL', 'CASTING'] %}
# MoldLay: Used for casting. Can be melted out like wax. Brittle and needs low chamber temps.
# ⚠️ Avoid excessive cooling. Brittle at room temp. Supports should be minimal.
{% set message = "Material: " ~ MATERIAL ~ " | PA: 0.035 | Chamber: 25°C | ⚠️ Brittle – handle gently post-print" %}
RESPOND MSG="{message}"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.035 SMOOTH=0.04
{% elif MATERIAL in ['PVA', 'SUPPORT-PVA'] %}
# PVA: Water-soluble support material. Store in airtight container. Extremely moisture-sensitive.
{% set message = "Material: PVA | PA: 0.035 | Chamber: 25°C | ⚠️ Water Soluble & Moisture Sensitive" %}
RESPOND MSG="{message}"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.0 # No fan to avoid drafts/drying out
SET_PA PA=0.035 SMOOTH=0.04
{% elif MATERIAL in ['PMMA', 'ACRYLIC'] %}
# PMMA: Transparent, acrylic-like. Shrinks a lot—needs chamber. Often cracks if too cold. Store dry.
{% set target_temp = 60 %}
{% set passive_wait = target_temp - 25 %}
{% set CHAMBER_LABEL = "(active heater)" if ACTIVE_CHAMBER_HEATING else "(passive via bed, will start at ≥" ~ passive_wait|string ~ "°C)" %}
{% set message = "Material: PMMA | PA: 0.04 | Chamber: " ~ target_temp|string ~ "°C " ~ CHAMBER_LABEL ~ " | ⚠️ Brittle when moist, dry thoroughly" %}
RESPOND MSG="{message}"
SET_CHAMBER_HEAT TARGET={target_temp} SENSOR="{CHAMBER_SENSOR}" HEATER={CHAMBER_HEATER} BED_HEATER={BED_HEATER} FAN={BED_FAN} ACTIVE={ACTIVE_CHAMBER_HEATING}
SET_PA PA=0.04 SMOOTH=0.045
{% else %}
# Default fallback for unknown materials
RESPOND MSG="Material: Unknown | Default PA: 0.04 | Chamber: 25°C"
M141 S25
SET_FAN_SPEED FAN={BED_FAN} SPEED=0.5
SET_PA PA=0.04 SMOOTH=0.045
{% endif %}
[gcode_macro SET_PA]
description: Set Pressure Advance with automatic nozzle and flow-based scaling
variable_pa: 0.04
# === OVERVIEW ===
# Dynamically adjusts Pressure Advance (PA) based on:
# - Configured nozzle size (from printer.cfg)
# - Actual print flow vs max flow (defaults to 10/15 mm³/s)
#
# === HOW TO USE ===
# SET_PA PA=<base_value> [FLOW=<actual_mm3/s>] [MAX_FLOW=<max_mm3/s>] [SMOOTH=<smoothing>]
#
# Example:
# SET_PA PA=0.05
# SET_PA PA=0.05 FLOW=35 MAX_FLOW=70
#
# === PARAMETERS ===
# PA : Base PA for 100% flow (required)
# FLOW : Actual flow rate in mm³/s (default: 10)
# MAX_FLOW : Max hotend flow in mm³/s (default: 15)
# SMOOTH : Optional smoothing (default: 0.045)
gcode:
{% set base_pa = params.PA|float %}
{% set smooth = params.SMOOTH|default(0.045)|float %}
{% set nozzle = printer.extruder.nozzle_diameter|float %}
{% set flow = params.FLOW|default(30.0)|float %}
{% set max_flow = params.MAX_FLOW|default(70.0)|float %}
# === Nozzle-based scaling ===
{% if nozzle <= 0.2 %}
{% set nozzle_scale = 1.8 %}
{% elif nozzle <= 0.3 %}
{% set nozzle_scale = 1.4 %}
{% elif nozzle <= 0.4 %}
{% set nozzle_scale = 1.0 %}
{% elif nozzle <= 0.6 %}
{% set nozzle_scale = 0.75 %}
{% elif nozzle <= 0.8 %}
{% set nozzle_scale = 0.5 %}
{% else %}
{% set nozzle_scale = 0.4 %}
{% endif %}
{% set scaled_pa = base_pa * nozzle_scale %}
# === Flow-based scaling (square root of flow ratio) ===
{% if max_flow > 0 %}
{% set flow_ratio = flow / max_flow %}
{% set flow_scale = flow_ratio ** 0.5 %}
{% set adjusted_pa = scaled_pa * flow_scale %}
{% else %}
{% set adjusted_pa = scaled_pa %}
{% endif %}
# === Set PA and store variable ===
SET_PRESSURE_ADVANCE ADVANCE={adjusted_pa} SMOOTH_TIME={smooth}
SET_GCODE_VARIABLE MACRO=SET_PA VARIABLE=pa VALUE={adjusted_pa}
# === Output status ===
{% set msg = "📐 PA scaled for nozzle " ~ nozzle|string ~ "mm | Base: " ~ base_pa|string ~
" ➜ x" ~ nozzle_scale|string ~ " (nozzle) ➜ x" ~ flow_scale|string ~ " (flow) = " ~ adjusted_pa|string ~
" | Smooth: " ~ smooth|string %}
RESPOND MSG="{msg}"
[gcode_macro SET_CHAMBER_HEAT]
description: Modular chamber heating logic with active/passive support, includes safety checks and debug output
# === OVERVIEW ===
# This macro heats the chamber to a target temperature using either:
# 1. An active heater (like a dedicated chamber heater), or
# 2. Passive heating (using the bed heater).
# It controls the bed heater, an optional chamber heater, and a circulation fan.
# It will block until the target temperature is reached.
# === SAFETY WARNINGS ===
# - Ensure your chamber temperature sensor is correctly installed and reporting.
# - Watch your printer during the first few uses of this macro.
# - Passive mode may take a long time to reach temperature.
# - Don't overheat your enclosure — check max safe temps for your printer!
# === PARAMETERS ===
# TARGET : (required) Target chamber temperature in °C.
# SENSOR : (optional) Temperature sensor name (default: temperature_sensor chamber_combined_mean).
# HEATER : (optional) Chamber heater name (used only if ACTIVE=True).
# BED_HEATER : (optional) Bed heater name (default: heater_bed).
# FAN : (optional) Circulation fan name (default: nevermore_fan).
# ACTIVE : (optional) If True, uses a dedicated heater; otherwise uses passive heating.
# === USAGE ===
# SET_CHAMBER_HEAT TARGET=60 ACTIVE=True HEATER="heater_generic chamber_heater"
# SET_CHAMBER_HEAT TARGET=60 ACTIVE=False
# === OVERVIEW ===
# Heats the chamber using:
# 🔥 Active: Chamber heater + bed + fan
# ❄️ Passive: Bed heater only
# ✅ Blocks until desired temperature is reached
gcode:
# === 🎛️ Parse Parameters ===
{% set target = params.TARGET|int %}
{% set sensor = params.SENSOR|default('temperature_sensor chamber_combined_mean') %}
{% set heater = params.HEATER|default('') %}
{% set bed_heater = params.BED_HEATER|default('heater_bed') %}
{% set bed_fan = params.FAN|default('nevermore_fan') %}
{% set active = params.ACTIVE|default("false")|lower == 'true' %}
{% set wait_temp = target if active else target - 25 %}
{% set msg = "🧰 [CHAMBER HEAT] Init | Target: " ~ target ~ "°C | Wait until: " ~ wait_temp ~ "°C | Mode: " ~ ("🔥 Active" if active else "❄️ Passive") %}
RESPOND MSG="{msg}"
M141 S{target} # Set virtual chamber temp for slicers
# === 🔥 ACTIVE MODE ===
{% if active %}
{% set msg = "🔥 [CHAMBER HEAT] Enabling active mode: chamber heater + bed + fan at full speed!" %}
RESPOND MSG="{msg}"
{% if heater|length > 0 %}
{% set msg = "🛠️ [CHAMBER HEAT] Chamber heater '" ~ heater ~ "' → " ~ target|string ~ "°C" %}
RESPOND MSG="{msg}"
SET_HEATER_TEMPERATURE HEATER={heater} TARGET={target}
{% endif %}
{% set msg = "🛏️ [CHAMBER HEAT] Bed heater '" ~ bed_heater ~ "' → " ~ target|string ~ "°C (support heat)" %}
RESPOND MSG="{msg}"
SET_HEATER_TEMPERATURE HEATER={bed_heater} TARGET={target}
{% set msg = "🌀 [CHAMBER HEAT] Fan '" ~ bed_fan ~ "' → speed = 100%" %}
RESPOND MSG="{msg}"
SET_FAN_SPEED FAN={bed_fan} SPEED=1.0
# === ❄️ PASSIVE MODE ===
{% else %}
{% if printer[sensor].temperature < wait_temp %}
{% set msg = "❄️ [CHAMBER HEAT] Chamber is cool (" ~ printer[sensor].temperature|round(1) ~ "°C) — warming with bed only!" %}
RESPOND MSG="{msg}"
{% set msg = "🌀 [CHAMBER HEAT] Fan '" ~ bed_fan ~ "' → speed = 50% (gentle circulation)" %}
RESPOND MSG="{msg}"
SET_FAN_SPEED FAN={bed_fan} SPEED=0.5
{% set msg = "🛏️ [CHAMBER HEAT] Bed heater '" ~ bed_heater ~ "' → 120°C (passive heating boost)" %}
RESPOND MSG="{msg}"
SET_HEATER_TEMPERATURE HEATER={bed_heater} TARGET=120
{% set msg = "⏳ [CHAMBER HEAT] Waiting for bed to reach 120°C..." %}
RESPOND MSG="{msg}"
TEMPERATURE_WAIT SENSOR="{bed_heater}" MINIMUM=120
{% else %}
{% set msg = "✅ [CHAMBER HEAT] Chamber already warm (" ~ printer[sensor].temperature|round(1) ~ "°C), skipping passive heat!" %}
RESPOND MSG="{msg}"
{% endif %}
{% set msg = "🌀 [CHAMBER HEAT] Fan '" ~ bed_fan ~ "' → speed = 100%" %}
RESPOND MSG="{msg}"
SET_FAN_SPEED FAN={bed_fan} SPEED=1.0
{% endif %}
# === ⏳ FINAL BLOCKING WAIT ===
{% set msg = "⏳ [CHAMBER HEAT] Waiting for chamber sensor '" ~ sensor ~ "' ≥ " ~ wait_temp ~ "°C..." %}
RESPOND MSG="{msg}"
TEMPERATURE_WAIT SENSOR="{sensor}" MINIMUM={wait_temp}
{% set msg = "🎉 [CHAMBER HEAT] Chamber ready! Final temp: " ~ printer[sensor].temperature|round(1) ~ "°C" %}
RESPOND MSG="{msg}"
[gcode_macro M106]
rename_existing: G106
description: Compresses fan speeds into 10–30% range if bed temp ≥ 70°C
# === OVERVIEW ===
# This macro overrides the default M106 behavior to apply a thermal-aware fan speed limiter.
# When the bed temperature is at or above 70°C, it compresses the part cooling fan speed range
# into a safer 10–30% range (i.e., 26–76 PWM) to reduce warping or delamination in high-temp materials.
#
# === WHY USE THIS ===
# - Prevents excessive part cooling when printing materials like ABS, ASA, or PC.
# - Helps maintain stable chamber temperatures and reduce thermal shock.
# - Minimizes curling or layer splitting due to sudden cooling on hot beds.
#
# === HOW TO USE ===
# Simply use M106 S<value> as usual in your G-code or slicer.
# The macro will automatically adjust the fan speed if needed based on bed temperature.
#
# === NOTES ===
# - This logic only applies when the bed temperature is 70°C or higher.
# - Below 70°C, full-range fan control is allowed.
# - You can customize the input/output compression range if needed.
# === PARAMETERS ===
# S: Standard fan speed in 0–255 (required by M106)
# Internal constants:
# min_input = 26 (10% of 255)
# max_input = 255 (100%)
# min_output = 26 (10%)
# max_output = 76 (30%)
gcode:
{% set fan_speed = params.S|default(0)|int %}
{% set bed_temp = printer["heater_bed"].temperature %}
{% set min_input = 26 %}
{% set max_input = 255 %}
{% set min_output = 26 %}
{% set max_output = 76 %}
{% if bed_temp >= 70 %}
# If below threshold, limit fan to the lower compressed range (10–30%)
{% if fan_speed < min_input %}
{% set compressed_speed = min_output %}
{% else %}
{% set compressed_speed = (min_output + ((fan_speed - min_input) * (max_output - min_output) / (max_input - min_input)))|int %}
{% endif %}
G106 S{compressed_speed}
{% else %}
# Below threshold, allow full fan speed as requested
G106 S{fan_speed}
{% endif %}