Design and Development of a real time data aquisition and control system by Emina, E. E Engr. Tech. part 1

July 18, 2017 | Autor: Etomi Emina | Categoria: Embedded Systems
Share Embed


Descrição do Produto

Chapter 1 INTRODUCTION The need to monitor, control and log data from process variables such as temperature, flow, pressure, humidity, distance etc. in a process plant on a real time basis is very important in the production and manufacturing industries. This is because it gives the Operator or Engineer control over the process variables needed for plant and process optimization. Such optimization of plant using a Data Acquisition and Control system gives other benefits like increased efficiency, reliability of the process under control, remote operation, safe and cost-effective operations of the manufacturing process. 1.1

Background to the Study

In industries were products are being manufactured there is always a need to measure, monitor and control one process variable or the other in a bid to bring about optimization of the different processes occurring in the plant. For example in incubators for poultry eggs temperature is the process variable controlled by taking measurement of the temperature of the incubating compartment and controlling the heating element to prevent it from exceeding its set point. At Trancorp, Ughelli Power Station (Gas turbine), in Delta State, Nigeria, a Programmable Logic Controller (PLC) at Delta 4 uses transducers to measure process variables such as:

temperature, level, voltage, frequency, power factor etc. By capturing the data from the different transducers using data acquisition technique plant parameters can be controlled for optimization and safe operation of the gas turbine to produce the required power transmission specifications. Data Acquisition and Control system thus encompasses a wide range of measurement applications, all of which require some form of characterization, monitoring, or control. No matter what the specific application, all data acquisition systems either measure a physical parameter (temperature, pressure, flow, humidity, distance etc.) or take a specific action base on the measured value and set points. They are also capable of logging measured data from transducers in real time for analysis of the systems performance. 1.2

Statement of the Problem

In various industrial processes it is very important to monitor in real time process variables used in the manufacturing/production process, were such variables cannot be monitored, controlled and managed adequately catastrophic event such as destruction of product, damage to processing plant and even injury to workers or loss of life could result. Data Acquisition and Control System has proved to be not just a cost effective solution for a plant, but also a way of achieving plant automation and optimization.

1.3

Objective of the Study  To design and develop a software for simulation of a Data Acquisition and Control System (DAQ).  To use the data captured from a thermal sensor and other control element to maintain a constant temperature of a process.  To monitor proximity (Distance) and display its value on a GUI.  To log the data collected during a process in a file format that can be assessable by data analysis software.

1.4

Significance of the Study

Data Acquisition and Control System is the process of sampling signals that measure real world physical conditions and converting the resulting samples into digital numeric values that can be manipulated by a computer. Managing such data on a PC DAQ program has tremendous advantages. They include:  Reduced data redundancy.

 Reduced updating errors and increased consistency.  Greater data integrity and independence from applications programs.  Improved data access to users through use of host and query languages.  Brings about automation of a process.  It is a cost effective process since the system automated will require fewer persons to operate it.  Easy analysis of Logged data.  The process can be shut down remotely. 1.5

Scope of the Study

The Data acquisition and Control System will consist of two transducers; a thermal sensor and humidity sensor for measurement of temperature and relative humidity. These process variables measured (temperature and relative humidity) will be displayed on a 16 x 2 LCD screen and on a PC GUI. Through the PC graphical user interface set points for temperature and relative humidity can be set or reset during processing. It will also display the temperature, relative humidity set points while creating a log of the data captured in a .csv file format.

CHAPTER 2 LITERATURE REVIEW 2.1

Temperature Measurement

In today’s industry temperature measurement encompass a wide variety of needs and applications. Many processes must have either a monitored or controlled temperature facility installed in it. This can range from the simple monitoring of the water temperature in the radiator of an automotive engine, control of the temperature of an incubator, temperature regulation for industrial oven for food and beverages or it could be as complex as the temperature of a weld in a laser welding machine. There are even more difficult measurements such as the temperature of smoke stack gas from a power generating station or blast furnace or the temperature of a rockets exhaust may need to be monitored and controlled. Temperature measurement can be classified into the following categories Thermometers, Probes and Non-contact. Thermometers are the first in this category

