• No results found

The invention of new type of thermal mass flow meter realizing in two-wire

N/A
N/A
Protected

Academic year: 2021

Share "The invention of new type of thermal mass flow meter realizing in two-wire"

Copied!
88
0
0

Loading.... (view fulltext now)

Full text

(1)

Department of Electrical Engineering

The invention of new type of thermal mass flow meter

realizing in two-wire

Author: Wu Wenyan

E-mail: wewu11@student.bth.se

Tutor: Ander Hultgren

E-mail: anders.hultgren@bth.se

Support institution: SHANGHAI HUAQIANG INSTRUMENT Co., Ltd Headquarters:

No.151, KEYUAN ROAD, SHANGHAI ZHANGJIANG Hi-Tech Park, SHANGHAI, CHINA Telephone number: +86 21 50276456

Website: http://www.hqcom.com.cn/englishindex.htm

Institution mentor: SHENGDENG SHAO E-mail:shaosdb@126.com

(2)

Abstract

For more than 20 years, the thermal mass flow meters have been widely used in several industries such as the petroleum refining industry, waste water processing and steeling making industry. I will call it “TMF” in the rest of the article. The TMF’ low-flow sensitivity and fast response have made them the first choice for many critical gas flow application.

However, there are still some inadequacies in the TMF. Such as interruption among the wires, high cost of the installation and influenced by temperature.

Some of the problem comes from its way of the connection--- four-wire connection. Two-wire connection can resolve some of these problems.

In this thesis, the author presents a new type of two-wire installation and use of TMF which can be realized low production cost. The author found a new measurement method, which is detecting the functional relationship between working current of a traditional TMF and the flow. The author also designs a measurement converter needed for adequate signal processing so that flow value measurement values can be shown in computers.

(3)
(4)

Acknowledgements

I would like to express my hearty and sincere gratitude to my tutor in the university Mr.Anders Hultgren, the kind, the merciful tutor in the university who give me the ability, strength and courage to understand and execute everything needed throughout the thesis work. I want to thank Mr.Anders Hultgren for good advice, consultation and direction. Thank you for spending so much time on giving lots of useful suggestions to me. I do really appreciate that.

I wish to thank SHANGHAI HUAQIANG INSTRUMENT Co., Ltd for the opportunity the conduct my thesis at this institute and giving me access for all equipment in Lab to facilitate my research work

I would like to pay my gratitude to my supervisor and mentor in the company Mr. Shao ShengDeng for his kind support and knowledgeable guidance during my thesis work. His expert supervision helped me develop ways of thinking and problem solving.

I want to thank Blekinge Institute of Technology and Department of Electrical Engineering for offering me a great opportunity to get M.Sc. degree from this institute.

(5)

4

List of Acronyms

TMF: Thermal Mass Flow meter

SCM: Single Chip Microcomputer

CFVs: Critical Flow Venturis

RVVP: a kind of cable

(6)

Contents

Abstract ... 1 Acknowledgements ... 3 List of Acronyms ... 4 Contents ... 5 Chapter1: Introduction ... 7 1.1 Application ... 7

1.2 The problem in the industry ... 7

1.3 Statement of my thesis purpose ... 8

1.4 Statement of my work part of thesis ... 8

1.5 Contribution of my thesis... 10

1.6 Result statement ... 10

Chapter2: Background ... 13

2.1 Introduction of the company ... 13

2.2 Principle of the thermal mass flow meter ... 14

2.3 Introduction of installation ... 15

Chapter3: Hardware design ... 17

(7)

6

3.4 Structure of the product ... 25

3.5 Experiment ... 27

3.5.1 The introduction of equipment ... 27

3.5.2 The steps of the experiment ... 28

Chapter4: Software design ... 29

4.1 Mathematic modeling---based on the mat lab ... 29

4.2 Converter----based on C++ in the center of the SCM ... 37

4.3.1 Receive data ... 40

4.3.2 Lossless current calculation ... 44

4.3.3 Flow calculation ... 48

4.3.4 Alarm system ... 49

4.4 Operation steps of the whole system ... 49

Chapter5: discussion and conclusion ... 51

5.1 Discussion ... 51

5.2 Conclusion ... 52

Chapter6: List of references ... 53

Chapter7: Working plan ... 57

Chapter8: Budget and Equipment Checklist ... 61

Chapter9:Copyright statement ... 63

Appendix ... 65

List of table ... 65

List of data ... 67

Program code ... 71

Mathematic modeling---based on Matlab ... 71

Measurement converter---based on C++ ... 76

(8)

Chapter1: Introduction

1.1 Application

Thermal mass flowmeter is a kind of intelligent device to measure the gas flow, especially the gas in low flow rate. I call it ‘TMF’ in the following part of thesis. For more than 20 years, the TMF have been widely used in the all kinds of industry, e.g. Petroleum refining industry, steeling making industry, and waste water processing. The meters’ low-flow sensitivity, fast response and outstanding range ability have made them the instrument of choice for many critical gas flow applications. The following figures show the typical application of the TMF. The figures are provided by the collaboration company.

Figure1.1 flare gas in petroleum industry [1] Figure 1.2 𝑵𝟐 & 𝑶𝟐 in steeling making industry [1] Approved for operation in hazardous environment, the TMF can provide direct electronic monitoring of gas mass flow rate. Other flow devices, such as orifices, turbine meters and vortex meters require temperature and pressure compensation to obtain mass flow. Eliminating the requirement for these separate transducers significantly reduce installation and maintenance costs.

1.2 The problem in the industry

Commonly, four-wire connection is used to link the TMF to the computer terminal in central control room. The details will be described in chapter2.3. In traditional TMF installations the following problems can appear.

1. Interruption among the wires. 2. High cost of the installation.

Because the distance between the scene and central control room is hundred meters away, the buyer need to purchase cable to link the TMF to the central control room. The cable is expensive.

3. Hard to detect the fault.

(9)

8

4. Have temperature factor.

Some of the problem comes from its way of the connection--- four-wire connection. Two-wire connection can resolve some of these problems.

In this thesis, the author presents a new type of two-wire installation and use of TMF which can be realized low production cost. The author found a new measurement method, which is detecting the functional relationship between working current of a traditional TMF and the flow. The author also designs a measurement converter needed for adequate signal processing so that flow value measurement values can be shown in computers.

1.3 Statement of my thesis purpose

My purpose is to find a new measurement method to measure the gas flow, which is based upon the relationship between the working current in a traditional TMF and the gas flow. The derivations are performed by mathematic modeling via Matlab.

1.4 Statement of my work part of thesis

Measure lossless supply current in the lab

To calculate the flow value, I derive what I define as the lossless current value first. Since the good experimental environment and advanced equipment, the working current I measured in the lab can be treated as lossless current. I define 𝐼𝑙𝑜𝑠𝑠𝑙𝑒𝑠𝑠 here to be the supply current from the traditional TMF. And I measure 𝐼𝑙𝑜𝑠𝑠𝑙𝑒𝑠𝑠 in the lab, which ranging from 160mA to 200mA.

