Influence of the Thermometer Inertia on the Quality of Temperature Control in a Hot Liquid Tank Heated with Electric Energy

This paper presents the medium temperature monitoring system based on digital proportional–integral–derivative (PID) control. For industrial thermometers with a complex structure used for measuring the temperature of the fluid under high pressure, the accuracy of the first-order model is inadequate. A second-order differential equation was applied to describe a dynamic response of a temperature sensor placed in a heavy thermowell (industrial thermometer). The quality of the water temperature control system in the tank was assessed when measuring the water temperature with a jacketed thermocouple and a thermometer in an industrial casing. A thermometer of a new design with a small time constant was also used to measure temperature. The quality of water temperature control in the hot water storage tank was evaluated using a classic industrial thermometer and a new design thermometer. In both cases, there was a K-type sheathed thermocouple inside the thermowell. Reductions in the time constant of the new thermometer are achieved by means of a steel casing with a small diameter hole inside which the thermocouple is precisely fitted. The time constants of the thermometers were determined experimentally with a jump in water temperature. A digital controller was designed to maintain the preset temperature in an electrically heated hot water tank. The function of the regulator was to adjust the power of the electrical heater to maintain a constant temperature of the liquid in the tank.


Introduction
Temperature measurement is the largest segment of all industrial measurements and can often have the most significant impact on process efficiency, energy consumption, and product quality.
High temperature, pressure, and process vibrations make robust temperature measurement devices essential for industrial applications. Besides, high accuracy, repeatability, and stability of temperature measurement are essential to ensure effective process control. A small measurement error can cause numerous disturbances or be very costly, so temperature measurements must be accurate and reliable. For this reason, every measuring system must be carefully designed and also subjected to rigorous control to meet process requirements.
Although many types of temperature sensors can be used, resistance temperature sensors and thermoelectric sensors are most commonly used in the industry [1]. The accuracy of thermocouples is influenced by several factors, including the type of thermocouple, its application range, measuring The temperature changes were controlled with the use of T-type thermoelectric sensors located either inside or along the heat pipe wall in the region between the evaporator and condenser. The measurements were used to evaluate the influence of the thermal capacity of walls, the temperature gradient of external walls, and the internal fluid adsorption. The internal, single-phase heat transfer coefficient was estimated, and the effective thermal conductivity of the projector was determined. It was found that heat conduction through pipe walls constitutes from 2% to 10% of the overall heat transfer coefficient, and significantly decreases with the increase in liquid advection at higher values of heat flow rates.
Optical fiber sensors are widely used in medical monitoring, military engineering, power systems, etc. for accurate measurement and the prediction of temperature and magnetic field intensity. The paper [14] presents research on micro-structured optical fiber as a high-sensitivity sensor with a temperature sensitivity of the nanometer scale and magnetic field of the picometer scale.
Seo et al. [15] proposed a flexible, detachable dual-output sensor for fluid temperature and moving dynamics based on the structural design of thermoelectric materials that detect changes in temperature and moving dynamics of water in high resolutions (<0.19 K and <0.03 cm/s). The authors conducted theoretical analysis and simulations of the structural design of thermoelectric materials (SDTM) modules' operation, the outcomes of which were compared with the results of experimental research.
Due to the great variety of processes in the industry as well as the different dimensions of the elements whose temperature is measured, various temperature measurement procedures are developed. The paper [16] proposes a method of measuring temperature on the inner surface of a microchannel based on the solution of the inverse problem of heat conduction. Due to the large dimensions of the thermocouple, it is not possible to place it inside the microchannel to measure the temperature of its inner surface. Therefore, the temperature of the easily accessible external surface of the duct is measured, and then the temperature and heat transfer coefficient on the internal surface of the duct is determined from the solution of the inverse problem.
A different approach to the determination of the heat transfer coefficient on the external surface of a mini channel is presented in paper [17]. Infrared thermography was used to avoid the insertion of large temperature sensors into the mini channel to determine the temperature distribution on its external surface. Then, a recovery of the heat transfer coefficient over the mini-channel outer surface and the internal boundary conditions were achieved with the measured temperature distributions and the inverse approach.
Modeling of heat transfer processes in dynamic scraped surface heat exchangers is a very complex problem. The processes in these types of heat exchangers comprise the complex dynamics of the flow of viscous, multi-phase temperature-dependent fluids. Analytical methods to study the mechanisms of liquid and heat transfer in dynamic scraped-surface heat exchangers are limited. To fully characterize the physical phenomena occurring inside the chamber, it is necessary to install an array of temperature and pressure sensors. The paper [18] presents the results of experimental research and computational fluid dynamics (CFD) modeling of such exchangers.
The analysis of factors influencing the process of fuel combustion in bubbling fluidized beds is the subject of the paper [19]. The thermographic camera measurements of temperature distribution in the fluidized bed were used to estimate the influence of key parameters of the process such as fluidization velocity, particle size, and pressure drop over the air distributor plate on the lateral mixing of bulk solids in bubbling fluidized beds. Utilizing the measured pressure drop over the bed, the sampled temperature field, and the finite volume method, the energy conservation equation was discretized at the pixel level. Next, the calculated effective heat transfer coefficient was used to determine the solid dispersion coefficient and solids volumetric fraction in the bed.
Under steady-state conditions, when the liquid temperature is constant, the temperature is measured with high accuracy because there is no damping or delay of the thermometer indications in relation to the medium temperature. When the temperature of a fluid changes rapidly, there are significant differences between the actual temperature of the fluid and the measured temperature. The reason for this is the time needed to transfer the heat to a temperature sensor in a solid casing. The PID (proportional-integral-derivative) is the most commonly used controller in the industry and has been the dominant control technique for process control for many decades [18,19].
The literature review shows that there are no fast response thermometers suitable for high-pressure fluid temperature measurement. The use of massive industrial thermometers in PID control systems results in the faulty operation of these systems, which may cause overheating of the pressure elements and too high a thermal stress and, consequently, decrease the lifetime of these elements.
In the digital PID controller, different mathematical models of thermometers were used to control the fluid temperature. Temperature sensors with a simple structure, such as a sheathed thermocouple, can be treated as inertial objects of the first order. Experimental tests were carried out to determine the time constants used in mathematical models for the thermometers investigated. One time constant is needed for the first order thermometer model and two time constants for the second-order model.
In this work, a digital PID control was developed to maintain a constant temperature in the domestic hot water tank. The electric heater raises the temperature of the water in the tank. A lumped capacity mathematical model of a hot water tank was developed, taking into account heat losses on the outer surface of the container. A second-order ordinary differential equation with two time constants describes the temporal changes of the temperature indicated by the thermometer. The time constants of the thermometer were pre-determined experimentally. The second-order equation for the thermometer was replaced by a system of two ordinary first-order differential equations to increase the accuracy of the numerical temperature determination of the thermometer. Thus, the time variations of the water and thermometer temperatures are described by a system of three first-order ordinary differential equations. The initial problem for the system of ordinary differential equations was solved by the Runge-Kutta method of the fourth order.
The task of the digital PID controller is to maintain the set temperature in the tank. It was shown that the new design thermometer, characterized by low inertia, contributes to faster achievement of the set temperature in the tank.
The use of a fast response thermometer reduces the electricity consumption for maintaining constant water temperature in the tank. Over one month and longer, these savings are noticeable. A digital PID control system has been developed, which operates online without large financial outlays. An important new element in this system is the use of a second-order inertial model to describe the dynamics of a complex thermometer. The second-order inertial model takes into account the delay of the thermometer reading in relation to changes in liquid temperature.
The main aim of the article was to compare the PID temperature control system using an industrial thermometer and a fast response thermometer developed by the authors. Ultimately, the low inertia thermometer will be used in temperature control systems for steam or gas with high temperature and pressure flowing at high velocity. Currently, massive thermometers are used [9,10], which prevent proper operation of the cascade PID regulation used to maintain the set temperature of superheated steam.
The novelty of the article is a numerical model of the thermometer tank system, which allows for the simulating of the operation of the PID control system. Simulations carried out with the use of a digital PID controller show that in the case of an object with a very high thermal inertia, the influence of the thermometer's inertia on the quality of control is not great. Much better effects of PID controller operation can be obtained, e.g., in case of large steam superheaters in power boilers, because the superheater's time constant is shorter and differences between industrial and new thermometer inertia are much bigger [9,10].