to be invented. The first thermometer was an air-thermoscope described in Natural Magic (1558, 1589). This device was in used before the invention of the current glass thermometers used in laboratories and hospitals. Capgo, 2013 [1] recorded that Up to 1841 there were 18 different temperature scales in use until Daniel Gabriel Fahrenheit, an instrument maker learned to calibrate thermometers from Ole Romer, a Danish astronomer. With his knowledge between 1708 and 1724 Fahrenheit began producing thermometers using Romer’s scale and then modified that to what we know today as the Fahrenheit scale. Fahrenheit greatly improved the thermometer by changing the reservoir to a cylinder and replaced the spirits used in the early devices with mercury. This was done because it had a nearly linear rate of thermal expansion. His calibration techniques were a trade secret, but it was known that he used a certain mixture of the melting point of a mixture of sea salt, ice and water and the armpit temperature of a healthy man as calibration points. When the scale was adopted by Great Britain the temperature of 212 was defined as the boiling point of water. This point as well as the melting point of plain ice were used as two known calibration points. About 1740 Anders Celsius proposed the centigrade scale. It is not clear who invented the scale, but it divided the range of the melting point of ice (100) to the steam point of water (0) into 100 parts, hence ‘centigrade’. Linnaeus inverted the scale so that 0 was the ice point and 100 was the steam point. In 1948 the name of the centigrade scale was changed to Celsius.

About the time that Fahrenheit was experimenting with his liquid filled devices, Jaspeh L. Gay-Lussac was working with gas filled tubes. He concluded that at a constant pressure, the volume of the gas would expand at a particular rate for each degree of temperature rise, that being 1/267 per degree. In 1874 Victor Regnault obtained better experimental results, showing this number to be 1/273 and concluded that the pressure would approach zero at 1/273.15℃. This lead to the definition of zero pressure at -273.15℃, or what we now know as the absolute scale. Owing to the development of the thermometer, came the evolution of temperature measurement and the era of temperature probe. In 1826 Becquerel an inventor developed and used the first platinum-vs-palladium thermocouple. The invention of the thermocouple ushered in a whole new wave of development, culminating in what we know today as practical thermometry. This resistance element was the first in a series of devices that are not classified as probes or transducers. In recent times, Semiconductor probes have gain popularity. Like a resistance probe, they require a current (or voltage) supply to create a reading. This is where the similarity ends. Semiconductor probes are created from a semiconductor wafer that contains a number of active circuits. Probably the most common of these are the Analog Devices AD590 Device. These devices are essentially a temperature variable resistance device, which then converts the change in resistance to a change in current or voltage.

2.2

Humidity Measurement

A document on managing indoor humidity without de-humidifier was presented by Alabama WISE, 2014 [2]. He expressed that the best indoor relative humidity is 45% to 55%, and identified that most heating and cooling systems were not designed to manage indoor humidity though home heating and cooling systems were controlled by a thermostat, which used a thermometer. Therefore, he pointed that indoor humidity control was only an incidental byproduct of the system operation and was a problem for homes in south Florida. Strategizing on managing indoor humidity, Alabama WISE, 2014 contributed that it begins by measuring the humidity of the environment by using humidistat an element used to evaluate the effectiveness of various moisture management strategies. He stated that the ideal indoor relative humidity is between 45% and 55%, but must always be maintained between 40% and 60% , since indoor humidity is often more important than air temperature. Further review in Beginner’s Guide to Humidity Measurement [3], Stephanie Bell, 2001 showed the relationship between air temperature, dew point temperature and relative humidity, and from her work, it was derived that increase in air temperature decreases the relative humidity in a space, and when the air temperature is high, the dew point becomes equal to or a little below the air temperature. Her work therefore

defined relative humidity as how a space becomes saturated with vapour molecules or gas is saturated with vapour and pointed out that relative humidity is commonly measured in percentage. Her research showed that the interaction of water vapour with materials in the space where these vapour occurred, and the conclusion that the deposition of the vapour molecules on the material were proportional to relative humidity, thus, a method of its measurement. The fraction or ratio of which humidity is measured is the proportion of water vapour in a gas, given in terms of mass, volume or moles. With this, a better review was that of the concentration of humidity as the amount of water vapour per unit volume, an example of a room air which typically contained about 10 grams of water vapour per cubic metre was given. With view to humidity-measuring instruments, Stephanie Bell, 2001 wrote on the relative humidity sensor; hygrometer based on an electronic component that absorbs water vapour according to air humidity and changes the electrical impedance. In an illustration of various humidity sensor, from her observations for the dew point probe, she indicated that the hygrometer was based on an electronic sensor changing electrical capacitance on absorbing water, capable of measuring trace levels of water vapour in very dry gas, then for Psychrometer; as the wet and dry-bulb hygrometer, she said that it uses evaporative cooling as a measure of humidity. 2.3

Data Acquisition System

On the definition of data acquisition system, omega defined it as products and or process used to collect information to document or analyze some phenomenon. He mentioned that as technology have progressed that the data acquisition system have been simplified and made more accurate, versatile and reliable through electronic equipment that ranges from simple recorders to sophisticated computer systems. He noted that it serves a focal point in system, tying together a wide range of products of sensors; an indicator of temperature, flow, level or pressure. In collaboration with sensors, Omega stated that recorders and dataloggers are products used with sensors to document information relating to a process. A few advantages of data logger pointed by him were less paper usage, higher resolution of reading and less chance of misinterpretation of data. According to his research, it was documented that data are acquired using computer which is a major component in data acquisition. He acknowledged that the computer has become prevalent in the existence of human lives, and depending on the skill level of the user and the products, that the computer performs several functions. In his work, he classified computer-related data acquisition products in two ways such as those that “plug-in” directly into the computer, and those that “stand alone” and interface to the computer through a communication port. In either situation, computer software is always required to instruct the computer on how to handle the data which he said is a key aspect of any computer.

