Part 2: PID Controller With SPICE-Modelled Thermistor Allows for Precise Temperature Profile Control
Nowadays it has become relatively simple to build temperature control systems with software like Simulink MATLAB. Depending on the complexity of these systems, the regulation can be performed with PI, PID, or fuzzy logic controllers. Simplicity of use, however, is not necessarily linked to low costs, as such programs can be very expensive. If you consider temperature control applications based on NTC thermistors, the level of precision that can be reached will depend strongly on the characterization method of the thermistor, including its tolerances. The focus of this article isn’t Simulink, but a zero-cost DIY method for achieving good temperature PID regulation in a simple system. This will be done with the help of a performant LTSpice electronic simulator and a precise thermistor model previously described.
In Old-School Analog Temperature Control Circuits Solved with Modern LTSpice Thermistor Dynamic Models, Part one1, we saw that it is possible to provide a SPICE model representing the temperature of a simple system and to feed it back to a voltage-driven thermistor, which is used to control the temperature of the system. Now we go to a next level of regulation with a NTC thermistor-based (completely analog) PID controller and its LTSpice model. This PID controller is intended to control the temperature of a system such as a small oven with a defined profile. The goal of the simulation is to stick to the defined profile as much as possible, with minimal deviation of temperature. For this application, the oven temperature will need to change as follows over a period a bit longer than one hour:
This temperature profile is one of the principal reasons why we need a PID controller, which will be able to very accurately follow the required dwells and slopes, while also avoiding big oscillations as much as possible. The second mission of our PID controller is to enable the system to react to external heat / cold noise, for example a variation of the external temperature as the alternative profile in figure 1 (grey curve). We are thus going to elaborate on a circuit proposal, simulate it, optimize it, and give some hints on how to relate this theoretical work to practical measurements.
Presentation of the Simulation
The total circuit is represented in Figure 2, with the following notes:
- There are two NTCLE203E3103_B0 thermistors in the sensing bridge. One is the physical sensing thermistor: the temperature sensor that senses the system temperature, with a time delay equal to the RC constant of the network connected to the node Ti. The second thermistor is there only for simulation. A piecewise linear file voltage is connected at the Tset node. This file contains the temporal information about the temperature profile to be followed (as defined in Figure 1). This is an ideal way to program our reference profile
- The heater unit consists of two fixed resistors R8 and R9 and a Darlington mounting based on two model ZTXB49 NPN transistors
- On the right of the “system” is a rough schematic of the oven, with a thermal mass represented by the capacitor Csystem. The heat generated in the oven is modelled by the B4 ABM (analog behavior) voltage source, which includes the dissipation from the oven to the surrounding temperature Tamb
- A pulse source (heat noise, and in this case it will be a cold source) is added in series to adequately represent the variation of the external ambient temperature (pulse of amplitude dT in the parameters)
- The SPICE directives contain the PID parameters Kp, Kd, and Ki; parasitic ambient source dT; thermistor response time Tau; fixed resistor tolerance RTOL.; and the NTC thermistor tolerance Rntctol and BTOL. for the B25/85 coefficient. The analysis is also performed for a worst case analysis with two special functions: vb() and wc() 
- The err function is the LTSpice RMS function of the difference between the produced system temperature Tsystem and the set temperature Tset. This err function must be minimized globally over the simulation time and will provide the optimal values for all circuit parameters