Mathematical Model of the Thermometer and Water Storage Tank
PID control systems are also widely used in the energy sector and many other industries. The operation of PID systems in temperature control of high pressure and temperature fluids is often faulty due to the high inertia of thermometers. The novelty of the paper is to develop a dynamic Energies 2020, 13, 4039 5 of 18 mathematical model of the system to analyze the operation of a PID control system with a conventional industrial thermometer and a newly designed low inertia thermometer. The digital PID control of temperature in the hot water tank will be shown. The heat storage tank is depicted in Figure 1.
Energies 2020, 13, x FOR PEER REVIEW 5 of 19 control of temperature in the hot water tank will be shown. The heat storage tank is depicted in Figure  1. The following assumptions were made in the construction of a mathematical model of a hot water tank with thermometers: • the temperature of the water in the tank is uniform and depends only on time, • the time-dependent temperature of the water and steel wall of the tank are identical, • the tank was modelled as a body with lumped thermal capacity at the temperature Tw,out(t) (Figure 1), • the heat transfer coefficients on the inner surface of the tank and the outer surface of the insulation are constant, • an industrial thermometer, as well as a fast response thermometer, were modeled as inertial objects of the second order.
The energy conservation equation for the hot water tank has the following form where ρw-denotes water density, kg/m 3 , cw-water specific isobaric heat capacity, J/(kg·K), mm-the mass of the storage tank, kg, cm-stainless steel specific heat capacity, J/(kg·K), Tw,in-inlet water temperature, °C, Tw,out-outlet and storage tank water temperature, °C, el Q  -heat flow rate transferred from an electric heater to water, W, and loss Q  -heat losses to the environment, W.
By converting the last equation for the time derivative of the water temperature, one obtains V str -water volume flow rate, m 3 /s.
The following assumptions were made in the construction of a mathematical model of a hot water tank with thermometers: • the temperature of the water in the tank is uniform and depends only on time, • the time-dependent temperature of the water and steel wall of the tank are identical, • the tank was modelled as a body with lumped thermal capacity at the temperature T w,out (t) (Figure 1), • the heat transfer coefficients on the inner surface of the tank and the outer surface of the insulation are constant, • an industrial thermometer, as well as a fast response thermometer, were modeled as inertial objects of the second order.
The energy conservation equation for the hot water tank has the following form where ρ w -denotes water density, kg/m 3 , c w -water specific isobaric heat capacity, J/(kg·K), m m -the mass of the storage tank, kg, c m -stainless steel specific heat capacity, J/(kg·K), T w,in -inlet water temperature, • C, T w,out -outlet and storage tank water temperature, • C, . Q el -heat flow rate transferred from an electric heater to water, W, and . Q loss -heat losses to the environment, W. By converting the last equation for the time derivative of the water temperature, one obtains Energies 2020, 13, 4039 6 of 18 Equation (2) gives the rate of change of the water temperature. The heat flow to the environment (heat loss to the surroundings) is calculated as follows where A in is the area of the storage tank inner surface, m 2 , and U in is the overall heat transfer coefficient referred to the inner surface of the tank The heat flux . q in at the inner surface of the tank is given by where The symbols R in , R wall , R isol, and R out in Equations (5) and (6) denote, respectively, inner convective thermal resistance, the conductive thermal resistance of the tank wall, the conductive thermal resistance of the insulation, and outer convective thermal resistance. The thermal circuit for heat flow from hot water through a metal tank wall and thermal insulation to the environment is illustrated in Figure 2.
Equation (2) gives the rate of change of the water temperature. The heat flow to the environment (heat loss to the surroundings) is calculated as follows where Ain is the area of the storage tank inner surface, m 2 , and Uin is the overall heat transfer coefficient referred to the inner surface of the tank The heat flux in q  at the inner surface of the tank is given by The symbols Rin, Rwall, Risol, and Rout in Equations (5) and (6) denote, respectively, inner convective thermal resistance, the conductive thermal resistance of the tank wall, the conductive thermal resistance of the insulation, and outer convective thermal resistance. The thermal circuit for heat flow from hot water through a metal tank wall and thermal insulation to the environment is illustrated in Figure 2. An industrial thermometer was used to control the temperature in the water tank. Due to its complex construction and massive housing, the thermometer was modeled as a second-order inertial object. The second-order ordinary differential equation was used to describe its transient behavior . q in , . q out -heat flux ant the inner surface of the tank wall and outer surface of the insulation, T w,out -water temperature at the tank, T wall,in , T wall,out -the temperature of the inner and outer surface of the tank wall, T isol,out -the temperature of the outer surface of the insulation, T env -environment temperature.
An industrial thermometer was used to control the temperature in the water tank. Due to its complex construction and massive housing, the thermometer was modeled as a second-order inertial object. The second-order ordinary differential equation was used to describe its transient behavior where τ 1 and τ 2 denotes the thermometer time constants. The symbols T t and T w,out stand for the temperature indicated by the thermometer and water temperature, respectively. The second-order differential Equation (7) was replaced by a system of two first-order differential equations The set of three ordinary differential Equations (2), (8) and (9) is subject to the following initial conditions T w,out t = 0 = T 0 (10) where: T 0 -the initial water and thermometer temperature, V 0 -initial value of the thermometer temperature rate. The mathematical model of the storage tank and the thermometer consisting of Equation (2) for the tank and two Equations (8) and (9) for the thermometer was solved by the Runge-Kutta fourth-order method. For numerical solving of ordinary differential equations, various methods can be used, such as one-step methods, for example, the explicit and implicit Euler methods with the first order of accuracy, or the Runge-Kutta method, and the multi-step methods, for instance, the Milne or Adams-Moulton method [20]. The Euler methods are simple and can be used for non-linear initial value problems. On the other hand, they are less accurate. The approximation error is proportional to the step size. A good approximation is obtained with a very small step size leading to more considerable computation time. The Milne method is simple, but it is subject to an instability problem in certain cases. The Adams-Moulton method does not have the instability problem as the Milne method but requires a set of starting values calculated by some other technique. The fourth-order Runge-Kutta methods are widely used in computer solutions to differential equations. The classic Runge-Kutta methods have proven themselves of substantial value and power for a broad range of scientific and engineering problems. They are easy to implement, explicit, very stable, fast, and self-starting. The fourth-order Runge-Kutta method is computationally more efficient than the Euler and other methods because the steps can be many times greater for the same accuracy. The primary disadvantages of Runge-Kutta methods are that they require significantly more computer time than multi-step methods of comparable accuracy [21].
The developed mathematical model of the water reservoir system including the thermometer simulated the transient behavior of the real system and was used in the digital PID control system.