In order to establish communication on data acquisition products, a communication interface was used for short distance communication as revealed by Omega which is RS-232, and he defined it as a serial communication for one device to one computer communication port, with speeds up to 115 K baud (bits per second). Focusing on the essential components of data acquisition system by Heintz, 2002 [4] he scripted that the measurement hardware consisted of A/D converter, a key element in any data acquisition system used to convert dc voltages acquired from the transducers into digital data, and the measured voltages corresponds to specific temperature, pressure, flow or speed. other measurement hardware were: Digital inputs which senses a digital bit pattern to determine whether an external device is on or off, and a counter which he said is used to count events from an external device. Further on control hardware Heintz, 2002 presented D/A converter system as an analog output which interprets commands from the control hardware and outputs a corresponding dc voltage or current. For control applications, he expressed that a switching card can be used to supply power to external fans, pumps or valves by completing an electrical circuits. He employed the use of electromechanical switches such as reed and armature relays, which are common in low-speed applications and have the ability to switch high voltage and current levels. He observed that the limitations of these switches was the switching rates of several hundreds of channels per second. In his conclusion, he indicated that by understanding the various

components of data acquisition system, the evaluation of available option and the best system choice can be made to meet desired needs. 2.5

Microcontroller (Arduino Uno)

Arduino is an open-source computer hardware and software company, project and user community that designs and manufactures kits for building digital devices [5] and interactive objects that can sense and control the physical world Wikipedia, 2015. Arduino boards may be purchased preassembled, or as do-it-yourself kits; at the same time, the hardware design information is available for those who would like to assemble an Arduino from scratch. The project is based on a family of microcontroller board designs manufactured primarily by SmartProjects in Italy, and also by several other vendors, using various 8-bit Atmel AVR microcontrollers or 32-bit Atmel ARM processors. These systems provide sets of digital and analog I/O pins that can be interfaced to various extension boards and other circuits. The boards feature serial communications interfaces, including USB on some models, for loading programs from personal computers. For programming the microcontrollers, the Arduino platform provides an integrated development environment (IDE) based on the Processing project, which includes support for C and C++ programming languages.

The first Arduino was introduced in 2005. The project leaders sought to provide an inexpensive and easy way for hobbyists, students, and professionals to create devices that interact with their environment using sensors and actuators. Common examples for beginner hobbyists include simple robots, thermostats and motion detectors. An Arduino board consists of an Atmel 8-bit AVR microcontroller with complementary components that facilitate programming and incorporation into other circuits. An important aspect of the Arduino is its standard connectors, which lets users connect the CPU board to a variety of interchangeable add-on modules known as shields. Some shields communicate with the Arduino board directly over various pins, but many shields are individually addressable via an I²C serial bus so many shields can be stacked and used in parallel. Official Arduinos have used the megaAVR series of chips, specifically the ATmega8, ATmega168, ATmega328, ATmega1280, and ATmega2560. A handful of other processors have been used by Arduino compatibles. Most boards include a 5 volt linear regulator and a 16 MHz crystal oscillator or ceramic resonator in some variants, although some designs such as the LilyPad run at 8 MHz and dispense with the onboard voltage regulator due to specific form-factor restrictions. An Arduino's microcontroller is also preprogrammed with a boot loader that simplifies uploading of programs to the on-chip flash memory, compared with other devices that typically need an external

programmer. This makes using an Arduino more straightforward by allowing the use of an ordinary computer as the programmer. At a conceptual level, when using the Arduino software stack, all boards are programmed over an RS-232 serial connection, but the way this is implemented varies by hardware version. Serial Arduino boards contain a level shifter circuit to convert between RS-232-level and TTL-level signals. Current Arduino boards are programmed via USB, implemented using USB-to-serial adapter chips such as the FTDI FT232. Some variants, such as the Arduino Mini and the unofficial Boarduino, use a detachable USB-to-serial adapter board or cable, Bluetooth or other methods. The Arduino board exposes most of the microcontroller's I/O pins for use by other circuits. The Diecimila, Duemilanove, and current Uno provide 14 digital I/O pins, six of which can produce pulse-width modulated signals, and six analog inputs, which can also be used as six digital I/O pins. These pins are on the top of the board, via female 0.10-inch (2.5 mm) headers. Several plug-in application shields are also commercially available. The Arduino Nano, and Arduino-compatible Bare Bones Board and Boarduino boards may provide male header pins on the underside of the board that can plug into solderless breadboards. 2.6