Mathematic modeling

I will detect functional relationship between 𝐼𝑙𝑜𝑠𝑠𝑙𝑒𝑠𝑠 and flow via mathematic modeling from Matlab.

Calculate 𝑰𝒍𝒐𝒔𝒔𝒍𝒆𝒔𝒔

The mathematic modeling is based on the data from the lab of the company. But when we measure the supply current on the site, it might have some loss. In that case, we should calculate 𝐼𝑙𝑜𝑠𝑠𝑙𝑒𝑠𝑠 before we calculate the flow value when my new product is applied in the industry.

Calculate practical supply current I

(10)

Calculate the resistance of the cable

The lost current is caused by the resistance of the cable. The cable size, which including length and the cross sectional area, material and the temperature outside can affect the resistance of the cable. For the TMF, the installation cable has a certain size in the cross sectional area and material requirements. Hence, we just need to collect the temperature value and length value to calculate the resistance of the cable.

Collect temperature value

We can use a temperature sensor, DS18B20 to sense the temperature signal. The cooperation of the SCM AT89C52 can make it get the temperature value. I define the temperature value T.

Collect length value.

Once the TMF has been installed on the site, the length of cable will be a constant value, which means that it will not change anymore. Hence we can measure the measure the cable length by measuring the distance between the TMF and power source. Even though the cable is bent in many places, the length still can be measured because the price of the cable has relative to its length. The buyer must have installation budget so that it is possible to know how long the cable is used in installation.

Here is the calculation flow diagram. It can clearly express all my work parts.

(11)

10

1.5 Contribution of my thesis

In this assay, the main contribution is to develop a unique way of using a TMF which can be realized in two-wire installation. If the new product can be successfully produced, it will be the first type two-wire installation TMF in China. The new product can possibly solve part of the problem from the present product, e.g. interruption between the wires, high cost of installation.

For the buyer, the can cut about half of the installation cost budget because only two cables are needed in the installation. Simultaneously, the accuracy of the device is expected to be maintained.

For the producer, this product can improve their market competitiveness. The profit from the increasing market share is expected to be much higher than the developing cost.

1.6 Result statement

Display the data transmitted from converter

This system can show the transmitted data from the converter, the temperature value and the analog input voltage value. And we can also input cable length value in it.

Display the calculation result of practical supply current 𝑰

The system can show the practical supply current here. This value is calculated by the analog input voltage value 𝑉𝐴.

Display the calculation result of resistance of cable

The system can show the resistance of the cable here. This value is calculated by the cable length and the temperature value.

Display the calculation results of lossless current 𝑰𝒍𝒐𝒔𝒔𝒍𝒆𝒔𝒔

This man-machine interface can show the lossless supply current. The 𝐼𝑙𝑜𝑠𝑠𝑙𝑒𝑠𝑠 is calculated by the practical current 𝐼 and the cable resistance

Display the flow results

Once we running the LabVIEW, we can get flow value after a serial of calculation. We can clearly see that the flow will change with the changing of the temperature, cable length and the working current.

Error statement

(12)

ranges from 160mA to 200mA as that in the lab. Under this tough situation, I have to use USB port in my computer to supply the measurement converter. Thus, the analog input voltage, as well as practical supply current is lower than the situation on the site. That will lead to the error about the flow value. The results here might be not perfect.

Furthermore, based on my modeling, the error rate is 0.007 over than the requirement of the company. I suggest the better way to solve this problem. The suggestion is described in the chapter5.

I have designed a man-machine interface made by the LabVIEW. This interface is easy for the operator to control. The following figure shows what I made in LabVIEW.

(13)
(14)

Chapter2: Background

2.1 Introduction of the company

Shanghai HQ Instruments Co., Ltd is one of the most famous flowmeter companies in China. In the early 1980’s, Shanghai HQ Instruments Co., Ltd is specialized in flow instrumentation. It is also one of the earliest enterprises for producing and developing automation control system. In 1992, it invested more than 50 million in Shanghai Pudong Zhangjiang High-tech Park. At the same time, it has built HQ Building for 7500m2 areas, named ‘Shanghai HQ Headquarters Building’. This building became the largest high-tech professionals’ flow meter calibration and testing production bases in China, including three sets of high-precision gases, liquids, steam flow calibration device, and Intelligent Instrument of automatic test equipment. [1]

The following figure is the product of the TMF from the company.

(15)

14

2.2 Principle of the thermal mass flow meter

Sensor:

There are two resistances in the thermal mass flowmeter, called ‘velocity sensor ‘and ‘temperature sensor’.

The velocity sensor measures the gas flow velocity. It should be supplied with current above 50mA so that it can provide heat power to maintain the temperature of it being higher than the gas flow around it. We define the temperature of the velocity sensor 𝑇𝑠

The temperature sensor measures the temperatures of the gas flow around it. On contrary to the velocity sensor, the current of the temperature senor should be controlled bellow 4mA so as not to itself being heated. We define the gas temperature here 𝑇𝑎

Here is the figure of the measurement sensor. The figure provided by the company.

Figure 2.2 the measurement sensor at the end part of the TMF [1]

Sensing principle:

We should maintain the temperature differential a constant, which means, TS− Ta= Constant.

When the gas flows around the velocity sensor, it will take up a part of heat around the velocity sensor. Obviously, the 𝑇𝑆 will be decreased here. Hence, we need to

compensate power on the velocity sensor to increase its temperature.

(16)

compensate power. We get the flow according to the compensate power.

Display principle:

The output current signals are controlled from 4mA to 20mA, which means the outputs current are standard signals. The amount of the flow has relationship with the value of the output current. The more the current is, the more the amount of flow will be.

The two wires with the current ranged from 4mA to 20mA connect to a kind of modem. There is a 250Ωresistance inside the modem. When the current goes through this resistance, the modem can detect voltage signal on this resistance. After that, the modem will convert the physical voltage signals to digital signals. Finally, the amount of the flow can be shown in the computer after some calculation.

2.3 Introduction of installation

Two wires from the TMF have been connected to the source of power. I call this two wires ‘power wires’ in the following content. The other two wires were linked to a kind of modem. The modem is used to change the physical electric standard signals to digital signals. I call this this two wires ‘signal wires’ in the following content.

The current of the signal wires, which are linked to the modem, ranges from about 4 mA to 20mA. That means the output signal is standard signal. The value of the current depends on the amount of the gas flow. The more the gas flow flows around the sensor, the much more current will be output.

The following figure is the installation diagram of the traditional TMF. The figure is provided by the company.

(17)
(18)

Chapter3: Hardware design

3.1 Source of idea

The traditional way to realize two-wire way connection is to make the two wires both be the power wires and signal wires.

Based on the principle of the TMF, the signal wires connect to a kind of modem. The value of the gas flow depends on measuring the current signals from the signal wires. The standard current signals range from 4mA to 20mA. The supply voltage for the used TMF is 24 volts DC, and the supply current is about 180mA.

