On the Use of Temperature Measurements as a Process Analytical Technology (PAT) for the Monitoring of a Pharmaceutical Freeze-Drying Process

The measurement of product temperature is one of the methods that can be adopted, especially in the pharmaceutical industry, to monitor the freeze-drying process and to obtain the values of the process parameters required by mathematical models useful for in-line (or off-line) optimization. Either a contact or a contactless device and a simple algorithm based on a mathematical model of the process can be employed to obtain a PAT tool. This work deeply investigated the use of direct temperature measurement for process monitoring to determine not only the product temperature, but also the end of primary drying and the process parameters (heat and mass transfer coefficients), as well as evaluating the degree of uncertainty of the obtained results. Experiments were carried out with thin thermocouples in a lab-scale freeze-dryer using two different model products, sucrose and PVP solutions; they are representative of two types of commonly freeze-dried products, namely those whose structures are strongly nonuniform in the axial direction, showing a variable pore size with the cake depth and a crust (leading to a strongly nonlinear cake resistance), as well as those whose structures are uniform, with an open structure and, consequently, a cake resistance varying linearly with thickness. The results confirm that the model parameters in both cases can be estimated with an uncertainty that is in agreement with that obtained with other more invasive and expensive sensors. Finally, the strengths and weaknesses of the proposed approach coupled with the use of thermocouples was discussed, comparing with a case using a contactless device (infrared camera).


