e1 shawn wong

14
PH3199 Physics Lab 3A Experiment 1: Introduction to LabVIEW Name of Student: Wong De Wei Shawn Name of Partner: Soh Chin Sheng Date of Experiment: 11/09/13 Date of Report: 20/09/13 Introduction Laboratory Virtual Instrumentation Engineering Workbench (LabVIEW) developed by National Instruments, is a graphical programming platform that helps engineers and scientists design and test small to large systems. It offers unprecedented integration with existing legacy software, IP, and hardware while incorporating the latest computing technologies. (National Instruments, 2013) Figure 1: DAQ Signal Accessory Figure 1 show Data Acquisition (DAQ) Signal Accessory with the IC temperature sensor which is wired to the Analog Input channel that produces a voltage output linearly proportional to the temperature; = × 100. Objectives Design a program that will allow the user to input the maximum and the minimum temperature limits and check if this limit is valid, if not alert the user with a LED indicator and alarm. Obtain the current temperature from the furnace in a Sub VI and output the current, maximum and minimum temperature on a waveform chart. If the current temperature is outside the maximum and minimum temperature range, display a warning message with a LED indicator and alarm to alert the user. Output the current temperature into a text-based measurement file. The user is able to start or end the temperature data acquisition. IC Temperature Sensor 1

Upload: edwardklaus

Post on 18-Jul-2016

56 views

Category:

Documents


2 download

DESCRIPTION

Lab report

TRANSCRIPT

Page 1: E1 Shawn Wong

PH3199 Physics Lab 3A Experiment 1: Introduction to LabVIEW

Name of Student: Wong De Wei Shawn

Name of Partner: Soh Chin Sheng Date of Experiment: 11/09/13

Date of Report: 20/09/13

Introduction

Laboratory Virtual Instrumentation Engineering Workbench (LabVIEW) developed by National Instruments, is a graphical programming platform that helps engineers and scientists design and test small to large systems. It offers unprecedented integration with existing legacy software, IP, and hardware while incorporating the latest computing technologies. (National Instruments, 2013)

Figure 1: DAQ Signal Accessory

Figure 1 show Data Acquisition (DAQ) Signal Accessory with the IC temperature sensor which is wired to the Analog Input channel that produces a voltage output linearly proportional to the temperature; 𝑇𝑒𝑚𝑝𝑒𝑟𝑎𝑡𝑢𝑟𝑒 = 𝑉𝑜𝑙𝑡𝑎𝑔𝑒 × 100.

Objectives

Design a program that will allow the user to input the maximum and the minimum temperature limits and check if this limit is valid, if not alert the user with a LED indicator and alarm.

Obtain the current temperature from the furnace in a Sub VI and output the current, maximum and minimum temperature on a waveform chart.

If the current temperature is outside the maximum and minimum temperature range, display a warning message with a LED indicator and alarm to alert the user.

Output the current temperature into a text-based measurement file. The user is able to start or end the temperature data acquisition.

IC Temperature Sensor

1

Page 2: E1 Shawn Wong

Experimental Procedure

This is a diagrammatic representation of the program algorithm.

The user is required to configure the write to measurement file settings.

If the User input of maximum and minimum temperature is not logical, a warning message will be displayed with a LED indicator and alarm; which will be listed in the Front panel under System status with the date and time.

The user can start or end the data acquisition by clicking on the Enable Acquiring Data button. The user can end the program by clicking on the End Task button.

If the current temperature is less than minimum temperature or more than maximum temperature, a warning message will be displayed with a LED indicator and alarm; which will be listed in the Front panel under System status with the date and time.

In summary, the program validates the user input data and alerts the user if the current temperature is outside the limits. The Front panel allows the user to control the start or end of the data acquisition.

Start

User input maximum and minimum temperature

Warning – Maximum and Minimum Temperature limits are invalid. Please re-input values.

Is Minimum < Maximum?

Enable Acquiring Data

Minimum < Current < Maximum Current > Maximum Current < Minimum

Warning – Current Temperature > Maximum Temperature

Warning – Current Temperature < Minimum Temperature

End Task

Configure write to measurement file

Yes