PID Controller
PID regulators are the most commonly used regulators in industrial practice [22,23]. In this paper, the temperature of the water in the storage tank is regulated using a digital PID controller ( Figure 3).   T set w,out -the set temperature of the water in the tank, T w,out -the temperature of the water in the tank and its outlet, T t -thermometer temperature, . Q el -the power of the electric heater, D(t)-disturbances, e-the difference between the preset and actual measured value.
The PID controller is designed to keep the temperature of the water in the tank constant. The electrical power of the heater u = . Q el is selected in successive time steps so that the difference between the set temperature T set w,out and the temperature of the thermometer T t , i.e., e = T set w,out − T t was equal to zero. The PID regulator equation has the following form [23]: Equation (13) can be written as where: u(t)-the output from the controller, t-time, s, u-average output from the controller, K p -the proportional gain of the PID controller, e(t)-the difference between the preset and actual measured value, τ i -integration time, s, τ d -differential time, s, K i -the integral gain of the PID controller, s −1 , and K d -the derivative gain of the PID controller, s. Equation (14) can be rewritten in a discrete form. The integral in the regulator equation is calculated approximately using the rectangles method, and the derivative is replaced by the backward finite-difference. The use of the backward difference results in a simple formula for calculating the u k value, without the need for iterative calculations. At the time point t k , the value of the output signal u k is where: u k = u(t k ), e k = e(t k ), t k = k∆t, k = 1,2, . . . Subsequently, u k−1 for the time t k−1 can be expressed as Subtracting Equation (16) from Equation (15) results in The transformation of Equation (17) leads to an equation used in further calculations Equation (18) is the basis for the operation of a digital PID controller.

