// Comment the following line to disable PID and enable bang-bang.
#define PIDTEMP
#ifdef PIDTEMP
// Limits current to nozzle while in bang-bang mode
#define BANG_MAX 255 // 255 is full current
// Limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below)
#define PID_MAX BANG_MAX // 255 is full current
// Sends debug data to the serial port
//#define PID_DEBUG
// Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define PID_OPENLOOP 1
// PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of
// approximately 1s useful for heaters driven by a relay
//#define SLOW_PWM_HEATERS
#define BANG_MAX 255 // limits current to nozzle while in bang-bang mode; 255=full current
#define PID_MAX BANG_MAX // limits current to nozzle while PID is active (see PID_FUNCTIONAL_RANGE below); 255=full current
#ifdef PIDTEMP
//#define PID_DEBUG // Sends debug data to the serial port.
//#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
//#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
// If the temperature difference between the target temperature and the actual temperature
// is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
#define PID_FUNCTIONAL_RANGE 10 // degC
// Limit for the integral term
#define PID_INTEGRAL_DRIVE_MAX PID_MAX
// Smoothing factor within the PID
#define K1 0.95
#define PID_INTEGRAL_DRIVE_MAX PID_MAX // Limit for the integral term
#define K1 0.95 // Smoothing factor within the PID
// HotEnd{HE0,HE1,HE2,HE3}
#define DEFAULT_Kp {41,41,41,41} // Kp for E0, E1, E2, E3