No

2

Page 3: E1 Shawn Wong

Front Panel

Figure 2: Front Panel

Components

1. Enable Acquiring Data button - Control for the user to start or end the data acquisition.

2. Current temperature display - Displays the numerical value of the current temperature obtained from the furnace.

3. User input for Maximum temperature - Numerical input with increment and decrement buttons in steps of 1.

4. User input for Minimum temperature - Numerical input with increment and decrement buttons in steps of 1.

5. Waveform Chart of Temperature vs Time - Red is the Maximum temperature - White is the Current temperature - Green is the Minimum temperature

6. System status - Warning messages and system status is displayed with date and time.

7. Minimum > Maximum temperature LED indicator - Turns on when the user inputs a minimum value greater than the maximum value.

1

2

3

4

5

6

7

8

9

10

3

Page 4: E1 Shawn Wong

8. Current < Minimum temperature LED indicator

- Turns on when the current temperature falls below the minimum temperature.

9. Current > Maximum temperature LED indicator - Turns on when the current temperature rise above the maximum temperature.

10. End Task button - Control for the user to end the program.

4

Page 5: E1 Shawn Wong

Block Diagram

Sub VI

Figure 3: DAQ Assistant inside the Sub VI

The function is to obtain data directly from the temperature sensor. The data collection is set to ‘on demand’. The voltage output from the DAQ Assistant is multiplied by a numerical constant of 100 to obtain the temperature reading in Degree Celsius (Figure 3).

Main VI

The Main VI is broken down into Region I, II and III for easier referencing.

Region I

Figure 4: Region I - True

The minimum and maximum temperatures are inputs from the user via the front panel. The input values are then validated. If the input minimum temperature value is greater than the maximum temperature value, the program will show this warning message “Warning – Maximum and Minimum Temperature limits are invalid. Please re-input values.” The LED indicator will turn on, an alarm will sound off and the warning message will be shown on the system status with the date and time. The program will prompt the user to re-input the values. The LED indicator and alarm will remain on until the minimum value is smaller than the maximum value (Figure 4).

5

Page 6: E1 Shawn Wong

Figure 5: Region I - False

If the input minimum temperature value is smaller than the maximum temperature value, the program will show this “Maximum and Minimum Temperature limits are valid.” on the system status (Figure 5).

Region II

Figure 6: Region II - True

The Current temperature is obtained from the Sub VI and compared with the Maximum and Minimum temperatures.

If the Current temperature is lower than the Minimum temperature, the program will show this warning message “Warning – Current Temperature < Minimum Temperature”. The LED indicator

6

Page 7: E1 Shawn Wong

will turn on, an alarm will sound off and the warning message will be shown on the system status with the date and time.

If the Current temperature is greater than the Maximum temperature, the program will show this warning message “Warning – Current Temperature > Maximum Temperature”. The LED indicator will turn on, an alarm will sound off and the warning message will be shown on the system status with the date and time (Figure 6).

Figure 7: Region II - False

If the Current temperature is within the Maximum and Minimum temperature range, the program will not show any warning messages on the system status (Figure 7).

Figure 8: Waveform chart

The Current temperature, Maximum temperature and Minimum temperature are output into a waveform chart of Temperature vs Time in the Front Panel. Current Temperature, Maximum Temperature and Minimum Temperature are reflected as a white line, red line and green line respectively (Figure 8).

7

Page 8: E1 Shawn Wong

Region III

Figure 9: Block diagrams Figure 10: Configuration for Write to Measurement file

The Current temperature data is written to a Measurement file which allows the user to control through the Enable Acquiring Data button (Figure 9). The user is given the options to configure the File name, File format, location to save at and action to take if a file already exists (Figure 10).

8

Page 9: E1 Shawn Wong

Region I, II, III

Figure 11: Block Diagram for All True

Figure 12: Block Diagram for All False

The entire Block diagram is placed in a while loop which terminates with the End Task button. Figure 11 shows the Block diagram for All True conditions and Figure 12 shows the Block diagram for All False conditions.

9

Page 10: E1 Shawn Wong

Operation

Invalid user input

Figure 13: Invalid user input of Maximum and Minimum values