Determination of Time Constants of Thermometers Used to Measure Water Temperature
Two different thermometers that can be used to measure the water temperature in the tank were analyzed (Figure 4). A classic industrial thermometer is presented in Figure 4a. The sheathed thermocouple is isolated from the housing with ceramic cylinders. The space between the outer surface of ceramic cylinders and the inner surface of the housing is filled with a bulk porous material, which provides additional thermal resistance. For this reason, an industrial thermometer of classic design has high thermal inertia characterized by a delay of the thermometer indications in relation to the changes of the liquid temperature. analyzed (Figure 4). A classic industrial thermometer is presented in Figure 4a. The sheathed thermocouple is isolated from the housing with ceramic cylinders. The space between the outer surface of ceramic cylinders and the inner surface of the housing is filled with a bulk porous material, which provides additional thermal resistance. For this reason, an industrial thermometer of classic design has high thermal inertia characterized by a delay of the thermometer indications in relation to the changes of the liquid temperature.  Due to the delayed response of the thermometer, a second-order mathematical model with two time constants was used. The thermometer shown in Figure 4b has much better dynamic properties, with the inner jacket thermocouple well attached to the inner casing. The quality of water temperature control in the hot water storage tank was evaluated using a classic industrial thermometer and a new design thermometer. In both cases, there was a K-type sheathed thermocouple inside the thermowell. Reductions in the time constant of the new thermometer are achieved by means of a steel casing with a small diameter hole inside which the thermocouple is precisely fitted. The diameter of the thermocouple sheath was 1 mm. The casing, together with the thermocouple, was treated as a solid steel cylinder in the axis of which time changes in temperature Due to the delayed response of the thermometer, a second-order mathematical model with two time constants was used. The thermometer shown in Figure 4b has much better dynamic properties, with the inner jacket thermocouple well attached to the inner casing. The quality of water temperature control in the hot water storage tank was evaluated using a classic industrial thermometer and a new design thermometer. In both cases, there was a K-type sheathed thermocouple inside the thermowell. Reductions in the time constant of the new thermometer are achieved by means of a steel casing with a small diameter hole inside which the thermocouple is precisely fitted. The diameter of the thermocouple sheath was 1 mm. The casing, together with the thermocouple, was treated as a solid steel cylinder in the axis of which time changes in temperature are known. The dynamic properties of the thermometer in Figure 4b will also be represented by two time constants.
For the experimental determination of the time constants τ 1 and τ 2 , Equation (7) was solved with a stepwise change in water temperature (Figure 5a). This solution has the following form A diagram of the thermometer response to unit jump (Heaviside function) in liquid temperature is shown in Figure 5b. A sudden change of the ambient temperature was realized by sudden insertion of the thermometer with the initial temperature T 0 into hot water of T w,out temperature.
The temperature of the thermometer was measured in a few hundred points. Sampling time was 1 s. Thermometer temperatures T t (t i ), i = 1, 2, ..., n t measured at time points were approximated by Equation (19) using the least-squares method [24]. The values of time constants τ 1 and τ 2 , at which the sum of squares of temperature differences between the temperature indicated by the thermometer and calculated using the Equation (19) reaches the minimum, were determined by the Levenberg-Marquardt method where the measured dimensionless temperature of the thermometer is given by The following time constants were obtained • industrial thermometer: τ 1 = 7.43 s, τ 2 = 57.76 s, • fast-response thermometer: τ 1 = 3.07 s, τ 2 = 8.256 s.
The measurement data and time response of the industrial thermometer are shown in Figure 6. The logarithmic time coordinate used in Figures 6b and 7b allows us to show the delay of the thermometer readings at the beginning of the thermometer heating after it is suddenly put in the water. The adopted second-order thermometer model ensures good compatibility with experimental data. Figure 7 illustrates illustrates the time response of the fast-response thermometer. To assess the response rate of both thermometers, the time has been determined, after which the dynamic error in temperature measurement is 1%. The dynamic error of water temperature measurement was calculated using the expression Energies 2020, 13, x FOR PEER REVIEW 10 of 19 are known. The dynamic properties of the thermometer in Figure 4b will also be represented by two time constants.
For the experimental determination of the time constants τ1 and τ2, Equation (7) was solved with a stepwise change in water temperature (Figure 5a). This solution has the following form A diagram of the thermometer response to unit jump (Heaviside function) in liquid temperature is shown in Figure 5b. A sudden change of the ambient temperature was realized by sudden insertion of the thermometer with the initial temperature T0 into hot water of Tw,out temperature. The temperature of the thermometer was measured in a few hundred points. Sampling time was 1 s. Thermometer temperatures Tt (ti), i = 1, 2, ..., nt measured at time points were approximated by Equation (19) using the least-squares method [24]. The values of time constants τ1 and τ 2, at which the sum of squares of temperature differences between the temperature indicated by the thermometer and calculated using the Equation (19) reaches the minimum, were determined by the Levenberg-Marquardt method where the measured dimensionless temperature of the thermometer is given by The following time constants were obtained • industrial thermometer: τ1 = 7.43 s, τ2 = 57.76 s, • fast-response thermometer: τ 1 = 3.07 s, τ 2 = 8.256 s.
The measurement data and time response of the industrial thermometer are shown in Figure 6. The logarithmic time coordinate used in Figures 6b and 7b allows us to show the delay of the thermometer readings at the beginning of the thermometer heating after it is suddenly put in the data. Figure 7 illustrates illustrates the time response of the fast-response thermometer. To assess the response rate of both thermometers, the time has been determined, after which the dynamic error in temperature measurement is 1%. The dynamic error of water temperature measurement was calculated using the expression In Figure 6a both the delay of the thermometer reading and the differences between the measurement data and the fit curve are invisible. The use of the logarithmic time-axis (Figure 6b) makes them visible. The time tx after which the dynamic measurement error reaches the required value eTx is determined from the following non-linear algebraic equation (a) (b)  Assuming the value of dynamic temperature measurement error eTx = −1% in Equation (23), the required measurement time tx is obtained, which for an industrial thermometer is 274 s and for a fastresponse thermometer 42 s.
It is, therefore, to be expected that the digital PID control system will work faster and more accurately with a fast-response thermometer.