Introduction
Freeze-drying is widely employed to increase the shelf life of pharmaceutical products, especially when liquid formulations must be processed in a vial or tray, but recently other containers, such as syringe cartridges or blisters, have also been considered. Water is removed via sublimation at low temperatures and pressures, and thus, it is generally considered the drying process of choice for thermolabile products, even if the freezing step and the solute concentration that occurs because of the formation of the ice crystals may also be dangerous, especially for biomolecules. Ice sublimation is an endothermal phenomenon; thus, heat must be supplied during primary drying at the maximum possible rate to speed up the process. The shelf temperature can be relatively high, as the heat transfer coefficient between the shelf and the bottom of the container is low as an effect of the very low pressure, but the product temperature remains low until there is ice that sublimates if the mass transfer resistance of the dried cake is sufficiently small to allow the flux of the vapor formed. If the driving force is not sufficient to allow this flux, heat 2 of 20 accumulates in the product, increasing its temperature; in fact, the higher temperature at the frozen-dry layer interface increases the vapor tension of ice and thus, the driving force and flux [1][2][3][4].
Thus, during primary drying, the product temperature must be maintained at the highest possible value below a threshold to preserve the final quality: both activity and appearance may be affected, and as far as what concerns the stability, not only must the product yield immediately after the completion of freeze-drying be taken into account, but also the long-term storage stability under specified conditions [5][6][7].The threshold temperature mentioned above may be related to thermal degradation of the product: the effect of temperature on stability has been discussed by Chen et al. [8] and by Wang and Pikal [9], who highlighted the importance of molecular motions on protein stability in the amorphous solid; since molecular mobility is significantly impacted by thermal history, variation in lyophilization processing conditions could produce big differences in product stability. Trespassing the threshold temperature during drying may cause the loss of the structure as a consequence of collapse: for amorphous products, the reference is generally the glass transition temperature of the "dried" product in contact with the frozen one, which has the highest residual moisture content [10]; collapsed formulations are often unacceptable by requested standards and show generally higher moisture content and longer reconstitution time. Anyway, Depaz et al. [11] showed that at higher protein concentrations, pharmaceutically acceptable cakes may be obtained for formulations freezedried above T g but below the collapse temperature. A non-ideal cake appearance is often rejected by quality protocols, even if it has been shown that it does not always impact product quality [12]. Actually, the majority of the investigations have found little or no decrease in product quality for formulations freeze-dried above the collapse temperature, while in a few studies some decrease in long-term stability was observed [13]; this is very interesting because the slight but controlled increase in process temperature that might be allowed would lead to a significant increase in productivity. For crystalline substances, the limit is generally the eutectic temperature; when trespassing it, some liquid forms, causing boiling for the low pressure and a final foamy appearance.
In the secondary drying step, shelf temperature and thus product temperature is increased to favor the desorption of the bound water which did not freeze, but remained adsorbed to the product. As the collapse temperature decreases with the residual moisture, higher temperatures are generally set in this step to accelerate water desorption; a proper temperature setting, as well as the correct identification of the start of secondary drying (with the corresponding temperature increase) above all, is important to reduce overall drying time and avoid collapse.
During the freeze-drying process, therefore, it may be important: i. to monitor product temperature, as it must remain below the threshold value to preserve final product quality. Usually, both product temperature at the bottom of the vial (T B ) and that at the interface of sublimation (T i ) should be known. ii.
to identify the occurrence of the ending point of the primary drying stage, corresponding to the time instant when no more ice is present or the thickness of the frozen layer (L frozen ) approaches zero, if a flat and planar interface is assumed. iii.
to estimate the value of the parameters of a mathematical model of the process. The heat transfer coefficient (K v ) and the resistance to mass transfer (R p ), which allow us to describe, respectively, the heat transfer to the product and the mass transfer from the product to the drying chamber, are generally selected. They can be used to predict the effect of the operating conditions and thus to optimize the process, minimizing the duration of the drying stage [14,15].
This may be performed by developing a suitable process analytical technology (PAT), which would allow us to monitor and eventually control the process in-line, thus assuring that the desired quality is obtained in the final product. This approach is totally different from the traditional quality-by-testing approach, and it was strongly encouraged by "Guidance for Industry PAT", which was issued by the FDA in September 2004 with the Pharmaceutics 2023, 15, 861 3 of 20 goal of producing effective, safe, and affordable medicines [16]. An extensive review of the systems that have been proposed to achieve these goals can be found in the literature. Barresi and coworkers [14,17] catalogued the various techniques proposed, considering the size of the sample (monitoring single vials, a group of vials, or the whole batch). Alternatively, they could be grouped on the basis of monitored variables, which could be a specific physical property (e.g., temperature or moisture), a flux (heat or sublimation flux) [18,19], or the identification of the ending point of the primary drying stage [19][20][21]. It must be evidenced that measuring devices should be able to supply the value of all the variables of interest-here, temperature and residual moisture (that is, the full state of the system)-to be applicable in a predictive control system.
Measuring the product temperature is probably the most used and powerful means of monitoring the process. Combined with the use of a process model, it can allow us to reach all the goals listed above, including the identification of the end of primary drying and the model parameters. It must be evidenced that the different approaches may be based on either the direct or the indirect (inferential) measurement of the product temperature; in the second case, the direct monitored variable may be the heat flux or the sublimation flow.
The pressure rise test is the base of a first group of indirect systems: it is a standard stepidentification approach using the measurement of the chamber pressure, which increases during the test as a function of the sublimation rate; it provides "mean" values of the desired variables and can simultaneously estimate the process parameters [22][23][24][25][26]. The "mean" product temperature may also be estimated using the direct measurement of the sublimation flow using the TDLAS, but in this case, the K v parameter must be known [27].
Unfortunately, the batch is generally nonhomogeneous [28], and to manage this heterogeneity, it is important to have the distributed values of the variables of interest [29]. The use of heat flux sensors, which was recently proposed, may allow us to obtain local values, but the accuracy and the practical use of this type of device still has some serious limitations [30]. In this respect, process monitoring via direct temperature measurement is more powerful because in principle, the most important or critical zones can be monitored separately using contact or contactless devices.
Regarding contact systems, resistance temperature detectors (RTDs) and thermocouples are the traditional ones generally used in lab and production apparatus: their advantages and limitations have recently been discussed in detail, also revising best practices, and comparing them to newly proposed devices [17,18]. As concerns the latter, TEMPRIS technology [31] has found interesting applications, especially after the size of the probe was significantly reduced, while optical fiber systems (OFSs) have promising characteristics, but are still a subject of research [32].
The temperature sensor most commonly employed to monitor the process and to map the non-uniformity of the batch is the thermocouple because of its reduced invasiveness and low cost [18,33].When the sensor-product interference is a concern, non-invasive monitoring of the product is possible using thermocouples sputtered on the vial external surface and obtained through low-pressure plasma processes; in this case, it is only required that the cake be in contact with the internal vial body [34][35][36]. An indirect sensing approach that allows for a non-invasive measurement via flexible multi-point sensing probe using thermistors, photosensitive lithography, and chemical etching was also recently proposed [37].
Anyway, because of their low cost, easy handling, and flexibility, standard thermocouples are widely employed in both small-and large-scale freeze-dryers when monitoring the temperature evolution in a large number of vials and in different positions of the batch is required. To this aim, thermocouple measurement devices, also called readers, can be designed using simple conditioning circuits with low power consumption and are able to withstand the severe ambient conditions normally found inside freeze-dryers without significantly impairing the measurement accuracy. Examples of battery-operated measurement devices for thermocouples that also embed a wireless communication link have been developed and tested in real conditions [38,39]. A further advantage of these systems is their flexibility and the reduction in the sensor wires routed inside the vacuum chamber.
Thermocouple measurement devices can be also designed to work outside the drying chamber. This solution has the advantage of simpler and more accurate electronics, but the thermocouple wires must be routed outside the chamber using a vacuum stopper, which is a drawback of this approach. Moreover, further problems arise for the sensor calibration, since the thermoelectric circuit spans from the thermocouple tip to the measurement devices through the stopper, and thus, a full thermometer calibration should also involve the stopper wires.
An infrared camera can be an alternative tool to capture product temperature in a freeze-drying cycle without being in contact with the monitored product. The main drawback is represented by the harsh conditions that are experienced by the sensor in the drying chamber, i.e., a temperature that may reach values as low as −40 • C or −50 • C (in the freezing step) during the cycle, a low pressure, and a gas composition that is about 100% water vapor. For these reasons, Emteborg et al. [40,41] placed the camera outside the drying chamber, on the top of the freeze-dryer, using a germanium window. In addition, also Van Bockstal et al. [42] placed the infrared camera outside the freeze-dryer, although in their case, a continuous freeze-drying process was monitored.
Up to now, the only device that was designed to be placed in the drying chamber and to monitor the (axial) product temperature in the vials used for manufacturing was designed by IMC Service S.r.l. (Italy) and firstly tested by Lietta et al. [43][44][45]. The system encompasses a standard infrared camera and a protective enclosure in a thermally insulating plastic material, transparent to Wi-Fi communications.
This work focuses on thermocouples with the aim of deeply investigating the use of direct temperature measurement for process monitoring, not only to determine the product temperature, but also to determine the end of primary drying and the process parameters that allow process optimization (and, in perspective, real process control). A preliminary analysis of the use of thermocouples for process monitoring was discussed by Fissore et al. [46]. This paper extends their investigation, focusing on the combination of this measure with a model of the process to estimate the desired variables and analyzing the main uncertainty contributions from a metrological point of view. A comparison of the measurement results obtained with different products and methods is eventually provided. At the end, the reliability of the approach for the pharmaceutical field is discussed, evidencing strengths and weaknesses of the proposed method based on thermocouples and comparing them with advantages and limitation of the contactless approach.

Determination of the End of Primary Drying
After the initial temperature increase at the beginning of the primary drying, once stationary conditions are attained, the product temperature remains low and practically constant until the heat supplied is used for ice sublimation. After ice sublimation is completed, the heat supplied is used to increase the product temperature until it reaches the temperature of the heating element. Thus, the measurement of product temperature can be used to estimate the ending point of the primary drying stage, looking at variations in the slope of the temperature evolution.