If the User input of maximum and minimum temperature is not logical where minimum value is greater than maximum value, a warning message will be displayed with a LED indicator and alarm; which will be listed in the Front panel under System status with the date and time (Figure 13).

Current temperature below Minimum temperature

Figure 14: Current temperature < Minimum temperature

10

Page 11: E1 Shawn Wong

The System status will show this warning message “Warning – Current Temperature < Minimum Temperature” with the date and time. The Current Temperature < Minimum Temperature LED indicator will turn on and an alarm will sound off (Figure 14).

Current temperature above Maximum temperature

Figure 15: Current temperature > Maximum temperature

The System status will show this warning message “Warning – Current Temperature > Maximum Temperature” with the date and time. The Current Temperature > Maximum Temperature LED indicator will turn on and an alarm will sound off (Figure 15).

11

Page 12: E1 Shawn Wong

MathScript

The raw data obtained from measurement in an unenclosed system does not always immediately convey useful information. The transformation of the signal, removing noise disturbances, correcting for data corrupted by faulty equipment, or compensating for environmental effects, such as temperature and humidity are essential. Hence, Signal Processing, the analysis, manipulation and interpretation of signals with the purpose of noise reduction, classification, amplification and filtering (Jahromi, 2007), is a fundamental necessity in virtually all engineering or scientific applications.

The LabVIEW MathScript RT Module allows .m files in line with the acquisition of data, thus data analysis occurs in sync with the acquisition of data, providing results in real time.

Fast Fourier Transform

Figure 16: SubVI modification with MathScript (Fast Fourier Transform)

Figure 17: Waveform charts of before and after Fast Fourier Transform (Source: www.NI.com)

Fourier Transform is the mathematical tool that allows the deconstruction of the waveform into a sum of sinusoidal basis functions. Each of these basis functions is a complex exponential of a specific frequency. By analyzing each of this function and identifying the source of noise or background disturbance from the surroundings, the signal can be filtered as seen in Figure 17.

12

Page 13: E1 Shawn Wong

Smoothing

Smoothing usually reduces the noise in a signal. If the noise is "white" (evenly distributed over all frequencies) and its standard deviation is 𝑠 and smooth width 𝑚, then the standard deviation of the noise remaining in the signal after one pass of a triangular smooth will be approximately 𝑠×0.8

√𝑚. A 7-

point triangular smoothing algorithm was applied to the temperature data obtained from the furnace.

-1 0 1 2 3 4 5

27.975

27.980

27.985

27.990 Temperature Temperature w smoothing

Tem

pera

ture

(Deg

ree

Cel

sius

)

Time (s)

Figure 18: Temperature after a 7-point triangular smoothing algorithm

Smoothing modifies each data points of a signal; individual points that are higher than the immediately adjacent points are reduced, and data points that are lower than the adjacent points are increased. Hence, this will result in a smoother signal (Figure 18).

In addition, smoothing increases the signal-to-noise ratio and allows the signal characteristics such as peak position, height, width, area to be measured more accurately.

Figure 19: SubVI modification with MathScript (Savitzky-Golay Smoothing)

The MathScript for the smoothing function is obtained from Savitzky-Golay Smoothing and Differentiation Filter (Luo J W, 2005) (Figure 19).

13

Page 14: E1 Shawn Wong

Conclusion

The program will validate the user input of the maximum and minimum temperature limits and output with the current temperature from the furnace on a waveform chart.

If the maximum and minimum temperature limits are invalid or the current temperature is outside the maximum and minimum temperature range, it will display an individual warning message with a LED indicator and alarm to alert the user.

The user is able to start or end the temperature data acquisition that is written into a text-based measurement file.

To enhance the data acquisition, LabVIEW MathScript RT Module allows signal processing tools to run in conjunction with the IC temperature sensor.

Works Cited

National Instruments. (2013). Retrieved from National Instruments: http://www.ni.com/labview/

Jahromi, O. S. (2007). Multirate Statistical Signal Processing.

Luo J W, Y. K. (2005). Properties of Savitzky-Golay Digital Differentiators, Digital Signal Processing.

14