Examples of Application of a Digital PID Controller to Maintain a Constant Temperature in the Water Tank
The hot water tank was chosen as a test facility due to, among other things, a simple mathematical model describing transient changes in water temperature. Moreover, in the secondorder thermometer model, which is analyzed in the article, it was necessary to determine two time constants experimentally. These constants were determined for hot water for the industrial thermometer and fast response thermometer. The digital PID control system for maintaining the set temperature of water in the tank allowed us to use experimentally verified mathematical models of massive thermometers. A certain disadvantage of the system is its high thermal inertia due to a large amount of water stored in the tank. In such a tank, even thermometers with high thermal inertia work properly. Differences in the quality of water temperature control using a digital PID controller and tested thermometers will be more visible in devices with low thermal inertia, such as, e.g., steam superheaters in power boilers or steam or gas pipelines in which a medium with high temperature and pressure flows.
Two examples of the application of the digital PID controller will be presented. The first example shows a developed control system for changing the volume flow rate of water entering the storage tank. In the second case, the operation of the controller over a long period will be analyzed. The hot water tank has neither been supplied with water nor taken from the storage tank. The electric resistance heater was switched on due to heat losses from water to the environment through the insulated tank wall. For the purpose of the control system, a mathematical model of a volume water heater (heat storage tank) was developed, the diagram of which is shown in Figure 1. The hot water tank was made as a cylindrical tank closed at both ends with elliptical bottoms. The inner diameter of the tank is din = 0.445 m, the wall thickness δ = 0.0045 m, and the height of the cylindrical part of the tank Hc and the heights of the elliptical head Heh are 0.818 m and 0.140 m, respectively. The tank is entirely covered with 0.061 m thick thermal insulation made of polyurethane foam with thermal conductivity kisol = 0.03 W/(m·K). An electric resistance heater with a nominal power of 2500 W was used to heat water in the tank. The temperature of water in the tank was controlled by an industrial thermometer and a fast response thermometer. In Figure 6a both the delay of the thermometer reading and the differences between the measurement data and the fit curve are invisible. The use of the logarithmic time-axis (Figure 6b) makes them visible. The time t x after which the dynamic measurement error reaches the required value e Tx is determined from the following non-linear algebraic equation

Example I
Assuming the value of dynamic temperature measurement error e Tx = −1% in Equation (23), the required measurement time t x is obtained, which for an industrial thermometer is 274 s and for a fast-response thermometer 42 s.
It is, therefore, to be expected that the digital PID control system will work faster and more accurately with a fast-response thermometer.