Identification of Process Parameters
In addition to the ending point, as was highlighted in the Section 1, it is quite often necessary to also estimate the value of the parameters of a mathematical model that is then used for process optimization, aiming to minimize the duration of the drying stage. Several models were proposed in the past to describe the freeze-drying process in vials and trays, but the majority of them are characterized by two parameters, namely K v and R p . Velardi and Barresi [47] have analyzed the effect of the various hypotheses and simplifications adopted, discussing the accuracy versus the complexity of various models as a function of the application. The model proposed used only two parameters to be identified, assuming negligible radial gradient of temperature and composition and, thus, a planar interface separating the dried and the frozen product. This was considered a suitable compromise for monitoring purposes; in fact, it was used extensively in the past both for off-line optimization, to calculate the design space of the primary drying stage [48,49], and for in-line optimization, e.g., in the LyoDriver algorithm [50].
The same model is adopted in this work, considering the simple general case of heat supplied by conduction through the lower shelf, with the frozen-dry interface moving downward as drying goes on; a scheme with an indication of the main variables is shown in Figure 1.
quite often necessary to also estimate the value of the parameters of a mathematical model that is then used for process optimization, aiming to minimize the duration of the drying stage. Several models were proposed in the past to describe the freeze-drying process in vials and trays, but the majority of them are characterized by two parameters, namely Kv and Rp. Velardi and Barresi [47] have analyzed the effect of the various hypotheses and simplifications adopted, discussing the accuracy versus the complexity of various models as a function of the application. The model proposed used only two parameters to be identified, assuming negligible radial gradient of temperature and composition and, thus, a planar interface separating the dried and the frozen product. This was considered a suitable compromise for monitoring purposes; in fact, it was used extensively in the past both for off-line optimization, to calculate the design space of the primary drying stage [48,49], and for in-line optimization, e.g., in the LyoDriver algorithm [50].
The same model is adopted in this work, considering the simple general case of heat supplied by conduction through the lower shelf, with the frozen-dry interface moving downward as drying goes on; a scheme with an indication of the main variables is shown in Figure 1. The procedure to be used for obtaining the value of the process parameters from the temperature measurements is the following. a) The value of the coefficient Kv can be calculated in a preliminary experiment using the measurement of product temperature. In fact, from the integral energy balance for the frozen product, where Kv can be obtained as the ratio of the total energy supplied to the sample and then used to sublimate the initial mass m of ice: The shelf temperature Tshelf might be measured directly using additional thermocouples, taking care to have a good thermal contact; alternatively, it is possible to use the measured value of the technical fluid, and in this case, Kv also includes the resistance of the shelf. The use of Equation (1a) requires estimating the primary drying time (tdrying) with an acceptable accuracy. The procedure to be used for obtaining the value of the process parameters from the temperature measurements is the following.
(a) The value of the coefficient K v can be calculated in a preliminary experiment using the measurement of product temperature. In fact, from the integral energy balance for the frozen product, where K v can be obtained as the ratio of the total energy supplied to the sample and then used to sublimate the initial mass m of ice: The shelf temperature T shelf might be measured directly using additional thermocouples, taking care to have a good thermal contact; alternatively, it is possible to use the measured value of the technical fluid, and in this case, K v also includes the resistance of the shelf. The use of Equation (1a) requires estimating the primary drying time (t drying ) with an acceptable accuracy.
Alternatively, a direct measurement of K v can be obtained using the gravimetric test [15]: at the time t 1 (before the ending of the ice sublimation) when the product is removed from the drying chamber, the vial with residual ice is weighed, and the mass of sublimated ice is calculated via difference. This allows us to calculate K v without any uncertainty on the duration of the sublimation stage, using Equation (1b): where the value of m is replaced by the measured weight loss ∆m and the drying time is replaced by the duration of the test t 1 , but it is necessary to weigh the vials before and at the end of the drying period.
(b) The cake resistance R p and its variation with L dried can be calculated using the K v value calculated in the previous step. The proposed algorithm is the following: i. The heat flux J q to the product is calculated with Equation (2), using the estimated value of K v and the measured values of T shelf and of the temperature of the product at the bottom of the vial (T B ), whose difference represents the driving force. ii.
The sublimation flux J w is then calculated using Equation (3), the energy balance at the interface of sublimation, considering that in steady-state the heat flow is equivalent to the mass flow times the heat of ice sublimation ∆H s . iii.
The cake resistance can be calculated from the sublimation flux, which, similarly to the heat flux, can be described as the product of a mass transfer coefficient (1/R p ) times a driving force (the difference between water vapor partial pressure at different locations: the interface and the chamber average): During primary drying, it can be assumed that p w,c is equal to chamber pressure (the fraction of air or inert gas is generally negligible), while the water partial pressure at the interface, p w,i , can be calculated: the interface temperature is not known, but T B is measured, and T i can be estimated by iteratively repeating steps (iii) to (v), neglecting the temperature gradient in the vial as a first attempt, or taking a value (1÷2) • C lower than T B on the basis of the experience. iv.
The sublimation flux in the time interval considered also allows us to estimate the evolution of L frozen (and thus, as difference to total thickness, of L dried ) using a mass balance to the frozen layer: and thus, to relate R p to L dried for each time interval. Integrating Equation (5), it is also possible to monitor the progress of the drying process in-line. v.
The temperature at the interface can be estimated precisely from the product temperature at the bottom of the container, which is the variable usually measured with thermocouples inserted in vials, considering the heat balance for the frozen product and previous relationships: This, once L frozen has been calculated from (iv), allows us to calculate p w,i with greater accuracy, and then to calculate R p using Equation (4). vi. The values of R p depend on the type of product (and freezing history), but also on the thickness of the dried product, as shown before. To model this dependence, an equation like the following one is usually adopted: The parameters R p,0 , A R p , and B R p are fitting parameters that can be easily calculated once the curve R p vs. L dried has been obtained in step (iv).

Experimental Apparatus
A pilot-scale freeze-dryer (LyoBeta 25, Telstar, Spain) with four shelves (total area available for the product: 0.5 m 2 ) in a 0.2 m 3 drying chamber, a vacuum pump, and an external condenser was used for the experimental runs. The service fluid temperature (silicon oil) was monitored using a RTD (Pt100) embedded in the control system of the apparatus. Chamber pressure was monitored with a capacitance gauge (Baratron type 626A, MKS Instruments, Andover, USA) and maintained at the desired value using nitrogen and a controlled leakage system.
The apparatus was equipped with a thermal conductivity gauge (Pirani type PSG-101-S, Inficon, Bad Ragaz, Switzerland). The signal of the Pirani gauge was not used for monitoring the pressure, but for identifying the ending point of the primary drying stage, considering the ratio with the value given by the capacitance gauge [20]. In fact, the thermal conductivity gauge was calibrated into air, and its value was affected by the fraction of water vapor present: only when the primary drying was completed and the atmosphere in the drying chamber contained no vapor did the ratio of the two signals equal one. This corresponded to the end of sublimation in all the vials, but there was some uncertainty in the identification of end of drying, and the onset and inflection point of the curve were also proposed. In fact, it has been evidenced that when the curve starts decreasing, the largest part of the batch has completed primary drying, and the time interval between onset and offset is influenced by the non-uniformity of the batch and by the dynamics of water vapor in the drying chamber [21].
Vial temperatures were measured using commercial T-type thermocouples made with 30 AWG single strand wires and exposed tips; the set-up is shown in Figure 2 (upper graphs). The wires were isolated with Kapton, and the overall external diameter of each sensor was about 0.9 mm. Thermocouples were plugged in a custom-made conditioning and acquisition system designed to work inside the vacuum chamber. The overall system was able to measure up to six temperatures with a rate of 1 s. The system was powered and interfaced to an external PC using a wired UART interface. The full measurement chain, from the sensor to the reader, was calibrated against a traceable Pt100 sensor. After the calibration, comparison tests carried out at different temperatures and ambient conditions showed a temperature error below 1 • C.

