Data Acquisition System

Slides:



Advertisements
Similar presentations
Chapter 12: Analog Converter Subsystem
Advertisements

Analog-to-Digital Converter (ADC) And
Lecture 17: Analog to Digital Converters Lecturers: Professor John Devlin Mr Robert Ross.
Sensors Interfacing.
Digital to Analogue Conversion
ECE 265 – LECTURE 14 Analog Signal Acquisition The A/D converters 5/14/ ECE265.
Digital to Analog and Analog to Digital Conversion
Announcements Assignment 8 posted –Due Friday Dec 2 nd. A bit longer than others. Project progress? Dates –Thursday 12/1 review lecture –Tuesday 12/6 project.
Data Acquisition Concepts Data Translation, Inc. Basics of Data Acquisition.
Lecture 9: D/A and A/D Converters
10/23/2003ME DAC Lecture1 DAC Sunij Chacko Pierre Emmanuel Deliou Thomas Holst Used with modification.
Analogue to Digital Conversion
68HC11 Analog I/O Chapter 12.
Interfacing Analog and Digital Circuits
DIGITAL SYSTEMS TCE INTERFACING WITH ANALOG DEVICES (Week 12)
Unit 4 Sensors and Actuators
Data acquisition and manipulation
Interfacing with the Analog World Wen-Hung Liao, Ph.D.
ECE 371 – Unit 15 Data Acquisition Systems A/Ds in MC9S12DPS56B Microcontroller.
Week 6aEECS40, Spring 2005 Week 6a OUTLINE Op-Amp circuits continued: examples Inverting amplifier circuit Summing amplifier circuit Non-inverting amplifier.
COMP3221: Microprocessors and Embedded Systems Lecture 20: Analog Output Lecturer: Hui Wu Session 2, 2004.
PH4705/ET4305: A/D: Analogue to Digital Conversion
Digital to Analog Converters
Digital to Analog and Analog to Digital Conversion
Week #7 Data Acquisition System, Part (A)
Computer Data Acquisition and Signal Conversion Chuck Kammin ABE 425 March 27, 2006.
Content Op-amp Application Introduction Inverting Amplifier
Electronic Devices Ninth Edition Floyd Chapter 13.
Digital to Analog Converters
1 Sensors and Measurements Penderia & Pengukuran ENT 164 Signal Processing Elements Hema C.R. School of Mechatronics Engineering Northern Malaysia University.
Topic 28: Direct Sensing 28.1 Sensing devices
Inverting Amplifier. Introduction An inverting amplifier is a type of electrical circuit that reverses the flow of current passing through it. This reversal.
©2008 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. This material is protected under all copyright laws as they currently exist.
Digital to Analogue Converter
Data Acquisition Systems
ELN5622 Embedded Systems Class 7 Spring, 2003 Aaron Itskovich
University of Tehran 1 Interface Design Transforms Omid Fatemi.
Digital to Analog Converters (DAC) 15 March 2006 Doug Hinckley Lee Huynh Dooroo Kim.
Revised: Aug 1, ECE 263 Embedded System Design Lessons HC12 Analog-to-Digital (ATD) Converter System.
Fundamentals of Electric Circuits Chapter 5 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Digital to Analog Converters (DAC) 1 Technician Series ©Paul Godin March 2015.
Analog Capture- Port E. Digital to Analog and Analog to Digital Conversion D/A or DAC and A/D or ADC.
Digital Voltmeter (DVM)
Digital to Analog Converter (DAC)
Embedded Systems Design 1 Lecture Set C Interfacing the MCS-51 to: –D/A Converter –A/D Converter.
Digital-to-Analog Analog-to-Digital Week 10. Data Handling Systems  Both data about the physical world and control signals sent to interact with the.
Digital-to-Analog Analog-to-Digital
Lecture Notes / PPT UNIT III
1 Summary Lecture: Part 1 Sensor Readout Electronics and Data Conversion Discovering Sensor Networks: Applications in Structural Health Monitoring.
Analog-Digital Conversion. Other types of ADC i. Dual Slope ADCs use a capacitor connected to a reference voltage. the capacitor voltage starts at zero.
Components of Mechatronic Systems AUE 425 Week 2 Kerem ALTUN October 3, 2016.
Digital to analog converter [DAC]
MECH 373 Instrumentation and Measurements
Digital-to-Analog Analog-to-Digital
Chapter 12: Analog-to-Digital Converter
Electronic Devices Ninth Edition Floyd Chapter 13.
Fundamentals of Electric Circuits Chapter 5
EI205 Lecture 13 Dianguang Ma Fall 2008.
Analog-to-Digital Converter
Digital-to-Analog Analog-to-Digital
Digital Control Systems Waseem Gulsher
ECE 354 Computer Systems Lab II
Lesson 8: Analog Signal Conversion
Digital to Analog Converters (DAC)
Conversation between Analogue and Digital System
Fundamentals of Electric Circuits Chapter 5
Chapter 5 OUTLINE Op-Amp from 2-Port Blocks
Chapter 5 Operational Amplifiers
Chapter 7 Converters.
Data Acquisition Electronics Unit – Lecture 6
Presentation transcript:

