# New Option: Model Predictive Temperature Control (Experimental)

**URL:** https://marlin.crc.id.au/forum/t/new-option-model-predictive-temperature-control-experimental/782
**Category:** Firmware Builder
**Tags:** builder, hotend, marlin
**Created:** [1 April 2022 10:10 UTC](https://marlin.crc.id.au/forum/t/new-option-model-predictive-temperature-control-experimental/782 "2022-04-01T10:10:54Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![CRCinAU](https://marlin.crc.id.au/forum/user_avatar/marlin.crc.id.au/crcinau/32/1337_2.png) [@CRCinAU](https://marlin.crc.id.au/forum/u/CRCinAU)
#### Post date: [1 April 2022 10:10 UTC](https://marlin.crc.id.au/forum/t/new-option-model-predictive-temperature-control-experimental/782/1 "2022-04-01T10:10:54Z")

</div>

Hi all,

Support for a new option to replace PID heating for the hotend has [just been merged](https://github.com/MarlinFirmware/Marlin/pull/23751). This seems to have a lot better control over the hotend heater, and at least in my testing, seems to have a better profile for heating.

You can find the new setting in the Firmware Builder as per the below screenshot.

 ![image](https://discourse.crc.id.au/uploads/default/original/1X/404ea24c2b9f59ade6648573bc051d35821e9b4d.png)

The documentation [is still being processed](https://github.com/MarlinFirmware/MarlinDocumentation/pull/442) - but in simple terms, the new command `M306` is now added.

The basic options are:

```auto
 A<watts/kelvin> Ambient heat transfer coefficient (no fan).
 C<joules/kelvin> Block heat capacity.
 E<extruder> Extruder number to set. (Default: E0)
 F<watts/kelvin> Ambient heat transfer coefficient (fan on full).
 P<watts> Heater power.
 R<kelvin/second/kelvin> Sensor responsiveness (= transfer coefficient / heat capcity).
 T Autotune the active extruder.

```

Once you flash your printer with a MPC enabled firmware, set your heater power as per the rating - most printers have either 30W or 40W heaters (mine is 70W), so you’d run:

```auto
M306 P30 ; 30W heater
M306 P40 ; 40W heater
M306 P70 ; 70W heater

```

Once that’s done, run the autotune:

```auto
M306 T

```

At this point, the rest of the setup is automatic.

When it finishes, save your settings via `M500`.

On my personal printer, the heatup profile when from this with an overshoot of 10-15c when using PID:  
 ![image](https://discourse.crc.id.au/uploads/default/original/1X/7e3e383f41348015edc34d9ca29df609c60d81ba.png)

To this when autotuned using MPC:  
 ![image](https://discourse.crc.id.au/uploads/default/original/1X/9d7be57865d635e79f8d89be1f406798faee446f.png)

I look forward to seeing peoples feedback on this brand new feature.

---

_[View the full topic](https://marlin.crc.id.au/forum/t/new-option-model-predictive-temperature-control-experimental/782)._
