Tunisia Polytechnic School
Engineer internship report Option Signal Signal and Systems Systems
Monitoring Monitoring System For A Photovoltaic Installation From 01 July to 15 August 2010
Hosting company : CMERP laboratory laboratory (ENIS) Supervised by
: Meher CHAABEN Lecturer
Elaborated by
: Ahmed SAKKA 3rd year student
Academic year: 2010/2011
Abstract Data acquisition acquisi tion systems (DAS) are extensi extensively vely used in solar sola r energy installations installa tions (SEI). Data are collected in order to forecast the system behavior for the following days, to evaluate its future capacity, to manage the energy, etc. This work describes the development of a sensor conditioning electronics for a computer-based data acquisition system in order to control the SEI and to save its parameters. The proposed system monitors a set of sensors which measure three parameters: solar irradiation, ambient temperature, photovoltaic cell temperature. The sensors output signals are conditioned using electronic circuits then connected to a PC by means of a data acquisition (DAQ) card. As LabVIEW development environment environment offers performance performance and flexibility by its programming programming language, la nguage, as well as highhigh level functionality functionali ty and config configuration uration util utilities ities designed specifically for measurement and automation applications, it is used to design the monitoring interface. Keywords: Data acquisition system; Solar energy system; Virtual instrument; Sensors; LabVIEW
1
Contents Introduct Introductiion ........................................... ................................................................... .............................................. ............................................... ....................................... .............. 4 1
2
3
Presenta Presenta tion o f the laborator laboratory:.................. y:........................................... .................................................. .............................................. ........................ ... 5 1.1
Machines Machines and Network team ................................................................... ....................................................................................... .................... 5
1.2
Diagnosis Diagnosis and Monitor ing ........................................................ ................................................................................. ................................... .......... 5
1.3
Renewab Renewablle ener gies gies ............................................ ..................................................................... .............................................. ................................ ........... 5
Project contex conte xt ........................................... .................................................................... .............................................. .............................................. ........................... .. 7 2.1
Presentat Presentatiio n of o f the so lar installa installation tion ........................................... ................................................................... ................................. ......... 7
2.2
Presentat Presentatiio n o f sensors: sensors : ........................................................ ................................................................................. ....................................... .............. 9
2.2.1
Heat se nsor .............................................. ....................................................................... .............................................. .................................... ............... 9
2.2.2
Irradiat Irradiation ion sensor ............................................. ..................................................................... .............................................. ........................... ..... 11
2.3
Shortco Shortcoming ming o f the existing DAS DAS ........................................... .................................................................... ................................... .......... 12
2.4
Project specificati specificat ion................... on ............................................ .................................................. .............................................. .............................. ......... 12
Project equipm equip me nts ............................................ ..................................................................... .............................................. ...................................... ................. 13 3.1
3.1.1
Features Features of KUSB-3108 card ................................................................... ............................................................................. .......... 13
3.1.2
Wiring method: method: ............................................ ..................................................................... .............................................. .............................. ......... 17
3.2
LabVI LabVIEW EW 8.6.......................................... 8.6............................................................... .............................................. .............................................. ..................... 18
3.2.1
Genera Genera l presentation ............................................ ..................................................................... .............................................. ....................... 18
3.2.2
LabVI LabVIEW EW term ter ms........................................... s.................................................................... .............................................. .............................. ......... 19
3.3 4
Data Data acquisiti acquis ition on (DAQ) card ........................................................ ................................................................................. ............................. .... 13
DT-LV DT-LV Link Link ............................................ ..................................................................... .............................................. .......................................... .....................21
Conceptio Conception n of o f the monitoring system................... syste m............................................ .................................................. ................................... .......... 23 4.1
Data Data acquisiti acquis ition on system ................................................................... ......................................................................................... .......................... .... 23
4.1.1
Test Test ing data acquisi acquis ition tio n with LabVIEW ......................................... ............................................................ ................... 23
4.1.2
Virt Virtu ual instrume instrume nt for solar irradi rrad iati at ion acq uisition uisitio n ............................................ ............................................ 24
4.1.3
Virt Virtu ual instrument for temperature acquisition acq uisition .................................................. .................................................. 25
4.2
Data Data logging........................................ logging.............................................................. ............................................... ................................................. ........................28
4.2.1
Creating log files files ............................................. ..................................................................... .............................................. ........................... ..... 28
4.2.2
Opening log files files ............................................. ..................................................................... .............................................. ........................... ..... 29
4.3
The The graphic interface a nd tests .............................................. ....................................................................... .................................... ........... 30
2
List of Figures figure 1 : The real solar installation............................................................................................. 8 figure 2: Synoptic sc hema of the solar installation .................................................................... 8 figure 3: The ambient temperature sensor .................................................................................. 9 figure 4 : The photovoltaic ce ll temperature sensor .................................................................. 10 figure 5: Spektron 210 sensor ................................................................................................... 11 Figure 6: Screw terminal assignments o f the KUSB-3108 board ............................................ 15 figure 7: Block Dia gram o f the KUSB-3108 Modules............................................................. 16 figure 8: connecting single-e nded voltage inputs (S hown for channel 1, 2 and 3) .................. 17 figure 9: Connecting Differential Voltage Inputs (S hown for Channel 0) ............................... 18 figure 10:LabVIEW logo.......................................................................................................... 18 figure 11 : Example of VI Front P anel ...................................................................................... 20 figure 12 : Example of VI Block Diagra m ................................................................................ 21 figure 13: The role of DT-LV Link ......................................................................................... 22 figure 14: The prepared Block diagram to test the KUSB board ............................................. 23 figure 15: The line chart of the collected measures .................................................................. 23 figure 16: The acquired input of the so lar irradiation sensor ................................................... 24 figure 17 : Temperature sensor stage c ircuit ............................................................................. 26 figure 18 : The input of the ope rational amp lifier ..................................................................... 27 figure 19: The voltage conditioning c irc uit .............................................................................. 27 figure 20: The carried out circuit .............................................................................................. 28 figure 21: The input of t he circuit with the filtering sta ge ....................................................... 28 figure 22: The developed graphic interface .............................................................................. 31
3
Introduction The use of solar energy in electric energy installation has been notably developed during the last decades. However, the use of solar energy in electrical installation remains limited due to the low efficiency of converter panels and the high price of storage systems (batteries). In order to improve solar plant generation, a total monitoring is necessary. Hence, many works are interested in a real time power management giving an instantaneous decision on the way to consume the generated energy. This tendency requires detailed knowledge of some meteorological data of the photovoltaic panel (PVP) of the installation. The chosen approach in the CMERP laboratory considers the PVP parameters provided by sensors (ambient temperature, photovoltaic cell temperature and solar irradiation) during the last ten days in order to forecast its behavior for the following day. So this pattern of research needs in addition to the current PVP parameters, a data base of these parameters during the last ten days. To accomplish this task a computer-based data acquisition system (DAS) for monitoring and saving these parameters can be the most flexible and simple solution. It is within this context that I carried out my engineering internship aimed to develop a data acquisition system to control in real time the PVP parameters from a graphic interface and to store them on log files for fixed period. The report is organized into four chapters. The first chapter gives an overview of the principal activities of CMERP laboratory. The second chapter presents the project context and specifications. The third chapter deals with the hardware and software equipments used in the project. The fourth chapter explains the different steps to carry out the data acquisition system and presents test results.
4
1
Presentation of the laboratory:
The research unit " Commande de Machines Electriques et Réseaux de Puissance " (CMERP) aims to bring together researchers from the Electrical Engineering discipline to coach, develop and publish research related to:
modeling, supervision and control of electrical machines;
modeling, optimization and management of solar energy;
supervision, diagnosis and numerical control of industrial processes.
The research themes are developed in the context of:
agreements with universities;
research contracts with industry;
research projects.
The research group at the laboratory is divided in 3 teams:
1.1 Machines and Network team The main themes of research of this team are:
Modelling, supervision and control of electrical machines;
Modeling and control of grid.
1.2 Diagnosis and Monitoring The main themes of research of this team are:
Diagnosis and monitoring of complex systems;
Monitoring and fault tolerant control.
1.3 Renewable energies The main themes of research of this team are:
Optimal energy management;
Modelling and design of installations;
Estimation of climatic parameters.
I carried out my internship with this team, especially with two researchers who conduct a project based on the solar installation of the laboratory. My project is dedicated principally to provide this team with a monitoring system for the principal parameters of the solar
5
installation and a data base of the collected measures to be used in the estimation of PVP behavior.
6
2
Project context
The target work consists in the implementation of a DAS for the solar installation. So to present the project context, a presentation of the solar installation and its sensors and an explanation of the shortcoming of the present DAS are required. That’s leads us to deal with the project specifications.
2.1 Presentation of the solar installation Cmerp is equipped by a solar installation which is exposed on the roof of the laboratory. It includes a 260 Wp photovoltaic panel generation and made up of four parallel connected arrays (TE500CR+ of Total Energie) and the electric grid as a complementary energy source. The PVP is equipped with a Maximum Power-Point Tracker, which is an electronic device that monitors PVP to operate near its maximum power-point along the I –V curve and an inverter that provides the same output voltage as the electric grid (230 V/ 50 Hz). The appliances, chosen as four lamps of 30, 40, 60 and 75 W, are supplied, via a switching relays bloc, either by the PVP output or the electric grid. The whole installation is controlled by a PC computer in which the planning algorithm is implemented. The computer is connected as well to commercial data logging unit providing climatic parameter measures: the solar irradiation G, the photovoltaic cell temperature T p and the ambient temperature T a . Figure 1 shows the real solar installation where as the figure 2 gives its synoptic schema.
7
figure 1 : The real solar i nstallation
figure 2: Synoptic schema of the solar installation
8
2.2
Presentation of sensors:
2.2.1 Heat sensor
To measure the temperatures, two PT1000 temperature sensors are used. PT1000 is a resistance temperature detector (RTD) which exploits the predictable change in electrical resistance of platinum with changing temperature. This sensor is called PT1000 because it is a platinum RTD and has a nominal resistance of 1000 ohms at 0 °C. The platinum resistance thermometers are widely used in meteorological applications thinks of their:
High accuracy for temperature below 200 °C Low drift Quasi-linear resistance-temperature relationship Chemical inertness Wide operating range (from -270 to 660 °C) Suitability for precision applications
The two PT1000 are used to measure respectively:
The ambient temperature whose sensor is mounted in a weatherproof Macrolone
housing. This sensor can measure a range of measurement from -20 to +200 °C.
figure 3: The ambient temperature sensor
The photovoltaic cell temperature whose sensor has been designed as adhesive foil
sensor for surface measurement. It is mainly used for temperature measurements of solar systems. In our system, it is stuck to the rear side of the photovoltaic panel. This sensor can measure a range of measurement from -20 to +150 °C.
9
figure 4: The photovoltaic cell tempera ture se nsor
The sensor characteristic equation
The platinum sensors have a near linear resistance versus temperature function. Its transfer function is given by the Callendar – Van Dusen equation which is described by two distinct polynomial equations: one for temperatures below 0°C and a nother for temperatures above 0°C. These equations are:
Where:
R T is the resistance at temperature T
R 0 is the resistance at 0 °C, in our case R 0 = 1000
A = 3.9083. 10 -3 °C-1
B= -5.775. 10 -7 °C-2
C= -4.183. 10 -12 °C-12
The last model give a precise result but it needs the use of numerical methods to calculate the temperature from a known resistance. Whereas, including a numerical method into the algorithm of a program can affect the performance of the real time case. Therefore, in this work a simplified linear model is applied. This model eliminates the two last terms of the last equation which are negligible compared to the other terms: R Pt 1000
A T B
Where A and B are constants that depend on the range of measured temperature. A scientific article entitled “RTD Interfacing and Linearization Using an ADuC8xx MicroConverter” deals with the choice of optimum values for A and B to minimize the error band for different ranges of the temperature. The next equation is the proposed one for this project and gives according to this article, accurate results for temperature ranged from -20 to +100 °C:
10
R Pt 1000
3,85 T 1000
2.2.2 Irradiation sensor To measure the solar irradiation the PVP is equipped by the Spektron 210 sensor. It is a silicon sensor providing a proportional voltage-intensity of the solar irradiation relationship. The output signal ranges from 0 to 150mV which correspond to a solar irradiation that ranges from 0 to 1500 W/m2. So to measure such voltage with high precision, either a measure instrument with high resolution should be used or the sensor signal should be amplified before proceeding to the measures step. The Spektron can be connected directly to a voltmeter or a data acquisition (DAQ) card. The voltage measured by the Spektron 210 can be converted into the unit of irradiation (W/m²), using the calibration value imprinted on the sensor.
figure 5: Spektron 210 se nsor
As the access to the irradiation sensor is difficult since it is exposed on the roof of the laboratory, I proceed to calculate the calibration value by measuring the input voltage of the sensor using a voltmeter for many different irradiations read from the old acquisition system. So I take the average value of proportionality coefficient as calibration value.
V: Output voltage (mV) G: Solar 31,35 30,6 30,23 35,05 34,6 39,67 39,38
irradiation(W/m 2) V/G: proportionality coefficient 417,61 13320,89314 408,9 13362,7451 403,18 13337,08237 466,68 13314,6933 462,22 13358,95954 528,11 13312,57877 525,4 13341,79787 11
38,88 38,13 37,38 37,68
518,54 508,69 498,106 502,12
13336,93416 13340,93889 13325,46816 13325,90234
Table 1: Calculation of the calibration value of the Spektron 210 sensor
The average value of the proportionality coefficient = 13333,0614 ≅ 133333
Thus
Solar irradiation = 133333 × Output voltage
2.3 Shortcoming of the existing DAS The problem of the existed commercial data logging unit is that it can’t save the historical values of the solar irradiation: It just displays the current value. However as mentioned in the introduction, the energy management strategy researches of the laboratory are based on the historical values of the PVP parameters (during the last ten days). Besides, such commercial data logging unit lacks flexibility compared with other data acquisition systems. This flexibility in DASs is highly required in a laboratory where many different approaches of research are carried out.
2.4 Project specification The required work consists of the implementation of a new acquisition system with the following features:
The DAS should be able to save the acquired data each one minute on a daily log files;
These log files should be able to be read by Microsoft Excel.
The user can monitor the current value of the measured parameters.
The graphic interface for monitoring should be harmonious and display clearly the target parameters.
The user should be able to vis ualize the saved data and the line chart of the progress of the measured parameters during any day when the data is stored.
12
3
Project equipments
This chapter gives an overview of the data acquisition (DAQ) card used in the collection of data, and gives a short introduction on the software to be used to control the data acquisition system and to store the collected data, NI LabVIEW.
3.1 Data acquisition (DAQ) card To acquire data from the sensor to the PC a data acquisition (DAQ) card is required. This card is a way to measure sensor signals and transfer the data into a computer. In this part, firstly, various aspects of a DAQ card are explained. After that, an overview of the DAQ card KUSB3108 used for this project is given.
3.1.1 Features of KUSB-3108 card The data acquisition system provided for this project is the Keithley KUSB-3108, which is a USB-based data acquisition module. This model is a low-cost, multifunctional data acquisition system which is very suitable for this project for many reasons:
The Keithley KUSB-3108 Series brings true plug-and-play data acquisition to computers that contain Universal Serial Bus (USB) 2.0 and 1.1 ports. The input resolution of the KUSB-3108 module is 16-bits. In fact, the
resolution of
the
converted signal is a function of the number of bits the analog to digital converter ADC uses to represents the digital data. The higher the resolution, the higher the number of divisions the voltage range is broken into, and therefore, the smaller the detectable voltage changes. An ADC with a resolution of 16 bits can encode an analog input to one in 216 different levels.
The gains of each channel are configurable in order to fix the effective input ranges of the acquired data. In fact, with fixing the range of the input data the programmable gate array PGA of the card configure this range as the full scale of the ADC for the corresponding channel. That’s means the minimum change in voltage required to guarantee a change in the output code level which called LSB (least significant bit, since this is the voltage represented by a change in the LSB) can be configured according to the target measured range so as to provide the maximum voltage resolution of the ADC.
The voltage resolution of an ADC is equal to its overall voltage measurement range divided by the number of discrete voltage intervals:
13
where: -
N is the number of voltage intervals,
-
EFSR is the full scale voltage range, given by, the upper and lower extremes respectively of the voltages that can be coded.
Normally, the number of voltage intervals is given by,
where M is
the ADC's resolution in bits.
Table 2 lists the supported gains and effective input ranges of the KUSB-3108 modules.
Table 2: Effective input ra nges of KUSB-3108 board
Note
For each channel the gain that has the smallest effective range that includes the target signal should be chosen. For example, if the range of the analog input signal is ±0.75 V, the effective input range for this channel is then ±1V, which provides the best sampling accuracy for that channel.
The Model KUSB-3108 module features a variety of analog input channels, as well as single-ended/differential analog input channels: KUSB-3108 modules support 16 single-ended analog input channels, or eight differential analog input channels. The configuration of the channel type as single-ended or differential is done through an adequate software such as LabVIEW.
The Model KUSB-3108 provides 2 analog output channels for high-resolution which can be used to feed the conditioning circuit. 14
The module powered by the +5 volt USB supply from the computer. So no external power is required.
The sampling frequency of the DAS is 50 KHz. According to the Nyquist theorem, the maximum frequency of the input signals should 25 KHz. Since the quantities measured, temperature and irradiation, do not change very frequently in time, the sample frequency is not a problematic for this project.
A 500V isolation barrier protects the computer and ensures a reliable stream of data. Without isolation the computer is tied directly to the external sensor which can potentially damage The PC.
Figure 4 shows the screw terminal assignments on the KUSB-3108 modules.
Figure 6: Screw terminal assignments of the KUSB-3108 board
Note
While only three parameters measures are acquired, only three input analog channels (channel 0, 1 and 2) are used. The use of three channels divides the 15
sampling frequency of the DAS by three . That’s means the possible sampling frequency for each channel is equal to 50KHz/3 = 16,66 KHz.
The card acquire only voltage signal measures, so to measure the two temperature sensors a conditioning circuit to convert the PT1000 resistances into a proportional voltage is needed.
In this project, not all functionalities of the KUSB module will be used.
Figure 5 shows a block diagram of the KUSB-3108 modules. Note that bold entries indicate signals you can access.
figure 7: Block D iagram of the KUSB-3108 Modules
16
3.1.2 Wiring method: The KUSB-3102 and KUSB-3108 modules support both single-ended and differential configuration:
Single-ended: We choose this configuration when we want to measure high-level signals, noise is not significant, the source of the input is close to the module, and all
the input signals are referred to the same common ground. When we choose the single-ended configuration, all 16 analog input channels are available. Figure 8 illustrates how to connect an analog signal source to a KUSB-3108 module using single-ended configuration.
figure 8: c onnecting single-ended voltage inputs (Shown for channel 1, 2 an d 3)
Differential : We choose this configuration when we want to measure low-level
signals (less than 1 V), we are using an A/D converter with high resolution (greater than 12 bits), noise is a significant part of the signal, or common-mode voltage exists. So the differential configuration is the best way to connect wires when the input voltage is a floating signal source. When we choose the differential configuration, only eight analog input channels are available. Figure 9 illustrates how to connect a floating signal source to a KUSB-3108 module using differential inputs. (A floating signal source is a voltage source that has no connection with earth ground.) 17
figure 9: C onnecting Differential Voltage Inputs (Show n for Channel 0)
3.2 LabVIEW 8.6 DAQ hardware without software is of little use-and without proper controls the hardware can be very difficult to program. The purpose of having appropriate software is the following:
Acquire data at specified sampling rate; Acquire data in the background while processing in foreground; Stream data to and from disk; Develop the graphic interface for monitoring and automatic saving of the collected data;
According to these specifications the chosen software is LabVIEW.
3.2.1 General presentation LabVIEW is the emerging standard in visual programming based instrumentation control systems. This application uses a data graphical programming language (called “G”) where the processing 18
figure 10 :LabVI EW logo
can be controlled using block diagrams and front panels instead of using lines of text to create applications. In contrast to text-based programming languages, where instructions determine program execution, LabVIEW uses dataflow programming, where the flow of data determines execution. In LabVIEW, you build a user interface by using a set of tools and objects. The user interface is known as the front panel. You then add code using graphical representations of functions to control the front panel objects. The block diagram contains this code. In some ways, the block diagram resembles a flowchart. LabVIEW is integrated fully for communication with hardware such as GPIB, VXI, PXI, RS-232, RS-485, and plug-in DAQ devices. Using LabVIEW, you can create test and measurement, data acquisition, instrument control, data logging, measurement analysis, and report generation applications. You also can create stand-alone executables and shared libraries, like DLLs, because LabVIEW is a true 32-bit compiler.
3.2.2 LabVIEW terms It is worthy before beginning the presentation of the developed program, defining the different term used by LabVIEW programmer. Virtual instrument VI:
The combination of a DAQ board and LabVIEW software makes a virtual instrument or a VI, because their appearance and operation imitate physical instruments, such as oscilloscopes and multimeters. A VI can perform like an instrument and is programmable by the software with the advantage of flexibility of logging the data that is being measured. In LabVIEW programming all inputs are called controls and all outputs are called indictors. Besides the subroutines are called subVIs. Each VI contains three main parts:
Front Panel : How the user interacts with the VI.
Block Diagram : The code that controls the program.
Icon/Connector : Means of connecting a VI to other VIs.
VI Front Panel
The front panel is the user interface of the VI. The front panel is built with controls and indicators, which are the interactive input and output terminals of the VI, respectively. Controls are knobs, pushbuttons, dials, and other input devices.
19
Indicators are graphs, LEDs, and other displays. Controls simulate instrument input devices and supply data to the block diagram of the VI. Indicators simulate instrument output devices and display data the block diagram acquires or generates.
figure 11 : Example of VI Front Panel
VI Block Diagram
The block diagram contains the graphical source code. Front panel objects appear as terminals on the block diagram. Additionally, the block diagram contains functions and structures from built-in LabVIEW VI libraries. Wires connect each of the nodes on the block diagram, including control and indicator terminals, functions, and structures.
20
figure 12: Example of VI Block Diagram
3.3 DT-LV Link LV Link is a collection of Virtual Instruments (VIs) that give programmers working in LabVIEW the ability to access KUSB data acquisition modules. This collection is consistent with the design and layout of the LabVIEW DAQmx VIs to speed development time and minimize learning curve issues. The standard version of DT-LV Link supports all DT-Open Layers compliant USB and PCI hardware, providing the ability to measure and control analog I/O, digital I/O, and counter/timer signals, and stream the data to disk at full-speed. To get up and running quickly, numerous application examples are provided with both versions of the software. Since the source code is also provided, people can easily modify the examples to speed their development time. By using DT-LV Link in the LabVIEW application, people can integrate all the Data Translation and National Instruments hardware in the same application. Three Levels of VIs
Similar to LabVIEW’s DAQ interface, DT -LV Link provides three levels of Vis: 1) The Easy I/O VIs
These Vis perform high level data acquisition operations, such as setting up and acquiring waveforms from multiple analog inputs. Easy I/Os can be run standalone or as part of a 21
more complex application. 2) The Utility and Intermediate VIs
These VIs provide more hardware functionality and efficiency in developing applications than the Easy I/O, but require more integration work. In addition, there are utility VIs to perform tasks such as converting codes to volts and computing the range and gain given the limits of a signal. 3) The Advanced VIs
These VIs are the lowest level of VIs for data acquisition. There are one Advanced VI for each DT-Open Layers® function. This provides people with access to the full functionality of all supported Data Translation data acquisition boards as well as completes flexibility in creating their application. It’s extremely easy to convert LabVIEW example VIs as well as their own custom applications to use Data Translation hardware. K As shown in the figure 13, DT-LV Link is both an interface and a library of VIs. The library interface is consistent with the design and layout of LabVIEW. The library of VIs enables you to access Data Translation’s data acquisition boards or any board that uses DT-Open Layers
device drivers.
figure 13: The role of DT-LV Link
When the device gets the data, it will be sent to the DT-Open Layers, then translated through the DT-Link VI, the analog signals transfer into digital signals. And the LabVIEW can analysis and process the data.
22
4
Conception of the monitoring system
4.1 Data acquisition system
4.1.1 Testing data acquisition with LabVIEW As a first step, I begin by testing the acquisition by LabVIEW using the KUSB card. I put in the analog input channel a precise voltage of 5V after preparing a block diagram on LabVIEW for this purpose based on the DT-LV Link Library. The prepared diagram consist in acquiring 1000 samples of this voltage with the full scale of the ADC (-10 to 10 V) and the full sampling frequency capacity of the board (50 KHz) using the single-ended wiring method. Besides, it calculates the average value of the acquired measures.
figure 14: The prepare d Block diagram to tes t the KUSB board
figure 15: The line chart of the collected meas ures
23
This line chart shows that the KUSB borad genarates a little noise. This noise can be considred as a white noise. The averge value of the 1000 collected samples = 4.99949 V. So, the mean of the white noise is equal to: μ = 5- 4.99949 = 0,00051 V = 0.51 mV. As it is mentionned in the datasheet KUSB borad, this noise is mainly generated by the amplifier and the ADC.
4.1.2 Virtual instrument for solar irradiation acquisition Acquiring the voltage of the irradiation sensor is very simple if I use the previous VI. But the result as it is shown in the following graph is very noisy and don’t give a precise voltage.
figure 16: The acquired input of the solar irradiation sensor
To reduce this noise I have followed the following steps: 1. For the hardware part:
I wire the voltage source of the sensor to analog input channel 0 using the differential configuration. In fact, according to the datasheet of the KUSB the differential wiring method is recommended when the measured signal low-level signals (less than 1 V). In addition, to the use of differential wiring method, I need to configure the card from the block diagram of the VI for this purpose.
As the voltage of the irradiation sensor ranges from 0 to 150mV it is worthy to configure the used channel of the card for this range. In fact , as mentioned above in the presentation of the features of the card, the lower is the range configuration of the ADC the more precise is the input of the ADC. From the table 2 listed above, the most suitable gain for our input range is 100 which correspond to an analog input ranges from -100mV to 100mV.
24
2. For the software part: As the previous task is not sufficient to obtain an acceptable noise I choose to use a simple algorithm to eliminate the false values. These false values can be due to a false interpretation of the analog input values by the ADC which is configured to acquire negative and positive values. Unfortunately, this configuration can’t be changed for this
card. This algorithm should be as simple as possible with the least complexity to conserve the real time acquisition case. The algorithm is s=0;
Calculating the average value
for i=1:n s=s+x(i); end m=s/n; x(1)=m; for i=2:n
Initialization of the first sample with the average value
if abs(x(i)-m)>(m/20) x(i)=x(i-1);
Checking if the difference between the current value and the previous value < 5 %
end end Adjustment o f the offset of the card
m=x(n)+ 0,00051;
4.1.3 Virtual instrument for temperature acquisition 4.1.3.1 Temperature conditioning circuit The selected temperature sensor is a resistive RTD sensor which provides a variation in resistance as the temperature changes. As the Data Acquisition System is unable to measure the changes in resistance, a conditioning circuit is needed to obtain an output voltage proportional to the resistive variation of the heat sensor.
4.1.3.1.1 Sensing stage To convert the variation in resistance to a variation in voltage an electronic circuit with an operational amplifier is the proposed solution. In fact, to reach this purpose, it is needed to pass the sensor resistance by a fix current. The most suitable solution to provide a fix current 25
is the use of an operational amplifier. According to the diagram from figure 17 the output voltage has to be: = −
→ = − 0,000549
figure 17: Temperature s ensor stage circuit
The maximum current processed by the sensor to depreciate self heating should be 1 mA, according to specifications. A current of 0.6mA has been selected.
=
=
5V
= 0,6 mA → = 8,33k Ω
[ 4.1]
The chosen resistance value is 9,1 k Ω because it is the nearest resistance value of the existing standard resistor. The equations of PT1000 has been used to find the resistance of sensor whit maximal and minimal temperature of measurement range (-10ºC a 60ºC). = −0°C → = 1000 Ω = −40°C ⇒ = 961,5 Ω = 55°C ⇒ = 1231 Ω
Consequently the maximal and the minimal voltage for the previous resistances and according to the output voltage equation shown previously result in: = − 10°C ⇒ = 961,5Ω ⇒ = −0,000549 ∙ 961,5 = − 0,527 V = 60°C ⇒ = 1231Ω ⇒ = − 0,000549 ∙ 1231 = − 0,678 V
26
For all of these calculations, the final sensing circuit implementation has to result the ones
showed in .
4.1.3.1.2 Filtering stage As it is shown in the figure 18 the problem of the previous circuit that the operational amplifier generates an important noise that can affect the real value of the heat sensor input. The problem can be so lved in the software part by t he conception of a numer ic filter but to decrease the complexity of the developed program, it is worthy to integrate the filtering stage in the electronic circuit.
figure 18: The input of t he operational amplifier
The output signal will be filtered using a low pass filter (LPF) to eliminate interferences. This LPF will filter out frequencies below ….Hz (rest some calculation) 4.1.3. The final voltage conditioning circuit
27
figure 19: The voltage conditioning circ uit
figure 2 0: The carr ied out circuit
As it is shown in the figure 21 which is presented in the same scale of the figure 18, the filter have eliminate nearly all the noise and gives a perfect result.
28
figure 21 : The input of the circuit with the filtering stage
4.2 Data logging When the calibration procedure is completed, the calculated values are displayed on the monitor. Also, the measurements performed every 1 min are stored on the PC hard disk, in files named with the current date. These files contain the exact time of the measurement along with each measured parameter identification and value. Through this part, I will describe the way that I proceeded to create the log files which save the data of the three sensor parameters and to open these files from the monitoring interface or from the excel software.
4.2.1 Creating log files LabVIEW provides an easy-to-use application and several functions to record data acquired from the DAQ card in real time. For data-logging applications, LabVIEW offers built-in functions to choose how data files are created. The developer have the choice to select from basic text files to compact binary files and user standard spreadsheet programs such as Microsoft Excel to view and interact with his data. For this project I have chosen the Technical Data Management Streaming (TDMS) as extension for log files. This extension is introduced by National Instruments for many useful purposes. In fact the TDMS format:
gives more effective and accurate data storage than the traditional format like txt. creates a file composed by three sheets: the first sheet to display the header information, the second sheet to display logged data and the third sheet to display the line chart for the corresponding data. may be opened in LabVIEW, of course, and in NI DIAdem which is a software tool for managing, analyzing, and reporting data in log files. Can be read by Microsoft excel by adding a plug-in provided by National Instrument. This characteristic provides for the researcher the ability to easily use the logged data into their researches. 29
The procedure of developing this part consists of storing the acquired data in a log file having the corresponding date as name. The storing action consists of creating a new line in the TDMS file that the first case is devoted for the instant of the storage, the second one is devoted for the order of the stored line and the other three cases are devoted to store the three acquired parameters. When the date change another log file will be created with this new date as name.
4.2.2 Opening log files Since I have organized the log files with the date of the target data I take advantage of this option to open the log files. In fact, I prepared a small box in the front panel in which I placed a label to enter the date of the target log file and a Boolean control button to order the opening of the file. Boolean controls have mechanical actions, which control how activation with the mouse affects the value of the control. In order to affect the true value for the Boolean control only when the button is pushed to open a log file I select the Switch until released as button behaviors. That’s means the value of the control changes only so long as the mouse button is held down. When the mouse button is released, the control returns to its default value. This behavior is not affected by how often the VI reads the control. In the block diagram part I put all the functions used for the conception of the opening box in a while loop which verify each milliseconds if the Boolean control button is pushed in other word if the value of the Boolean control is true. If this value is true and the user have entered the date of the target log file a case structure will be activated and give the permission for the TDMS function to open the file.
30
4.3 The graphic interface and tests The final developed graphic interface is shown in figure 22. The measurements of all sensors described in last sections, collected in a specific day, are illustrated in figure 23. A part of the LABVIEW program code is shown in 24.
figure 22: The developed graphic interfac e
31