Hence, if I assume two-wire way connection in the form of the following figure, I have to change the supply current to be low, i.e. as low as 4 mA. To enable the transmission of power the supply voltage has to be increased up to about 1080 Volt. This is of course unrealistic.

Figure3.1 assumed two-wire installation diagram of the TMF

According to what I mentioned above, the better way is not to change the inner component but the outer measurement method.

3.2 Working principle

(19)

18

The installation diagram has been shown below.

Figure3.2 a new type of two-wire installation diagram in my design

The designed measurement converter realizes three functions. The first one is to detect the temperature signal. The author chooses a temperature senor, DS18B20 to realize this function. The temperature value is saved in a SCM, AT89C52. The second one is to detect the analog input voltage and convert it to digital signal. The author chooses ADC0832 to realize this function. The analog input voltage value can be saved in this SCM, either. The third function of the converter is to transmit these digital data to the computer. The MAX232 is a communication chip, which can link to the communication port, RS232 from the computer. After some calculation, the amount of the flow can be shown in the computer.

For the computer terminal, I use LabVIEW to control the whole system. Before running the program in LabVIEW, I should initialize the system and input the cable length. Then the LabVIEW system starts to work. Firstly, it receives the temperature data and analog input voltage data from the SCM inside the converter. Secondly, it calculates the resistance of the cable according to the cable length, temperature value. Thirdly, it calculates the lossless value according to the analog input voltage value and resistance of the cable. Finally, we call the fitted function from the Matlab to calculate the flow value. For the sake of safety, I design an alarm system. If the gas flow is out of the measuring range, the alarm button will show in red, otherwise it shows in green.

(20)

Figure 3.3 my working principle flow diagram

The TMF is installed in the industrial site. But the converter, the computer terminals and the power source are all in the central control room which are hundred meters away from the site. The power source in the central control room supplies DC voltage to the converter.

3.3 Introduction of hardware

3.3.1AT89C52

(21)

20

Function

The AT89C52 chip can realize many functions. In this thesis, its main function is to save analog input voltage value and temperature value with the cooperation of ADC0832, DS18B20.

Introduction

The Atmel AT89C52 chip is an Intel 8051-compatible family of 8 bit microcontrollers (µCs) manufactured by the Atmel Corporation. [5]

Based on the Intel 8051 core, the AT89C52 chip remains popular as general purpose microcontrollers, due to their industry standard instruction set, and low unit cost. This allows a great amount of legacy code to be reused without modification in new applications. The figures of the chip and the functional table are shown below. [5]

Figure 3.5 the STC89C52 Pin Configurations [26] Table 3.1 DIP Package Pin Layout [5]

number Port pin name Alternate functions

1 P1.0 T2 External count input to Timer/Counter 2),clock-out

2 P1.1 T2EX Timer/Counter 2 capture/reload trigger and direction control 3 P1.2 8-bit bi-directional I/O port with internal pull-ups’

4 P1.3 8-bit bi-directional I/O port with internal pull-ups 5 P1.4 8-bit bi-directional I/O port with internal pull-ups 6 P1.5 8-bit bi-directional I/O port with internal pull-ups 7 P1.6 8-bit bi-directional I/O port with internal pull-ups 8 P1.7 8-bit bi-directional I/O port with internal pull-ups

9 RST Reset input.

(22)

11 P3.1 TXD Serial output port 12 P3.2 INT0 External interrupt 0 13 P3.3 INT1 External interrupt 1 14 P3.4 T0 Timer 0 external input 15 P3.5 T1 Timer 1 external input

16 P3.6 WR External data memory write strobe 17 P3.7 RD External data memory read strobe

18 XTAL2 Output from the inverting oscillator amplifier

19 XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit

20 GND Ground

21 P2.0 A8 an 8-bit bi-directional I/O port with internal pull-ups 22 P2.1 A9 an 8-bit bi-directional I/O port with internal pull-ups 23 P2.2 A10 an 8-bit bi-directional I/O port with internal pull-ups 24 P2.3 A11 an 8-bit bi-directional I/O port with internal pull-ups 25 P2.4 A12 an 8-bit bi-directional I/O port with internal pull-ups 26 P2.5 A13 an 8-bit bi-directional I/O port with internal pull-ups 27 P2.6 A14 an 8-bit bi-directional I/O port with internal pull-ups 28 P2.7 A15 an 8-bit bi-directional I/O port with internal pull-ups 29 PSEN read strobe to external program memory

30 ALE/PROG ALE: Output pulse for latching the low byte of the address PROG: the program pulse input

31 EA/VPP EA: be strapped to VCC for internal program executions. VPP: receives the 12-volt programming enable voltage 32 P0.0 AD0 8-bit open drain bi-directional I/O port

33 P0.1 AD1 8-bit open drain bi-directional I/O port 34 P0.2 AD2 8-bit open drain bi-directional I/O port 35 P0.3 AD3 8-bit open drain bi-directional I/O port 36 P0.4 AD4 8-bit open drain bi-directional I/O port 37 P0.5 AD5 8-bit open drain bi-directional I/O port 38 P0.6 AD6 8-bit open drain bi-directional I/O port 39 P0.7 AD7 8-bit open drain bi-directional I/O port

(23)

22

3.3.2DS18B20

Figure 3.6 the physical image of the DS18B20 [27] Function:

DS18B20 is a kind of temperature senor which can sense the temperature from -55℃ to +125℃. The temperature measurement range satisfies the situation of this project in the thesis.

Introduction:

The DS18B20 is produced by the company, Dallas Semiconductor from the U.S.A. The temperature sensor’s low error rate, high speed of conversion, and reasonable price has made it widely used in all kinds of instruments. [5]

Figure 3.7 the DS18B20 Pin Configurations [5] Tabble3.2 DS18B20 Package Pin Layout [5] Port pin Name Alternate Functions

1 GND Ground

2 DQ Communication port

(24)

3.3.3ADC0832

Figure 3.8 the physical image of the ADC0832 [28] Function:

The function of the chip is to sense the voltage in analog input port and covert the analog signal to digital signal.

Introduction:

ADC0832 is an analog-to-digital conversion chip produced by the company, National Semiconductor from the U.S.A. The chip’ miniature size, high speed of conversion, and reasonable price has made it widely used in all kinds of instruments. [5]

The rated voltage is 5 volts. The input voltage ranges from 0 volt to 5 volts. The rated working power is 15mW. [5]

Figure 3.9 the ADC0832 Pin Configurations [28]

Tabble3.3 ADC0832 Package Pin Layout [28] Port pin name Alternate Functions

1 CS Chip Select (Active Low)

2 CH0 Analog signal input channel1

3 CH1 Analog signal input channel2

4 GND Ground

5 DI Digital signal data input channel

6 DO Digital signal data output channel

7 CKL Serial clock input terminal

(25)

24

3.3.4MAX232

Figure 3.10 the physical image of the MAX232 [29] Function:

