The cleanest hot-wire setup keeps a strict division of labour: cncfoam.com stays dumb about temperature et machine owns the heat. The tool emits only "wire on" and "wire off" (M8 / M9) — pure intent, no magnitude. How hot the wire actually gets is decided entirely on the hardware side.
Why temperature does NOT belong in the G-code
Wire heat depends on physics the design tool simply cannot know: the wire's length, gauge et alloy, your supply voltagela ambient temperature et airflow around it. If cncfoam.com baked a temperature number (an S value) into the cut, that number would be wrong on every other machine — and wrong on votre machine the moment you changed the wire, the supply or the room. You'd be re-cutting files on every hardware tweak. That is bad coupling. So cncfoam.com never writes a temperature value; the same G-code runs on any rig, and the heat is set where the physics actually lives — at the machine.
What cncfoam.com DOES contribute
- On/off intent —
M8brackets each cutting run,M9turns the wire off during travels, so it is only hot while actually cutting. - Préchauffage en pause — right after
M8it emits aG4pause (your Pre-heat ms) so the wire reaches temperature before it starts moving, avoiding a marked entry. - Feedrate + material presets — a starting feed per foam type. Feed and temperature are a pair, but the tool only sets the feed; you match the heat to it on the machine.
In other words, cncfoam.com owns the timing et motion; the machine owns the magnitude of the heat.
Doing the hardware side — two clean options
1. Manual / analog (simplest)
Run the wire through a MOSFET that the controller gates on and off with M8/M9, and set the actual heat by hand — a bench PSU voltage knob or a cheap PWM dimmer module you turn yourself. The controller never tries to set temperature; it just enables the circuit. You dial the heat per material with a quick test cut and leave it. Zero firmware complexity, and it works reliably.
2. Closed-loop constant-temperature (best)
A small dedicated MCU (an ESP32 is ideal) runs a fast inner loop that holds a temperature setpoint: it measures the wire (its resistance rises with temperature, or its current) and PWMs the power to keep the heat constant. The controller's M8 just enables this regulator. Because the loop reacts in milliseconds, the wire stays at the same temperature whether it is sweeping fast down a straight or crawling through a tight corner — so you get no burn marks where the cut slows. This is the "proper" foam-cutter approach, at the cost of a bit more build.
| Manual / analog | Closed-loop | |
|---|---|---|
| Sets temperature | You, by hand (knob/dimmer) | A dedicated MCU, automatically |
| Constant heat at any feed | No (drifts with speed) | Yes (regulated) |
| Build effort | Minimal | More (sensing + control) |
| cncfoam.com's role | Identical — emits only M8/M9 | |
See also Puissance de la hot-wire (the supply + MOSFET wiring), Température du fil, vitesse d'avance et débit (matching heat to feed on the foam side) and Sécurité & ventilation.