Microsoft Word - Vol 12_no1_2011_June.doc IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 79 DESIGN AND IMPLEMENTATION OF POTENTIOMETER-BASED NONLINEAR TRANSDUCER EMULATOR SHEROZ KHAN, JAMALUDIN OMAR, SK KHAIRUL HASAN, ALIZA AINI BINTI MD RALIB, MA LI YA, ATIKA ARSHAD, HANUM SYAHIDA HUSSIN, NORHANIS AIDA MOHD NOR, AHM ZAHIRUL ALAM AND MD RAFIQUL ISLAM Electrical and Computer Engineering Department, Faculty of Engineering, International Islamic University Malaysia (IIUM), Jalan Gombak, 53100, Kuala Lumpur, Malaysia. E-mail: sheroz@iium.edu.my ABSTRACT : Transducers are normally with nonlinear responses over the entire of a physical parameter they are meant to measure. A potentiometer can be regarded as a linear differential resistive transducer for measuring linear (or angular) movement. In this work, an analog is suggested to make a potentiometer catwalk in order to emulate an actual transducer with its nonlinear response represented as a concatenation of linear segments with known slopes. Each segment of a given slope is implemented by a potentiometer to emulate the variation of input ranging over a given input section of the input. Ultimately we get as many circuits as the number of segments the nonlinear response is made of. Next, an input circuit is used to decide on a range the input is falling into for making use of appropriate potentiometer circuit with the help of a digital selection circuit. The circuit is simulated using MULTISIM to verify that variations in the input voltage give rise to an output voltage that emulates very closely the envisaged nonlinear response. The utility of this work lies in emulating purpose-built real world transducers. ABSTRAK: Transduser merupakan respon yang tidak linear bagi keseluruhan parameter fizikal yang perlu diukur. Meter pembolehubah atau ‘potensiometer‘ boleh dikaitkan/dianggap sebagai transduser pembezaan linear resistif untuk mengukur linear (atau sudut) gerakan. Sistem analog yang terhasil adalah tidak linear. Dalam kajian, potensiometer ini dapat menghasilkan respon linear yang hampir sama dengan transduser sebenar. Dengan ini, respon yang tidak linear dapat dibahagikan kepada rangkaian cerun-cerun segmen yang linear. Setiap cerun segmen dapat digunakan oleh potensiometer untuk meniru variasi julat input ke atas setiap input segmen. Akhirnya, kita dapat menghasilkan sebanyak mungkin litar bagi tiap-tiap respon segmen tidak linear yang terhasil. Kemudian, litar input ini dapat digunakan untuk menentukan julat input yang terhasil. Julat ini dapat digunakan oleh litar potensiometer yang bersesuaian dengan bantuan sistem pemilihan litar digital. Litar ini disimulasikan dengan menggunakan perisian MULTISIM untuk menyemak perubahan pada voltan input yang kemudiannya menghasilkan kenaikan kepada voltan output yang dipercayai dapat meniru dengan tepat respon yang tidak linear. Kajian ini berguna bagi tujuan pembinaan transduser sebenar. KEY WORDS: Emulator transducers, Nonlinear transducers, Potentiometer, Differential, transducers, Quantization errors IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 80 1. INTRODUCTION Analog to digital conversion has always been associated with some adjustments that could lead to losing some of the information that could be termed as affordable quantization errors in quite a number of applications. However, in some other applications it would not be in the interest of the signal concerned that one is able to obtain as much a digital equivalent of the signal as is possible as losing some content would not be considered a concern one can come to terms as acceptable. The data losing concern becomes quite significant when it comes to reading data from sensors with nonlinear responses, however the fast development in both wired and wireless communication has been heralding an improvement of analog to digital conversion and even concerns of nonlinear errors are addressed so properly leading to final research products are achieving high level of accuracy conversion. ADCs which are serving as bridging platforms in between real world signals and a digital processor system are the fundamental elements in all measurements and circuits applied. Generally sensor will produce analog output and ADC is needed for its conversion to produce smart sensor. Analog to digital conversion has becoming so important a device that it comes in besides stand alone, as integrated in some processors designed and meant for measurement and monitoring system. This is because that today’s modern systems are digital that are programmed for automation finely tuned and better equipped for enhanced features. However, all conventional ADC work on linear fashion, and produce a digital code in direct proportional to the length of the section of the analog input signal that is sampled to be digitized. No matter how much accurate and quick ADCs are, they are associated with the errors inherited from the very basic mechanism in which they are designed to function. The errors are quantization error, offset errors and nonlinearity errors. Quantization error is due to the finite resolution present in all ADC conversion mechanism, and is an inherited in all types of ADC [1]. An analog input voltage falling between two adjacent output codes will result inaccurate output code that does not become a true replica of the given analog signal, something termed as quantization that one is unable to avoid. Offset error is the difference between the ideal LSB transitions to the actual transition point. For nonlinearity errors, all ADCs suffer from non-linearity errors resulting in their output to deviate from a linear function of their input. On top of these errors there is another source of error that is stemming out from the transducers from which is the analog to be digitized is obtained. This error may not sound significant in applications where the control system is operating over a limited range of the input parameter or even in system which such error falls well within the level that is acceptable in most application. However in some critical applications even a small error of the level of a single degree of Celsius temperature change such as in the cases of industrial boilers may not be an affordable quantity. Researchers have presented the solution of the nonlinearity issues. The solution for linearization technique can be categorized into three: nonlinear analog signal conditioning circuits, correction based on digital signal processing and correction based on nonlinear analog to digital AD converters [2, 3]. IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 81 The work is analysed using mathematical linear equations for the segments of which the nonlinear response is made. Using excel data sheet, it is then shown to be a close fit of the whole response curve. Having decided on the number of analog circuits, the excel sheet response is then verified by implemented the complete circuit by using MULTISIM. The excel sheet response and that from MULITISIM closely relate, showing that the mathematical derivations of excel sheet are hardware implement able. 2. MATHEMATICAL ANALYSIS AND EXCEL IMPLEMENTATION 2.1 Figure1 shows an actual airflow transducer characteristic response characteristic for a supply pressure varying between 0 and 15 p.s.i. (103.42 kPa) using equation (1) below pbaVVolts  (1) 2.2 where a= 0.788, and b= 1.084 [2]. The 0-15psi pressure is linearly represented by 0-5 V potentiometer reading. Fig. 1: Actual and Segmented nonlinear characteristics curve. The curve of Fig. 1 is sectioned into four such that the output voltage is assumed to be varying linearly with input parameter over its respective ranges as given in Table 1. IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 82 Using excel the mismatch of the linear segments with their respective actual segments is also shown in the form of errors. An actual response curve is sectioned into four segments such that one can easily define the four segments by the following four equations by identifying their slopes and y-intercepts as given in Table 2. Table 1: Theoretical selection of segments. Input-Bytes Pressure (psi) Volts 0 0.00000 0.78800 96 1.40762 2.07409 320 4.69208 3.13608 640 9.38416 4.10868 1024 15.00000 4.98631 Table 2: Input-ranges with slopes and y-intercept. 3. CIRCUIT IMPLEMENTATION The main system hardware components of the proposed design consist of: (A) range selection circuit, (B) channel selection circuit, (C) digital logic switching circuit, and (D) linear conversion circuit. 3.1 Range Selection Circuit The range selection circuit consists of four comparators named as U12A, U11A, U10A, and U9A using LM339M as shown in Fig. 2. The input voltage is applied to the positive inputs of comparators while the voltages coming from a resistive chain are applied to the negative terminals as the lower limits of respective ranges. Seg. No Voltage Range Slope-m Y-intercept 1 0-0.5 V 1.315 0 2 0.5-2.0 V 0.63 0.319 3 2.0-3.0 V 0.4 0.6 4 3.0-5.0 V 0.252 1 IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 83 Fig. 2: Range Selection Circuit. An input voltage from the potentiometer, e.g., in the 0.5-2.0V range, will obviously produce a logic ‘1’ at the output of comparator U11A, thus making the channel selection circuit to extend the input voltage with its appropriate reference value (in this case 0.319V) and slope (0.5634) to the output stage in such a way such that the last stage (presumably ADC) of the circuit makes the input keep ranging almost linearly. 3.2 Channel Selection Circuit The channel selection circuit is designed based on Boolean logic principles given in Table 3, consists of four input AND gates and three inverters as shown in Fig. 3. The design is such that a logic ‘1’ at the output of an AND gate will shows all logic ‘1’ at the output of comparators up to that stage. Assuming that switch J8 is turned on, the output of the AND (gate 2) will be high at logic ‘1’ and one of the input of the AND (gate 1) will be inverted and its output will be made to stay at logic ‘0’, that is to say switch J9 is turned off. The same condition applies for other switches. U 9A U1 0A U1 1A U1 2A V 6 Key= 4 R 13 3 R 17 2 R 18 1 9 V 2 9 V IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 84 Table 3: Truth table for channel selection circuit. Fig. 3: Linear conversion circuit. U12A, U11A, U10A and U9A are comparators, assuming the highlighted are inverted forms of their variables, and J9, J8, J7, J6 are switches with Boolean functions given by: J9 = U12A U11A U10A U9A J8 = J9’.U11A U10A U9A J7 = J9’.J8’.U10A U9A J6 = J9’.J8’.J7’.U9A Vt U12A U11A U10A U9A J9 J8 J7 J6 0 ≤ VT ≤ 0.5 V 1 0 0 0 1 0 0 0 0.5 ≤ VT ≤ 2 V 1 1 0 0 0 1 0 0 2. ≤ VT ≤ 3 V 1 1 1 0 0 0 1 0 3 ≤ VT ≤ 5 V 1 1 1 1 0 0 0 1 Channel 4 Channel 3 Channel 2 Channel 1 U6B U4B U1B R4 R13 R3 R17 R2 R18 V1 9 V V 9 V U9A U10A U11A U12A 9V R6 1k? Key=B U3A U2A U5A U7 7 R1 R7 R8 0 R9 IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 85 At one time, only one switch is turned ON indicated by a blinking LED shown in Fig. 3, thus choosing only one range for extension on to the next stage made of linear conversion circuits. Accordingly, the ADC at its intended output stage is thus facilitated to keep functioning linearly, minimizing the nonlinearity errors thus eliminating causes of the read-in signal to be obscured. This way the equivalent digital code of a sample is tuned up/down considerably closer to its actual value. The same basic principle applies to the other remaining three input voltage ranges already mentioned. 3.3 Linear Conversion Circuit The linear conversion circuit of Fig. 3 is utilizing two-stages of operational amplifiers, the first stage is to set the slope for the segment under consideration while the second stage is meant to provide the straight line equations with a proper y- intercept, thus implementing the straight linear equation. The input stage after having chosen the range of 0.5-2V passes on the input to the Boolean logic to select the onward channel. The Boolean logic on the basis of the input closes switch J8, the third form the bottom switch, and hence the input is put through block two among the output stages. The respective output stage provides the ADC (if any) with an input that is varying linearly over its range lying between the lower infliction and the upper infliction points. 3.4 Whole Circuit Design and Description Figure 5 shows a complete circuit for a virtual transducer, which is a combination of range selection circuit, channel selection circuit, linear conversion circuit before the signal is finally applied to an ADC or microcontroller with built-in A/D. 4. SIMULATION RESULT AND DISCUSSION Simulation of circuit shown in Fig. 4 is performed using MULTISIM where input is derived from a potentiometer varying over the ranges identified in Table 2. Data collected tabulated and plotted in Fig. 5 shows a very close resemblance to that shown in Fig.1. 5. CONCLUSION With reference to the principles of piecewise linear approach, a schematic circuit has been developed. The circuit helps translate a potentiometer (also called a linear transducer) to emulate an actual transducer of interest. The circuit was designed utilizing an EMULATOR that provides output characteristics similar to that of an actual transducer. The EMULATOR was used to replace the need of an actual transducer that was unavailable due to shortage of funds. Although, the various design principles have already been individually reported in other literature reviews, the IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 86 collective aspect of the applications has never been reported. A Boolean based digital logic circuit is used to integrate all stages such that when the input voltage ranges and crosses over the inflection points, the circuit behaves linearly with a new slope and y- intercept for the transducer. When the input voltage is made to vary over the entire input range, ultimately, it provides a concatenation of the straight line-segments. The implementation is straightforward and easy to be realized with discrete components besides being considered for chip integration. The simulated output response curve matches very closely to that which has been proposed and analyzed as shown in Fig. 6. The piece-wise linear approach is implemented using excel for seeing the nonlinear response curve as made of four segments fitting closely to the curve in Fig. 1, which also shows the errors incurred (referred to as mathematical analysis). Increasing errors are observed when the transducer is operated at points where the PWL segments do not fit with the actual curve. In our MULTISIM simulation, the actual curve is sectionalized into four segments manually through a pencil and ruler for known slopes and y-intercepts as shown in Table 2. This data is used for deciding on the values of elements given in Fig. 2, 3, and 5. After repetitive runs over the entire range, the output data were obtained. The comparative analysis of Fig. 5 and Fig. 1 is provided in Fig. 6. The comparative analysis has clearly verified the variations in the input voltage which give rise to an output voltage that emulates very closely the envisaged nonlinear response. The utility of this work lies in emulating purpose-built real world transducers. IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 87 Fig. 4: Complete nonlinearity correction circuit diagram. U9A LM 339M 54 3 2 12 U10A LM 339M 54 3 2 12 U11A LM 339M 54 3 2 12 U12A LM 339M 54 3 2 12 pos 9V R6 1kΩ Key=B 50% neg neg neg neg pos pos pos pos U3A U2A U5A U7A 15 pos15 107 8 R1 1Ω 0 R7 100Ω 0 R8 100Ω 0 R9 100Ω 0 LED4 15 LED1 9 LED2 22 LED3 23 U6B U4B U1B 11 20 16 13 0 J4 1mV 0mV J1 1mV 0mV J2 1mV 0mV J3 1mV 0mV sw1 sw2 sw3 sw4 pos R4 850Ω R13 50Ω R3 200Ω R17 700Ω R2 300Ω R18 600Ω 000 V1 9 V V2 9 V neg pos 26 U14 3288RT 1 2 54 3 R23 400Ω R24 1kΩ U15 3288RT 1 2 54 3 R25 1kΩ R26 1kΩ R27 1kΩ V3 0.6 V neg pos neg pos 12 0 5 14 0 0 2 U16 3288RT 1 2 54 3 R28 574.6Ω R29 1kΩ U17 3288RT 1 2 54 3 R30 1kΩ R31 1kΩ R32 1kΩ V5 0.319 V neg pos neg pos 34 0 33 35 0 0 32 U18 3288RT 1 2 54 3 R33 1.315kΩ R34 1kΩ U19 3288RT 1 2 54 3 R35 1kΩ R36 1kΩ R37 1kΩ V6 0 V neg 48 neg pos 46 0 45 47 0 0 44 U83288RT 1 2 54 3 R5 252.4Ω R10 1kΩ U13 3288RT 1 2 54 3 R11 1kΩ R12 1kΩ R14 1kΩ V4 1 V 24 2421 18 0 17 19 0 0 4 pos pos pos pos J5 1mV 0mV 25 J6 1mV 0mV 28 sw4 J7 1mV 0mV sw3 J8 1mV 0mV 30 29 sw1 0 6 1 3 sw2 0ut4 out3 out2 out1 ground 38 V: 1.60 V V: 2.50 V IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 88 S im u la te d V e rs u s A n a ly s is 0 1000 2000 3000 4000 5000 -176 24 224 424 624 824 1024 In p u t V o lta g e (m V ) O u tp u t V o lt ag e (m V ) Fig. 5: Simulation plot of the complete circuit of Fig. 4. Fig. 6: Comparison of simulation results with analysis outputs. IIUM Engineering Journal, Vol. 12, No. 1, 2011 Khan et al. 89 REFERENCES [1] Nicholas Gray “ABC of ADCs Analog to Digital Converter Basics”, November 24, 2003. [2] J. M. Dias Pereira, "Octavian Postolache, P. M. B. Silva Girão, “A Digitally Programmable A/D Converter for Smart Sensors Applications” IEEE Transactions on Instrumentation. Meas. Vol.56, no. 1, February 2007. [3] Giovanni Bucci, Marco Faccio, and Carmine Landi, “New ADC with Piecewise Linear Characteristic : Case Study - Implementation of a Smart Humidity Sensor”, IEEE Trans. Instrum. Meas., Vol. 49, no. 6, December 2000. [4] S. Kaliyugavaradan, P. Sankaran, and V. G. K. Murti, “A new compensation scheme for thermistor and its implementation for response linearization over a wide temperature range”, IEEE Trans. Instrum. Meas., vol. 42, no. 5, pp. 952–956, Oct. 1993. [5] M. Yamada, T. Takebayashi, S. I. Notoyama, and K. Watanabe, “A switched capacitor interface for capacitive pressure sensor”, IEEE Trans. Instrum. Meas., vol. 41, pp. 81–86, Feb. 1992. [6] C. Marven and G. Ewers, “A Simple Approach to Digital Signal Processing”, New York: Wiley-Interscience, 1996.