The MAX232 is an integrated circuit that converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits. The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals.

Introduction:

The drivers provide RS-232 voltage level outputs from a single + 5 V supply via on-chip charge pumps and external capacitors. This makes it useful for implementing RS-232 in devices that otherwise do not need any voltages outside the 0 V to + 5 V range, as power supply design does not need to be made more complicated just for driving the RS-232 in this case. [5]

The receivers reduce RS-232 inputs, which may be as high as ± 25 V, to standard 5 V TTL levels. These receivers have a typical threshold of 1.3 V, and a typical hysteresis of 0.5 V. [5]

The later MAX232A is backwards compatible with the original MAX232 but may operate at higher baud rates and can use smaller external capacitors – 0.1 μF in place of the 1.0 μF capacitors used with the original device. [5]

(26)

Figure3.11 MAX232 Pin Configurations [30] Table3.4 MAX232 DIP Package Pin Layout [5]

3.4 Structure of the product

This is the structure diagram. The ADC0832 links to the AT89C52 so that the analog voltage value hare can be saved in the AT89C52. The DS1820 connects to the AT89C52 so that the temperature value can be saved in it, either. MAX232 is a communication chip. The AT89C52 bridges to the MAX232 so that the data saved in it can be transmit to the computer terminal via this communication chip.

Port pin Name Purpose

1 C1+ + connector for capacitor C1

2 V+ output of voltage pump

3 C1- - connector for capacitor C1

4 C2+ + connector for capacitor C2

5 C2- - connector for capacitor C2

6 V- output of voltage pump / inverter

7 T2out Driver 2 output

8 R2in Receiver 2 input

9 R2out Receiver 2 output

10 T2in Driver 2 input

11 T1in Driver 1 input

12 R1out Receiver 1 output

13 R1in Receiver 1 input

14 T1out Driver 1 output

15 GND Ground

(27)

26

Figure 3.12 the measurement converter connection diagram

In my design, I make the TMF directly connect to the measurement converter. That means that the two wires both deliver the power to the TMF and the measurement signal. But the difference is that the measurement signal in the application is not the standard measurement signal from the TMF, it is the supply current that is interpreted as also the measurement signal.

The supply voltage of the TMF is 24v DC. LM78M05 is used to stably transform 24v DC into 5v DC. According to the requirement of the company, the voltage of the analog input port should be about 1.6 volt. Since some of the SCM has its own AD converter inside the chip, the signal collection of the voltage should be about 1.6volt. In this project, Ilossless= ⌈160,200⌉mA According to the ohm’s law: R3 =I V

lossless (1) R3 = 1.6v

200mA= 8Ω

Hence, V+ = Ilossless× R3 (2) V+ = ⌈1.28 , 1.6⌉v

But for this chip ADC0832, the signal collection voltage ranges from -10 v to +10v. So we need to amplify the voltage to +10v.

The ideal op-amp model condition is: V− = V+ and I− = I+ (3)

(28)

The KCL equation at the negative terminal of the op-amp is: VB

R4 = VA−VB

R5 (5) Thus, the voltage gain is VVA

B= 1 + R5

R4 To get the VB≈10v, we must satisfy: RR5

4 ≈ 5

We choose: R5=5kΩ, R4=1kΩ, Here the voltages range: 𝑉𝐴 = [7.68 , 9.6] v

[13], [14], [15]

3.5 Experiment

3.5.1 The introduction of equipment

The SONIC NOZZLE, also known as a "Critical Flow Venturi" or "Critical Flow Nozzle" is accepted internationally as a flow measurement standard and flowmeter. Sonic Nozzles can be used as a calibration standard for gas mass flowmeter or any flow measurement device. By design, Sonic Nozzles are a constant volumetric flowmeter. The device has been shown below. The picture is provided by the company.

Figure3.13 Sonic nozzle flow testing device—back part [1]

(29)

28

3.5.2 The steps of the experiment

Step1 Install the TMF

Firstly, we need to install the TMF into the corresponding testing pipe. At the same time, we link an ammeter between the anode of power source and the anode port of TMF to measure the working current.

Step2 Reset system

When the Sonic Nozzle testing device is on power, we need to reset some parameters in the PC control system. The parameters include pressure, temperature, gas density, and the diameter of the testing pipe.

Step3 Measure the current in different amount of gas flow

Once we determined the TMF’s caliber, we set the caliber value to the PC control system, the system will automatically show 16 different amount of gas flow which are all under the TMF’s maximum measurement range. Since TMF’s different kind of caliber have different gas measurement range, we need to set the caliber value first. The Sonic Nozzle flow testing device can control the gas flow in these 16 different amounts so that we can measure the working current in these amounts via ammeter.

Step4 Record data

(30)

Chapter4: Software design

4.1 Mathematic modeling---based on the mat lab

The purpose of using Matlab is to fit the function between the lossless supply current and the flow. We aim to measure the flow according to the fitted function. And we get the lossless supply current values from the lab.

Figure4.1 the logo of Matlab [31]

As I described in the chapter 3, we do every experiment three times, so I should calculate the average current value first. This calculation will in the step of ‘import and scan data’.

The following figure is the procedure flow chart

(31)

30

Initialize the system

We should close and clear all the running script before we run this program. This order makes sure that the system will not be crashed.

Import and scan data

Because we have lots of experimental data, it’s inconvenient to write all the data in the program. The data can be saved in other file path. They will be imported into the program when necessary. This process can make the program more refined. We use the ‘fopen ()’ order in the Matlab to import data. We should input the file path of the data into the bracket.

We use ‘textscan ()’ order in the Matlab to scan the data. We should input the file path and the number of the columns which we need to scan.

Fitting function and plot figures

We use ‘polyfit ()’ order in the Matlab to fit the function. The data string of variable, the data string of function and the maximum power of the variable should be included in the bracket.

We use ‘polyval ()’ order in the Matlab to return the value of a polynomial of degree n evaluated at variable x. in this situation, we can get the equation about flow and working current.

The results of the fitting function can be shown below.

Figure4.3 results of fitted function

We use ‘subplot ()’ order in the Matlab to make four figures in one picture. As the picture is shown at first, the four types of TMF’s functional diagram are in one picture. The number of line and columns should be included in the bracket.

(32)

between the data and the fitted function, the data string of variable and function, and the fitted functional diagram should all be included in the bracket.

We use ‘xlabel ()’ order in the Matlab to name the figure. The title or headline of the figure should be included in the bracket.

The figures are shown below.

Figure4.4 the fitted functional sketch

Deviation calculation

Deviation requirement

The TMF needs the error rate to be controlled in the range of ±1%. The results from the data have a certain deviation from the value in fitted function. Hence, we need to calculate the deviation before we choose the fitted function. Only the deviation is under the error range can be choose to do the calculation on flow.

Calculation method

During the experiment, we get a current value corresponding to a flow. When these data are used into fitting function, we can get a function equation. But the current value points are not all in the respective flow values curve.

(33)

32

Calculation steps

