Robotic Project - published paper

4
lnterfacing Polaroid Ultrasonic Sensor to lntel SDK-85 Microprocessor by Farrokh Attarzadeh, University of Houston Robert Rosier, University of Houston Abstract This paper considers the interface of the Polaroid Ultrasonic Ranging Kit (PURK) to the lntel System Development Kit-85 (SDK-85). The interlace provides an autonomous robot with visual perception, A rcliable haldware interface is developed, using existing interracing theory. Logic devices are recommended and a diagram ol the resulting 8-bit inport is shown. A software routine is provided wlth a description of operation. The SOK-85 microprocessor under program control manipulates the hardware inport, inputs the distance reading of the PURK, and then stores it lor further processing. Software and hardware implementations are balanced for optimal interface response. Keywords: interfacing, microprocessor, ultrasonic ranging, robotics vision, mobile tobot. INTRODUCTION Autonomous robots that can detect motion, avoid obstacles, and calculate distances are becoming a reality due to Polaroid's development of the ultrasonic ranging technology which focuses cameras automatically. The Polaroid Ultrasonic Ranging Kit (PURK) was developed from ultrasonic technology for consumer tests and experimentation. With Polaroid's PURK and is operating handbook, tests and experiments for special applications can be conducted. The application described in this paper involved interfacing the PURKT to the Intel System Development Kit-85 (SDK-85)'z in order to provide an autonomous robot with primitive visual perception. The PURK consists of a transducer, an ultrasonic ranging board, and an Experimental Development Board (EDB). A block diagram of the PURK is shown in Figure L The transducer transmitts the outgoing ultrasonic signal and then functions as a microphone to receive the reflected signal. The ultrasonic board controls the operating mode of the transducer (transmit/receive). It contains the driving, receiving, and processing circuitry for the transducer. The EDB measures the time interval required for an ultrasonic signal to be transmitted and the reflected signal to be received, then the EDB displays the calculated distance. The time interval is directly related to the obstacle's distance from the transducer. Distances in the range of 0.2743m to 10.668m are calculated 5 times a second. The EDB is designed so that various systems can be interfaced to it. The balance between hardware and software implementation had to be resolved before an algorithm could be developed. Most of the development covered in this paper was concentrated around this basic problem. The synchronization of SDK-85 signals to PURK signals and the signal's level compatibility were other problems to overcome. 12 I Journal of Engineering Technology A solution using the timing diagrams provided in the PURK operator's handbook in conjunction with known interhcing technology was formulated. The PURK's operating handbook proved to be an invaluable guide in resolving the differences in timing requirements between the PURK and the SDK-85. Figure 1 PURK Interconnections After developing several prototypes, a workable interface was constructed. The interface can be modified for any microprocessor system. Figure 2 shows a block diagram of the system. The first part of this paper explains the important signals and their meanings, The second part considers the modifications required to existing PURK circuitry. Hardware and software implementations are discussed in parts three and four. The conclusion provides possible expansion of the system. Figure 2 Block Diagram of PURK's Interface to a SDK-85 SIGNAL DESCRIPTIONS In order to design an interface for the PURK and SDK-85, working knowledge of these devices is necessary. Most important are the status and data signals produced by both devices. The status signals of the PURK are used by the SDK's microprocessor for device synchronization. Microprocessor EDB CIRCUIT BOARD ULTRASONIC CIRCUT MARD (c,

Transcript of Robotic Project - published paper

Page 1: Robotic Project - published paper

lnterfacing Polaroid Ultrasonic Sensor to lntelSDK-85 MicroprocessorbyFarrokh Attarzadeh, University of HoustonRobert Rosier, University of Houston

Abstract

This paper considers the interface of the PolaroidUltrasonic Ranging Kit (PURK) to the lntel SystemDevelopment Kit-85 (SDK-85). The interlace providesan autonomous robot with visual perception, A rcliablehaldware interface is developed, using existinginterracing theory. Logic devices are recommendedand a diagram ol the resulting 8-bit inport is shown.A software routine is provided wlth a description ofoperation. The SOK-85 microprocessor under programcontrol manipulates the hardware inport, inputs thedistance reading of the PURK, and then stores it lorfurther processing. Software and hardwareimplementations are balanced for optimal interfaceresponse.Keywords: interfacing, microprocessor, ultrasonicranging, robotics vision, mobile tobot.

INTRODUCTION