Case Study
Two different formulations were considered in the study to evaluate the thermocouplebased PAT tool for process monitoring, namely (i) a 5% by weight sucrose (Riedel de Haën) aqueous solution and (ii) a 5% by weight polyvinylpyrrolidone (PVP) (Fluka) aqueous solution. The rationale for this choice was that these two solutions are representative of two types of commonly freeze-dried products, namely those whose structures are strongly nonuniform in the axial direction with the formation of a crust on the top (sucrose, see for example Figure 5 in [51]) and those whose structures are more uniform, with an open structure (PVP). Figure 2 (lower graphs) shows the typical structure of the two products. Experimental results have evidenced the dependence of the average pore size and pore size distribution and their axial distribution both on product type and concentration and on freezing conditions [52,53], while formation of crust seems characteristic of the product, even if the mechanisms have not been completely clarified. The presence of a crust leads to a strongly nonlinear cake resistance, but when the axial distribution is more uniform, the cake resistance varies linearly with thickness. Thus, the selected products should allow us to test the performance of the PAT tool with the two typical shapes of R p commonly encountered in pharmaceutical applications.

3.2.Case Study
Two different formulations were considered in the study to evaluate the thermocouple-based PAT tool for process monitoring, namely (i) a 5% by weight sucrose (Riedel de Haën) aqueous solution and (ii) a 5% by weight polyvinylpyrrolidone (PVP) (Fluka) aqueous solution. The rationale for this choice was that these two solutions are representative of two types of commonly freeze-dried products, namely those whose structures are strongly nonuniform in the axial direction with the formation of a crust on the top (sucrose, see for example Figure 5 in [51]) and those whose structures are more uniform, with an open structure (PVP). Figure 2 (lower graphs) shows the typical structure of the two products. Experimental results have evidenced the dependence of the average pore size and pore size distribution and their axial distribution both on product type and concentration and on freezing conditions [52,53], while formation of crust seems characteristic of the product, even if the mechanisms have not been completely clarified. The presence of a crust leads to a strongly nonlinear cake resistance, but when the axial distribution is more uniform, the cake resistance varies linearly with thickness. Thus, the selected prod- Formulations were prepared using ultra-pure water produced by a Millipore system (Milli-Q RG, Millipore, Billerica, MA). The solutions were then processed in non-GMP conditions into ISO 8362-1 8R glass tubing vials (external diameter = 22 ± 0.2 mm, wall thickness = 1 ± 0.04 mm), pouring 2 mL of liquid in each vial; vials were partially closed using silicon stoppers (West Pharmaceutical Services, Milano, Italy) and loaded onto the shelves of the drying chamber according to a hexagonal array.
Freezing was carried out at −50 • C, with initial cooling decreasing the temperature of the technical fluid at 1 • C/min. The primary drying stage was carried out at 10 Pa and −20 • C (fluid temperature) for the sucrose solution and at −14 • C for the polyvinylpyrrolidone solution. The secondary drying stage was carried out at 20 • C and 2 Pa in both cases.  Figure 3A shows the trend of temperature measurements obtained in four different vials placed in the central part of the batch when the sucrose-based solution was processed. This trend is representative of the product temperature evolution in a freeze-drying process, as discussed in the following section. As discussed in Section 2, the heat supplied during primary drying increases the product temperature up to an almost steady-state value, which should be maintained until the heat is used for ice sublimation. Then, the energy supplied increases the temperature of the dry product, and the temperature measured by the thermocouple rises approaching the temperature of the heating shelf. In practice, a sudden increase in the measured temperature is generally observed well before the end of the primary drying stage, with a large variability from vial to vial. This variability may also be related to incorrect position of the thermocouples. However, it has been pointed out by Bosca et al. [33] that the anticipated sudden temperature increase generally occurs because the front overcomes the thermocouple tip position, but may also be due to irregularity in the ice interface or simply loss of contact between the thermocouple tip and the product. It is worth pointing out that in the presence of a temperature change, the following temperature measurements are no longer representative of the temperature of the frozen product. temperature measurement for its definition, an uncertainty exists that will therefore affects the values of Kv and, thus, of Rp. It can be seen that the ice sublimation is completed about 18 h after the onset of the primary drying stage; this value can also be confirmed by the pressure ratio shown in Figure 3B, as this curve reaches the lower asymptote at the same moment. As discussed in the experimental set-up section, this technique also allows us to identify the end of primary drying with uncertainty, but the corresponding value at the offset of the curve should correspond to the end of drying, even in the last vials of the batch. From a measurement point of view, a better analysis of the temperature curves highlights that the ending point can be assumed as a random variable having a uniform distribution with values between a minimum of 17 h and a maximum of 19 h.
Temperature TB is recorded during the full drying process, but when the ice sublimation is approaching the end, i.e., after the time instant when the "sudden" temperature change occurs, the temperature is no longer meaningful; anyway, it is possible to assume that, in case the temperature of the heating shelf and the pressure in the drying chamber are not modified, then the slope of the temperature curve does not change till the end of the primary drying. The missing part of the temperature measures can thus just be hypothesized, and in this work it has been assumed constant until the end of the drying, the slope being very small. On the other hand, an abrupt temperature change may correspond to the end of the sublimation stage in just the monitored vial, which is thus not representative of the whole batch. It must be remarked that the temperature detected in different monitored vials generally is not "exactly" the same; differences can be noted both before and after the "sudden" temperature variation occurs. In fact, in the first part of the primary drying, the heat flux may not be the same for all the vials of the batch, even in the central ones shielded by the edge vials from radiation by the chamber walls. This may be due, among other things, to temperature gradients in the shelf, to the characteristics of the contact area between the vials and the shelf, and/or to the geometric features of the vial bottom. In the case of a well-designed freeze-dryer where the temperature gradients over the shelf are minimized, as well as high-quality vials being used for product processing, with tight tolerance in geometric features, the temperature difference detected in the central vials of the batch may be as low as the accuracy of the temperature probe.