Data Acquisition System

Data Acquisition System The purpose of any data acquisition system is to acquire analog signals and present them to the MCU in a form that can be manipulated. The main components of any general data acquisition system consists of the following: Transducers (sensors) Analog Multiplexer Signal Conditioning (Amplification, Filtering, ..) Sample and Hold Circuit Analog to Digital Converter Microcomputer System Digital to Analog Converter Actuator

Data Acquisition Components Transducers (sensors) convert variable processes such as pressure, temperature into electrical signals such as voltage or current. Signal conditioning: Isolation & buffering: protection from dangerous voltages (i.e. interfacing an MCU to a 110V or 220V) Amplification: Need full scale signal for conversion (transducers usually provide very small signals millivolts) Bandwidth limiting: Low pass filter to limit range (noise) Sample and Hold: used to keep signals constant while converting an analog signal to digital A/D and D/A are interfaces to the MCU to the outside world Actuators: interfaces to activate motors, switches, e.t.c

Signal Paths of a DAS Signal Conditioning Analog Mux Real World Humidity Analog Mux Real World Measurand Temp Transducer (sensors) Pressure …… A/D Conv D/A Conv Sample and Hold Circuit MCU Actuator

Signal Conditioning: Op-Amps Inverting Non-inverting Operational Amplifiers are electronic devices used to amplify signals, filters, signal conditioning, e.t.c. It consists of three terminals (two inputs, one output) OP-AMPs require dc power to operate (+VCC, -Vcc) OPERATION: OP-AMPS are designed to sense the difference between the voltage signals applied to its two input terminals (V2 – V1) , multiply this by a number A , and cause the resulting voltage A (V2 – V1) to appear at output terminal 3. sedr42021_0201.jpg

Operational Amplifiers: Rules for Analysis +12V +12V Inverting Non-inverting -12V -12V Voltage ranges are bounded by supply voltage i.e +/- 12V Input currents are zero because input impedance is large (infinite input impedance for ideal op-amp) Positive feedback or no feedback drives output to saturation (i.e. +12V and -12V) A Virtual short circuit exists between the two input terminals (i.e. whatever voltage is at terminal 2 will automatically appear at terminal 1) due to infinite gain A. sedr42021_0201.jpg

Inverting OPAMP

Analysis of Inverting OPAMP sedr42021_0206a.jpg

Inverting Adder According to virtual ground rule, voltage at inverting and non-inverting inputs are 0. According to Ohm’s law: i1 = V1/R1, i2 = V2/R2, … All these currents sum together to produce the current i; that is i = i1 + i2 + i3 (will be forced to flow through Rf) The output voltage V0 = 0 – iRf = -iRf sedr42021_0210.jpg

Binary Weighted DAC The binary weighted DAC is the simplest converter. This DAC creates currents that are proportional to the weight of each code bit. The inverting OP AMP can produce an output voltage which is linear combination of several input voltages.

Binary Weighted DAC By using input resistors which scale by a factor of 2, a summing Op Amp can produce an output which follows a binary pattern.

Binary Weighted DAC By using switches on the input resistors, a summing Op Amp can produce an output which is a binary number (representing which switches are closed) times a reference voltage. Conversion Factor

Binary Weighted DAC CF = - (RF/R0)VB is called the conversion factor or quantum interval. The quantum Interval is defined as the change in output signal for a unit change of input code, 0000, 0001, 0010 The largest voltage that can be produced by an n-bit binary DAC is Vmax = (2n-1)CF NOTE: CF will be set to the maximum allowable value which is limited by the maximum output of the OP-AMP (VOM) The largest conversion factor is calculated as CFMAX = (VOM)/(2n-1)

Binary Weighted DAC: Example A 4-bit binary weighted DAC has values of RF = 10K, R0=360K What is the value of R1, R2, R3 Calculate (a) the conversion factor when VB = -8V (b) and the maximum output of the system. Solution: R0 = 2R1 = 4R2 = 8R3, So R1 = 180K, R2 = 90K, R3 = 45K CF = (-RF x VB)/R0 = -(10)(-8)/360 = 0.222 Maximum output of this system emax = (2N-1) x CF = 15 x 0.222 = 3.33V