Liquid Crystal Display

The LCD chosen for this project is the 16 × 2 alphanumeric LCD display, it is capable of displaying 16 characters on each of the 2 rows and it makes use of the HD44780U standard for LCD controller chip. This standard [5] makes use of three Control lines as well as 4 or 8 Input/output lines for its data bus Mazidi, 2012. The control lines of the LCD are:  EN line is called Enable  RS line is called Register select line  RW is called is Read/Write This control lines together with the 8 bits data bus are used to give command to the LCD screen to display alphanumeric characters on the screen.  The Enable control line (EN) is used to inform the LCD that a data is being sent, to do this, the enable line is made low and the RS, RW are set to be high while the data intended for use is sent to the data bus.  The RS line is the register select line used for selecting the data as a command or a special instruction, for example: clear screen, position cursor, shift display. To do this, RS is made equal to zero otherwise when RS is made equal 1, the data being sent to the screen is a text.  The RW line is the Read/ write control line, when the RW line is low, the information on the data bus is written to the LCD, when RW is high, the

program is effectively querying the LCD that is reading the LCD, this means that it gets the LCD status whether it is ready to receive data. Table 2.1: Hex code and function for 𝟏𝟔 × 𝟐 LCD Code (Hex) Command to LCD instruction register 1

Clear display screen

2

Return home

4

Decrement cursor

6

Increment cursor

5

Shift display right

7

Shift display left

8

Display off, Cursor off

A

Display off, Cursor on

C

Display on, Cursor off

E

Display on, Cursor on

F

Display on, Cursor blinking

10

Shift cursor position left

14

Shift cursor position right

18

Shift entire display to the left

1C

Shift entire display to the right

80

Force cursor to begin from 1st line

C0

Force cursor to begin from 2nd line

38

2 line 5 x 7 matrix

2.7

MAX232

The MAX232 is an integrated circuit, first created in 1987 by Maxim Integrated Products [6], that converts signals from an RS-232 serial port to signals suitable for use in TTL compatible digital logic circuits (Wikipedia, 2014). The MAX232 is a dual driver/receiver and typically converts the RX, TX, CTS and RTS signals. The drivers provide RS-232 voltage level outputs of approximately ± 7.5 V 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.

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. 2.8

VB.net and C programming

Visual Basic .NET [7] also called VB.NET for short is a multi-paradigm, high level programming language, implemented on the .NET Framework (Wikipedia, 2015). Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language. Along with Visual C#, it is one of the two main languages targeting the .NET framework. The .NET Framework pronounced dot net is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large class library known as Framework Class Library (FCL) and provides language interoperability so that each language can use code written in other languages across several programming languages. Programs written for .NET Framework execute in a software environment as contrasted to hardware environment, known as Common Language Runtime (CLR), an application virtual machine that provides services such as security, memory management, and exception handling. FCL and CLR together constitute .NET Framework.

FCL provides user interface, data access, database connectivity, cryptography, web application development, numeric algorithms, and network communications. Programmers produce software by combining their own source code with .NET Framework and other libraries. .NET Framework is intended to be used by most new applications created for Windows platform. Microsoft also produces an integrated development environment largely for .NET. Microsoft's integrated development environment (IDE) for developing software in Visual Basic .NET language is Visual Studio. Most of Visual Studio editions are commercial; the only exceptions are Visual Studio Express and Visual Studio Community which are freeware. The C programming language is perhaps the most popular programming language for programming embedded systems. Most C programmers are spoiled because they program in environments where there is a standard library implementation, but there are frequently a number of other libraries available for use. The fact is, that in embedded systems, there rarely are many of the libraries that programmers have grown used to, but occasionally an embedded system might not have a complete standard library, if there is a standard library at all. Few embedded systems have capability for dynamic linking, so if standard library functions are to be available at all, they often need to be directly linked into the executable. Oftentimes, because of

space concerns, it is not possible to link in an entire library file, and programmers are often forced to "brew their own" standard c library implementations if they want to use them at all. While some libraries are bulky and not well suited for use on microcontrollers, many development systems still include the standard libraries which are the most common for C programmers. C remains a very popular language for micro-controller developers due to the code efficiency and reduced overhead and development time. C offers low-level control and is considered more readable than assembly. Many free C compilers are available for a wide variety of development platforms. The compilers are part of an IDEs with ICD support, breakpoints, single-stepping and an assembly window. The performance of C compilers has improved considerably in recent years, and they are claimed to be more or less as good as assembly, depending on who you ask. Most tools now offer options for customizing the compiler optimization. Additionally, using C increases portability, since C code can be compiled for different types of processors.

Lihat lebih banyak...

Comentários

Copyright © 2017 DADOSPDF Inc.