Kv Estimation and Uncertainty
In this paper, the difference in the behavior of the four vials was not negligible, and it has been taken into account as a measurement reproducibility that, in turn, affects the K v measurements.
The ending point of the primary drying stage t drying is a quantity that must be known in Equation (1a), and it has been assessed (for the sucrose solution) with regards to analyzing the curves of Figure 3A, but for the reasons already discussed, when using the temperature measurement for its definition, an uncertainty exists that will therefore affects the values of K v and, thus, of R p . It can be seen that the ice sublimation is completed about 18 h after the onset of the primary drying stage; this value can also be confirmed by the pressure ratio shown in Figure 3B, as this curve reaches the lower asymptote at the same moment. As discussed in the Section 3, this technique also allows us to identify the end of primary drying with uncertainty, but the corresponding value at the offset of the curve should correspond to the end of drying, even in the last vials of the batch.
From a measurement point of view, a better analysis of the temperature curves highlights that the ending point can be assumed as a random variable having a uniform distribution with values between a minimum of 17 h and a maximum of 19 h.
Temperature T B is recorded during the full drying process, but when the ice sublimation is approaching the end, i.e., after the time instant when the "sudden" temperature change occurs, the temperature is no longer meaningful; anyway, it is possible to assume that, in case the temperature of the heating shelf and the pressure in the drying chamber are not modified, then the slope of the temperature curve does not change till the end of the primary drying. The missing part of the temperature measures can thus just be hypothesized, and in this work it has been assumed constant until the end of the drying, the slope being very small.

K v Estimation and Uncertainty
The values of K v obtained with Equation (1a) for three different values of assumed drying time (minimum, maximum and mean value, uniform time distribution) are shown in Table 1; the results obtained using the four temperature measurements available from the test run are compared. The table also reports the maximum deviation of K v with respect to the mean value, both for the drying time and for the monitored vials. It appears that K v is mainly affected by the drying time (±5.4%) and that the dispersion of the results obtained among the four vials is about ±1.8%, which is a small but not negligible value. Table 1. Values of K v (W m −2 K −1 ) for sucrose solution estimated from different drying times and considering the temperature measured in the 4 vials.

