EE 4770 Lecture Notes

Generated from file lsli02.dvi.

This page was generated using an imperfect translator. Text may be poorly positioned and mathematics will be barely readable. Illustrations will not show at all. If possible, view the PostScript or PDF versions of these notes.


02-1                      Process State, Sensors, and Interfacing                                  *
 *          02-1




       Function of sensors:  convert physical quantity to information.


       Information will (usually) be read by computer via an interface.


       Ultimately, the information, in the desired form, will be stored in a mem-
       ory location.



       The following steps are typical:


   1:  A transducer converts process state to a raw electrical quantity.


   2:  A conditioning circuit converts the raw electrical quantity into a useful
       electrical quantity.


   3:  An analog-to-digital converter (ADC) converts the useful electrical quan-
       tity to information.


   4:  A buffer and interface store, format, and present the information to a
       computer.


   5:  An interface routine reads the information, converts it to the desired
       form, and stores it in the desired place.



02-1                   EE 4770 Lecture Transparency.  Formatted  8:30,  15 January 1999 from lsli02*
 *.                  02-1

02-2 Process State and Process Variables * * 02-2 The process state is the current condition of the process, down to in- finitesimal detail. The process variable is a part or characterization of a process state, usu- ally in terms of a common measure. For example, consider a coffee maker. Process_state:_____amount of water in carafe, water temperature, chemical description of water in carafe, type of coffee beans, etc. Process_variable:______temperature of water. Process_variable_value:________70 ffiC. Characteristics It is impossible to know the complete process state (because of infinite detail). It is impossible to know the exact value of a process variable. A process variable value, however, can be determined to a high degree of precision. 02-2 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli02* *. 02-2
02-3 Dimensions * * 02-3 Basics A process variable's value is usually expressed as the product of a number and a dimension. For example, let process variable T be the temperature of water in a cof- fee maker carafe. Then a value for T might be 60 ffiC. An equivalent value might be T = 333:15 K. Notation Dimensions will be written in Roman (upright) type. For example, mA , V, and m. Symbols representing values (variables) will be written in italic type: T , x, and R. Thus, 3V V means "three vee volts." 02-3 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli02* *. 02-3
02-4 * * 02-4 Algebraic Manipulation of Dimensions In expressions, dimensions are manipulated in the same way as numbers and variables. For example: __3_km____ = 3_km__hr__ = 3_km__hr__ ___Mi____ = 3_ hr : 5 MPH 5 Mi 5 Mi 1:6 km 8 Graphs of Values Axes will be labeled with a symbol divided by a dimension. For example, x= V or R= k. The numbers on the axis are then dimensionless. 02-4 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli02* *. 02-4
02-5 Transducers * * 02-5 Transducer: Device which converts a physical quantity from one form to an- other. Usually from: : : : : :a physical quantity which is a process variable to: : : : : :some useful electrical quantity. For example, a transducer might convert temperature to resistance. Transducer Modeling Mapping (function) from process variable to electrical quantity. Symbol Ht denotes the function. Let x be a process variable. Then Ht(x) is the output: : : : : :of the transducer with function Ht. 02-5 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli02* *. 02-5
02-6 * * 02-6 Example A variable resistor can be used as a transducer. Consider a variable resistor which consists of a slider that can move 15 mm while resistance varies linearly from 0 to 10 k. Process variable: position of slider, x. Mapping: Ht(x) = x 10_k_____15.mm Process variable value determined from transducer output. Let y = Ht(x) where Ht and x are as above. Quantity y is a resistance. The position x is found by inverting Ht: H1t (y) = y 15_mm____10 k The process of finding the inverse is equivalent to solving for x in the equation y = x 10_k_____15.mm 02-6 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli02* *. 02-6
02-7 Conditioning Circuits * * 02-7 Purpose The output of a transducer is a raw electrical quantity. It might have to be amplified or otherwise processed. This is done by conditioning circuits. Conditioning circuits might have to do one or more of the following: - Amplify a tiny voltage. - Convert resistance to voltage. - Detect tiny changes in resistance (e.g., 100:1 to 100:2 ). - Add an offset to the transducer output. - Correct for nonlinearities in the transducer function. - Other functions. Notation The symbol Hc will be used for the conditioning circuit's function. An amplifier is a simple conditioning circuit: Hc(v) = Av, where A, the gain, is a dimensionless number. For example, if x is a process variable, then Ht(x) is the transducer out- put and Hc(Ht(x)) is the conditioning circuit output. Sensors The combination of transducer and conditioning circuit is referred to as a sensor. 02-7 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli02* *. 02-7
02-8 Analog to Digital Conversion * * 02-8 ADC Use Conditioning-circuit output is usually fed to an ADC. An analog-to-digital converter converts electrical quantities to informa- tion. Input is usually a voltage, output is usually an integer. Symbol HADC (v) will be used for an ADC function. Standard ADC Function Since most ADCs will convert voltage to integers a standard function will be used.: j v k HADC (h;b)(v) = __h(2b 1) ; where h is a voltage and b is an integer. This ADC would convert voltages in the range 0 to h (inclusive) to a binary number from 0 to 2b 1. For example, HADC (10 V;8)(5 V) = 127 and HADC (17 V;16) (1:3 V) = 5011 . 02-8 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli02* *. 02-8
02-9 Sampling, Buffering, and Interfacing * * 02-9 Buffering is the short-term storing information. Two reasons for buffering the value of a process variable: Value at a particular time is needed. (Value is buffered at that time.) Value is only valid at certain times. (Value is buffered when valid.) The buffer itself can be a simple flip-flop, a register, a RAM, etc. Usually, buffer contents read by a computer through an interface. The interface presents the buffered data to the computer in some stan- dard form. The computer is running some RT (real time) program. The RT program has one or more interface routines. The interface could tell the RT program that data is available by mak- ing an interrupt request. : : :or: : : An interface routine could read the buffer without being alerted by an external signal. For example, it might read the buffer every millisecond. Sampling is the process of reading a process variable at regular intervals. 02-9 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli02* *. 02-9
02-10 Interface Routine * * 02-10 The following is done to transfer a value from the interface to the memory location: 1: The interface routine makes a call to read the interface. raw = readInterface(); 2: The interface routine, or some other code, applies a function, Hf, to the value read. 3: The result is written into the memory location. theMemoryLocation = HsubF(raw); The function Hf puts the value into the final form. It may perform one or more of the following operations: - Convert the raw value to a floating-point quantity. (ADC output is usually an integer.) - Correct for any nonlinearities in the transducer or conversion circuit. - Convert the quantity to the desired dimensions. (E.g., meters, mi- crons.) In terms of the process variable, the final value written is: Hf(HADC (Hc(Ht(x)))) Value is read by other parts of the RT program. 02-10 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli0* *2. 02-10
02-11 The Conditioning Problem * * 02-11 Archetypical Problem: Design a system to write variable procVar with H (x), the value of : : :in : : :, where process variable x is : : :, x can take values in the range [xmin ; xmax ] and where H (x) = . Example Problem: Design a system to write variable waterLevel with H (x), an integer giving the water level, where process variable x is the water level in room 2161 CEBA, x can take on values in the range [0 m; 1 m] and 5 where H (x) = x ____. m Solution Overview 1: Choose a transducer. A variable resistor connected to a float with cables. 2: Choose an ADC. Suppose an ADC with function HADC (5 V;8) is available. 3: Design a conversion circuit. This will convert resistance to voltage. 4: Design the buffer and interface. Details for this part will be skipped here. 5: Write the function for computing the final value. Easy, but tedious. 02-11 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli0* *2. 02-11
02-12 Example Problem Selection of Transducer * * 02-12 Use potentiometer: Construction: shaft that can rotate 6 radians. Three leads. 100 k Resistance between center and lower lead, __________, 6 where 2 [0; 6] is the shaft angle. Resistance between center and upper lead, 100 k __100 k. 6 Transfer function for center and lower lead, Hvr () = __100 k. 6 Use of Potentiometer Floats, guides, and cables will convert water level to shaft rotation. These constructed so that = x _6___1m. Ht(x) = x 100_k____m. 02-12 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli0* *2. 02-12
02-13 * * 02-13 The Conversion Circuit The output of the conversion circuit will be: Hc(Ht(x)) = Hc x 100_k____m : The type of ADC chosen requires its input in the range of 0 to 5 V. A variety of conversion circuits could be used. The simplest is a linear conversion from resistance to voltage. Hc(R) = R __5_V____100.k Hc(Ht(x)) = x 100_k____m__5_V____100.k Hc(Ht(x)) = x 5_V__m. 02-13 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli0* *2. 02-13
02-14 * * 02-14 ADC, Buffering, and Final Processing The ADC function is fixed at 8 HADC (5 V;8)(v) = v (2___1)____5 V= v 255__5 V: HADC (5 V;8)(Hc(Ht(x))) = x 5_V__m255_5 V= x 255__m : The ADC output is clocked into a buffer and then transfered to the com- puter through an interface. Details of these parts will be covered later in the semester. 02-14 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli0* *2. 02-14
02-15 * * 02-15 Finally, the interface routine converts the raw form into the desired 5 form: H (x) = x ____. m Hf(HADC (5 V;8)(Hc(Ht(x)))) = H(x) Hf(bx(255= m) c) = H(x) Define y = g(x) = bx(255= m) c. Then x = g1 (y) ss y _m___255for x 2 [0 m; 1 m]. Then Hf(g(x)) = H(x) Hf(y) = H(g1 (y)) = H(y _m___255) = _5__my _m___255 = _y__51: The code fragment in the RT program is then: int raw; double waterLevel; raw = readInterface(); waterLevel = raw/51.0; : : :and we're done! 02-15 EE 4770 Lecture Transparency. Formatted 8:30, 15 January 1999 from lsli0* *2. 02-15

ECE Home Page 4770 Home Page Up
David M. Koppelman - koppel@ee.lsu.edu
Modified 15 Jan 1999 8:31 (14:31 UTC)