Firstly, I put the experimental current values into the fitted equation to get the calculated flow value. I use ‘fx=polyval ()’ order in the Matlab to get the calculated flow f(x).

Secondly, I compare the results to the experimental flow value and calculate the error rate. I use‘s=abs ((fx-y). /y) ’order in the Matlab to get the absolute value of the

error rate.

Thirdly, I compare all the error rates s and get the maximum error rate. I use the loop

‘for’ to realize this function.

Finally, I judge whether the maximum error rate is in the range of the required error range.

Figure4.5 the deviation results Deviation analysis

During the process of fitting function, I figured that the choice of variable can influence the deviation. If we choose lossless supply current to be the variable 𝑥, and flow value as the functional value y, the error rate is low. But if we choose flow value to be variable, and lossless supply current to be the functional value, the error rate is higher than the previous situation.

For example, we set the maximum polynomial degree value to 3, the figures are shown below. We can see that the deviations are different.

According to the figure4.6 or figure4.7, the reader might see that the flow value has a certain distribution in each of the figure, i.e. in caliber100; the range of the flow value is from 0 to 100, in caliber200, the range is from 0 to 200.

(34)

every type of TMF, it has its measurement range, we only need to promise the accuracy in the measurement range is within the required error rate.

Figure4.6 the graph of the fitted function in first situation, x represents supply current value, y represents flow value

Figure 4.7 the graph of the fitted function in second situation x represents flow value, y represents supply current value

(35)

34

[−1%, +1%] to [0, +2%], the result is still close to the error range, which means the research is still available to application. According to this situation, I will give the suggestion to the company in the following part of the essay.

Figure 4.8 the deviation and fitted function in first situation x represents supply current value, y represents flow value

Figure 4.9 the deviation and fitted function in second situation x represents flow value, y represents supply current value

(36)

Intelligent program and Output the results

I created a man-machine interface in the Matlab so as to make the program more intelligent to see an easier to control. Furthermore, the other employee can dig the research based on my study.

Input dialog

I use the ‘inputdlg ()’ order in the Matlab to create this box. The box can only input one number. This number is thevalue of polynomial of degree n when the Matlab fitting the function. According to the requirement of the company, the deviation should be controlled among ±1% for the product. I will choose the value of polynomial of degree n which can satisfy this requirement. There are lots of n which can meet with requirement. We’d better choose the minimum one so as to make the calculation as easy as possible.

Figure 4.10 the input dialog box from Matlab Question dialog

I set three functions, which are ‘continue to run the program’, ‘finish’ and ‘results in detail’. I use ‘continue’ order in the Matlab to make the program run again. I use

‘break’ order in the Matlab to finish the program. If the controller chooses ‘results in

detail’, the fitted functions and their deviation can be output. The results will be shown in the form of massage box. The interface is shown below.

(37)

36

Message box

I use ‘msgbox ()’ order in the Matlab to import the results of the mathematic modeling in details. The results include the fitted function and its deviation in different caliber. The massage box is shown below.

Figure 4.12 the output results from Matlab

Build a communication channel to the LabVIEW

In my design, the whole system likes a group. The group leader is LabVIEW system. The converter and mathematic modeling system are group members. Converter system’s work is to sense the temperature and analog input voltage via C++ in SCM. The mathematic modeling system’s work is to fit function via Matlab. After the group members finished their job, they need to give their results to the group leader via communication channel. The group leader’s work is to analyze these results together and get final result.

The one of the best communication channel is text file. The LabVIEW can calculate the lossless supply current, which means the LabVIEW system can get the variable from Matlab in specific value. Thus, we only need coefficient of the variable. Fortunately, after getting the fitted functions, the Matlab can automatically record the coefficients of the variable in every fitted function in a text file. So, when doing the flow calculation, the LabVIEW system can open and scan the data from this text file.

(38)

4.2 Converter----based on C++ in the center of the SCM

Except for being the power source as I mentioned in last chapter, the converter will also realize other three functions. The heart of the converter is a type of SCM—STC89C52. I choose C++ to be the programming language.

Figure4.13 logo of C++ [32]

Introduction of the function

The first function is to sense and read the voltage signals from the analog input port. The voltage range has been calculated in the chapter3.4. Then the A/D converter will change these physical voltage signals to digital voltage signals. These digital voltage signals can be saved in the SCM—AT89C52. All the process is based on the C++.

The second function is to sense the temperature. Because the temperature can have influence in working current value, we need to add the current value loss to the final current calculation. We use the temperature sensor DS18B20 to sense the temperature. The value of the temperature can be saved in SCM—STC89C52. The whole process is based on the C++.

The third function is to transmit the data to computer terminal from SCM. I choose the communication chip MAX 232 to realize this function. The whole process is based on the C++.

(39)

38

Figure 4.14 the flow diagram of the measurement converter

ATC89C52

MAX232

Computer

DS18B20

A/D converter

(40)

4.3 Computer interface ---based on LabVIEW

LabVIEW, short for ‘Laboratory Virtual Instrumentation Engineering Workbench’, is a system design platform and development environment for a visual programming language from National Instruments.

Figure4.15logo of LabVIEW [33]

The produced program from LabVIEW is the form of block diagram. The graphical language is named "G" (not to be confused with G-code). LabVIEW is commonly used for data acquisition, instrument control, and industrial automation on a variety of platforms.

The author will create an intelligent man-machine system to combine all the functional modules together and get the final gas flow value. The following figure is the procedure flow chart via LabVIEW.

(41)

40

4.3.1 Receive data

Firstly I will use VISA module to make the communication between the C++ programs in the SCM and LabVIEW. In other words, the author make the LabVIEW system can read the C++ programs in the STC. More specifically, I make the LabVIEW system receive the temperature and the practical working voltage. This is the most difficult part in the whole thesis.

Initialize

We should set an appropriate communication port. Commonly, we choose COM4 or COM5. The baud rate should be 9600 bit/S. The data bit is 8 bit/S. The parity should be none. The stop bit is 1.0bit/S. The flow control is unnecessary. The most import thing in this step is to input the cable length. It is one of the key parameter in the calculation of the cable resistance. The following figure is from the LabVIEW.

Figure4.17 initialize system module

Receiving data

A. Transmit data

We need to transmit temperature value and voltage value from the measurement converter to the computer. The temperature ranges from -40.0 ℃to +40.0 ℃. And the voltage value ranges from 7.68 volt to 9.60 volt.

(42)

E.g. we need to transmit the temperature value 12.3℃ and analog input value 7.89v

AT89C52 MAX232 VISA LabVIEW

When we receive the data, it will display in decimal number in the LabVIEW. We can see from the table, the data has been plus 128 during the transmission. Hence, we need to minus 128 before we display the data in the LabVIEW. The result has been shown below.

VISA LabVIEW Operator

Furthermore, we have problem in order, either. I will use the same example to demonstrate the problem.