Examples of Application of a Digital PID Controller to Maintain a Constant Temperature in the Water Tank
The hot water tank was chosen as a test facility due to, among other things, a simple mathematical model describing transient changes in water temperature. Moreover, in the second-order thermometer model, which is analyzed in the article, it was necessary to determine two time constants experimentally. These constants were determined for hot water for the industrial thermometer and fast response thermometer. The digital PID control system for maintaining the set temperature of water in the tank allowed us to use experimentally verified mathematical models of massive thermometers. A certain disadvantage of the system is its high thermal inertia due to a large amount of water stored in the tank. In such a tank, even thermometers with high thermal inertia work properly. Differences in the quality of water temperature control using a digital PID controller and tested thermometers will be more visible in devices with low thermal inertia, such as, e.g., steam superheaters in power boilers or steam or gas pipelines in which a medium with high temperature and pressure flows.
Two examples of the application of the digital PID controller will be presented. The first example shows a developed control system for changing the volume flow rate of water entering the storage tank. In the second case, the operation of the controller over a long period will be analyzed. The hot water tank has neither been supplied with water nor taken from the storage tank. The electric resistance heater was switched on due to heat losses from water to the environment through the insulated tank wall. For the purpose of the control system, a mathematical model of a volume water heater (heat storage tank) was developed, the diagram of which is shown in Figure 1. The hot water tank was made as a cylindrical tank closed at both ends with elliptical bottoms. The inner diameter of the tank is d in = 0.445 m, the wall thickness δ m = 0.0045 m, and the height of the cylindrical part of the tank H c and the heights of the elliptical head H eh are 0.818 m and 0.140 m, respectively. The tank is entirely covered with 0.061 m thick thermal insulation made of polyurethane foam with thermal conductivity k isol = 0.03 W/(m·K). An electric resistance heater with a nominal power of 2500 W was used to heat water in the tank. The temperature of water in the tank was controlled by an industrial thermometer and a fast response thermometer.

Example I
Water with a temperature of T w , in = 15 • C was supplied to the tank, which flowed at a velocity of w w = 1 m/s. After time t = 300 s the water supply was closed. The changes in water velocity in the feed line is depicted in Figure 8. In the first stage, hot water with a temperature of 60 • C was taken from the tank, and the water loss in the tank was continuously refilled with fresh water with a much lower temperature of 15 • C. Water with a temperature of Tw,in = 15 °C was supplied to the tank, which flowed at a velocity of ww = 1 m/s. After time t = 300 s the water supply was closed. The changes in water velocity in the feed line is depicted in Figure 8. In the first stage, hot water with a temperature of 60 °C was taken from the tank, and the water loss in the tank was continuously refilled with fresh water with a much lower temperature of 15 °C. The system of differential Equations (2), (8), and (9) was used to determine the temperature changes of the water and thermometer during the heater operation. The system was solved by the Runge-Kutta method of the fourth order. The power of the electrical heater set by the regulator is depicted in Figure 9. The calculated temperature changes of the thermometers are illustrated in Figure 10, and the water temperature in Figure 11. Figures 10a and 11a show the temperatures of thermometers and water for the following parameters: the proportional gain of the PID controller Kp = 5.0 W/K, the integral gain Ki = 1 s −1 , and the derivative gain Kd = 2 s, which were selected at random without using any algorithm to determine their optimum values. Figures 10b and 11b show industrial and low inertia thermometer temperatures for another set of parameters: Kp = 1640 W/K, the integral gain Ki = 100 s −1 , and the derivative gain Kd = 10 s, whose values were determined using trial-and-error tuning. Trial-and-error tuning is well described by Ingham et al. [25] and by Sung et al. [26]. By changing the parameters of the PID controller, the set water temperature is reached faster. After just 1770 s, the water temperature of 60 °C was reached, while in the first case, even after 10,000 s, the water temperature was still unstable. The performance of the PID regulator could be further improved by using more sophisticated PID regulator tuning methods such as the first or second Ziegler-Nichols rules [27], internal model control (IMC) tuning relations, tuning relations based on integral error criteria, or even others [28]. The system of differential Equations (2), (8), and (9) was used to determine the temperature changes of the water and thermometer during the heater operation. The system was solved by the Runge-Kutta method of the fourth order. The power of the electrical heater set by the regulator is depicted in Figure 9. The calculated temperature changes of the thermometers are illustrated in Figure 10, and the water temperature in Figure 11. In the case of the fast response thermometer, the heater started to heat at full power of 2500 W after 223 s, and in the case of the industrial thermometer, the time to reach full power of the heater was longer and amounted to 268 s. The control system is more dynamic when using a fast response thermometer. The power of the heater in the adjustment system with the new thermometer starts to decrease after 1908 s, while for the industrial thermometer the time of the beginning of the power reduction was 2001 s. In the case of the fast response thermometer, the heater started to heat at full power of 2500 W after 223 s, and in the case of the industrial thermometer, the time to reach full power of the heater was longer and amounted to 268 s. The control system is more dynamic when using a fast response thermometer. The power of the heater in the adjustment system with the new thermometer starts to decrease after 1908 s, while for the industrial thermometer the time of the beginning of the power reduction was 2001 s. Better dynamic properties of the fast response thermometer can be seen in Figure 11. When the water temperature drops, the new thermometer shows a lower temperature, both when the water is cooled down during the cold-water supply to the tank and when the electrical power is switched off after 1908 s. It can be seen that if the water temperature is over-regulated above the 60 °C set point, the thermometer temperature drops very slowly. After a time of 1908 s for a new thermometer, the heater is completely switched off, and the drop in the tank water temperature is only caused by heat loss to the environment.
As a result of supplying cold water at a temperature of 15 °C to the tank, the temperature of the water was quickly reduced to around 54 °C ( Figure 11). After 300 s, the cold-water supply to the tank has ended.