Autonomous robots that can detect motion, avoid obstacles,and calculate distances are becoming a reality due to Polaroid'sdevelopment of the ultrasonic ranging technology whichfocuses cameras automatically. The Polaroid UltrasonicRanging Kit (PURK) was developed from ultrasonictechnology for consumer tests and experimentation. WithPolaroid's PURK and is operating handbook, tests andexperiments for special applications can be conducted. Theapplication described in this paper involved interfacing thePURKT to the Intel System Development Kit-85 (SDK-85)'zin order to provide an autonomous robot with primitive visualperception.

The PURK consists of a transducer, an ultrasonic rangingboard, and an Experimental Development Board (EDB). Ablock diagram of the PURK is shown in Figure L Thetransducer transmitts the outgoing ultrasonic signal and thenfunctions as a microphone to receive the reflected signal. Theultrasonic board controls the operating mode of the transducer(transmit/receive). It contains the driving, receiving, andprocessing circuitry for the transducer.

The EDB measures the time interval required for anultrasonic signal to be transmitted and the reflected signalto be received, then the EDB displays the calculated distance.The time interval is directly related to the obstacle's distancefrom the transducer. Distances in the range of 0.2743m to10.668m are calculated 5 times a second. The EDB is designedso that various systems can be interfaced to it.

The balance between hardware and softwareimplementation had to be resolved before an algorithm couldbe developed. Most of the development covered in this paperwas concentrated around this basic problem. Thesynchronization of SDK-85 signals to PURK signals and thesignal's level compatibility were other problems to overcome.

12 I Journal of Engineering Technology

A solution using the timing diagrams provided in thePURK operator's handbook in conjunction with knowninterhcing technology was formulated. The PURK's operatinghandbook proved to be an invaluable guide in resolving thedifferences in timing requirements between the PURK andthe SDK-85.

Figure 1

PURK Interconnections

After developing several prototypes, a workable interfacewas constructed. The interface can be modified for anymicroprocessor system. Figure 2 shows a block diagram ofthe system. The first part of this paper explains the importantsignals and their meanings, The second part considers themodifications required to existing PURK circuitry. Hardwareand software implementations are discussed in parts three andfour. The conclusion provides possible expansion of thesystem.

Figure 2Block Diagram of PURK's Interface to a SDK-85

SIGNAL DESCRIPTIONS

In order to design an interface for the PURK and SDK-85,working knowledge of these devices is necessary. Mostimportant are the status and data signals produced by bothdevices. The status signals of the PURK are used by the SDK'smicroprocessor for device synchronization. Microprocessor

EDB CIRCUIT BOARD

ULTRASONIC CIRCUT MARD

(c,

Page 2: Robotic Project - published paper

control signals are combined to input the distance dataproduced by the EDB. Figure 2 indicates the signal flow.

LE:

LE is an EDB-generated signal. A low to high transitionindicates that the reflected signal has been detected and thedistance calculated. The microprocessor checks for thiscondition to synchronize itself to the EDB. When this initialtransition takes place, the distance data is inputted and storedin the SDK's memory.

Qe - Q3:

These four signals represent the BCD value of thecalculated distance. They are transferred from the EDB tothe SDK-85 by the microprocessor's IN instruction. Thedistance is represented with three significant BCD figureswhich are the tenth's, unit's, and ten's position. Each BCDdigit is multiplexed on the input of the inport at regularintervals.

DSI:

DSl is an EDB-generated signal whose active lowcondition indicates that the corresponding data (Qg - Q3)is the tenth's BCD value of distance. the microprocessor checksfor this low condition.

DS2:

DS2 is the same as DSl, except it indicates the unit's BCDvalue of distance is on the QO - Ql lines.

DS3:

DS3 is the same as DSl, except it indicates the ten's BCDvalue of distance is on the Qg - Q3 lines.

IO/M, RD AO

These signals are produced by the SDK-85'smicroprocessor. Combination of these signals produces anenable signal to control data transfer.

SYSTEM MODIFICATION

Only one modiflcation to the existing PURK system wasnecessary but successful interface operation depended on it.The modification to the EDB required pin 4 of MC145533to be disconnected from pin 9 of MC140403 and connectedto pin 4 of MC14O[0. This modification expands the pulsewidth of DSl, DS2, and DS3 from 4.8 ps to 169,5 ps. Thisalso increases the valid distance width (Qg - Q:) to 169.5 ps.

The software routine requires 17.28 ps to input a status

signal (DSl, DS2, DS3), verifu it, input the distance data,and store the data in memory. The modification provided thesoftware routine with a sufficient time span to perform itsstated function. Figure 3 shows timing diagrams for DS1, DS2,DS3, and QO - Q:.

**

Figure 3Timing Diagram of DS and Q Signals

HARDWARE INTEREACE

The hardware interfuce had to deal with two basic factors.These were: (1) the interface of CMOS logic levels of the EDBto TTL logic levels of the SDK-85 in a 5-volt system and (2)microprocessor control of status and data entry.

CMOS to TTL interface required the translation of CMOSlogic levels to TTL logic levels with the CMOS device requiredto handle the higher currents of TTLJ Several CMOS devicesexist that can accomplish the logic translation and handle thecurrent requirements. The CD4049UB, CD405OB, andCD404IB were chosen because they can drive two TTL gates

in a 5-volt system. Figure 4 shows the connection of a CMOSoutput to a TTL input in a 5-volt system.

Figure 4CMOS to TTL Interface

Status and data entry from the EDB must be controlledso that the microprocessor can access it when needed forprocessing. A 74L5125 tri-state buffer accomplishes thisfunction.s The 74L5725 is connected to form a 4-bit inportto the SDK-85. A TTL NAND gate combines microprocessorcontrol signals. The:gr.rblatiqqptglq.oprocessor controlsignals produces an Inport Enable Signal which activates theinport. This allows the entry of data from the EDB to theSDK-85. Figure 5 shows this interface

Many different IC configurations of CMOSbuffers/inverters, TTL tri-state buffers, and TTL NAND gatescould have been utilized. The selection depends on theapplicatons and parts availability. One octal CMOS bufferdriving one octal TTL trlstate buffer is the most efficientconfiguration for the SDK-85's 8-bit processor. For this

Spring 1987 I 13

Page 3: Robotic Project - published paper

t0/M

+5V

Inport Enable Signal Produced by NandCombination of SDK-85 Signals

interface, two Quad CMOS buffers and two Quad TTL tri-state buffers were used to form an 8-bit inport. Therequirements of inputting the EDB's status and data signals(8 inputs) and microprocessor control of data entry are shownin the diagram, Figure 6.

SOFTWARE IMPLEMENTATION

Software impJementation was the most critical aspect ofthe design. The program had to account for three things; (1)

the timing of the signals produced by the PURK, (2) theexecutiontiming of the software routines by the SDK-85, and(3) their synchronization of these timing signals.

By enabling the inport, shown in Figure 6, the SDK-85under program control inputs the status information. Tosynchronize the SDK-85 with the EDB, status signal LE ischecked by the program for a low and then a high logic levelusing input and comparison instructions.

DSI:

Figure 6Composite Diagram of Hardware Interface

After this initial synchronization, the SDK-85 inputs andchecks status signal DSl for a low logic level. A low indicates DS2:that Q6 - Q3 on the inport represent the BCD unit's digitof the calculated distance. The BCD digit is inputted into thedata bus of the 8085 by an IN instruction and stored in amemory location. Theprogram check both the DS2 and DS3,then inputs and stores their data in successive memorylocations.

14 / Journal of Engineering Technology

The distance calculated is represented by three BCD digits,stored in three successive memory locations. The first digitrepresents the tenth's position; the second digit, the unit'sposition; and the third, the ten's position. Each positional valuemust be entered and then stored by the program.

Inputting and checking each status signal plus storing thecorresponding BCD digit requires 17.28 ps execution timeper digit. (Inputting and checking status signals, plus storingthe corresponding disance values requires 54 cycles. SDK-85'smicroprocessor has a period of 320 ns; therefore, 54 cyclestimes 320 ns gives an execution time of 17.28 p,s.) The stablepulse width value of each digit is 169.5 ps. The programexecution time stays well within these timing constraints ofthe PURK. Figure 7 is the program written to provide reliableoperation and to stay within the timing requirements of thePURK.

The efficient usage of 8085 assembly language instructionsallowed the inputting of distance data produced by the PURK.Simple routines controlled synchronization of signals and dataentry.

Distance Subroutine

This subroutine interfaces the EDB to the SDK-85. Thesubroutine first polls for the 'LE' signal which indicates thatthe echo signal has been received. The SDK-85 then checksfor the tenth's status and when it is received, stores the BCDquantity in memory. The same is done for the unit's and ten'sBCD digits.

DISTANCE: ORG 2000H ;starting locationLXI H, MEMORY ;set storage location of

;distanceAGAINI: IN OlH ;input data (enable

;inport)ANI 08H ;isolate LE and check

;for low levelJNZ AGAIN1 ;not low, try again

AGAIN2: IN OlH ;low, input data

;(enable inport);isolate LE and check

;for high level

;not high, try again

;high, input daa;(enable inport);isolate DSI and check;for low level

;not low, try again

;low, input data;(enable inport);isolate tenth's BCD;store in memory;advance memory;pointer;input data (enable

;inport);isolate DS2 and check;for low level;not low, try again;low, input data;(enable inport)

Dst

DS,

EDB DS3

LEANI O8H

JZ AGAIN2IN OIH

ANI OlH

JNZ DS1TN OIH

ANI OFOH

MOV M,AINX H

IN OlH

ANI O2H

JNZ DS2IN OlH

Page 4: Robotic Project - published paper

DS3:

AM O4H

JNZ DS3IN OlH

ANI OFOHMOV M,A

MEMORY DS O3H

RET ;return to the calling;program

Figure 7Assembly Program for Software Implementation

CONCLUSION

In this paper, the Folaroid lJltrasonic Ranging Kit (PURK)was interfaced to the System Development Kit-85 (SDK-85)using existing interface theory and 8085 instructions. Thisenables an autonomous mobile robot to sense motion, detectobjects, and calculate distances. With modifications, anymicroprocessor system can use the resultant interface.

Future modifications of the PURK will allowmicroprocessor control of ranging functions to multipletransducers. This would provide a mobile robot with increasedperception, but would require a more complex hardware andsoftware scheme.

A demultiplexer whose output is microprocessor-controlled can be used to enable switching relays. The relayscan in turn gate the generated ultrasonic signal to one of a

number of transducers. Relays are recommended for theswitching medium, because 300 volts are applied to thetransducer during signal transmission. Relays which canhandle this voltage across their contacts are readily available.The most important advantage is the lower cost of a relayfor each transducer, compared to the cost of a PURK for eachtransducer.

Software modification for future expansion requires thata program (l) select one of the multiple transducers byproviding a select code to a decoder and (2) initiate ranging

functions with a subroutine-generated switching signal. Thisswitching signal initiates ranging action. Both tasks can beperformed with the standard 8085 instruction set.

REFERENCES

l. Uhrasonic Ranging System Manual arud ,Mdendum,Polaroid Corporation, Cambridge, Massachusetts, 1980.

2. SDK-85 System Design Kit User's Manual, IntelCorporation, Santa Clara, California, 1978.

3. Motorola CMOS Databook, Motorola Corporation,Austin, Texas, 1978.

4. Lancaster, Don, CMOS Cookbook, Howard W. Sams &Company, Indianapolis, 1984.

5. Lancaster, Don, TTL Cookbook, Howard W. Sams &Compahy, Indianapolis, 1982.

Farrokh Attarzadeh is an Assistant Protessor of Electrical andElectronics Technology at the University of Houston, Houston,Texas. He holds a B.S.E.E. (1970) from California State PolytechnicUniversity; an M.S.E.E. (1972) from California State Univercity, tongBeach; and a Ph.D. (1983) in Electrical Engineering from theUnivercity of Houston. Prior to entering the teaching prcfession,he was with Brown & Root, lnc., and Fluor Engineel€, lnc., bothengineering and construction companies in Houston. He taughtcomputer programming languages atthe College of Technology,University of Houston, for over five yearc on a part-time basisbetorc ioining the laculty of the Electrical-Electr6nics Departmenton a full-time basis in 1983. At prcsent he is teaching compuielhardware and software coursies and ass.embly languageprogramming, and actively doing rcsearch in the field ol robotics.He has established a robotics research laboratory in the Collegeand directs and supervises several upper-division students invarious phases ol the ongoing robotics-related proiects. He isa Registered Professiona! Engineer in the State of Texas and amember of ASEE, SME, Rl, and lSA.

Robert Rosier is a senior in Electrical and Electronics EngineeringTechnology at the Unaversity of Houston. His work experienceincludes five years as a field service engineer with 3M Corporationand Texas American Microfilm. He is currently working as a

teaching assistant in the ELET Department. He studied digitalelectronics at Elkins lnstitute and Devry lnstitute ol Technologybelore coming to the University of Houston. Mr. Rosier has beenon the Dean's List since ioining the University ol Houston, andhe is a member of Tau Alpha Phi Honor Society.

ANI OFOHMOV M,AINX H

IN OlH

;isolate unit's BCD;store in memory;advance memory;pointer;input data (enable

;inport);isolate DS3 and check

;for low level;not low, try again;low, input data;(enable inport);isolate ten's BCD;store in memory;allocate three memory:locations

Spring 1987 / 15