The data can be transmitted in the order of 237891, 378912 or 789123, and so on. So I will mark a symbol to help us find the beginning of the data. I choose to mark a decimal number 10 at the beginning of the decimal data because the transmitted decimal numbers range from 0 to 9. And the data will be in the form of hexadecimal number during the transmission, which means the decimal number 10 represents hexadecimal number A. Obviously, the hexadecimal number A can be distinguished from the other data. In this situation, we need to transmit 7 numbers to the computer. When transmitting to the computer, the worst case is that the number in Decimal

number

Binary number with sign bit

(43)

42

the order of 123789A. To solve address this case, we can transmit 13 numbers, which means the number can be transmitted in the form of 123789A123789. But according to Chinese culture, the number 13 is an unlucky number. So I decide to transmit 14 numbers during the transmission.

When doing the part of receiving data, we just need to receive the data after the hexadecimal number A. The details will be described in the next section. The following figure is the data transmission module from the LabVIEW.

Figure 4.18 the data transmission module Select the transmit data

As I mentioned in the previous part, we need to minus 128 during the transmission of data. And I also mentioned in the previous part, I put a mark, hexadecimal number 10 in front of the data which we want to receive. The mark represents the decimal number of ten. Hence when we receive data, we should check which decimal number minus 128 equals to 10. The next 6 decimal numbers are the data we want to receive. This process is the same as the program I wrote below.

int i; float y,p;

(44)

Here is the data selection module in the LabVIEW system.

Figure4.19 the data selection module Receive and restore data

After last two steps, I can receive and restore the data. The first three numbers are the ten digits, the unit, and the tenths of the temperature vale. The other three numbers are the unit, the tenths and thepercentile of the voltage value. We should calibrate them to the temperature value and voltage value .This process is the same as the program I wrote below.

More specifically, I will use the example to illustrate the restoring of the data. The temperature value 12.3℃ and analog input value 7.89v

Here are the results I mentioned above.

(45)

44

The following figure is the data receiving and restoration module in the LabVIEW.

Figure 4.20 the data receiving and restoration module The figure shows the whole part of ‘receive data’ in the LabVIEW.

Figure4.21 the receive data module 4.3.2 Lossless current calculation

Secondly, the computer can calculate precise working current without loss. To begin with, the computer will calculate the resistance of the cable, which causes the current loss. To calculate the resistance of the cable, we need to input the cable length and receive the temperature value from the measurement converter. Then,

Transmit data

Select the transmitted data

(46)

the computer will calculate the practical supply current based on the analog input voltage transmitted data from measurement converter. Finally, the computer can get the lossless supply current value according to the cable resistance and practical supply current.

Cable resistance calculation

Cable length requirement:

If there is no requirement about output for in the processing of the measurement, the buyer can use 2*33/0.2 of RVVP cable as the 24VDC power supply. The max length of cable is 200m.

A. The size and material factor

Some of the power that is fed into a transmission cable is lost because of its resistance. The resistance of the cable depends on the resistivity of the cable material, the length of the cable and the cross sectional area of the electrical line.

Here is the equation:

𝑅(𝑇

0

) =

𝜌×𝑙𝑆

𝛺 (6)

ρ——the Resistivity in 20 centigrade

L—— the length of the cable

S—— the cross sectional area of the electrical line

In this thesis, the material in the cable is copper. According to the resistivity table, the resistivity of the copper is ρ =1.68×10− Ω·m.

As I mentioned above, the cable size is 2*33/0.2.

According to the area equation: = 2 = 4 2

Here, = 4[0.2 × 10−3]2× 32 × 2 = 6.4 × 10−

B. The temperature factor

The electrical resistance of a conductor such as a copper wire is dependent upon collisional process within the wire. The resistance could be expected to increase with temperature because of more collisions. The resistivity will change in accordance with the change of the temperature. The temperature coefficient is the relative change of a physical property when the temperature is changed by 1 K.

Given these definitions, the equation is:

R(T) = R(𝑇

0

)(1 + 𝛼∆𝑇)Ω (7)

(47)

46

T --- The temperature at which the property is measured.

𝑇0---The reference temperature. Commonly, we choose 𝑇0 to be 20 centigrade. ΔT---The difference between T and 𝑇0.

α ---- The temperature coefficient

Here α has the dimension of an inverse temperature (1/K or K−1).

Practical current calculation

This is the connection diagram

Figure 4.22 connection diagram

I have described above, the voltage gain here is6. And the 𝑅3 here is 8Ω. Hence the calculation of the practical current is easy.

𝐼 =

=

=

=

4

A

I realize this calculation in LabVIEW. Here is the code in the LabVIEW.

Figure 4.23 Practical current calculation module Analog input voltage value (v)

Temperature value(℃)

(48)

Lossless current calculation

In order to calculate the lossless current we have to apply an equivalent electrical model of the TMF. Here two different models are suggested, calculations for one of them is presented in the following section. Further experiments have to be performed in order to verify which TMF model that is proper.

The two different TMF models are resistance and constant power. The resistance model is presented in detail below as illustration of how calculation of the lossless current can be performed and implemented. The constant power model implies that it is assumed that the TMF power is a function of the measured flow. The constant power model implies that the TMF can be modeled as a negative resistance. The calculation and the implementation can be performed in a similar way as for the resistance model of the TMF.

Here is the resistance model. We treat the TMF a variable resistance. The resistivity will change by the different amounts of gas flow. In the first case, it has no loss here. We can get equation A. In second case, the loss is caused by the resistance of the cable. We can get equation B according to the ohm’s law

Figure 4.24 the resistance model