Example II
In the second case, it was assumed that no water is taken from the tank. The PID controller settings were as follows: the proportional gain Kp = 5.0 W/K, the integral gain Ki = 1.0 s −1 , and the derivative gain Kd = 2.0 s. There is a loss of heat to the environment, which is calculated using Equation (3). The overall heat transfer coefficient of a multi-layer insulated wall Uin given by Equation (4) is related to the internal surface of the tank. Such a situation causes the digital PID controller to switch on the heater as soon as the water temperature decreases slightly and switches off after exceeding the set temperature equal 60 °C. This process is accompanied by the oscillating temperature changes of both types of industrial thermometers ( Figure 12) and the water temperature in the tank ( Figure 13). As can be seen from Figures 12 and 13, the lower amplitude medium temperature oscillations occur when a modern low inertia thermometer with a smaller time constant is used for temperature measuring. Figure 11. Changes in water temperature in the water volume heater obtained for the following PID controller settings: (a) K p = 5.0 W/K, the integral gain K i = 1 s −1 , and the derivative gain K d = 2 s, (b) K p = 1640 W/K, the integral gain K i = 100 s −1 , and the derivative gain K d = 10 s. Figures 10a and 11a show the temperatures of thermometers and water for the following parameters: the proportional gain of the PID controller K p = 5.0 W/K, the integral gain K i = 1 s −1 , and the derivative gain K d = 2 s, which were selected at random without using any algorithm to determine their optimum values. Figures 10b and 11b show industrial and low inertia thermometer temperatures for another set of parameters: K p = 1640 W/K, the integral gain K i = 100 s −1 , and the derivative gain K d = 10 s, whose values were determined using trial-and-error tuning. Trial-and-error tuning is well described by Ingham et al. [25] and by Sung et al. [26]. By changing the parameters of the PID controller, the set water temperature is reached faster. After just 1770 s, the water temperature of 60 • C was reached, while in the first case, even after 10,000 s, the water temperature was still unstable. The performance of the PID regulator could be further improved by using more sophisticated PID regulator tuning methods such as the first or second Ziegler-Nichols rules [27], internal model control (IMC) tuning relations, tuning relations based on integral error criteria, or even others [28].
In the case of the fast response thermometer, the heater started to heat at full power of 2500 W after 223 s, and in the case of the industrial thermometer, the time to reach full power of the heater was longer and amounted to 268 s. The control system is more dynamic when using a fast response thermometer. The power of the heater in the adjustment system with the new thermometer starts to decrease after 1908 s, while for the industrial thermometer the time of the beginning of the power reduction was 2001 s. Better dynamic properties of the fast response thermometer can be seen in Figure 11. When the water temperature drops, the new thermometer shows a lower temperature, both when the water is cooled down during the cold-water supply to the tank and when the electrical power is switched off after 1908 s. It can be seen that if the water temperature is over-regulated above the 60 • C set point, the thermometer temperature drops very slowly. After a time of 1908 s for a new thermometer, the heater is completely switched off, and the drop in the tank water temperature is only caused by heat loss to the environment.
As a result of supplying cold water at a temperature of 15 • C to the tank, the temperature of the water was quickly reduced to around 54 • C ( Figure 11). After 300 s, the cold-water supply to the tank has ended.

Example II
In the second case, it was assumed that no water is taken from the tank. The PID controller settings were as follows: the proportional gain K p = 5.0 W/K, the integral gain K i = 1.0 s −1 , and the derivative gain K d = 2.0 s. There is a loss of heat to the environment, which is calculated using Equation (3). The overall heat transfer coefficient of a multi-layer insulated wall U in given by Equation (4) is related to the internal surface of the tank. Such a situation causes the digital PID controller to switch on the heater as soon as the water temperature decreases slightly and switches off after exceeding the set temperature equal 60 • C. This process is accompanied by the oscillating temperature changes of both types of industrial thermometers ( Figure 12) and the water temperature in the tank ( Figure 13). As can be seen from Figures 12 and 13, the lower amplitude medium temperature oscillations occur when a modern low inertia thermometer with a smaller time constant is used for temperature measuring.

Example II
In the second case, it was assumed that no water is taken from the tank. The PID controller settings were as follows: the proportional gain Kp = 5.0 W/K, the integral gain Ki = 1.0 s −1 , and the derivative gain Kd = 2.0 s. There is a loss of heat to the environment, which is calculated using Equation (3). The overall heat transfer coefficient of a multi-layer insulated wall Uin given by Equation (4) is related to the internal surface of the tank. Such a situation causes the digital PID controller to switch on the heater as soon as the water temperature decreases slightly and switches off after exceeding the set temperature equal 60 °C. This process is accompanied by the oscillating temperature changes of both types of industrial thermometers ( Figure 12) and the water temperature in the tank ( Figure 13). As can be seen from Figures 12 and 13, the lower amplitude medium temperature oscillations occur when a modern low inertia thermometer with a smaller time constant is used for temperature measuring.  The range of temperature changes indicated by an industrial thermometer (Figures 12 and 13) is higher than that of a fast response thermometer. Such behavior of thermometers is due to the larger τ 1 and τ 2 time constants for the industrial thermometer compared to the fast response thermometer. The lower amplitudes for both thermometers are identical because the minimum heater power that the regulator can set is 0, i.e., the regulator cannot set the negative power of the heaters. Energies 2020, 13, x FOR PEER REVIEW 16 of 19 Figure 13. Temperature variations of the water temperature for low inertia and industrial thermometer as a function of time.
The range of temperature changes indicated by an industrial thermometer (Figures 12 and 13) is higher than that of a fast response thermometer. Such behavior of thermometers is due to the larger τ1 and τ2 time constants for the industrial thermometer compared to the fast response thermometer. The lower amplitudes for both thermometers are identical because the minimum heater power that the regulator can set is 0, i.e., the regulator cannot set the negative power of the heaters.
Although the differences in water temperature oscillations for the fast response and conventional thermometer are marginal, this results in noticeable differences in the electricity used to heat it. Figure 14 illustrates the changes in heater power over time.  Figure 14 illustrates that differences in the power consumed to heat water with a new and conventional thermometer are noticeable. The calculated monthly energy consumption for maintaining a constant tank water temperature was 27.86 kWh when a thermometer with the small time constant was used in the PID control system, and 43.16 kWh when an industrial thermometer was applied. The use of an industrial thermometer with a high time constant will contribute to the increase of electric energy consumption in domestic hot water production.

Conclusions
A digital PID control system for maintaining the prescribed temperature in the domestic hot water tank is presented. A conventional thermometer and a special design fast response thermometer Although the differences in water temperature oscillations for the fast response and conventional thermometer are marginal, this results in noticeable differences in the electricity used to heat it. Figure 14 illustrates the changes in heater power over time. The range of temperature changes indicated by an industrial thermometer (Figures 12 and 13) is higher than that of a fast response thermometer. Such behavior of thermometers is due to the larger τ1 and τ2 time constants for the industrial thermometer compared to the fast response thermometer. The lower amplitudes for both thermometers are identical because the minimum heater power that the regulator can set is 0, i.e., the regulator cannot set the negative power of the heaters.
Although the differences in water temperature oscillations for the fast response and conventional thermometer are marginal, this results in noticeable differences in the electricity used to heat it. Figure 14 illustrates the changes in heater power over time.  Figure 14 illustrates that differences in the power consumed to heat water with a new and conventional thermometer are noticeable. The calculated monthly energy consumption for maintaining a constant tank water temperature was 27.86 kWh when a thermometer with the small time constant was used in the PID control system, and 43.16 kWh when an industrial thermometer was applied. The use of an industrial thermometer with a high time constant will contribute to the increase of electric energy consumption in domestic hot water production.

Conclusions
A digital PID control system for maintaining the prescribed temperature in the domestic hot water tank is presented. A conventional thermometer and a special design fast response thermometer  Figure 14 illustrates that differences in the power consumed to heat water with a new and conventional thermometer are noticeable. The calculated monthly energy consumption for maintaining a constant tank water temperature was 27.86 kWh when a thermometer with the small time constant was used in the PID control system, and 43.16 kWh when an industrial thermometer was applied. The use of an industrial thermometer with a high time constant will contribute to the increase of electric energy consumption in domestic hot water production.

Conclusions
A digital PID control system for maintaining the prescribed temperature in the domestic hot water tank is presented. A conventional thermometer and a special design fast response thermometer were used to measure water temperature. The digital PID system works correctly, even if the initial water temperature is significantly different from the set one. A numerical-mathematical model of the system consisting of a hot water tank and thermometer was developed. The thermometers were modeled as inertial objects of the second order, thanks to which, the delay of thermometer indications could be Energies 2020, 13, 4039 16 of 18 taken into account. A control system in which a low inertia thermometer is used to measure the water temperature works faster compared to a system in which the water temperature is measured with a conventional thermometer. By using a thermometer with a small time constant, significant savings in hot water preparation costs are achieved. An additional aim of the study was to carry out tests using massive thermometers, which are used to measure the temperature of a liquid under high pressure and flowing at a high velocity. Due to the large heat capacity of the hot water storage tank, the water temperature changes are slow, so there are no significant differences in the operation of the industrial thermometer and the one proposed in this article. In the case of objects with smaller time constants, such as boiler steam superheaters or other heat exchangers, the quality of liquid temperature control at the exchanger outlet with the proposed digital PID controller will be much higher. This is due to the lower thermal inertia of the mentioned heat exchangers.