fuzzy logic multimeter (part 1) - کانون...

6
FUZZY LOGIC MULTIMETER (PART 1) AUTORANGING, WITH SOFTWARE CONTROL FOR FUZZY LOGIC APPLICATIONS Together with the associated software, this circuit is not only a 3%-digit PC-controlled digital multimeter (DMM) with a plethora of beils and whistles, but also a very flexible measurement input for a control system based on fuzzy logic. Whether a sensor converts to current, voltage or resistance, the DMM can handle its output signal. Your sensor has a non-linear response? No problem for fuzzy logic. In the first two instalments we describe the PC-driven multimeter, while the last instalment will present a fuzzy logic control system that makes use of the present DMM. SOV/O.SA SV/3SmA MAIN FEATURES Display: Ranges: 3Y< digit ±400.0 mV - ±400 V (AC and DC) ±400 mA (AC and DC) 400.0 0- 40.00 MO Accuracy after calibration - voltmeter: -1% bandwitdh max. erest factor (Up/U rms ): - ohmmeter: - ammeter: better than ±(1% of measured value + 1 digit) 300 Hz 5 ±(1% of measured value + 1 digit) ±(1% of measured value + 1 digit) Switching outputs: 4 power outputs with flyback diode 6 HCT outputs System requirements: IBM compatible PC-AT (286, 386 or 486) with '1MB EMS and hard disk (DMM softwate not suitable for PC-XT). 1.44-MB 3.5-inch floppy disk drive. Dne free 8-bit slot. Mouse and colour VGA monitor recommended. Design by H. Schalten Y OU may wonder why we did not call the present ctrcutt an A-D Ianalogue-to-dtgttall converter. After a11 , it converts the level of an analogue signal into a corresponding digital value. In generat. an A-D converter is a circuit capable of fast conversion of a direct voltage into a digital value - 'fast' meaning within a few microsec- onds. Other physical quantities re- quire additional (externa1) electrorucs circuttry. Although a DMM (digital multime- ter) also contains an A-D converter, this is not usually very fast. For-exam- ple, in the case of the present DMM. the conversion time ts 50 ms. Also, the DMM usually needs a few seconds be- fore the measured value is correctly displayed following a large change in the input stgnal, This ts called the set- tling time. Fortunately, in view of the application range of the DMM, 'slow' converston is not really a problem. The above mentioned additional electronics required by an ADC to measure other quantities than direct voltages are al- ready implemented in the instrument, whence the name multimeter. In the case of the present DMM, we are even more fortunate because a Iarge part of this additional electrorucs is contained in a single integrated circuit. Where a control system ts involved, the chotce between a DMM and an ADC depends on the nature of the stg nal to be measured. Dynamic slgnals require an A-D converter which is fast enough to follow all changes, Although an ADe may alsc be used when the input stgnal is (quasi-) stattc, a DMM has the advantage of easier sensor connection ~ all you need to da is set the nght measurement range. As lang as the sensor supplies a stgnal that falls within the range of the meter. you are relieved of separate adaptor ctr cuits, and other problems that artse from driving a 'bare bories' A-D con- verter. The pe interface The multtmeter consists of a PC inser- tion card and a DMM card proper. The ctrcutt diagram of the first is shown in Fig. 1. The DMM card being a pretty sensitive unrt. it is not fitted in the computer, but connected to the Inser- tion card via a length of flatcable. Although the PC interface is de- ELEKTOR ELECTRONICS SEPTEMBER 1993

Upload: buikien

Post on 27-Mar-2019

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: FUZZY LOGIC MULTIMETER (PART 1) - کانون الکترونیکcdn.eleinfo.ir/el1990-1999/pdf/1993/e939036.pdf · 2008-12-05 · FUZZY LOGIC MULTIMETER (PART 1) AUTORANGING, ... ELEKTOR

FUZZY LOGIC MULTIMETER(PART 1)

AUTORANGING, WITH SOFTWARE CONTROLFOR FUZZY LOGIC APPLICATIONS