{

𝐼

𝑙𝑜𝑠𝑠𝑙𝑒𝑠𝑠

=

24

𝑅(𝑇𝑀𝐹)

(𝐴)

𝐼 =

24

𝑅(𝑐𝑎𝑏𝑙𝑒) + 𝑅(𝑇𝑀𝐹)

(𝐵)

For (B): 𝑅(𝑇𝑀𝐹) =

24− ( 𝑎 𝑙𝑒)

(Ω)

(49)

48

I realize this calculation in LabVIEW. Here you can see the lossless supply current here.

Figure 4.25 lossless current calculation module 4.3.3 Flow calculation

Thirdly, the lossless working current will be applied into the fitted mathematic function which has relationship with gas flow value via the Mat Lab. In this step, I can get the flow value.

Here is the calculation part in the LabVIEW.

Figure4.26 flow calculation module Supply current calculation equation

Output the lossless supply current value 𝑖2 (mA)

current

Put the working current value 𝑰𝟐(𝐦𝐀) Into the current calculation equation

Put the value of cable resistance R into the current calculation equation

Call the results from Matlab

Choose the type of

(50)

4.3.4 Alarm system

Finally, I create an alarm system so as to solve the safety problem. When accident happens, including the over height temperature or current and so on, the system

will alarm the controller to stop running the program.

Figure4.27 the alarm system module

When the gas flow is over the TMF’s measuring range, the system will warn the controller. When the gas flow is out of the measuring range, the alarm button will be in red color. When the gas flow is in the measuring range, the alarm button will be in green color.

4.4 Operation steps of the whole system

Running Matlab

We select the most suitable function from Matlab. That means we should select the function whose deviation between the lab value and functional value ranges -1% to +1 %. Then the results will be recorded in a text file saved in a certain file path. When we need this result, we can call it from the computer. Then we’d better close the Matlab to reduce the CPU’s work.

Download the program into converter

As I mentioned in the chapter 4.2, I should download the C++ program into the converter to make it work. When I down load the program, I should firstly change the file type first, which means I need to change the filename extension ‘.c’ to ‘.hex’ . I use KEIL μVISION2 to realize this step.

(51)

50

Secondly, I use STC ISP to download the program into the converter. This software is specialized in the SCM. The power of the converter can only be switched on after successfully download the program into the SCM

Figure4.29 the interface when download program Check communication port

Before we transmit the data to the computer from the converter, we should check whether the communication port can work. I use a software named ‘serial assistant’ and made in China.

Running the LabVIEW

Before running the whole system, we should initialize the settings and input cable length. The reason has been mentioned in the chapter4.3.

Results display

Once we running the LabVIEW, we can clearly see that the flow will change with the changing of the temperature, cable length and the working current.

(52)

Chapter5: discussion and conclusion

5.1 Discussion

During the project, I find some problem which has not been considered or solved. I will make a further discussion with the company and give my suggestion.

Suggestion for the measurement converter

Firstly, in this project, the temperature sensor DS18B20 is on the same board as the other chips in the converter. The converter is installed in the central control room which is far away from the site. Hence the temperature senor here can only detect the temperature of the central control room. But the temperature outside do influence the accuracy of the TMF. Hence, I wish that the company could consider about how to install the temperature sensor on the site.

Secondly, the communication chip MAX232 can only work in the temperature ranging from0℃ to 70℃. The problem is whether the temperatures in central control room in all kinds of industries are within this range. If not, the company should change another communication chip. I strongly suggest that the company could do the research about it.

Suggestion for the mathematic modeling

The company strongly believes that we should do the mathematic modeling based on fitting the polynomial function when detecting the relationship between the lossless supply current and flow value, because it is easy for the programming and some other processing. But as I have mentioned in the analysis of the deviation, the deviation could be 0.007 over the error range. Hence, I suggest that the company can have alternative fitted function when doing the mathematic modeling part.

Suggestions for calculation of the flow

Firstly, I suggest that further experiments have to be performed in order to verify which TMF model that is proper, the resistance or constant power model?

(53)

52

5.2 Conclusion

I have successfully realized in two-wire installation for the TMF. The whole system can model measurement process and get flow value. The error rate is about 0.007 over the required error range for the company, but it is very close to the requirement. That fact proves that my idea can be adopted. Hence, I give my suggestion to the company as what I described in the chapter5.1.

(54)

Chapter6: List of references

[1] Shanghai Huaqiang Instrument Co., Ltd; http://hqcom.com.cn, Last visited May 2012

[2] J. E. Hardy, Flow measurement methods and applications. New York: Wiley, cop. 1999.

[3] D.W. Spitzer, Industrial flow measurement [electronic resource]. Raleigh : ISA-The Instrumentation, Systems, and Automation Society, c2005. [4] E. Håkansson, The performance of an ultrasonic gas flowmeter. Lund:

Tekniska högskolan i Lund, 1993.

[5] Z. Yuanliang, Inteligent Intrument design and practical techoniq and

prcatical case. Beijing: China machine press, 2008

[6] Lv Wuxuan, Meaurement Instrument. Beijing: National Defence Industry Press, 2007

[7] Shi Ren, Automation Instrument and processing monitoring. Being: Publishing House of Electronics Industry 2011

[8] Du Juan, Measurement Instrument and Automation. Beijing: China Petroleum University, 2006

[9] Yang Yutan, Xu Yinghua, Wang Zigang, Gas flowmeter. Chengdu: China Metrology Press, 2007

[10] Salvatore Nuccio,Ciro Spataro, Assessment of Virtual Instrument

Uncertainty.Computer standards & Interfaces, 2001

[11] Candy JV Sullivan E J, ModelBased Signal Enhancement for the Hudson Canyon Experiment.Computational Acoustics, 1994

(55)

54 [13] J.David Irwin, R.Mark Kelms, Basic Enginering Circuit Analysis. New

York: Wiley, cop. 2007.

[14] Fawwaz T.Ulaby, Fundamentals of Applied Electromagnetics. Beijing:

Posts Telecom Press, 2007

[15] Ma Wenwei, Physics. Shanghai: High Education Press, 2008

[16] Tan Haoqiang, Lu Jingqiiu, Fang Zhihao, C++ Basic Design. Beijing: Qinghua University, 2009

[17] Zheng Li, Dong Jie, He Fangzhou, C++ Language Program Design. Shanghai: High Education Press, 2007

[18] Zhang Zhiyong, Yang Zuying, Matlab in Engineering. Beijing: Aerospace University Press, 2011

[19] Zhuo Jinwu, Matlab in Mathematic Modeling. Bejing: Aerospace University Press, 2011

[20] Robert. H, LabVIEW 2009 Student Edition . Bishop and National National Instruments, 2009

[21] L.Chugani Mahesh, R. SamantAblhag, Michanel Cerra, LabVIE Signal

Processing. Prentice Hall RTR, 1998

[22] Cheng Shuxue, Liu Xuan, LabVIEW8.2: from Amateur to Master. Beijing: Publishing House of Electronics Industry, 2011

[23] Long Huawei, Gu Yonggang, LabVIEW8.6 DAQ Data Collection. Beijing: Qinghua University, 2008

[24] Measurement and Monitoring Specialist group, H980 Thermal Mass

Flowmeter Instrucion Booklet.

[25] Figure of 3.4 the physical image of the STC89C52;

(56)

+ATMEL+AT+51%E7%B3%BB%E5%88%97%E5%8D%95%E7%89%87 %E6%9C%BA+ATMEL+Integrated+Circuits+Manufacturer+exporting+di rect+from+China, Last visted June 2012

[26] Figure 3.5 the STC89C52 Pin Configurations;

http://www.8051projects.info/intro_3.asp, Last visited June 2012 [27] Figure 3.6 the physical image of the DS18B20 ;

http://www.nuelectronics.com/estore/index.php?main_page=product_in fo&products_id=5, Last visted June 2012

[28] Figure 3.8 the physical image of the ADC0832;

http://www.futurlec.com/ADConv/ADC0832.shtml, Last visited June 2012 [29] Figure 3.10 the physical image of the MAX232;

http://shop.avrvi.com/pic-104.html, Last visted June 2012 [30] Figure3.11 MAX232 Pin Configurations;

http://www.febat.com/Elettronica/Elettronica_interfaccia_RS232.html, Last visited June 2012

[31] Figure4.1 the logo of Matlab;

http://www.downeu.net/m/matlab+2012+unix, Last visited June 2012 [32] Figure4.13 logo of C++;

http://developer.51cto.com/art/201101/241679.htm, Last visted June 2012

[33] Figure4.15logo of LabVIEW;

http://freggelweb.de/labView-tutorial-beispiel1.html, Last visited June 2012

[34] Figure4.28 the logo of the KEIL μVISION2;

(57)
(58)

Chapter7: Working plan

Week Task Name Delivery Deadline

Plan (hours) Done (hours) Wu, Wenyan Wu, Wenyan 6 Identification,

definition and planning

1 Contact with the company 2012/2/5 2012/2/6 1 1

2 Project plan 2012/2/7 2012/2/8 2 2

3 2 2

4 Search for references 2012/2/9 2012/2/10 2 2

5 2 2

9 9

7 Outline of the research

1 Contact with the company 2012/2/12 2012/2/13 1 1

2 Introduction 2 2 3 2 2 4 2 2 5 2 3 9 10 8 Preparation

1 Contact with the company 2012/2/19 2012/2/20 1 1

2 Background 2012/2/21 2012/2/25 2 2 3 2 2 4 2 3 5 2 3 9 11 9 Preparation

1 Contact with the company 2012/2/26 2012/2/27 1 4

2 the rest of thesis proposal 2012/2/28 2012/3/3 2 4

3 2 2 4 2 2 5 2 2 9 14 10 Data analysis

1 Contact with the company 2012/3/4 2012/3/5 1 2

2 Analysis data 2012/3/6 2012/3/10 2 2 3 2 2 4 2 2 5 2 2 9 10 11 Thesis planning

(59)

58 2 Thesis structure design 2012/3/13 2012/3/17 2 1

3 2 1 4 2 1 5 2 1 9 6 12 Mathematic modeling

1 Contact with the company 2012/3/18 2012/03/19 1 1

2 Mathematic modeling 2012/3/19 2012/03/24 2 3 3 2 3 4 2 2 5 2 2 9 11 13 Mathematic modeling

1 Contact with the company 2012/3/25 2012/3/26 1 2

2 Deviation and calibration 2012/3/27 2012/3/31 2 4

3 2 4 4 2 4 5 2 4 9 18 14 Mathematic modeling

1 Contact with the company 2012/4/1 2012/4/2 1 2

2 Intelligent the program 2012/4/3 2012/04/7 2 4

3 2 4 4 2 4 5 2 4 9 18

15 Design the converter

1 Contact with the company 2012/4/8 2012/4/9 1 2

2 Design the converter 2012/4/10 2012/4/14 2 4

3 2 4 4 2 4 5 2 4 9 18

16 The factor which can affect

accuracy

1 Contact with the company 2012/4/15 2012/4/16 1 1

2 Temperature analysis 2012/4/20 2012/4/21 2 2

3 Cable length analysis 2 2

4 2 4 5 2 4 9 13 17 SCM in Converter part

1 Contact with my company 2012/4/22 2012/4/23 1 1

2 Learning STC89C52 and C++ 2012/4/24 2012/4/28 2 3

(60)

3 2 4 4 2 4 5 2 2 9 14 18 SCM in Converter part

1 Contact with my company 2012/4/29 2012/4/30 1 2

2 C++ Detect the temperature 2012/5/1 2012/5/5 2 5

3 2 5 4 2 5 5 2 5 9 22 19 SCM in Converter part

1 Contact with my company 2012/5/6 2012/5/7 1 2

2 C++ Read voltage 2012/5/8 2012/5/12 2 5 3 2 5 4 2 5 5 2 5 9 22 20 VB part

1 Contact with my company 2012/5/13 2012/5/14 1 1

2 LabVIEW system 2012/5/15 2012/5/20 2 5 3 2 5 4 2 8 5 2 8 6 2 8 11 35

21 Revision and calibration

report

1 Contact with my company 2012/5/20 2012/5/21 1 8

2 Calibration and revision 2012/5/22 2012/5/27 2 8

(61)
(62)

Chapter8: Budget and Equipment Checklist

Equipment and program payment

HQ980 thermal mass flow meter Free(supplied by the company) Sonic nozzle flow test device Free(supplied by the company) Computer terminal Free(supplied by the company) The ampere volt ohm meter Free(supplied by the company)

Transport fee Air ticket 5,773 kr. Bus and underground ticket 50 kr. The component of making a converter.

Including SCM studying board, A/D conversion module.

200 kr.

(63)
(64)
(65)
(66)

Appendix

List of table

(67)
(68)

List of data

100mm caliber

Flow number Current1 Current2 Current3

(69)
(70)

200mm caliber

(71)

70 250mm caliber

flow code Current1 mA Current2 mA Current2 mA averag

(72)

Program code

Mathematic modeling---based on Matlab

All the data in text files should be put in the path of' D:\graduation_design\caliber data\caliber

while 1 %initialzie close all; clear all; fclose all; %%%%%%%%%%%%%%input dialog%%%%%%%%%%%%%%%

%create an input box where can input a number of the highest power in fitting the function,the number is put in 'mu'

str={'the maximum power of the variable in polynomial fitting'}; shuru={''};

mu=inputdlg(str,'input box',1,shuru);

%create a box named 'input box', the string can be written in a box

mu=cell2mat(mu); %change the cell into mat mu=str2double(mu);

%change the string into double-precision data

%%%%%%%%%%%%%%import and scan data%%%%%%%%%%%%%%% %all the data should be written in the text file

for jj=1:4 %we have four types of TMF, hence we need do four loops.

%name the file path

a=50+jj*50;

% we have four types of TMF, so we have four groups of data. name these group of data

st1='D:\graduation_design\caliber data\caliber';

%part name of the file path

st2='.txt'; %part name of the file path

a=strcat(st1,num2str(a)); %choose one group of data

a=strcat(a,st2); % full name of the file path

%import and scan data

fp1= fopen(a); %open the data according to the file path

C1 = textscan(fp1,'%f%f%f%f%f'); %scan the data

fclose('all'); %close the txt

References

Related documents

Stöden omfattar statliga lån och kreditgarantier; anstånd med skatter och avgifter; tillfälligt sänkta arbetsgivaravgifter under pandemins första fas; ökat statligt ansvar

46 Konkreta exempel skulle kunna vara främjandeinsatser för affärsänglar/affärsängelnätverk, skapa arenor där aktörer från utbuds- och efterfrågesidan kan mötas eller

Generally, a transition from primary raw materials to recycled materials, along with a change to renewable energy, are the most important actions to reduce greenhouse gas emissions

För att uppskatta den totala effekten av reformerna måste dock hänsyn tas till såväl samt- liga priseffekter som sammansättningseffekter, till följd av ökad försäljningsandel

Från den teoretiska modellen vet vi att när det finns två budgivare på marknaden, och marknadsandelen för månadens vara ökar, så leder detta till lägre

Regioner med en omfattande varuproduktion hade också en tydlig tendens att ha den starkaste nedgången i bruttoregionproduktionen (BRP) under krisåret 2009. De

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft