Design of a Multichannel Dynamic Temperature Measurement System for
Developing Thermal Management System of New Energy Vehicles

A multichannel temperature measurement system based on LabVIEW and modular instruments with general purpose input/output interface is described. External simple electronic components, such as analog switches arrays, sampling resistors and voltage reference are used to expand the analog input channel of the instrument. The interface circuit for 3-wire resistance temperature device powered by the voltage reference was designed and constructed. The feasibility of filtering algorithm based on moving average filter and the data conversion method by direct computation of the polynomial are verified in LabVIEW. A comparison test with the commercial temperature measurement instrument is conducted to test the same point of a li-ion battery. Meanwhile, the temperature in different points on the surface of a battery was clearly captured by the proposed system, when the battery was discharging. The results of the test clearly shows that the two channels for comparison has basically the same curve progression with a deviation of less than 0.2°C. The temperature measurement accuracy is better than ±0.3°C, and the sampling rate reaches 1000 Hz. The temperature measurement system can be used in the development of new energy vehicle thermal management system especially when the number of points to be measured exceeds the number of sampling channels of the instruments.


Introduction
In the past few years, as an effect way to cope with energy and environment problems, the development of new energy vehicles (NEVs) was quite rapid. The mainstream of NEVs is battery electric vehicles whose powertrains consist of battery packs and driving motors. Contemporarily, Hydrogen fuel cell vehicles are also in use in some countries and areas, exhibiting rather promising application [1]. Compared to traditional vehicles driven by an engine, powertrains of NEVs have advantages of both efficiency and cleaning. However, some inherent defeats exist, such as that the performance is sensitive to the operating temperature. All of the Li-ion battery, fuel cell stack and driving motor are subjected to temperature limits at work. For example, the acceptable temperature range for Li-ion battery operation has been reported to be between −10°C and +50°C, and a narrower range has been reported for performance and lifetime considerations [2]. The operation temperature range of a hydrogen fuel cell pack is to be between +45°C and +60°C [3]. Working temperature of driving motor is much wider, the upper limit of which is up to +130°C [4,5]. In order to popularize NEVs globally and adapt them to the cold and tropical regions, it is essential to equip their powertrain with a reliable thermal management system. As real-time working temperature is the control target for a thermal management system, temperature measurement is indispensable both during development process and in actual operation. Working condition of vehicles is complex and variable, and with it, the working temperature of its powertrain. As a result, a temperature measurement system with the performance of rapid sampling and precision is required for thermal management system. Meanwhile, to insure temperature balance in different points of a battery pack or a fuel cell stack, multipoint and simultaneous measurement is always implemented, which requires the thermal management system to have the function of multi-channel dynamic temperature measurement. Particularly, in the process of developing a thermal management system, in order to find out the unknown characteristics of the controlled object, more temperature sensors need to be deployed. Meanwhile, higher precision and less response time are required for the measurement system. For example, up to 25 temperature measurement channels with precision of ±0.5°C were used in developing a thermal management system based on heat pipes [6]. In researching the cooling features of prismatic Li-ion cells under elevated temperatures, 13 temperature measurement channels were adopted which used thermocouples with precision of ±0.3°C [2]. In a study of mist cooling for lithium-ion battery, 6 temperature measurement channels were used for testing only one cylindrical cell [7].
An extension of the number of channel in the temperature measurement system is mainly limited by the limited number of analog input channels of the data acquisition instruments or the chips. This problem is particularly prominent when additional analog to digital (AD) sampling points are added to eliminate the lead resistance of the temperature sensor [8]. In general, the number of temperature measurement channels in commercial temperature testing systems is limited. For example, as adopted in [6], the data acquisition and switch unit (HP34970; Keysight Technologies, Inc., USA) can only mostly support 16 channels of 4 lines resistance temperature detector (RTD) measurements [9]. Although some modular instruments can multiply the input channels, the cost is high.
The proposed design mainly focuses on contact temperature measurement whose measuring objects are surface of a battery, coolant, ambient air and other cooling medium. Thermistors, thermocouples, RTDs and silicon-based sensors (e.g., bipolar junction transistor sensors) are commonly used as contact sensors [10]. Compared to the poor linearity of thermal resistance and its complication of signal processing, the relatively insufficient accuracy of thermocouple, the narrow range of silicon based sensor, RTD features in excellent linearity, high accuracy, wide range and quick response. Therefore, it is selected as the sensor of proposed temperature measurement system.
There are two types of RTD measurement circuit: driving by constant current source and by constant voltage source, of which the former calls for relatively complex analog circuit. The proposed method that The RTDs are driven by constant voltage source is beneficial to the channel expansion. Besides, the circuit is simple and cost is low. In order to eliminate the adverse influence on test accuracy brought by extra resistance of long lead wires, 3-wire configuration is adopted, which means that, for each RTD, three long lead wires are connected and two AD sampling points are set [11]. Compared to 2-wire configuration, the proposed method need more lead wires and AD sampling channels, but the measurement error caused by extra resistance of long lead wire can be completely eliminated [12]. Thus, this ensures the measurement accuracy to the greatest extent and is suitable for the application in this paper.
To maintain high precision and dynamic performance of RTDs, their sampling and signal processing circuits ought to possess performances of higher sampling resolution and less sampling time. A set of modular test instruments based on real-time operating system are proposed to realize temperature measurement in this paper, in which a general purpose input/output (I/O) module based on field programmable gate array (FPGA) is equipped with 8 analog input channels of 16 bits and 48 high-speed digital I/O channels. Its detailed specifications will be described later in this paper. As the method mentioned above, such configuration is limited to a maximum of 4 temperature measurement channels. In this paper, the number of channels is successfully doubled through building a multiplexer by low-cost analog switch chips. At the same time, due to the high working frequency of the FPGA, the proposed measurement system is still able to maintains a high enough sampling frequency. In terms of the software of temperature measurement system, LabVIEW was usually used for acquisition and calculation [13,14]. In this paper, LabVIEW is adopted to realize logical control, data transmission and display. As a demonstration, a design of 6-channel temperature measurement system is described in this paper. Texas Instruments Inc., USA), a voltage reference (REF3020, Texas Instruments Inc., USA) and a digital control power supply (IT6720; Itech Electronics Co., Ltd., China) are integrated in the system. From the midpoint of each pair of RTD sensor and sampling resistor, temperature-dependent voltage signal generates. Analog switches are composed of several analog switch chips and other electronic components, which responsible for expanding the limited AD sampling channels. In addition, a generalpurpose computer is adopted.

Schematic
Schematic of hardware layer is shown in Fig. 2, in which a case of six channels temperature measurement circuit based on six RTDs (Rref1 to Rref6) is presented, so as to prove the feasibility of expanding more temperature measurement channels. Six sampling resistors, with the tolerance of 0.1% and TCR (temperature coefficient of resistance) of ±10 ppm/°C at +25°C to +85°C, are connected to the RTDs (Rrtd1 to Rrtd6) respectively. The sampling resistors have two main functions: firstly, to adjust the current that passes through the RTDs. This allows the self-heating of the RTDs to be controlled, which will affect the accuracy of the measurement. Secondly, to divide the reference voltage. This allows the output voltage match the input range of ADC. A digital control power supply is set to output direct current (DC) of 5 V to power the voltage reference chip (U1) and analog switch chips (U2, U3 and U4). Voltage reference chip (U1) outputs a reference voltage of 2.048 V for the sensor circuit. Supply bypass capacitors (C1 to C4) are placed to prevent power disturbance. Multifunction input and output (MIO) connector (SCB-68A; National Instruments Corp., USA) is a shielded terminal box. The voltage signals implying temperature are routed through the analog switches, introduced to MIO connector and delivered to PXIe chassis for AD conversion. Fig. 3 is a snap shot of the prototype of the circuit mentioned above.

Circuit Components Determination
Excess current flowing through the RTD will cause self-heating and will result in a difference in the temperature [15]. The main technical characteristics of the proposed RTDs are listed in Tab. 1. The recommended measuring current is between 1 × 10 −4 A and 3 × 10 −4 A [16]. Self-heating has to be considered. To reduce the current and alleviate the self-heating phenomenon, the resistance of each proposed sensor is selected as 1000 Ω at 0°C. The RTDs are welded to 3 lead wires and covered with shrinkable tubes. Their physical size is less than 1.7 × 10 −3 m.
According to the recommended measuring current of RTD, the voltage across it is between 0.1 V and 0.3 V. So, the input range of ADC used in this paper was configured as ±1 V. In order to make full use of the ADC sampling range and resist self-heating, sampling resistors with nominal resistance of 4 kΩ is choose combined with a 2.048 V reference voltage. And the output voltage to ADC is from 0.31 V to 0.71 V at the temperature from −70°C to 300°C [17].
Voltage reference chip REF3020 generates a reference voltage of 2.048 V with an initial accuracy of 0.2% under a 5 V supply voltage. The chip has a drift performance of 50 ppm/°C from 0°C to +70°C and a load regulation of 26 ppm [18]. As discussed above, according to the RTD resistance value of 723.35 Ω at −70°C, the maximum current through each RTD is 4.3 × 10 −4 A. Hence, the maximum load current of the voltage reference chip is 2.6 × 10 −3 A for 6 temperature test channels that is less than the maximum output current of 2.5 × 10 −2 A. And another 51 channels can be expanded in this circuit.
The TS5A23157 device is a dual single-pole double throw(SPDT) analog switch designed to use in sample-and-hold circuits. Its bandwidth is 2.2 × 10 8 Hz while turn-on and turnoff time is both less than 2.7 × 10 −8 s [19]. Fig. 2 indicates that one TS5A23157 device can connect two RTDs to two AD channels of PXIe chassis.

Instruments Setup
Some commercial instruments and devices are employed in this paper. A digital control power supply (IT6720; Itech Electronics Co., Ltd., China) outputs fixed voltage of 5 V with a load regulation of 0.01% +  This makes for fast I/O sampling and switching especially when the number of temperature measurement channels is quite large. Besides, an embedded controller module running a real-time operating system is adopted. Fig. 4 shows all the instruments and devices in the experimental platform in which temperature sensors are placed in a thermotank together with a battery to be measured.

Temperature Calculation
Taking one channel of the interface circuit for RTDs in Fig. 2 as an example, the equivalent circuit can be drawn as shown in Fig. 5. Since there is always a long distance between the signal sampling area and the  signal processing area, it is necessary to use long lead wires to connect to the sensor. R wire1 , R wire2 and R wire3 in Fig. 5 indicate the equivalent resistors of three lead wires, whose resistances relate to their length. R sw1 and R sw2 represent the equivalent on-state resistance of the analog switches. R ref is the sampling resistor with a nominal resistance of 4 × 10 3 Ω, whose actual value used in the calculation will be measured by digital multimeter 34461A beforehand.
Because the input ports of ADC are typically high-impedance and virtually no current flows through R sw1 , R sw2 and R wire2 , the port of AI0+ only measures the voltage across R wire1 , R rtd and R wire3 . In the same way, the port of AI1+ measures the voltage across R rtd and R wire3 . These relations are shown in Eqs. (1) and (2).
Shown in Fig. 5 as the arrow, the currents flow through the sampling resistor R ref , R rtd , and lead wire resistors R sw1 and R sw3 are all equal. The value of the current can be determined by Eq. (3).
In engineering practice, the length of the three lead wires is almost equal, so they have the same resistance which can be calculated according to Eq. (4).
To convert RTD resistance to temperature record, there are two methods: using the look-up table and direct calculation of the polynomial. The latter is more accurate but requires a longer time for computation, while the former, though faster, is not very accurate [10], and is going to cause some interpolation error. Since the system proposed in this paper is implemented by LabVIEW program running in the real-time controller, the calculation speed is not the design bottleneck and the method of polynomial calculation is adopted. The callendar-van Dusen equation of the sensors adopted in this paper are shown in Eq. (6) [17].
where R rtd represents the resistance of RTD in ohms and t represents temperature in Celsius, A = 3.9083 × 10 −3°C−1 , B = −5.775 × 10 −7°C−2 , and C = −4.183 × 10 −12°C−4 . Fig. 6 shows the Engineering architecture of the temperature measurement system. Software layers are over the hardware layer which consists of interface layer, real time control layer and application layer. Interface layer functions AD sampling and digital I/O. To obtain rapid sampling and channels switch, a FPGA multifunction I/O module is adopted in this paper. Real time control layer executes programs for temperature calculation and data processing. On the top layer, a LabVIEW application is developed for operation and display.

Software Implementation
Take two of the measurement channels as an example, the timing diagram of the logic control program of interface layer is shown in Fig. 7. After pulling up DIO0 and DIO1 for 5 × 10 −8 s, The ADC execute an AD sampling at the ports of AIO+ and AI0-, and then complete the temperature calculation for the first sensor in the time of t1. Similarly, the temperature tested by the second sensor is calculated at the same amount of time of t2 after DIO0 and DIO1 are pulled down, and so on. The time of t1 or t2, whose size is 2 × 10 −6 s, is the signal conversion time for ADC in PXIe-7846R. The half cycle of DIO is set to wait for the analog switch to complete switch on the one hand, and to control the sampling rate of the sensor on the other hand. Therefore, for one temperature sensor in this paper, the sampling rate can be close to 1000 Hz.
According to the method mentioned above, LabVIEW program running in the real-time controller can be designed to calculate the temperature.  : Engineering architecture of the temperature measurement system RTD is less than 1000 Ω. This program will be called by the program of each measurement channels, and its calculation result stored in the variable named Root will be passed to the application layer software.

Experiment
In order to verify the performance of the temperature measurement system described in this paper, six channels were used and a comparative test was conducted with the temperature measurement channel of the commercial digital multimeter 34461A as a benchmark. The sensor used in the comparison instrument is a RTD (M213A; Heraeus Group, Germany) of the same accuracy level produced by the same manufacturer. Before the experiment, the digital multimeter 34461A was used to measure the sampling resistances and reference voltage in the temperature measurement system, and the measured values were input into the calculation program. The sensor for comparison was connected to the digital multimeter 34461A by 4wire configuration. All the sensors were attached to the surface of a cylindrical Li-ion battery to measure the temperature at different points as shown in Fig. 9.
A battery was fixed by a pair of metal support and was placed in the thermotank. The battery whose capacity is 3.2 Ah can discharge through a pair of electrodes. The application layer software designed for the experiment recorded and real-timely displayed the measurements of 6 RTDs whose numbers were T1~T6. Meanwhile, the commercial digital multimeter synchronously showed the measurement data of the sensor whose number was Tc for comparison. The ambient temperature was test by T1. Tc and T6 were put together in the middle of the battery for comparison.