Sucrose-Vial
The uncertainty of K v can now be obtained by propagating the main uncertainty contributions that appear in Equation (1a) using the procedure described in the "Guide to the Expression of Uncertainty in Measurement" [54,55]. Drying time and temperature uncertainties are considered here, whereas the uncertainties related to the vial area A v and water mass m can be neglected. Effects related to temperature differences recorded in different vials are considered a reproducibility contribution and treated in a statistical way. Other aspects, such as the thermocouple wires that perturb the vial sublimation process and the product temperature, which can only be hypothesized towards the end of the drying, have not been considered here, since their role looks negligible after a preliminary investigation.
The approach described in [54] requires knowledge of the standard uncertainties and their sensitivity coefficients, as well as the correlation coefficients. The drying time can be assumed to be a random variable uniformly distributed between 17 h and 19 h, as said before. Thus, its expected value is 18 h, and the uncertainty can be obtained using the type-B method, that is, a method of evaluation of uncertainty not based on the statistical analysis of series of observations. The standard uncertainty is thus u B (t drying )= 1/ √ 3 h, where the suffix B refers to a type-B method employed here.
The sensitivity coefficient of K v with respect to the drying time can be assessed from Table 1 or numerically with Equation (1a) as ∆K v /∆t drying , thus obtaining S K v t drying = 1.0 Wm −2 K −1 /h, regardless of the considered vial.
Temperature measurements for the K v computation were obtained using two different thermometers.
The product temperature T B was measured in different vials using thermocouple sensors. A maximum error of ± 1 • C was considered, and thus, the standard uncertainty could be obtained using a type-B method considering a uniform distribution, obtaining u B (T B )=1/ √ 3 • C. The shelf temperature T shelf is the fluid temperature measured and controlled by the freeze-dryer. A maximum deviation of ±1 • C from the set-point T shelf = −20 • C has been considered in this uncertainty evaluation. As for T B , the standard uncertainty of T shelf is u B (T shelf )=1/ √ 3 • C. Moreover, temperatures in Equation (1a) are integrated during the drying phase, and the integral has been approximated as a sum of temperatures sampled every minute. These repeated measurements are considered fully correlated here because the temperature does not present large changes during the drying, and the thermometer noise can be assumed negligible with respect to the calibration uncertainty that affects all the measurements. On the other hand, temperature measurement T B can be considered fully uncorrelated with respect to the measurement T shelf , these two quantities being obtained or controlled using different thermometers.
The sensitivity of K v with respect to T shelf and T B has been obtained numerically, introducing a small temperature perturbation during the computation of Equation (1a). The two sensitivities are very similar, and they do not depend significantly on the considered vial. The obtained result is The uncertainty contribution related to the different temperature profiles recorded in the different vials (#1 to #4 in Table 1) can be estimated with a type-A method, that is, as the experimental standard deviation of the mean, obtained by processing the four different K v values when the drying time is 18 h, thus obtaining a standard uncertainty of the average u A (vial) = 0.16W·m −2 ·K −1 .
Eventually, the combined standard uncertainty of K v is: In conclusion, the measurement of K v is the mean of the four values obtained at time 18 h, and it is K v =18.7 W·m −2 ·K −1 , with an expanded uncertainty (coverage factor 2, confidence level 95%) U=2.4W·m −2 ·K −1 , which is about 13% when expressed in relative form.
This result also shows that temperature measurements represent the main uncertainty contributions and thus the thermometer accuracy, as well as the correlation analysis among measurements, deserve a deeper investigation.
The same analysis can be carried out for the polyvinylpyrrolidone solution: looking at the temperature profiles shown in Figure 3C, it appears that the trend is similar to that shown in graph A for the sucrose solution, and in this case there is also an uncertainty in the estimation of the drying time that could range between 17 and 20 h. Table 2 shows the calculated values of K v , assuming different values of the drying time. In this case, the dispersion on the estimated value of K v related to the assumption about the drying time is slightly higher than in the case of the sucrose solution (±7.8% max vs. 5.4% max). Table 2. Values of K v (W·m −2 ·K −1 ) for PVP solution estimated from different drying times and considering the temperature measured in the 4 vials.

PVP-Vial
The K v uncertainty can be estimated with the same procedure described for the test with sucrose solution. The sensitivity coefficients are almost the same, but the standard uncertainties of the drying time and reproducibility are slightly larger (from data in Table 2: u B (t dying )= 1.5/ √ 3 h and u A (vial) = 0.30W·m −2 ·K −1 ). The measurement of K v , computed as the mean value of the K v values obtained with the four vials at the mean drying time of 18.5 h, is K v =17.4 W·m −2 ·K −1 , with an expanded uncertainty (coverage factor 2, confidence level 95%) U=2.4 W·m −2 ·K −1 , that is, about 16% in relative form. The K v measurements with sucrose and with PVP are thus in agreement.
The heat transfer coefficient has been also measured with the gravimetric procedure for comparison purposes. To this aim, a different test was carried out in the same nominal conditions but for a shorter duration that was about half the full drying time. The mass of a large set of vials was measured using an analytical balance. Eventually, the coefficient was obtained with Equation (1b).
The uncertainty estimation follows the same procedure described for the two previous tests, but in this case:

•
The drying time t 1 is defined by the user, and its uncertainty is negligible.

•
A set of about 100 vials was identified as representative of the full batch. The vials were weighed before and after the test, thus obtaining a set of ∆m measurements and, with Equation (1b), a set of K v coefficients. The mean value is 18.7 W·m −2 ·K −1 and the dispersion can be treated using a Type-A method, thus obtaining a standard deviation of about 2 W·m −2 ·K −1 and a standard uncertainty, that is, the standard deviation of the mean value, of about u A (vial) = 0.2 W·m −2 ·K −1 .
As in the previous case, temperature measurements were considered fully correlated among the T B measurements and fully uncorrelated with T Shelf ; the sensitivity coefficients were numerically computed from Equation (1b), thus obtaining results very similar to the ones obtained in the previous tests. Moreover, the gravimetric test was performed using the same thermometers, and thus, the temperature uncertainties are also the same, that is, The overall uncertainty is: The heat transfer coefficient K v measured with the gravimetric test is thus K v = 18.7 W·m −2 ·K −1 with an expanded uncertainty (coverage factor 2, confidence level 95%) U = 2 W·m −2 ·K −1 , about 11% in relative form.  Figure 4 shows the K v measures obtained from recording the full drying of sucrose and PVP, as well as the measurement result from the gravimetric test. The results are in good agreement, with a small difference in the measured values. One should note that the proposed method has a larger uncertainty but also the advantage of saving time, and it can be carried out during the manufacturing run. the same thermometers, and thus, the temperature uncertainties are also the same, that is, u B (TShelf)=u B (TB)=1/√3°C. The overall uncertainty is: The heat transfer coefficient Kv measured with the gravimetric test is thus Kv = 18.7 W·m −2 ·K −1 with an expanded uncertainty (coverage factor 2, confidence level 95%) U = 2 W·m −2 ·K −1 , about 11% in relative form. Figure 4 shows the Kv measures obtained from recording the full drying of sucrose and PVP, as well as the measurement result from the gravimetric test. The results are in good agreement, with a small difference in the measured values. One should note that the proposed method has a larger uncertainty but also the advantage of saving time, and it can be carried out during the manufacturing run.

Rp Estimation and Monitoring of Primary Drying Progress
Once the value of Kv has been estimated, the curve of Rp vs. Ldried can be obtained, and then the three values of the parameters Rp,0, , and can be calculated. According to the algorithm previously described, the measurement of product temperature is required to obtain the curve of Rp vs. Ldried, and thus, as various temperature measurements are usually available, different curves of Rp vs. Ldried are obtained, i.e., different sets of values of Rp,0, , and (see Figure 5). The approach used in this study is the following: i. estimate the values of Rp,0, , and from the curve of Rp vs. Ldried obtained from the first temperature measurement;

Rp Estimation and Monitoring of Primary Drying Progress
Once the value of K v has been estimated, the curve of R p vs. L dried can be obtained, and then the three values of the parameters R p,0 , A R p , and B R p can be calculated. According to the algorithm previously described, the measurement of product temperature is required to obtain the curve of R p vs. L dried , and thus, as various temperature measurements are usually available, different curves of R p vs. L dried are obtained, i.e., different sets of values of R p,0 , A R p , and B R p (see Figure 5). The approach used in this study is the following: i.
estimate the values of R p,0 , B R p , and A R p from the curve of R p vs. L dried obtained from the first temperature measurement; ii.
use the previously obtained values of R p,0 and B R p to calculate the value of A R p in such a way that the data of R p vs. L dried obtained from the other temperature measurements can be best-fitted; iii.
calculate the mean value of A R p and its standard deviation.
For the first product, considering the four different temperature measurements and the four different R p vs. L dried curves it is possible to obtain (mean value ± standard deviation): R p,0 = 10 4 m·s −1 , A R p = 2.84·10 8 s −1 ± 7.6%, and B R p = 2.16·10 3 m −1 . Similarly, for the second product, it is possible to obtain R p,0 = 5·10 4 m·s −1 , A R p = 8.43·10 7 s −1 ± 9.61%, and B R p = 0 m −1 . The standard deviation on A R p is in agreement with that reported in the literature when other methods were used to estimate it [48]. With respect to the estimated R p values, it is impossible to compare them with a value measured using a different technique, as it was performed for the coefficient K v . Nevertheless, it is possible to evaluate whether these estimates are correct by running a simulation using the mathematical model of the process with the estimated values of model parameters, then comparing calculated and measured values of product temperature and process duration. Results are shown in Figure 6 for both products, evidencing the accuracy of both the temperature values calculated and the drying time (i.e., the time when L frozen becomes equal to zero). Graphs B and D of Figure 6 also evidence that even if the direct measurement of the interface position is not possible in normal process conditions, using the proposed PAT and Equation (5), by means of an inferential approach, it may be possible to also monitor this variable, and thus the progress of the primary drying. ii. use the previously obtained values of Rp,0 and to calculate the value of in such a way that the data of Rp vs. Ldried obtained from the other temperature measurements can be best-fitted; iii.
calculate the mean value of and its standard deviation. For the first product, considering the four different temperature measurements and the four different Rp vs. Ldried curves it is possible to obtain (mean value ± standard deviation): Rp,0 = 10 4 m·s −1 , = 2.84·10 8 s −1 ± 7.6%, and = 2.16·10 3 m −1 . Similarly, for the second product, it is possible to obtain Rp,0 = 5·10 4 m·s −1 , = 8.43·10 7 s −1 ± 9.61%, and = 0 m −1 . The standard deviation on is in agreement with that reported in the literature when other methods were used to estimate it [48]. With respect to the estimated Rp values, it is impossible to compare them with a value measured using a different technique, as it was performed for the coefficient Kv. Nevertheless, it is possible to evaluate whether these estimates are correct by running a simulation using the mathematical model of the process with the estimated values of model parameters, then comparing calculated and measured values of product temperature and process duration. Results are shown in Figure 6 for both products, evidencing the accuracy of both the temperature values calculated and the drying time (i.e., the time when Lfrozen becomes equal to zero). Graphs B and D of Figure 6 also evidence that even if the direct measurement of the interface position is not possible in normal process conditions, using the proposed PAT and Equation (5), by means of an inferential approach, it may be possible to also monitor this variable, and thus the progress of the primary drying.

Strengths and Weaknesses of Thermocuples for Pharmaceutical Applications in Comparison with a Contactless Device (IR Camera)
The previous section demonstrated that thermocouples may become a reliable and efficient PAT tool which allows us to monitor the process and estimate the relevant parameters with an uncertainty comparable to more time-consuming approaches. Attention must be paid, anyway, to the fact that when using thermocouples or other contact measuring devices, the measured value is strongly influenced by the close environment of the sensing element and by the quality of contact with the product, as discussed by Bosca et

Strengths and Weaknesses of Thermocuples for Pharmaceutical Applications in Comparison with a Contactless Device (IR Camera)
The previous section demonstrated that thermocouples may become a reliable and efficient PAT tool which allows us to monitor the process and estimate the relevant parame-ters with an uncertainty comparable to more time-consuming approaches. Attention must be paid, anyway, to the fact that when using thermocouples or other contact measuring devices, the measured value is strongly influenced by the close environment of the sensing element and by the quality of contact with the product, as discussed by Bosca et al. [33]; this may be responsible for either anticipated temperature rise during primary drying, a consequence of preferential drying or microcollapse along the thermocouple wire, or slower temperature increase for the presence of residual ice.
What makes thermocouples widely employed in the pharmaceutical field, especially at pilot scale and in the development step, is the facility of use and possibility to easily place them in various positions all over the apparatus, thus allowing us to monitor the core and edge zones over different shelves. In fact, the contribution of the different heat transfer mechanisms changes with the position of the product on the shelf: the product at the edges of the shelf may also be heated by radiation from the chamber walls; core and border vials may have a different contribution by conduction. This leads to differences in the process parameters, not only in K v but also in R p , because the different freezing conditions may lead to differences in the ice structure and then in the cake porosity, which will be reflected in differences in product temperature and the residual amount of water from vial to vial. Placement of thermocouples in certain zones of a large apparatus may be limited by accessibility, but the use of a system with wireless signal transmission (two different solutions have been presented, for example, in [38,39]) may help solve the problem; at the moment, anyway, contact devices are the only ones that may allow a complete mapping, and the use of wireless modules allows us to increase, with virtually no limitations, the number of probes utilizable without any modifications of the apparatus.
On the other hand, wired measurement systems require a dedicated vacuum stopper and, when the thermocouple signals are measured outside the chamber, a more complex calibration procedure [56].
Contactless devices such as IR cameras, in this respect, have many more limitations. If placed outside the chamber on the top of the freeze-dryer, the sensor, through a germanium window, was able to measure the product temperature on the top surface of the upper shelf, the only one that the camera could see [40]. In order to also measure the whole axial temperature profile, Emteborg et al. [41] used custom-made cuvettes with a germanium window on one side, placed close to an IR mirror with a 45 • angle in such a way that the IR radiation from the cuvette was reflected upwards to the IR camera. It is evident that such a system requires strong hardware modifications and is not widely applicable.
The use of an IR camera inside the chamber allows for much more flexibility and the possibility of using it in an existing device with no modifications, if a passthrough for connections is available. Obviously, only the shelf with the camera and only vials at the edge of the shelf may be monitored. This may be a strong limitation because, as discussed before, the edge vials generally receive more heat and are not representative of the core of the batch. Harguindeguy and Fissore [45] showed that, taking advantage of the hexagonal arrangement of the vials in the batch, it is possible to acquire temperature measurements for both first-and second-row vials from the image obtained, which might be considered representative of "edge" and (with sufficient approximation) "central" vials.
Compared to thermocouples, which have limited measurement and calibration issues, the use of an infrared camera inserted in the drying chamber presents several problems. The first is the accuracy of the temperature measurement: in particular, the emissivity of the object has to be detected-for example, by using the ISO 18434-136 guideline [57] (Part 1, Annex A.2, E) as well as the "reflected apparent temperature" due to the radiations emitted by the surrounding environment at the measured object, which reflects the same at the camera with its radiation. The second issue is the object detection and segmentation, as it is necessary to identify and segment the objects whose temperatures have to be measured and to track them in case of movement due to equipment vibrations, correlating information across subsequent images [44]. Thus, the data acquired require a complex postprocessing; the calibration is generally performed via comparison with another temperature measurement with a final higher uncertainty and with a spatial resolution related to the pixel size of the image.
On the other hand, contactless devices obviously do not interfere directly with the process, apart from possible radiation effects. The unique capacity of the sensor, which is placed in the drying chamber, to track the whole axial temperature profile can be exploited in the freezing stage to estimate the mean size of the ice crystals and, from this, the resistance of the dried cake to vapor flux (R p ), as the size of the pores corresponds to that of the ice crystals (in case collapse does not occur) [58]. Recent work by Harguindeguy et al. [59] has also shown how the infrared camera may be effective in investigating the freezing phenomena when controlled nucleation is used (e.g., vacuum-induced surface freezing) and when non-conventional vial loading is used.
On the contrary, the thermocouple inserted in the vial might interfere, especially in case of liquid products. In fact, its presence might favor the nucleation of ice crystals, altering the final cake structure, or might modify heat transfer mechanisms, acting as a fin. It was evidenced by Bosca et al. [33] that in non-GMP conditions, which are those generally encountered in laboratory and development stages, the effect of this interference may be neglected, but it may be relevant in the freezing step in a production environment and should be further investigated. The problem can be solved using thermistors or thermocouples sputtered on the external of the vial: such a system has also been proven to be effective for monitoring processes with controlled nucleation [36]. In this case, the vial itself becomes a PAT tool and must be prepared on purpose, but any commercial vial can be employed, and it is also possible to obtain a thermocouple array with several measuring points [35]. Of course, in this case the temperature of the glass vial is measured (as in the case of using the IR camera). It has been shown via modeling that the difference between the product and the vial may be very small [47], but it must be remembered that this is true only if there is good contact between the product and the vial; this is generally true for the frozen product, while the dried cake may shrink, detaching from the wall.
When comparing contact and contactless sensors, it must be considered that in the first case, in general, only one punctual measurement is available (even if devices with multiple measuring point have been proposed), and the size of the measuring element and its correct position are critical. With thermocouples, the sensing tip may be very tiny, but its real location can be different from the assumed one as a consequence of deformations, undesired movements, and human errors [60]. Infrared cameras allow us to measure the whole temperature profile along the axis of the vial, but the measurements are affected by the accuracy of the sensor, and the resolution is related to the pixel size.
To complete the comparison between contact and contactless devices, their use for process monitoring and optimization must be considered. Using thermocouples, the values of model parameters can be obtained only at the end of the primary drying stage, and thus the system can be used only for off-line optimization and not for real-time control and optimization, unless a different algorithm is used-for example, using a robust soft-sensor [46,61]. Obviously, once the parameters have been determined, the PAT tool can be used to monitor the progress of the drying in-line, estimating the position of the frozen interface, as shown.
Similarly, when the infrared camera is used, the model parameters K v and R p may be estimated at the end of the primary drying [43] and used to calculate the design space of the primary drying step [62], as well as in-line, taking advantage of the detection of the moving sublimation interface (where the temperature of the product is lower) and, thus, of the thickness of the frozen layer [45,62]. Furthermore, the temperature detected may be used to identify the ending point of the primary drying step, together with the estimated thickness of the frozen layer [45], even if the measurement may be quite noisy.

Conclusions
Temperature sensors based on different technologies, coupled with a model, can become a powerful PAT tool. They can be used to monitor freeze-drying processes and to estimate both the model parameters to be used for off-line process optimization and the minimum primary drying time, thus avoiding prolonging this stage unnecessarily. The described procedure can, in principle, be applied to both contact and contactless sensors, even if sources of error and uncertainty are different in the two cases. In this paper, a tool based on thermocouples inserted in the vial was developed and tested, analyzing the main uncertainty contributions from a metrological point of view. It was shown that the variables and parameters of interest can be estimated with an accuracy similar to that obtained using other measuring systems, but the hardware involved is less expensive, and it is not required to carry out any preliminary investigation to obtain the values of model parameters since they can be retrieved during a manufacturing run, thus saving time and money.
The PAT tool was developed for the configuration of general interest in pharmaceutical manufacturing, with heat supplied only through the shelf and the bottom of the container; in this case, the bottom temperature T B , which is the measured variable, is the highest and thus the most relevant temperature, but the interface temperature may also be estimated, which is useful for a more accurate evaluation of mass transfer in the cake. Modifications will be necessary to adapt the system to be employed if the heat flow from the chamber walls and the upper shelf is significant, because the temperature profiles in the product will be affected.
Thermocouples are the most employed temperature sensors since they represent an excellent trade-off among cost, accuracy, invasiveness, ease of use, and sensor interchangeability. Anyway, the effect on the drying process is still an open issue, since these sensors are in contact with the product. They can both affect the nucleation process locally, because they introduce a local discontinuity, and speed up the drying process, for example, because the sensor wires introduce a heat path from the vial to the product. For these reasons, contactless devices were proposed, and their performances were compared here to those of the thermocouples, evidencing reciprocal strengths and weaknesses. The infrared camera may be able to solve several issues with respect to contact probes, as the absence of any contact between the sensor and the product undergoing freeze-drying prevents any effect on ice nucleation. The tool may surely be useful in the stage of process development carried out at lab scale, where it can be manually inserted in the equipment, monitoring the dynamics of the vials of interest. They are effective but still not so easy to use, and commercial sensors based on these approaches are not yet available. Application at an industrial (manufacturing) scale is more tricky due to the automatic systems for loading/unloading vials, unless it is directly embedded in the drying chamber.

Conflicts of Interest:
The authors declare no conflict of interest.

Symbols
A R p fitting parameter for cake resistance relationship in Equation (7) A v cross-section area of the vial B R p fitting parameter for cake resistance relationship in Equation (7) ∆H s heat of ice sublimation J q heat flux to the product J w sublimation flux k frozen thermal conductivity of the frozen layer K v heat transfer coefficient L thickness of the product L dried thickness of the dried product L frozen thickness of the frozen layer m mass of ice in the vial ∆m variation of ice by sublimation in the test p w,i water vapor partial pressure at the interface of sublimation p w,c water vapor partial pressure in the drying chamber R p resistance to mass transfer R p,0 fitting parameter for cake resistance relationship (7) S y x sensitivity coefficient of the output quantity y with respect to the input quantity x evaluated at the measurement values T B product temperature at the bottom of the vial T i product temperature at the interface of sublimation T shelf shelf (or fluid) temperature t time t drying time required to complete the ice sublimation U expanded uncertainty u A (x) standard uncertainty of the quantity x evaluated with type-A method u B (x) standard uncertainty of the quantity x evaluated with type-B method u c (x) combined uncertainty of the quantity x v i interface retreating velocity ρ dried density of the dried product ρ frozen density of the frozen product