MECH 373 Instrumentation and Measurements Lecture 7 Course

  • Slides: 33
Download presentation
MECH 373 Instrumentation and Measurements Lecture 7 (Course Website: Access from your “My Concordia”

MECH 373 Instrumentation and Measurements Lecture 7 (Course Website: Access from your “My Concordia” portal) Computerized Data-Acquisition Systems (Chapter 4) • Computer systems • Representing numbers in computer systems Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 1

Data Acquisition Systems (review) A measurement system could consist of a single sensor, appropriate

Data Acquisition Systems (review) A measurement system could consist of a single sensor, appropriate signal conditioning, and an indicating device such as a digital voltmeter. Then a data acquisition system can be used for accepting the outputs from several sensors and record them. Each of the inputs to the acquisition system is called a channel. Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 2

Computerized Data-Acquisition System Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements

Computerized Data-Acquisition System Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 3

Computerized Data-Acquisition System A data acquisition (DAQ) system is a collection of add -on

Computerized Data-Acquisition System A data acquisition (DAQ) system is a collection of add -on hardware and software components that allow your computer to receive realworld information from sensors. It consists of § Sensors § DAQ board(s) § Computer Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 4

General Computerized DAQ System Sensors Signal Conditioning A/D Conversion Computer Feedback Lecture 7 Lecture

General Computerized DAQ System Sensors Signal Conditioning A/D Conversion Computer Feedback Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements D/A Conversion 5

What is a Computer? What is a computer? Software Hardware Computer Hardware Organization Lecture

What is a Computer? What is a computer? Software Hardware Computer Hardware Organization Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements

Components of Computer Systems Although some computers used in data acquisition are highly specialized

Components of Computer Systems Although some computers used in data acquisition are highly specialized (the engine control computer in an automobile, for example), the computers normally used for data acquisition are quite standard and have the following components: • Central processing unit (CPU) • Program (Software) • Random access memory (RAM) • Mass storage system (e. g. hard drive) • Display (Monitor) • User input devices (keyboard, mouse, etc. ) • Printers and plotters Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 7

Components of Computer Systems Central processing unit (CPU) • The CPU controls all aspects

Components of Computer Systems Central processing unit (CPU) • The CPU controls all aspects of a computer system operation and performs all of the arithmetic operations. • The CPU operations follow the instructions contained in the userprovided program. • The CPU also follows instructions from the computer operating system programs and from built-in programs. Program (Software) • The program provides a set of instructions that cause a computer to perform a specific function. The program or software may either be written by the user completely, or it may be commercial software in which the user only specifies certain inputs. • In some cases, (and commonly in the data-acquisition field), the user may combine his or her own programming and commercial software. Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 8

Components of Computer Systems Random access memory (RAM) • The RAM is a subsystem

Components of Computer Systems Random access memory (RAM) • The RAM is a subsystem of the computer that can store information temporarily. • In particular, it stores the program instructions and numerical data when the computer is being operated. • The information in RAM can be readily changed by the CPU. • All the stored information in the RAM is lost when the computer power is interrupted or when the computer is turned OFF. • Another kind of memory in a computer, read-only memory (ROM), is used for permanent storage of information required by the computer to operate. The user cannot normally modify information stored in ROM. Mass storage devices • Mass storage devices are used to store large volumes of information in a permanent or semi-permanent form. • The most common mass storage system is the disk drive. • In disk drive, the information is stored on rotating disks coated with a magnetic material. Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 9

Components of Computer Systems • An electromagnetic read/write heat moves radially over the disk

Components of Computer Systems • An electromagnetic read/write heat moves radially over the disk surface and alters the magnetic properties of the surface in a retrievable manner. • Disk drives store large amounts of data, which can be transferred to the CPU rapidly (but much slower than RAM). Display • The display (monitor) uses cathode ray tube (CRT) or now a days liquid crystal display (LCD). • The display shows the user a limited amount of information and is also used to prompt the user for required input or actions. User input devices • The most common user input device is the keyboard on which, the user simply types required information. Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 10

Inside the Case of a Computer It contains a system board (mother board). This

Inside the Case of a Computer It contains a system board (mother board). This board hosts most of the circuits connecting: CPU Memory I/O ports Buses Storage Power supplier Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 11

Representing Numbers in Computers Everyday life: Decimal Computers: Binary One-to-one correspondence The smallest unit

Representing Numbers in Computers Everyday life: Decimal Computers: Binary One-to-one correspondence The smallest unit in digital signal is the bit. A bit is a single element in digital signal, having only two possible states: on (indicating 1) 1 or off (indicating 0). 0 Off 0 Bits are organized into larger units called bytes, the basic unit of information in a computer system. A basic byte contains 8 bits. The total amount of information it can convey is 28 (=256) possible combinations. On 1 Off On Off Off On 0 0 1 The leftmost “ 1” in the binary number 1001 is the most significant bit (MSB). The rightmost “ 1” is the least significant bit (LSB). Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 12

Representing Numbers in Computers Conversion from binary numbers to decimal numbers: For n bits,

Representing Numbers in Computers Conversion from binary numbers to decimal numbers: For n bits, highest decimal number = Exercise: Convert the 8 -bit binary number 00100001 to decimal. A number which is not an integer can be expressed using decimal-point notation. For example, Similarly, we can express a non-integer binary number using binary-point notation. For example, Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 13

Representing Numbers in Computers Conversion from decimal numbers to binary numbers: The answer is

Representing Numbers in Computers Conversion from decimal numbers to binary numbers: The answer is contained in the remainders. The top number is the least significant bit (LSB), and the bottom number is the most significant bit (MSB). The answer is, thus, 1011100. However, we are asked for an 8 -bit number, so the most significant bit is 0 and the answer is: N 2 = 01011100 Exercise: Convert the decimal number 147 to 8 -bit binary number. Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 14

Representing Numbers in Computers Conversion from decimal numbers to binary numbers: Lecture 7 Lecture

Representing Numbers in Computers Conversion from decimal numbers to binary numbers: Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 15

Representing Negative Numbers In the above examples, binary numbers are used to represent positive

Representing Negative Numbers In the above examples, binary numbers are used to represent positive decimal integers. However, it is also necessary to represent negative numbers and floating-point numbers (such as 1. 23). Special techniques are used to represent these numbers. Negative numbers are most commonly represented inside computers by a technique known as 2’s complement. Example: 4 bits can be used to represent the decimal integers 0 to 15. These same 4 bits can alternatively be used to represent numbers from -8 to +7. The positive numbers from 0 to 7 are represented by the three least significant bits, ranging from 0000 to 0111. The negative numbers from -8 to -1 are represented by the binary numbers 1000 to 1111, respectively. For positive numbers, the most significant bit is always 0, while it is always 1 for negative numbers. MSB is 0 for positive numbers MSB is 1 for negative numbers Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 16

Representing Negative Numbers 2’s complement To convert a negative decimal integer to 2’scomplement binary,

Representing Negative Numbers 2’s complement To convert a negative decimal integer to 2’scomplement binary, the following procedure can be followed: (1) Convert the integer to binary as if it were positive (2) Invert all of the bits (3) Add 1 least significant bit to produce the final result Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 17

Representing Numbers in Computers Example: Lecture 7 Lecture Notes on MECH 373 – Instrumentation

Representing Numbers in Computers Example: Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 18

Representing Numbers in Computers Example: Exercise: Convert numbers +121 and -121 to 2’s-complement 8

Representing Numbers in Computers Example: Exercise: Convert numbers +121 and -121 to 2’s-complement 8 -bit binary numbers. Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 19

Representing Numbers in Computers When computers communicate with the outside world through various input/output

Representing Numbers in Computers When computers communicate with the outside world through various input/output ports, other binary codes are normally used that differ from the internal code. The most common code used in computers is known as the American Code for Information Interchange (ASCII). In this code, 8 bits are used to represent up to 256 characters. The first 128 of these (0 to 127) are standardized, and ASCII codes 33 to 127 are shown in Table 4. 1. For example, the character lowercase k is represented by the binary number 01101011, which has the decimal value 107. Codes 0 to 32 are special control characters and are not shown. While ASCII-coded data are used to transfer information, they are not useful for arithmetic operations. Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 20

Representing Numbers in Computers Lecture 7 Lecture Notes on MECH 373 – Instrumentation and

Representing Numbers in Computers Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 21

Computerized Data-Acquisition System Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements

Computerized Data-Acquisition System Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 22

General Computerized DAQ System Sensors Signal Conditioning A/D Conversion Computer Feedback Lecture 7 Lecture

General Computerized DAQ System Sensors Signal Conditioning A/D Conversion Computer Feedback Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements D/A Conversion 23

Multiplexer A multiplexer or MUX is a device that performs multiplexing: it selects one

Multiplexer A multiplexer or MUX is a device that performs multiplexing: it selects one of many analog or digital data sources and outputs that source into a single channel. http: //en. wikipedia. org/wiki/Multiplexer Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 24

Basics of Analog-to-Digital Conversion An A/D (or ADC) converts an analog voltage to a

Basics of Analog-to-Digital Conversion An A/D (or ADC) converts an analog voltage to a digital number through the process of quantization. The digital number represents the input voltage in discrete steps with finite resolution. ADC resolution is determined by the number of bits that represent the digital number. For example, an 8 -bit converter with a full-scale voltage of 10 V will give you a resolution of 10 V/256 which is 39. 1 m. V. Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 25

Basics of A/D Converters q In general, the output of an analog-to-digital converter has

Basics of A/D Converters q In general, the output of an analog-to-digital converter has 2 N possible values: quantization N: number of bits used to represent the digital output. q Characteristics Ø N determines the resolution of the output The greater the number of bits, the greater the number of possible output states and the more accurately the digital output will represent the analog input Ø Input range: unipolar and bipolar A unipolar converter can only respond to analog inputs with the same sign Bipolar converters can convert both positive and negative analog inputs Ø Conversion speed Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 26

Basics of A/D Converters In general, the output of an analog-to-digital converter has possible

Basics of A/D Converters In general, the output of an analog-to-digital converter has possible values, where N is the number of bits used to represent the digital output. The 1 -bit device has two possible output states, 0 and 1; The 2 -bit device has possible output states (00, 01, 10, and 11 in binary representation). Computerized data-acquisition systems usually use A/D converters with at least 8 bits, where the number of possible states is (which equals 256). The possible states are then represented by binary numbers with values between 0000 and 1111. For example of an output of 10000001, which represents a number of 129 in decimal. Bits 2 N = Lecture 7 1 2 2 4 6 64 8 256 Lecture Notes on MECH 373 – Instrumentation and Measurements 10 1024 12 4096 27

1 -bit Analog-to-Digital Conversion • A comparator is the most basic ADC • This

1 -bit Analog-to-Digital Conversion • A comparator is the most basic ADC • This is a 1 -bit Flash ADC Vin C Out 1 Volt Vref 1 Comparator Vref =. 5 V Out = 0 if Vin < Vref = 1 if Vin > Vref 0 0 Volt Vin Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements VOut 28

3 -bit Analog-to-Digital Conversion Analog Input N-bit Digital Output N-bit ADC 3 -bit ADC

3 -bit Analog-to-Digital Conversion Analog Input N-bit Digital Output N-bit ADC 3 -bit ADC Scale 1 Volt 111 110 101 100 011 010 001 000 . 875. 75 Volt. 625 . 5 V Step Size = . 375 = 0. 125 V . 25 V. 125 0 Volt Analog Input Signal Data Range 0 -10 volts Lecture 7 Digital Output Code 8 -bit ADC Lecture Notes on MECH 373 – Instrumentation and Measurements 256 distinct possible values 29

Encoding (8 -bit System, 0 -5 V Input) Encoding: The way in which symbols

Encoding (8 -bit System, 0 -5 V Input) Encoding: The way in which symbols are mapped onto bytes. 2 N 2 N 255 (2 N-1) Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 30

Example of Encoding (8 -bit system) Encoding: The way in which symbols are mapped

Example of Encoding (8 -bit system) Encoding: The way in which symbols are mapped onto bytes. Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 31

A/D Conversion Basics: Quantization is to converter the input voltage range into Q=2 N

A/D Conversion Basics: Quantization is to converter the input voltage range into Q=2 N bands to encode a continuous analog signal to discrete digital levels. Volt Quantization Interval: Time Quantization Error: Lecture 7 Lecture Notes on MECH 373 – Instrumentation and Measurements 32

A/D Conversion Basics: Resolution • Related to input range, typically – Lowest bit determines

A/D Conversion Basics: Resolution • Related to input range, typically – Lowest bit determines resolution • Resolution = 1 / 2 N, where N = # of bits Bits 2 N = Res. % Lecture 7 1 2 50 2 4 25 6 64 1. 6 8 256 0. 39 Lecture Notes on MECH 373 – Instrumentation and Measurements 10 1024 0. 1 12 4096 0. 024 33