.1 Error Analysis and Processing
During the experiment, the lead wires are long and unshielded, making them vulnerable to interference from nearby instruments and power lines, generating ripple and noise signals. Fig. 10a shows the original graph measured by the proposed experiment platform during heating from +39.5°C to +41.5°C. It can be seen that the high-frequency random noise with peak-to-peak value exceeding 2°C seriously affects the accuracy of the measurement system and must be eliminated. In this paper, the algorithm of moving average filter (MAF) was programmed in the application layer software to eliminate the measurement noise. MAF is capable of eliminating the ripple frequency and harmonics. MAF also presents the added advantage of simple implementation, which is well documented and explained in the literatures about discrete signal processing. The downside of the MAF filter is the larger delay, which increases the voltage drop during a step-response [23]. The proposed measurement system has a high sampling frequency and the temperature gradient being measured is limited. A good filtering effect can be obtained by sampling 50 times and calculating the mean value of MAF once. The filtered graph in Fig. 10b shows that the noise signal was effectively suppressed, and the peak-to-peak values of ripples were all within 0.3°C. Besides the error caused by interference, the systematic errors of the measurement system itself mainly come from the following aspects: i) lead resistance: The measurement sensitivity of the RTDs used in this paper is 0.256°C/Ω at 0°C.
The resistance of high temperature Teflon lead wires is 0.1545 Ω/m. If a 2-wire RTD was used, when the length of signal transmission path reached 6.47 m, lead resistance would add up to 2 Ω. This would produce 0.512°C deviation and could not satisfy the requirement of thermal management system. While the proposed 3-wire configuration can completely eliminate the measurement error caused by lead wire resistance. ii) Input impedance of ADC: If input impedance is insufficient, the preconditions of Eqs. (1) and (2) are not satisfied, which will bring measurement errors. The impedance of the analog input in PXIe-7846R is up to 1.25 × 10 9 Ω that is six orders of magnitude lager than the resistance of RTD, so this measurement error can be completely negligible. Similarly, the on-state equivalent resistance of the analog switch and its temperature drift will not affect the measurement accuracy. iii) Nominal error: There is deviation between the actual value and nominal value in the sampling resistor and the voltage reference, which will exert adverse influence on the measurement results.
In order to avoid this error, the actual values of resistance and voltage were measured by the high-precision multimeter and input into the calculation program beforehand. iv) AD sampling accuracy: According to the specification of PXIe-7846R, at the scale of ±0.1 V, the absolute accuracy of AD sampling is 2.52 × 10 −8 V. Assuming that the errors of two AD sampling values are opposite, according to Eq. (5), the corresponding resistance error is 0.37 Ω. Converted to temperature by Eq. (6), it is about 0.095°C and is acceptable in this application. v) Self-heating error: The adopted RTD has a self-heating coefficient of 600 K/W at 0°C. Based on the proposed design, the working current of RTD is 4.096 × 10 −4 A. Thus, the self-heating error can be calculated to be 0.1°C. So, it is an acceptable error for this application too.

Analysis of Experiment Results
The colored curves showed in Fig. 11 indicate the temperature curves over time read by six channels of the temperature measurement system in this paper. And the red circles represent the temperature data read by the contrasted commercial temperature measuring instrument. The battery starts discharging at time t1 and stop discharging at time t2. The discharge current was set to 6.4 A (2C) by the electronic load. The battery was left standing for two hours before the discharge procedure begins. Fig. 11 shows that, before t1, the graphs of all the six channels shows basically stable, and the deviation between each other is within 0.3°C. At the same time, compared with the three reference temperature points read by commercial instrument, the deviation of T6 is not exceeded 0.2°C. It can be indirectly considered that the accuracy of this temperature measurement system is better than ±0.3°C, and reach the level of commercial temperature measurement instruments.
After discharging begins, T1, T4, T5, T6 and Tc synchronously increase. The temperature of anode (T2) is always higher than the others. and the temperature of cathode is lower because of the sensor attaches to the insulation spacer. From the enlarged views near t1 and t2 in Fig. 11, it can qualitatively infer that the proposed measurement system can quickly follow and real-timely calculate and display the fast-changing temperature values.

Conclusion
A set of multi-channel dynamic temperature measurement system for laboratory was designed in this paper, in which the multiplexing AD sampling channel was realized by analog switch array. By adopting 3-wire RTDs and a method of lead resistance compensation, the measurement accuracy reached ±0.3°C, and each channel could be sampled 1000 times per second. By LabVIEW programming, the sampling channel switching, polynomial equation solving and MAF filtering algorithm were realized. In order to verify the performance of the proposed temperature measuring system, a comparative test was conducted with commercial temperature measuring instruments. This design aims to make full use of a limited number of high-precision AD sampling resources to build a multi-channel temperature measurement system and effectively reduce the cost of the measurement system. In terms of measurement accuracy and dynamic characteristics, it can meet the temperature measurement requirements on the test rig of NEVs thermal management system. Although the proposed design is based on the virtual instrument, after the extraction and adaptation of the algorithm combined with the special design of the hardware circuit, it is also applicable to the development of temperature measurement products based on the embedded system. Besides, the system can also be applied to other industries of thermal physical process temperature measurement. However, no effective method was adopted to eliminate the systematic errors caused by self-heating in this paper, and the calibration function of the measurement system has not been realized in the software. These questions are left for future investigation. Conflicts of Interests: The authors declare that they have no conflicts of interest to report regarding the present study.