Welcome! Log In Create A New Profile

Advanced

Question: How Temperature control of nozzle actually works

Posted by Kappa95 
Question: How Temperature control of nozzle actually works
June 08, 2022 06:50AM
Dear community,

I would like to understand better how it works and behaves the temperature control for nozzle. Reading around I am confused if the method used is a Bang-Bang control or a PID control (and in this case what is the control action of this PID: a time in which the extruder signal is high i.e., duty cycle or directly the analogwrite value to the extruder).
I am asking this because I would like to replicate a very very simplified extruder control without all the sophisticated stuff implemented in Marlin in order to play with all the parameters in future. But at the beginning I would like to use the same method of Marlin for the temperature control in order to use also the same stock PID gains provided by the extruder designer (in order to be sure to don't burn nothing).
rq3
Re: Question: How Temperature control of nozzle actually works
June 08, 2022 11:49AM
Marlin currently has three methods of nozzle temperature control:
1) Bang-bang, in which the heater is either completely on or completely off in response to the temperature set point. If the temp is too low, the heater is fully on. If the temperature is too high, the heater is completely off.
2) PID (Proportional, Integral, Derivitive), an industry standard in which the software attempts to predict over time what the temperature will be in the future. The heater is pulse width modulated to maintain an "average" power that will maintain the temperature at set point.
3) MPC (Model Predictive Control), a new method that models the heater, sensor, heater block, and the environment to predict the pulse width modulation to the heater that will result in a stable set point temperature. Like PID, it constantly corrects itself for changing conditions (like filament feed rate, printing speed, and the effect of part cooling fans), but in my opinion does so much more smoothly and reliably. MPC has an auto-calibration function (M306 T) that works for me very well.
Re: Question: How Temperature control of nozzle actually works
June 08, 2022 12:51PM
Hence, for clarify the PID behavior. It works such as at any cycle it computes the control action and then the signal which arrives to the heaters pin is: analogwrite(heater_pin, control_action). Where the control_action computed by PID is bounded between 0 and 255.
Re: Question: How Temperature control of nozzle actually works
June 08, 2022 04:25PM
Marlin's PID option isn't purely PID. It's PID when within PID_FUNCTIONAL_RANGE of the target temperature and BANG-BANG outside.

For large temperature changes, this gets the temperature to target faster but the first over/under shoot isn't a classical PID waveform.
rq3
Re: Question: How Temperature control of nozzle actually works
June 09, 2022 11:07AM
Quote
[email protected]
Marlin's PID option isn't purely PID. It's PID when within PID_FUNCTIONAL_RANGE of the target temperature and BANG-BANG outside.

For large temperature changes, this gets the temperature to target faster but the first over/under shoot isn't a classical PID waveform.

A very good point! I think one of the reasons that the new MPC control works so well is that during calibration (M306 T), it intentionally overshoots the setpoint so that it can correct for it in the future. MPC is also "bang-bang", at least during inital heat-up, with 100% power applied until the hot end approaches set point. It then settles into control mode very smoothly. Worst case, I see about 0.5C overshoot, and it settles within 0.1C of set point within 20 seconds after that.

I have a 40 watt heater, pure silver heat block, and amplified PT1000 platinum sensor, and a diamond nozzle, so results may vary. Marlin 2.1.x.

Edited 1 time(s). Last edit at 06/09/2022 11:08AM by rq3.
Sorry, only registered users may post in this forum.

Click here to login