---
tag: m0306
title: Model Predictive Temp. Control
brief: Set MPC values for a hotend.
author: CRCinAU
contrib: StevilKnevil

group: thermal
since: 2.0.9.4
requires: MPCTEMP
eeprom: true

codes: [ M306 ]

notes:
- View current values with `M306` and no parameters.
- If `EEPROM_SETTINGS` is enabled, all calibration values are saved with [`M500`](/docs/gcode/M500.html), loaded with [`M501`](/docs/gcode/M501.html), and reset with [`M502`](/docs/gcode/M502.html).
- Heater Power (P) is related to the heater cartridge in the hotend. Most printers have 30 or 40 watt heaters.
- '`M306 T` will move your hotend to 1mm above the bed for optimal calibration. You should ensure your hotend and print bed are free from debris before running an auto-tune.'
- See the [MPC documentation](/docs/features/model_predictive_control.html) for more information about MPC parameters.

parameters:

- tag: A
  optional: true
  description: Ambient heat transfer coefficient (no fan).
  values:
  - tag: value
    type: float

- tag: C
  optional: true
  description: Heatblock Capacity (joules/kelvin)
  values:
  - tag: value
    type: float

- tag: E
  optional: true
  description: Extruder index. If omitted, the command applies to the active extruder.
  values:
  - tag: index
    type: int

- tag: F
  optional: true
  description: Ambient heat transfer coefficient (fan on full).
  values:
  - tag: value
    type: float

- tag: H
  optional: true
  description: Filament Heat Capacity (joules/kelvin/mm)
  values:
  - tag: value
    type: float

- tag: P
  optional: true
  description: Heater power in watts
  values:
  - tag: value
    type: float

- tag: R
  optional: true
  description: Sensor responsiveness (= transfer coefficient / heat capacity).
  values:
  - tag: value
    type: float

- tag: S
  optional: true
  since: 2.1.3
  requires: MPC_AUTOTUNE
  description: "Tuning method (with parameter '`T`'). (Default: 0 = AUTO)"
  values:
  - tag: 0
    description: Auto Select
  - tag: 1
    description: Differential
  - tag: 2
    description: Asymptotic

- tag: T
  optional: true
  requires: MPC_AUTOTUNE
  description: Autotune the selected extruder. Use parameter '`S`' to select the type of tuning to use.

examples:

- pre: 'Configure `MPCTEMP` for 40W hotend heater'
  code: M306 P40

- pre: 'Perform `MPCTEMP` *Differential* auto-tune - after setting heater element power'
  code: M306 T S1

---