Together with the associated software, this circuit is not only a3%-digit PC-controlled digital multimeter (DMM) with a plethoraof beils and whistles, but also a very flexible measurementinput for a control system based on fuzzy logic. Whether asensor converts to current, voltage or resistance, the DMM canhandle its output signal. Your sensor has a non-linearresponse? No problem for fuzzy logic. In the first twoinstalments we describe the PC-driven multimeter, while thelast instalment will present a fuzzy logic control system thatmakes use of the present DMM.

SOV/O.SASV/3SmA

MAIN FEATURES

Display:Ranges:

3Y< digit±400.0 mV - ±400 V (AC and DC)±400 mA (AC and DC)400.0 0 -40.00 MO

Accuracy after calibration- voltmeter:

-1% bandwitdhmax. erest factor (Up/Urms):

- ohmmeter:- ammeter:

better than ±(1% of measured value + 1 digit)300 Hz5±(1% of measured value + 1 digit)±(1% of measured value + 1 digit)

Switching outputs:4 power outputs withflyback diode6 HCT outputs

System requirements:IBM compatible PC-AT (286, 386 or 486) with '1MB EMS and hard disk (DMMsoftwate not suitable for PC-XT).1.44-MB 3.5-inch floppy disk drive.Dne free 8-bit slot.Mouse and colour VGA monitor recommended.

Design by H. Schalten

YOU may wonder why we did notcall the present ctrcutt an A-D

Ianalogue-to-dtgttall converter. Aftera11, it converts the level of an analoguesignal into a corresponding digitalvalue. In generat. an A-D converter is acircuit capable of fast conversion of adirect voltage into a digital value -'fast' meaning within a few microsec-onds. Other physical quantities re-quire additional (externa1) electrorucscircuttry.

Although a DMM (digital multime-ter) also contains an A-D converter,this is not usually very fast. For-exam-ple, in the case of the present DMM.the conversion time ts 50 ms. Also, theDMM usually needs a few seconds be-fore the measured value is correctlydisplayed following a large change inthe input stgnal, This ts called the set-tling time. Fortunately, in view of theapplication range of the DMM, 'slow'converston is not really a problem. Theabove mentioned additional electronicsrequired by an ADC to measure otherquantities than direct voltages are al-ready implemented in the instrument,whence the name multimeter. In thecase of the present DMM, we are evenmore fortunate because a Iarge part ofthis additional electrorucs is containedin a single integrated circuit.

Where a control system ts involved,the chotce between a DMM and anADC depends on the nature of the stgnal to be measured. Dynamic slgnalsrequire an A-D converter which is fastenough to follow all changes, Althoughan ADe may alsc be used when theinput stgnal is (quasi-) stattc, a DMMhas the advantage of easier sensorconnection ~ all you need to da is setthe nght measurement range. As langas the sensor supplies a stgnal thatfalls within the range of the meter. youare relieved of separate adaptor ctrcuits, and other problems that artsefrom driving a 'bare bories' A-D con-verter.

The pe interfaceThe multtmeter consists of a PC inser-tion card and a DMM card proper. Thectrcutt diagram of the first is shown inFig. 1. The DMM card being a prettysensitive unrt. it is not fitted in thecomputer, but connected to the Inser-tion card via a length of flatcable.

Although the PC interface is de-

ELEKTOR ELECTRONICS SEPTEMBER 1993

Page 2: FUZZY LOGIC MULTIMETER (PART 1) - کانون الکترونیکcdn.eleinfo.ir/el1990-1999/pdf/1993/e939036.pdf · 2008-12-05 · FUZZY LOGIC MULTIMETER (PART 1) AUTORANGING, ... ELEKTOR

stgned as an Insertfon eard for 8-bitslots, it can not be used in a PC-XT.T'hts ia because the software has agraphics user interface (GUI), whichcalls for a PC-AT with a minimum ofI MByte EMS.

The PC interface was not specifieallydestgned for the OMMcard. lts outputconneetor. Kr. supplies a number ofsrgnals intended Ior a bus systemcalled MicroSystem. destgned by theauthor for measurement and controlsystems. The bus allows several exten-sions, tncluding DMM eards. to be

eonneeted, and consists of the follow-ing signals: etght data !ines (00-07).etght card selection lines (KO-K7),fiveregister address lines, read, wrtte,strobe, reset, int, nmi, watt. clock,mc l . ground and the positive supplyvoltage.

Although tbe PC interface is rela-tively simple. a quick dtscuaston of ttsoperaüon may be useful for some read-ers. The address at whtch the card canbe accessed by the PC is set wtth theaid ofDlP switch block SI. ComparatorIC3 compares the address on the

FUZZY LOGIC MULTlMETER (I)

switches with that on address ItnesA3-A9 (A9 has to be '1' in all cases).The addressing of the eard complieswith the lO-bit addressing system de-fined for 1/0 cards in PCs. None theless, the interface uses more addresslines than the usual ten. However. thelogie levels on these additional linesare only valid if the address decoderhas detected that the interface is betngaddressed via the normal set of ten ad-dress ltnes. In other words, the Iü-brtPC-I/O address is a 'key' that gives ac-cess to the addresses indicated by the

C2 '" 7406C4 '" 74HCTOOC6" 74HCT125

IBMCONA

'.•r,s•,,

''"~ i 30~' .Al I 2&

01.4: 27

"s 1 2G

Mi :,\7:ea:i 22

"11:"12: ID

A13: 16

"14 I 17

"151c::::::J--1ti

"161c::::::J--15

"11 I c::::::J-- 14"18: c::::::J-- 13"19!~12

~ i ~~=':~'~~~~~:~~~.CHROY! 10 CHRDY

L ..

,e,14HCT645

V, 4- ,I ~ ,v I..00

00' a " "~ • " 00

~ s .. 00- • " ~00' r " es

"+ ~ • " 00

" 00' • " ",I~Nl{AB]

"3EIf2\BA]

" ~oo,

'"..~~..M

'""M....... t

."'"...

" "" .," ~" .," "rc ~• ", "

svC+

[,"

"''"o co",p

~

9 8 7 s 5 4 l 2

11,1,1,1,1,1; 1

a

",", 0..

~,--"1 J 7 IC3

"'~~"--'" 'n 11'.0 p.!!--~ 14HCT688~~ p

,,'

rcrIC4a 3 ,

"3ElIl[AII]

~....,ea•, ,

~", 4,I ~a

•s,,••

h2"07 .18 MC'

11 WRITE

18 READ.. "

IC2b 4

..~'"...

74HCT645

14 Rl

" "12 Rl

" "

CfL~J

o~~~~~

os , • ~" • '" oa

" " " 00

" " " "" " " "., " " ~., " '" "" " " "" " " "" .. " ,~'" " .. STA05Eww, as ~ .~.0> at aa .,~ClDCK sa " RESET

-"+

"~Wirr

BiCHRDY , t 'w."~

'"~, ." B 7EN ,,., 4

,H",

'''''aassr • t • """

" ,["JC2a ~ IC2f ~lcU( r,=-tl~ ~12-"pa CLDCK~13~ur-_9·11·11

Fig. 1, This pe interface allows up to eight 1/0cards to be controlled. One 01 these is the digital multimeter.

ELEKTOR ELECTRONICS SEPTEMBER 1993

Page 3: FUZZY LOGIC MULTIMETER (PART 1) - کانون الکترونیکcdn.eleinfo.ir/el1990-1999/pdf/1993/e939036.pdf · 2008-12-05 · FUZZY LOGIC MULTIMETER (PART 1) AUTORANGING, ... ELEKTOR

TEST AND MEASUREMENT

J

...,.,.,...,...,.....,.,..

JFig.2. pes artwork for the pe insertion card (double-sided, through-plated).

high er address lines. No access with-out this key! The first three of the(rarely used) high address lines, AIO,All and A12, are used by the interfaceto address one of the cards on theMicroSystem bus. This is achieved viaIC5 whjch decodes AlO, All and Al2into etght individual card selection!ines (KO-K7J, one of which can be ac-ttve at a time. Further , address linesAl3 and A14, together wtth AO, Al andA2, are buffered by lC 1, after whichthey are used as regtster address lines.In this way. up to 32 registers are cre-ated [if necessary) at every card ad-dress. Circuit ICI buffers a couple ofpe cxtcnsion 810t signats, and putsthem on to the bus. Je7 does the samewith the PC's databus stgnals.

lnterrupt requests are conveyed tothe pe via three-state buffers con-tained in IC6. If the MicroSystem busdoes not supply interrupts (NMI orINT), the outputs of the buffers areswttched to high impedance. In thiscondtttcn, the PC's interrupt lines are'free' for other interrupt sourees. If theMicroSystem bus does generate an in-terrupl request, the output of the rele-vant buffer goes high, and causes antntcrrupt on the PC. Jumpers allowyou to select the mtcrrupt line used inthe PC. The seleclion should be madecarefully, since choosing a line that isalready used by another extensioncard in the PC may upset the operation

COMPONENTS LIST

PClNTERFACE

Resislors:1 10kO3 lkO1 8-way 1OkO81L2 1000

RlR2;R4;RSR3R6;R7

Capacitors:3 100nF1 1OfLF2SV

Cl;C3;C4C2

Semiconductors:2 74HCT64S1 74061 74HCT6881 74HCTOO1 74HCT1381 74HCT12S

IC1;IC7IC2IC3IC4ICSIC6

Miscellaneous:1 34-way box header,

angled pins K12-way PCB terminal block,Smm pitch K2

1 6-way DIP switch 812 34-way IDCsocket1 Printed circuit board 920049-2 (see

page 78)

ELEKTOR ELECTRONICS SEPTEMBER 1993

Page 4: FUZZY LOGIC MULTIMETER (PART 1) - کانون الکترونیکcdn.eleinfo.ir/el1990-1999/pdf/1993/e939036.pdf · 2008-12-05 · FUZZY LOGIC MULTIMETER (PART 1) AUTORANGING, ... ELEKTOR

of the entire system. Stncc the controlof the DMM does not requtre inter-rupts, it is best to fit no jumpers at aIlIf this extenston ts used on theMicroSystem. If you want to knowwhich interrupt is still free in your sys-tem, use a J'C diagnostic program suchas MSO (MicroSoft Diagnostics 2.0),which is supplied with Windows 3.1(but can be used without Windows. i.e,run from the DOS prompt).

The supply voltage selection on thebus ts also made with the aid of ajumper. The options available are+5 V, +12 V or an external voltage con-nected to K2. The advantages of an ex-ternal power supply over the one in thePC are mainly a cleaner output voltageand a htgher maximum current.

The artwork of the printed circuitboard designed for the PC interface tsgiven in Ftg. 2. Constructton of thiseard is straightforward. and requtresno further discussion. The printed cir-cutt board is available ready-madethrough our Readers Services. The de-fault jumper settings are as follows:JP3 fitted (no further interruptjumpers fitted), JP8 fitted, JP9 toground, JPIO to +12 V. The DIP switchblock allows the base address of theinterface to be set between 200H and3F8H. This type of card is usuallymapped in the range belween 300Hand 31FH. The default address as-sumed here Is 300H, which Is set upby sliding all switches in SI, except theone nearest to JPl, to the 'on' position.

MAX134: neorlyeverything,. ,The main TC in the multimeter ctrcuttts the MAXI34 from Maxim Inc. Apartfrom a 3%.-digitA-D converter, it alsocontains nearly all the switches re-quired to build a complete OMM, andan associated computer interface. Theintegrated switches reduce the exter-nal component count considerably,and need to be complemented by onlya few external contacts to create theDMM's resistance ranges. The blockdiagram of the analogue part of theMAXI34 is shown in Fig. 3. The draw-ing also shows what is 'missing .fromthe chtp': resistors in the voltage di-vider that creates the measurementranges, a true-rms converter. a voltagereference, and a couple of filter compo-nents.

The MAXI34 ts capable of exchang-ing data with a PC via an on -chip in-terface consisting of a four-bitbidirectional data bus (00-03), threeaddress lines (AO,Aland A2) and twocontrol lines (read and wrtte). Ftgure 4shows the ttmtng diagram pertainingto a read and a write operation on theinterface. Remarkably, the addresshas to be stable for qutte a while before

ELEKTOR ELECTRONICS SEPTEMBER 1993

FUZZY LOGIC MULTIMETER (I)

~~~., ~VFUlIICII2

4VTQ

I~ ~.. ,.n. j'""• '" scmlCEi ~W/Z

,.. n 1000JllUG on ,,.. /

lIEf MI ~"""1.1111I0,.' 1.1111I0

0-.. t~t -c»111-1 L>. /

[ .......111-' I IOlkO IOlkOIEfU

[ i~ ,.''" ,.. I ,.n ,on

I~ ,.... ,.. <On <On!C~ ,..~·I ~

co•• a. CG•• I!II

o:.~R C -~ ."n ~.....MAXI......., """" 3D.

MAX133mRn.~ "MAX134

CIIHllur[ "tURM.1 w1R:.~lC m~ •OU~UT

I

C ~ I IITUUL I~c

~-KCGIMWTU

flL!E~on E~AC

RLnw""" m~,,,,nllllP OUT A.' I. ..l.Zlm FILTER FILTU...~, RESlIlOR RISlITOR""~, RrlmllllPUT47nf 41nF

II66oIYFOB$o1IZ

1

....'"Uf..T...SISTOAS

"n920049,11- 13

Fig. 3. Block diagram 01the analogue part 01the MAX134.The large number of switches con-tained in the IC enable the external component count to be reduced considerably.

the read or write pulse may be grven.The relevant times are 3250 ns (taccland 2500 ns (ta,)' which are quite longfor a Pö. Further on, you will see thatthts has been taken tnto account inthe destgn of the hardware and soft-ware. Table 1 indicates the type of dataread from. or wrtttcn to. the DMM addresses.

DMM cordThe complete circuit diagram of theOMM card is shown in Ftg. 5. Apartfrom the components already indicatedin the block diagram of Ftg. 3, the cir-cuit diagram shows the interface to theMicroSystem bus (JC4;ICe-IC9), a cou-pIe of computer-controlled digital out-puts (IC4, IC9 and ICII), apower

supply based on a voltage regulator(JC10),a voltage inverter (JC3), a true-rms converter (JC2)and, flnally, a ref-erence voltage source. We will discussthese sub-oircuits in reverse order.

The reference voltage source isheaded by a filter, R21-C8-C9-CIO,onthe +5-V rall. Next. the voltage is re-duced to 1.2 V by a high-precisionband gap reference diode, 05. The C-version of the ICL8069 used here has atemperature coefftcient of only 50 ppm'C·! (0.005% 'C'I). The 1.2 V is useddirectly as a reference for the resis-tance measurements (via ptn 32 ofICI), but it has to be halved to enableit to be used as a reference for the A-Dconverter. This is achieved with the aidof a voltage dtvider which consists oftwo precision resistars shunted by a

READ CYCLE

~ •• w. X

920049 • 11• 14

Fig.4. The timing of the control signals for the MAX134 is quite slow, and requires a soft-ware/hardware trick to keep the (much faster) PC happy.

Page 5: FUZZY LOGIC MULTIMETER (PART 1) - کانون الکترونیکcdn.eleinfo.ir/el1990-1999/pdf/1993/e939036.pdf · 2008-12-05 · FUZZY LOGIC MULTIMETER (PART 1) AUTORANGING, ... ELEKTOR

TEST AND MEASUREMENT

htgh-value multiturn preset (R23-R24-PI). This particular type of connectionaffords smooth adjustment while pre-servmg the stability of the potential dt-vider. The exact level of the referencevoltage depends on the mains Ire-quency to be suppressed. This will beeither 50 Hz or 60 Hz (selected via thecontrol software), The integration time

the number of clock cycles, tt has to beadjusted to match the mains fre-queney. The exact reference levels are:655 mV for 50 Hz, and 545 mV for60 Hz,

of the converter ideally covers exactlyone period of the mains voltage for op-timum suppression of hum picked upby the sensor or the ADC itself. At50 Hz. the period (integratton time)lasts 655 ADC clock cycles, or 545ADe clock cycles tf the mains fre-queney is 60 Hz. Since the referencevoltage is dependent on, among others. Continued next month

Most components used in thisproject are avaüable fromViewcom Electronics (see adverton pages 18 and 19).

svC+

sv(-

U'I n,i ~.tr.J"'CAV 5 ~

~ VIN IC2VOUT~'~_--r --,

A0736JN M:oJ'" '[

~'S COM cc ,0iJ

~ I' 9~ '",,~ -&'Q~V

L,,~J~~~~

07 30 29 D6

~00

00

""~""'",~

Sffi06E

es " ar

" " "" " "" ea "" " .." .. "" .. ts

" .. rasa " .."' .. •

tcse, , '", •~ .. ct,'"

"' , "" a.. ,,,,,

s••

00

0'ca00

~ ~2 10 C> 'V 19, ..· "· ..

~~ Vf.!.!-..

"..ts..""

74HCT574

1C9

IC5b 6 &

, ts

,0...~

00 , '00' aca •00 •00 ,00 r00 ," ,

Fig. 5. Circuit diagram 01the digital multimeter.

,.1 WRITE

:J:'J ~ p, • C12~~'~

~

oo. ~r'- • '00. n,.+.,OIi...SRC 32 ~ ~~k 16V W2

V REF 1!....- YJ.".jj..JO-"-+C~Cl ,'" ~CL8069C

,~o~"--1'........-{i I rR7INTlN:: MI(f [~

BUF2 OUT •.•

Ra .1 1%BUF10UT 34 ~

osca

'"cscr

fAIN..

FROUT ea

FFlIN "CUAIN

aa

" ".., ..

10H(..

• ~· ".--' "

" ~" ~• 'OC

[.;;;;-"BEEPER

00'0.., OGNO OUT

",

..-a

"

rcs ,",74HCT08sv+

C2S 20 16 20 ZD 211

1~~~~~~~~.

t> V 151te

"..

74HCT574

rs..""

"",.,

G~~

"~

BVV27-100

00

,

• '0.. ,." "

.."..

~

': H!'

""",cea

JIW~9_1I·\2

-

ELEKTOR ELECTRONICS SEPTEMBER 1993

Page 6: FUZZY LOGIC MULTIMETER (PART 1) - کانون الکترونیکcdn.eleinfo.ir/el1990-1999/pdf/1993/e939036.pdf · 2008-12-05 · FUZZY LOGIC MULTIMETER (PART 1) AUTORANGING, ... ELEKTOR

~EST AND MEASUREMENT

ID CIIID CIIID CIIID CIIID CIIID CIIID CIIID.CIIID CIIID CII

~

IDCII

ID CII

ID

J

Fig. 2. PCB artwork for the PC insertion card (double-sided, through-plated).

o

higher address lines. No access with-out this key! The first three of the(rarely used) high address lines, AIO,All and A12, are used by the interfaceto address one of the cards on theMicroSystem bus. This is achieved viaIC5 which decodes AIO, All and Al2into etght individual card selectionlines (KO- K7), one of which can be ac-tive at a time. Further, address linesAl3 and A14, together with AO,Al andA2, are buffered by ICI, after whichthey are used as register address lines.In this way, up to 32 regtsters are cre-ated (tf necessary) at every card ad-dress. Circuit ICI buffers a couple ofPC extension slot stgnals, and putsthem on to the bus. IC7 does the samewith the PC's databus stgnals.

.Interrupt requests are conveyed tothe PC via three-state buffers con-tained in IC6. If the MicroSystem busdoes not supply interrupts (NMI orINT), the outputs of the buffers areswitched to high impedance. In thiscondition, the PC's interrupt lines are'free' for other interrupt sources. If theMicroSystem bus does generate an in-terrupt request, the output of the rele-vant buffer goes high, and causes aninterrupt on the PC. Jumpers allowyou to select the interrupt line used inthe PC. The selection should be madecarefully, since choosing a line that isalready used by another extensioncard in the PC may upset the operation

COMPONENTS LIST

PCINTERFACE

Resistors:1 10kQ3 1kQ1 8-way 10kQ SIL2 100Q

R1R2;R4;R5R3R6;R7

Capacitors:3 100nF1 10J.l.F25V

C1;C3;C4C2

Semiconductors:2 74HCT6451 74061 74HCT6881 74HCTOO1 74HCT1381 74HCT125

IC1;IC7IC2IC3IC4IC5IC6

Miscellaneous:1 34-way box header,

angled pins K12-way PCB terminal block,5mm pitch K2

1 6-way DIP switch S12 34-way IDC socket1 Printed circuit board 920049-2 (see

page 78)

ELEKTOR ELECTRONICS SEPTEMBER 1993