Back to the Gcode Dictionary
M307: Set or report heating process parameters
- Hn Heater number (0 is usually the bed heater)
- Rnnn Heating rate in degC/sec at full power when the heater temperature is close to ambient (RRF 3.2 and later)
- Annn (deprecated in RRF 3.2 and later in favour of the R parameter) gAin, expressed as ultimate temperature rise obtained in degC divided by the PWM fraction. For example, if G=180 then at 50% PWM the ultimate temperature rise would be 90C.
- Cnnn or Caaa:bbb dominant time Constant of the heating process in seconds. If two values are provided (supported in RRF 3.2beta3.2 and later), the first value is with the fan off and the second is with the fan on at full PWM.
- Dnnn Dead time in seconds
- Innn Invert PWM signal (I0 = not inverted, I1 = invert PWM/bang-bang signal for inverted temperature control [e.g. with Peltier elements], I2 = full PWM signal inversion, I3 = both) (supported by RRF > 1.20)
Additional parameters to help control the heating process:
- Bn selects Bang-bang control instead of PID if non-zero. Default at power-up is 0 for extruder heaters, 1 for the bed heater.
- Fnnn PWM frequency to use (RepRapFirmware 1.20 and later. Deprecated in RRF 3, use M950 to set the frequency when you define the heater.)
- Snnn maximum PWM to be used used with this heater on a scale of 0 to 1. Default 1.0.
- Vnnn VIN supply voltage at which the A parameter was calibrated (RepRapFirmware 1.20 and later). This allows the PID controller to compensate for changes in supply voltage. A value of zero disables compensation for changes in supply voltage. Use V0 for AC mains powered heaters. (V0 is the default. Leaving off V is the same as V0)
- M307 H0 ; report the process parameters for heater 0
- M307 H1 A346.2 C140 D5.3 B0 S0.8 V23.8; set process parameters for heater 1, use PID, and limit heater 1 PWM to 80%
- M307 H2 R2.186 C202.1:155.0 D5.67 S1.00 V24.0 ; set the process parameters (RRF 3.2beta3.2 or later)
Notes - RepRapFirmware 3
The F parameter is no longer supported. Use M950 to set the frequency in the M950 command that you use to define the heater .
The I2 parameter is no longer supported, and I3 does the same as I1. You can use M950 to invert the output.
You can no longer disable a heater using M307 A-1 C-1 D-1. To use the pin for something else, don't create a heater on that pin.
Example - old code:
M307 H0 F100 ; change heater 0 PWM frequency to 100Hz M307 H2 A-1 C-1 D-1 ; disable heater 2 so we can use its pin to drive a fan
M950 H0 C"bed_heat" Q100 T0 ; heater 0 uses the bed_heat pin, sensor 0, PWM frequency 100Hz ; No need to disable heater 2 because we didn't define it in the first place
Each heater and its corresponding load may be approximated as a first order process with dead time, which is characterised by the gain, time constant and dead time parameters. The model can used to calculate optimum PID parameters (including using different values for the heating or cooling phase and the steady state phase), to better detect heater faults, and to calculate feed-forward terms to better respond to changes in the load. Normally these model parameters are found by auto tuning - see M303 and Wiki:Tuning Temperature Control.
For those platforms that provide power voltage monitoring, the calibration voltage setting allows the heating controller to adjust the power automatically in response to changes in the power supply voltage. For example, if a bed or chamber heater is turned on or off, this may cause the power supply voltage to change a little, which if not corrected for would change the extruder heater power.
RepRapFirmware 1.16 and later allow the PID controller for a heater to be disabled by setting the A, C and D parameters to -1. This frees up the corresponding heater control pin for use as a general purpose I/O pin to use with the M42 or M280 command.