Skip to content

Model Predictive Temperature Control (MPC)

Miguel Risco-Castillo edited this page Dec 15, 2023 · 2 revisions

Currently, most of the precompiled binaries of the Professional Firmware are using MPC instead of PID for the extruder temperature control.

It is possible to enable this special feature by editing the configuration file. This Marlin feature will allow for more precise control of the temperature of the hotend and a very low overshoot. Currently it is being incorporated in all firmware versions for devices with enough program memory.

MPC

From the Marlin documentation:

"Temperature is commonly controlled with a PID algorithm. The basic premise of PID is that the further the temperature is from the set-point, the more power is applied. If you could supply PID with perfect temperature information, it could, in principle, apply perfect control. However real-life temperature information comes from sensors which exhibit both latency and noise. Model predictive control takes a different approach to PID. Instead of trying to control against the sensor output, it maintains a simulation of the system and uses the simulated hotend temperature to plan an optimal power output. The simulation has no noise and no latency, making near perfect control possible. To prevent the simulated system state diverging from the real life hotend state, the simulated temperature is continually gently dragged towards the temperature measure from the sensor. This does introduce a little noise and latency into the simulated system but the effect is far smaller than for PID."

This firmware supports MPC trought a MPC settings menu:

MPC2

To compile firmware with MPC, enable MPCTEMP and disable PIDTEMP in configuration.adv file, or enable MPC in the Professional Firmware Configurator, set the proper heater power and run MPC Autotune.

This feature was implemented in Marlin core by the user @tombrazier.