A-to-D Conversion Samples in the Time Domain When an analog signal is to be represented by a digital code  the range of analog signal is divided into levels (quantization levels)  Pulse Code Modulation (PCM) Using level numbers to represent analog signals leads to Inaccuracy  Quantization Error (shaded region) Sampling theory states that if samples are taken of an analog signal, the original analog signal can be recovered if  fs > 2B

A Simple A/D Converter Components: (a) Counter (b) D/A (c) Comparator (d) Latch The counter counts from 0 to 2n-1 The counter drives the input of the D/A converter The output of the D/A is compared to the input voltage vin When the output of the comparator switches logic this means that the generated voltage of D/A passed the input voltage. The comparator then latches the counter output to the latch. Problem with Slope A/D?  it takes 2n clock cycles for conversion

Recall: Staircase A/D Converter Problem with Slope A/D  it takes 2nclock cycles for conversion Can we do better!

Tracking Converter Is an improved version of the staircase ADC If VA increases over previously converted value the counter will count up If VA decreases over previously converted value the counter will count down Conversion time is Not Constant sedr42021_0943.jpg

Successive Approximation A/D Is based on intelligent trial-and-error method When start signal is asserted the controller instructs the sequencer to Place a `1’ in MSB position of Register. All other bits remain at `0’ level A comparator compares two voltage values on its two inputs. If guess is low then the next MSB is set to `1’ If guess is high then that bit is set to `0’ and the next MSB is set to `1’ Requires N clock periods for N-bit converter.

Successive-Approximation Example 6-bit A/D with range 0V – 5V Step Size = 5/26 = 0.078

Successive-Approximation Example 4.16 – 4.141 = 0.019 Error is smaller than ½ LSB Digital output is 110101

Successive Approximation A/D A Successive Approximation A/D can give the wrong output if the voltage changes during a conversion A Track/Hold or Sample/Hold circuit is needed to hold the input voltage constant during conversion.

Sample and Hold Circuit Circuit  Capacitor & Switch It works by charging the capacitor to the input voltage, then disconnecting the capacitor from the input voltage during conversion. sedr42021_0936a.jpg

Concepts and Terminology Analog signals have a ratio-metric range These range from a low value to a high value 0V to 5V -2.5V to 12.5V 4mA to 20mA Binary Code representation for Analog (0V to 5V) 0V  $00 5V  $FF 2.5V  $80 (middle of analog range) If the analog range starts from a nonzero minimum value it is usually represented by an “offset binary code” e.g. -2.5 V - +12.5V, then -2.5 == $00

Concepts and Terminology Definitions :Assume an analog signal ranges from 0V-5V, and number of bits used in A/D converter is 3 Offset  Minimum Analog Value  0V Span  Max to Min Analog Value  5V-0V = 5V Step Size, Quantum Interval  Span/2n Resolution  Refers to the number of bits in ADC and also to smallest analog change corresponding to a change in a bit in the digital number. Conversion: Analog Number = (Digital Number x Step Size) + Offset Digital Number = (Analog Number – Offset)/Step Size Dynamic Range (DR) = (Range or Span)/Resolution = 2n The dynamic range determines the required word size of an ADC.

Example A 6-bit DAC has an analog output range of -2.5 to 5.0V. Calculate the analog output when input is 010101 (i.e. decimal 21) Solution: Offset = -2.5 Span = 5 – (-2.5) = 7.5V Step Size = 7.5V/26 = 10/64 = 0.1172V Analog Output = (digital number x step size) + offset = (21 x 0.1172) – 2.5V = -0.039V

Example A temperature sensor has a measurement range of -10 to 140C. The output range is -2.5 to +5mv. It has a resolution of 0.5C. Determine the # of bits in ADC? What is the reading of the ADC when the output of the sensor is -1.0 mv? Solution: Span = 140 – (-10) = 150 C (or) 5 – (-2.5mv) = 7.5mv Dynamic Range = 150 C / 0.5C = 300 DR = 300 = 2n  n = log2 (300) = 8.22  9 bits Step Size = Span /2n = 7.5mv/(29) = 0.01464 Digital Number = (Analog Number – Offset)/Step Size = (-1.0mv – (-2.5mv))/0.01464 = (102)10 = (001100110)2

CPU12 ADC Subsystem: Features The CPU12 has no DAC! Features of the ADC module include: Eight multiplexed input channels ADC based on successive approximation 8-bit Resolution Single or continuous conversion Conversion complete flag with CPU interrupt request. Selectable ATD clock 28

CPU12 A/D The HC12 has a sample/hold amplifier built in. The Successive Approximation A/D converter has speeds up to several million samples per second. VRH is the highest voltage the A/D converter can handle VRL is the lowest voltage the A/D converter can handle

CPU12 A/D Analog Multiplexer Channel 0 Analog Multiplexer The HC12 uses an analog multiplexer to allow eight input pins to connect to the A/D converter

CPU12 A/D: Control and Status Registers

CPU12 A/D: Control Registers ADPU  1: Powers up the A/D ( if ADPU  0, then AD Port General Purpose). Stabilization Period! SCAN: Perform one conversion or continuous MULT: Conversion of sequential channels or single channel ADPU SCAN MULT

CPU12 A/D: Channels

CPU12 A/D: ATDCTL2 Could either use Polling or Interrupt Driven I/O If ASCIE  1, then interrupt requests are enabled. The ASCIF interrupt FLAG is set = 1, when conversion sequence is complete. ASCIE ASCIF

CPU12 A/D: ATDCTL4 Conversion Time = Initial Sample Time + Transfer Time + Final Sample time + Resolution Time SMP1 SMP0 PRS4 PRS3 PRS2 PRS1 PRS0

CPU12 A/D: ATDCTL5 The S8CM bit in ATDCTL5 is used to select conversion sequences of either 8 or 4 conversions. If set to  0, then 4 conversion sequences are selected and remember that the result is stored in ADRH2 and not ADRH6 if CC=1, CB=1, CA =0 (0110) AN6 ADRxH2 S8CM

CPU12 A/D: Status Registers SCF (Sequence Complete Flag) In single conversion sequence mode, SCF set at end of conversion In continuous conversion mode, SCF is set at end of first conversion CCF0-CCF7 (Conversion Complete Flags) Each ATD channel has a CCF flag which is set at the end of the conversion on that channel. CCF flag can be cleared by reading STATUS REGISTER #1 and then reading the result register of that channel. SCF CCF7 CCF0

CPU12 A/D: LAB

Using the ATD to Measure Signal ; -------------------------------------------------------------------- ; Main Program ;--------------------------------------------------------------------- ORG $7000 ; 16K on board RAM MAIN: BSR INIT ; branch to init ATC BSR CONVERT ; Branch to conversion DONE: BRA DONE ; Branch to Self ;----------------------------------------------------------------------- ; Subroutine INIT INIT: LDAA #$80 ; Power up ATC STAA ATDCTL2 ; ATD Flags clear normally & Disable Interrupt BSR DELAY ; Delay (100 us) LDAA #$00 ; Select continue conversion in BGND Mode STAA ATDCTL3 ; Ignore FREEZE in ATDCTL3 LDAA #$01 ; Select Final sample time = 2 A/D clocks STAA ATDCTL4 ; Prescaler = Div by 4 RTS

Using the ATD to Measure Signal ;----------------------------------------------------------------------- ; Subroutine DELAY 100 us ; Delay required for ATD converter to stabilize (100 usec) DELAY: LDAA #$C8 ; Load Acc with “100 usec delay value” DECA ; Decrement ACC BNE DELAY ; Branch if not equal to Zero RTS ; Return from subroutine

Using the ATD to Measure Signal ; -------------------------------------------------------------------- ; Subroutine Convert ; set-up ATC, make single conversion and store result to a memory location ; Configure and start A/D conversion ; Analog Input Signal: on Port AD6 ; Convert: using single channel, non-continuous ; The result will be located in ADR2H ;--------------------------------------------------------------------- CONVERT LDAA #$06 ; Initialize ATD  SCAN = 0, MULT=0, ; ; S8CM = 0, PAD6, Write clears Flag STAA ATDCTL5 ; 4 Conversions on a Single Conversion ; sequence WTCONV: BRCLR ATDSTATH,#$80,WTCONV; Wait for Sequence Complete Flag LDD ADR2H ; Loads Conversion result (ADR2H) ; into Accumulator RTS ; Return from Subroutine

Summary Data acquisition systems consists of several components (i) sensors (ii) signal conditioning, (iii) Analog to Digital Converters, (iv) MCU, (v) Digital to Analog converters. Engineers must justify the usage of each component in the path and consider (i) Cost, (ii) error Operational Amplifiers are at the heart of Signal conditioning circuits, ADCs, DACs and therefore analysis of these circuits is very important. Determining the # of bits required by ADC or DAC is important and knowing the sampling frequency is also as important to recover the original signal. There are several types of ADCs available (next topic)

Extra Slides

Example Given an analog signal with range -5V to +5V and an 8-bit ADC Determine: Offset, Span, Step Size, %Resolution Solution: Offset = -5V Span = 5 – (-5) = 10V Step Size = 10V/28 = 10/256 = 39.1mv % Resolution = 0.391%