Professional Documents
Culture Documents
[?]Subscribe
ToThisSite
ClaimYour:Useful
CustomSearch
"ArduinoSoftwareGuide"
SignupforMicroZine:
''The''Microcontroller
Newsletter
RightNow...
Enteryourfirst
Nameandprimary
emailaddressinthe
formbelow:
Name:FirstName
Email: PrimaryEmail
Home
PICIntroduction
PICProgramming
ProgrammerTypes
PICProjects
ProjectIdeas
TIPS&Techniques
PICTutorials
AboutMe
ContactMe
CustomerSupport
TermsofUse
SearchThisSite
DigitalDownloads
Articles
Forum
MicroBlog
Oscilloscopes
Books
ResourceLinks
SiteMap
PrivacyPolicy
Andreceiveabsolutely
FREEafullprojectfor:
Download
"Measuring
AnalogueVoltages
WithoutAnADC"
(Usingonlyonepin).
InstantDownload:
YouCan
GetItRightNow
Warning:This
projectcouldbe
Removed
atanytime.
OpticalDistanceMeasurement
Registeringacompany?
regus.co.za/Virtual_Office
ReduceyourOfficeCosts.GetaVirtualOfficeinstead!
NIRLaserAnalysis
oceanoptics.com/application/
MeasureNIRLaserswithhighresminiaturespectrometers
GanttChartTemplate
smartsheet.com
Yes,it'seasy.Nothingtoinstall.TryitFree!
Lasermeasurement
scientechinc.com
Scientechlaserpowerandenergymeasurementsystems
MadeintheUSA
microns.
Thisproject,anopticaldistance
measurementfrom1993,Shows
howtomeasuredistanceaccurate
upto1micronbymeasuringthe
phasedifferenceofareflectedbeam
oflight.
Alightbeam,usingeitheralaser
diodeoralightemittingdiode,is
reflectedoffofanobjectandthe
reflectedlightbeamiscomparedto
thetransmittedlightbeam.The
differenceinphasebetweenthetwo
allowsacuratemeasurementofthe
distancebetweentheobjetcstoan
accuracyotbetween1and10
ItwillNOTbe
available
indefinitelySO
Toavoid
disappointment
getit:
Now
Name:
FirstName
EMail:
PrimaryEmail
FREEAccessHere
Don'tworryyouremail
addressistotallysecure.I
promisetouseitonlyto
sendyouMicroZine
Rememberthisisaproject
withfulldescription
andfullydebuggedCSource
codeandit'snotavailable
fromthemainwebsite.
Youcanonlygetit
throughthisnewsletter.
Togetexclusiveaccess
EnteryourfirstnameName
andprimaryemailaddress
Nowintheformabove.:
Butwait!
There'smore...
You'llreceivemore
freeandexclusive
reportsaswellas
siteinformationand
ExecutiveSummaryoftheOpticalDistanceMeasurement
Alightbeamencoderformeasuringabsolutedistanceoveralinearpathwithan
accuracyofatleastthatprovidedbyincrementalopticalencoders,butoverlonger
rangesthancanreadilybeachievedwithopticallinearencodersduetothe
difficultyofprovidingasufficientlylongopticalscalewiththerequisiteaccuracy
andresolution.
siteproduct
updates.
Scrolluptotheformabove
andsignupNOW.Don't
forgetit'sFREEandifyou
don'tlikeityoucan
unsubscribeatanytime.
Theresolutionprovidedbythelightbeamencodercanbeapproximately110
microns.Ahighfrequencyamplitudemodulatedlightbeamisreflectedbya
ClickHereNowtousethe
reflectordisposedatthedistancetobemeasured,andthephaselagofthe
formabovetogetyour
reflectedlightbeamisdeterminedtoprovideanabsolutemeasureofthedistance.
Valuableinformation
absolutelyfree.
Theencodermixesalocaloscillatorsignalgeneratedbyaphaselockedloopwith
bothareferenceoscillatorsignalandthedistancesignal.Thus,theheterodyne
mixersprovidetwolowfrequencysignalspreservingthephaselagbetweenthe
twoopticalsignals.Inapreferredembodiment,highresolutioncomputationofthe
phaselagisaccomplishedwithamicroprocessorreceivingprecisecrossovertime
informationindicatingtimedelaysandperiodsoverseveralcyclesofthelow
frequencysignalsusinglinearandnonlinearfilteringandaveragingalgorithms.
Projects
Distance
Optical
BackgroundoftheOpticalDistanceMeasurement
Opticalglassscalelinearencodersareknownformeasuringdistancesalonga
linearpathbydetectinglightreflectedfromortransmittedthroughalinearly
extendingglassscale.Therangeofdistancesoverwhichsuchencodersoperate
maybelimitedduetothedifficultyofprovidingasufficientlylongglassscalewith
therequisiteresolutionandaccuracy.
Anothertypeoflinearencoderisalaserinterferometer.Whilethistypeof
encodergenerallyprovideshighaccuracyandresolution,suchencodersrequire
coherentradiation,wavelengthstabilizedlasers,areveryexpensive,dependupon
incrementalcountingofinterferencecycles,andprovidenozeroreferenceindex
asadatumpoint.
Electronicdistancemeasurementsystems(EDM)areknownformeasuring
relativelylongdistances,suchasinlandsurveying.Thesesystemsoperateby
generatinganamplitudemodulatedlightbeamusingalaseroralightemitting
diodeanddeterminingthedistancebythephaselagofthebeamreturningfroma
reflector.
Phaselagismeasuredbycountingtimeclockincrementsbetweencrossovers
fromthetransmittedbeamtothereceivedbeam,providingresolutionsaroundone
millimeter.Coarsemeasurementsarefirstmadeusinglowfrequencymodulation
followedbyhighermodulatingfrequenciesfortherequiredresolution.
KnownEDMsystemsarenotcapableofachievingveryhighresolutionsandhigher
resolutionsarenotneededforEDMuse.
SummaryoftheOpticalDistanceMeasurement
Alightbeamencodermeasuresabsolutedistancesoveralinearpathwithan
accuracyofatleastthatprovidedbyincrementallinearencoders,butoverlonger
rangesthanarereadilyachievablewithopticallinearencoders.Theresolution
achievablewiththepresentlightbeamencoderisapproximately110microns.
Ahighfrequencyamplitudemodulatedlightbeamisreflectedbyareflector
disposedatthedistancetobemeasured.Thereflectedlightbeamprovidesahigh
frequencyphaseshifteddistancesignal,thephaselagofwhichisindicativeofthe
distancebetweenthelightbeamsourceandthereflector.
Theencodermixesalocaloscillatorsignalgeneratedbyalownoise,phaselocked
loopwithbothahighfrequencyreferencesignalandthehighfrequencyphase
shifteddistancesignal.Thephasedifferenceispreservedinthetworesultinglow
frequencysignals.Inordertoachievethehighresolutionrequiredforencoder
purposes,phaselagiscomputedfrommeasurementsofbothtimedelaysand
periodsoverseveralcyclesofthetwolowfrequencysignals.
Inordertoaccomplishthehighresolutionsneededforencoderpurposes(110
microns),signalsensingisaccomplisheddowntobasiccircuitnoiselevelsand
componentstabilitylevels,requiringoptimaltradeoffsbetweenspeedofresponse
andultimateresolutioninposition.Oneembodimentprovidesadaptivedigital
filteringyieldingfastdynamicresponsewithmoderateresolutionathighinput
velocities,butswitchingtohigherresolutionwithslowerresponseasthemotion
slowsdownforfinalsettling.
Thepresentdesignusesalightbeamproduced,forexample,byeitheralaser
diodeoralightemittingdiode.Moregenerally,anycollimatedlightbeamcanbe
usedinthepresentdesignsinceitisthephaseoftheamplitudemodulatedlight
beam,asopposedtoacoherentopticalwavelengthphase,thatisrelevanttothe
performanceofthelightbeamencoder.
SocialBookmarking
Click&Add:
Blink
Del.icio.us
Digg
Furl
Google
Simpy
Spurl
Technorati
Y!MyWeb
Readerscomments
"Iwantedtothank
yousososomuch
foralltheinformation
youhaveprovidedin
yoursiteit's
SUPERBandFANTASTIC."
RanishPottath
"Thissitereallyis
thebestandmyfavorite.
Ifindheremanyuseful
projectsandtips."
Milan
bursach<at>gmail.com
LearnPICCNow
Wondering
howto
programyour
nextproject
usingCand
needagreat
start?
"FirstModule
Free:"CLICK
HERE
"Awesomesite,
very,veryeasyandnice
tonavigate!"
Theencoderofthedesignincludesacornerreflectorwhichismovablealongthe
measurementpath,andadetectorforreceivingalaserbeamreflectedbythe
cornerreflector.Thelaserbeamsourceisamplitudemodulatedbyareference
oscillatorsignalandthedetectorconvertsthereflectedlightbeamintoahigh
frequencyphaseshifteddistancesignalwithaphaseshiftrelativetothephase
ofthereferenceoscillatorsignal.
Matt
matt_tr<at>
wolf359.cjb.net
"IamanewbietoPIC
andIwantedtosay
howgreatyour
sitehasbeenforme."
Inoneembodiment,thelightbeamencoderincludesanRFsectionwhichprovides
thereferenceoscillatorsignal,alocaloscillatorsignal,andalowfrequencyphase
referencesignal.
Alsoprovidedisaheterodynesectionwithamixerwhichreceivesthehigh
frequencyphaseshifteddistancesignalandthelocaloscillatorsignal,and
generatesalowfrequencydistancesignal,shiftedinphasebythesameamount
asthehighfrequencydistancesignal.Thelowfrequencydistancesignaliscoupled
toastablehighresolutioncrossoverdetectoramplifier(CRA)whichyieldsa
squarewavesignalwithhighresolutiontransitions.
Ameasurementsectionincludesatimeintervalcounterthatreceivesthelow
frequencydistancesquarewavesignal,aphasereferencesquarewavesignal,and
ahighfrequencyclocksignal,whichmaybederivedfromthehighfrequency
referenceoscillatorsignal.Thetimeintervalcountercontinuallycountstheclock
signalandlatchesthecountvaluesatthetwosquarewavetransitioninstantsof
bothsquarewavesignals,transmittingthecountdatatoamicroprocessorsection.
Themicroprocessorsectionreceivesthetimeinstantdataandcomputesthephase
angleasaratioofthedelaystothecycleperiodsbetweenreferenceand
distancesignalpaths.Redundantandaveragedcomputationsarescaledand
filteredtoprovidehighresolutiondistancesignals.Thecomputationsmayalso
providecompensationcorrectionsfromperiodicrecalibration,ifneeded,andfrom
airdensitytransducersindicatingchangingenvironmentaleffectsonlightbeam
velocity.
Figure1:Isablockdiagramofanembodimentofthelightbeamencoderof
theinvention
fortheopticaldistancemeasurementdevice
Dave
de_scott<at>bellsouth.net
LearnMicrocontrollers
"Interestedin
Microcontrollers?"
SignupforThe
Free7dayguide:
FREEGUIDE:
CLICKHERE
"Yoursiteisagreat
andperfectwork.
congratulations."
Suresh
integratredinfosys<at>
yahoo.com
"Icouldn'tfindthecorrect
wordstodefine
yourwebsite.
Veryuseful,uncovered,
honestandclear.
Thankssomuchfor
yourtimeandworks.
Regards."
Anon
DescriptionoftheOpticalDistanceMeasurement
ReferringtoFIG.1,alightbeamencoder10formeasuringdistanceoveralinear
pathincludesanRFsection11,alaserencodersection26,aheterodynesection
40,ameasurementsection24,andamicroprocessorsection60.Acorner
reflector34isattachedtoadevicelocatedatadistanceDfromareference
location,wheredistanceDistobemeasured.
Moreparticularly,thecornerreflector34ismoveablealongthelinearpathin
accordancewiththedevicehavingadistancetobeencoded.Thedistanceis
measuredbydeterminingthephaselagofanamplitudemodulatedlightbeam
directedtowardandreflectedbythecornerreflector34,aswillbedescribed.
Referringtotheencodersection26,thelightbeamtravelsoverthetotaldistance
2Dwithavelocityofc=3.times.108meter/second(actualvelocityinairisslightly
lessandiscompensatedforusingairdensitytransducers).Thusthetransittime
forthebeamoverthepathwillbe:
Forexample,ifD=1.5meters,thetransittimebecomes108seconds,or10
nanoseconds.Iftheamplitudemodulationfrequencyis100Mhzwithaperiodof10
nanoseconds,aphaselagof360willbeseenatthereceiver.Forlesser
distances,thephaselagbecomes:
Todetectadistanceincrementto10micronsresolution,thecorrespondingphase
lagmustbedetectableto:
Thisis100.times.finer
resolutionthanisrequiredbyalandsurveyingEDMforonemillimeterresolution.
Othermodulationfrequenciesandresolutionrequirementscanbeselected,for
example:
f
75Mhz
2.0M/cy
10uM
.0018
300Mhz
0.5M/cy
1uM
.00072
Stable,highresolutionsensingofsmallphaseincrementsisaccomplishedwiththe
newtechnologiesofthisdesign.Theencoderoperatingrangecanbeextended
overmultiplecyclespanswithverylowresolutionencodingusingthewellknown
"V"or"U"scanlogicwiththelightbeamencoderhighresolutiondistancereadout.
Apreferredimplementationisaccomplishedwithinthelightbeamencoderby
periodicswitchingofthereferenceoscillatorfrom100MHzto10MHz,thus
providinga10.times.1.5meteroperatingrange,or15meters.
TheRFsection11includesareferenceoscillator12forprovidingareference
oscillatorsignalf 1havingareferencephase,suchaszerodegrees.Aphaselocked
loopmixerisprovidedandincludesaphasedetector14,afilter16,avoltage
controlledoscillator(VCO)18,amixer20,andacrossoverdetectoramplifier
(CRA)22.
Thecrossoveramplifier22(aswellascrossoveramplifier44discussedbelow)
providessignalconversionfordetectinglowlevelvoltagecrossoversandcreating
veryfastslewingtransitions.Forpurposesofdiscussingtheoverallencoder
operationinconjunctionwithFIG.1,itshallbeassumedthatthesteadystate
referencephaseofsignalf 1isinfactzerodegrees,asshown.
Figure2:Isamoredetailedblockdiagramofaportionofthelightbeam
encoderoffig.1
fortheopticaldistancemeasurementdevice.
Theeffectofanynoiseonthephaseofreferenceoscillatorsignalf 1andothersof
theencodergeneratedsignalswillbediscussedbelowinconjunctionwithFIG.2.
Referenceoscillatorsignalf 1isahighfrequencysignal,e.g.,100MHz,andis
coupledtoacounterdivider24thatdividesthefrequency(andphase)ofthe
referenceoscillatorsignalf 1byafactorN,forexampleN=150,000,toprovidea
signalF1offrequencyf 1/N.
Thephasedetector14ofthephaselockedloopreceivesthesignalF1andafter
filtering,connectstotheVCO18whichproducesthelocaloscillatorsignalf 2.
Mixer20receivesthesignalf 2andthereferenceoscillatorsignalf 1andproduces
afiltereddifferencesignal(f 1f 2)whichissquaredupbythecrossoveramplifier
22whoseoutputF2feedsbacktothephasedetector14.
Thus,thefrequencyandphaseofF2ismadetotrackF1,at666.7Hz.Thesteady
statephaseofsignalf 2isideallylockedtothatofthereferenceoscillatorsignalf 1
andthusisideallyzerodegrees,asindicatedinFIG.1.Thefrequencyofsignalf 2
isrelatedtothatofsignalf 1bytherelation:
Anyphasenoiseonreferencesignalf 1isreproducedinthelocaloscillatorsignal
f 2withinthebandwidthofthephaselockedloopdynamicresponse.Consequently
thesubsequentheterodynemixingoff 1andf 2todeterminethedistancephaselag
willminimizedifferentialphasenoise.
FurthermoreanyphasenoiseoriginatingfromwithintheVCO18isfedback
throughthemixer20inthephaselockedloopandisthussuppressed.Notethat,
inpriorartsystemshavingaconventionalphaselockedloop,asignaldivideris
coupledinafeedbackrelationshipbetweentheoutputoftheVCOandaninputof
thephasedetectorandthus,thelocaloscillatornoiseisnotsuppressednoristhe
phasenoiseofthereferencesignalf 1reproducedinsignalf 2forcancellinginthe
heterodynemixing.
Themixer20ispreferablyimplementedusingahighspeedfourquadrantanalog
multiplierwhichacceptsthetwosinewavesignals,f 1andf 2andproducesoutput
sinewaveswithsumanddifferencearguments.Thesummedfrequencywaveis
eliminatedbyafilter(notshown)leavingasinewaveatthedifferencefrequency
anddifferencephase.
Theanalogmultipliermixerdoesnotproduceanyothersignificantharmonicsthat
mightotherwisebiasthedifferencefrequencycrossovers.FIG.2showsinmore
detailhowphasenoisefromthereferenceoscillatorandthelocaloscillatorare
substantiallyreduced.Thesteadystatephaseofthereferenceoscillatoristaken
tobe0,thusanynoiseislabeled1,asshown.
TheVCOoutputphase2trackstheinputphase1andsuppressesVCOphase
noisesothattwoinputstomixer20arenearlyidenticalinphase.Thusonly
differentialphasenoiseshouldappearatthemixeroutput.
Themixeroutputisasinewaveofminimumphasenoiseandatthedifference
frequency(f 1f 2),or6662/3Hz.Atypicalamplitudeis0.1volts,leadingtoa
crossoverslopeofabout4v/10nanoseconds.Inthispreferredembodiment,10
nanosecondscorrespondstoaphaseincrementof0.0024andonedistance
resolutionincrementof10M.
Thiscrossoverinstantmustbepreservedinstable,highgain,lownoise
amplification.Themixer20isfollowedbythecrossoveramplifier22ofspecial
featurestoaccomplishthisrequirement.
Figure3:Isablockdiagramofanexemplarycrossoveramplifieroffig.1
fortheopticaldistancemeasurementdevice.
FIG.3providesafunctionalschematicdiagramofthecrossoveramplifier22.The
mixeroutputisasinewavecurrentthatiscoupledtoaninputofpreamplifier76
withastepuptransformertunedtothedifferencefrequency,667Hz.Thestepup
factorandthecircuitloadingareselectedtoprovideoptimalcrossovertonoise
ratio,includingconsiderationofthepreampinputnoisesources.
Thepreamp76mustsupplyhighgainandnosaturationtransientsandminimum
noise.Thepreampmustbeveryfastandhaveahighgaininordertorecover
rapidlyfromsaturationasthesignalapproachesthecrossoverinstantfromboth
directions.Suchastagewillinvolvehighfrequencygaussiannoisewhichmust
thenbeminimizedinfilter78,butwithenoughbandwidthtopassthecrossover
transientduringtheshortdurationoflinearamplificationbetweenexcursionsfrom
thesaturationrails.
Insomeapplicationsthepreamplifiermaybechopperstabilizedtopreventa
changingdcoffsetfrombiasingthecrossoverinstant.Thefilteroutputcouplesto
thecomparator80inputterminals,where,withfurtherlineargaininthecrossover
region,theoutputsquarewavesareformedwithveryhighresolutiontransition
instantsinordertodefinethecrossoverinstantsasrequiredbytheencoder
application.
Noteinparticularthatthesignalatthepreampinputisstillalinearsinewave
withoptimalsignaltonoiseratio,butwitharelativelyslowvoltagerateatthe
transition.Fromthispointonthesignalmustbedirectcoupledtomakethe
transitioninstantindependentofanydissymmetryofthesubsequentsaturated
signals.
Alsoveryimportantistheuseofdifferentialsignalcouplingandamplificationall
thewayfromthemixeroutputtothecomparatoroutput,insteadofsinglesided
transmissionthatwouldbevulnerabletocommonmodebiasandnoiseeffects.
Thuscrossoveramplifier22providesthehighgain,lownoisesensingofthemixer
signalswithatimeresolutionontheorderofananosecondandexcursion
resolutioninthemicrovoltrange.
Timejitteroftheoutputtransitionsbecomesadirectfunctionoftheratioofthe
noiseamplitudetocrossovervoltagerate.Forexample,anoiseamplitudeof2
microvoltRMSandasignalcrossoverrateof4V/10nanosecondswouldresultin
atimejitterof5nanoseconds.Noisemaybebothrandomgaussiantypeandnon
randomsystemicnoisefromtheelectronicimplementation.
Subsequentdigitalfilteringandaveragingtoachievehighresolutioncomputation
ofthedistancephaseangleisdescribedbelow.
ReferringagaintoFIG.2,theheterodynesection40receivesthelocaloscillator
signalf 2<2fromtheRFsection11alongwiththephaseshifteddistancesignalf 1
<1fromthelaserencodersection26.Mixer42andCRA44functionasdo
mixer20andCRA22aboveintheRFsection,producingahighresolutionsquare
waveF2<12thatnowincludesthephaseshiftproportionaltothedistance
D.
NotethatboththissquarewaveandthereferencesquarewaveF2<12contain
theresidualdifferentialphasenoise(12)thatissmallmagnitudecompared
witheither1or2,entirelybecauseofthemixertypephaselockloopdescribed
above.
Thesubsequentdeterminationofthephasedifferencebetweenthesesignals
furtherreducesphasenoiseerrorincomputingthedistanceoutput.
Figure4:Isaschematicofanexemplarytimeintervalcounteroffig.1
fortheopticaldistancemeasurementdevice.
FIG.1showsthetwosquarewavescoupledtothemeasurementsection24,where
alltransitioninstantsarecontinuouslymeasuredandpassedontothe
microprocessorsection60.FIG.4isablockdiagramofthehighspeedtime
intervalcounter30.A24bitcounter88continuouslyrunsinresponsetoaclock
inputsignal.
Inthepreferredembodiment,theclocksignalisderivedfromthereference
oscillatorsignalf 1,at100MHz.Thecounter88ispreferablyimplementedby
MotorolaECLPSorotherhighspeedASICdevices.Theparalleloutputofcounter
88isbussedtoapairofhighspeedlatches,90and92,thatareenabled
alternatelybysuccessivetransitionsofthetwosquarewavesfromCRA22and
CRA44.
InFIG.4,thesquarewavefromCRA22islabeledREFCRAandthesquarewave
fromCRA44islabeledDISCRA.Alongwiththeparalleloutputofthecounter88,
thestatesofbothsquarewavesarelatchedintolatches90and92.
Thealternatelatchingofsignalsintolatch90and92isaccomplishedinlatch
selector86byXORingtheCRAsquarewaves,usingtheXORedsignaltotrigger
latch90andthecomplementXORedsignaltotriggerlatch92.TheXORedsignal
andcomplementarealsosynchronizedtotheclocksignal,butontheopposite
transitionrequiredtomakethecounterincrementthisensuresthecounterisnot
inthemiddleofatransitionwhentheoutputislatched.
Theoutputofthelatches,eachofwhichhasa24bitlatchedcountand2bitsfor
thelatchedCRAstates,arefedintothe4:1multiplexer94.Themultiplexer94
providesa16bitoutput,andeachofthefourchoicesofinputselectionisalso16
bitswide.Inputselectionofmultiplexer94isdeterminedbycontrolsignalsfrom
themicroprocessorsection60.
Inputselectionisscannedbythemicroprocessorinascendingordersuchthat
lowest16countbitsfromlatch90arefirst.Nextselectedarethehigher8count
bitsfromlatch90,plus2bitsfortherepresentativeCRAstates.Theadditional6
bitsforthisinputselectionarenotused.Thethirdmultiplexerinputselectionare
thelowest16countbitsfromlatch92.
Lastselectedarethehigher8countbitsfromlatch92,plus2bitsforthe
associatedCRAstates.The6remainingbitsforthelastinputselectionarealso
notused.AsectionofFIG.4outlinesthemultiplexerinput(data)selection.
Notethatinthepreferredembodiment,theintervalcounteruptothemultiplexer
94,usesECLsignals.Theoutputofmultiplexer94isalteredtoTTLsignals,using
ECLtoTTLconverter38,tointerfacewiththemicroprocessorsection60,sincea
verybroadselectionofmicroprocessorsoperateusingTTLsignals.
Also,themultiplexercontrolsignalsfromthemicroprocessorsectionarechanged
fromTTLsignalstoECLsignals,usingTTLtoECLconverter39.Thereasonfor
usingECLsignalsandcomponentsinthetimeintervalcounteristoprovidethe
fastestcountingandlatchingpossible.
Figure5:Isablockdiagramofanexemplarymicroprocessorsectionoffig.
1and
fortheopticaldistancemeasurement
Themicroprocessorsection60canbealmostanymicroprocessorwiththe
appropriateinterfacelogictothetimeintervalcounter,environmentalsensors,
andreadout.FIG.5isablockdiagramofanexemplarymicroprocessorsection60.
Inthepreferredembodiment,microprocessor46isaTexasInstruments
TMS320C30DigitalSignalProcessor.
Programcode,whichimplementsscanningforthetimeintervaldata,inputsthe
environmentaldata,andexecutesthealgorithmsforcalculatingdistance,aswell
aspassingthecalculateddistancetothereadoutinterface108,iscontainedin
programmemory104.Themicroprocessorisprovideda25MHzclock,whichin
thepreferredembodimentcanbederivedfromf 1throughthedivider100.
Memorymapdecoder98providesthemicroprocessor46withaninterfacetothe
timeintervalcounter30aswellastheenvironmentalsensors.Timeintervaldata,
plusthecorrespondingCRAstatesarepolledbythemicroprocessor46byfirst
sendingthroughthememorymapdecoderthemultiplexerinputselection,then
readingtheassociatedtimeintervaldata(asreferredtoinFIG.4).
Throughmemorymapdecoder106,themicroprocessor46canaccessthereadout
interface108.Inthepreferredembodiment,thereadoutinterfacepassesthe
computeddistancedatatoPC110.Althoughwiththeappropriateinterfaceany
computercanbeconnected,thisexamplereferstoanIBMcompatiblecomputer.
Figure6:Isatimingdiagramofanexemplarysquarewavetransition
samplingandcomputingalgorithm
fortheopticaldistancemeasurement
FIG.6showsatimingdiagramofthereferenceandthedistancesquarewavesand
illustratesanefficientalgorithmforcomputingphaseangleinthepresenceof
noise.ThetimingdiagramshowsabouttwocyclesofthereferencewaveF2<0
andthelaggingdistancewaveF2<.
Forclaritythelagisshownatabout90,butmaybeanyamountfromzeroupto
awholecycle.Thetransitioninstantsarelabeledr 0tor 4forthereferencewave
andd0tod3forthedistancewave.Ateachtransitionacounterreadingislatched
andpassedontothemicroprocessorsection.
Theabsolutecountvaluesareunimportantbecausecomputationsofdelayand
cycleperiodsareallmadefromdifferencereadings.Alltransitionsaresubjectto
noiseshiftsineitherdirection.Ineachcycletherearetwointervalswheretime
lagmaybemeasured:fromrisingedgetorisingedgeandfromfallingedgeto
fallingedge,asshownbytheshadedareas.
Inordertodistinguishphaselagfromsimpletimedelay,computationsaremade
oftheratioofeachdelayintervaltotheenclosingcycleperiodsfromboth
measuredwaveforms.Thusfourphaselagsamplesarecomputedandaveraged
ineachcycletominimizednoiseandoffseteffects,seeFIG.6.
Furthermore,additionalaveragingovernumbersofcyclesprovidesadditional
filteringattheexpenseofreducingreadoutrates.Inthedescribedembodiment,
thesquarewavefrequencyis667Hzandareadoutateachcyclewouldresultin
anequivalentNyquistbandwidthof333Hz.Manycurrentapplicationscanbe
servedwithaveragingover8cycleswhichprovidesalowerrorspreadofafew
micronsRMSandareadouteverytwelvemilliseconds.
Furthersmoothingforhigherresolution,whereneeded,isavailablefromthe
microprocessorwithrecursivedigitalfilteringandcorrespondinglyslowerresponse
time.
Adistinctionismadeherebetweenquantizeddigitalresolution,e.g.the10Mof
thedescribedembodiment,andtheexpectednoiseerrorspreadofaparticular
modelencoder.Withoutnoise,anydigitalsignalwillinvolveaquantizationerror
ofuniformdistributionbetween.+.0.5quantawiththeassociatedstandard
deviationofabout0.3quanta.
Ifthesignalinvolvesothernoiseitshouldbeseparatelyspecifiedandmaybe
rootsumsquaredwiththebasicquantizationerror.Theabovediscussionofnoise
tradeoffsinthelightbeamencoderdoesnotrefertodigitalquantization.
Anothermicroprocessortaskistoscaledistanceoutputdatatotheactualspan
correspondingtoonecompletecycleofmodulation.Inthedescribedembodiment
thisdistanceis1.5meters,withassumedvelocityoflightof3.times.108
meters/second.Actualvelocitydependsupontheambientairdensityandisa
functionoftemperatureandpressure.
Theactualonecycledistancespanis
whereT=(T59)F.,and
P=(P29.92)0.1"HgTemperatureandpressuretransducerssensetheambient
valuesoftheseairvariables,transmittothemicroprocessorandthecorrectspan
iscomputedandmultipliedbythephaselagratiotogeneratethedistanceoutput.
Otherembodimentsmaymakeuseofthisscalingfeature.Thelightbeammaybe
switchedeitherautomaticallyormanuallyintoafixed,accuratelyknownreference
opticalpathforcalibrationpurposes.Theresultingdistanceoutputcanbe
comparedwiththeknownreferencepathdistanceandthescalefactorcorrected.
Anotherembodimentmayprovidesubstantiallyincreasedfilteringonthe
computeddistanceoutputinordertorealizehigherresolutionindistancereadout,
howeversuchfilteringlimitsdynamicresponsetofastchanginginputmotion.An
adaptivesystemisaccomplishedbyfirstcomputinginputvelocityfromthe
unfiltereddistancesignal(themicroprocessorwilldividesuccessivedistance
readingsbyelapsedtime)andthenswitchintheextrafilteringforhighresolution
onlyaftertheinputmotionslowsdownforfinalpositioning.
Withthisadaptivefilteringfeature,theLBEmaybecomethepositionfeedback
elementinarapidresponseservosystem,whichresponseneedonlybe
compromisedasthevelocitydecreasesnearthefinaldestination.
Clickhereformoreprojectideas.
LearntoprograminC
ineasysteps.
Essential&EASY:
PICCProgrammingCourse:
CLICKHERE.
Jumpfromtheopticaldistancemeasurementpageto
BestMicrocontrollerProjectsHomePage.
PrivacyPolicy|Contact|AboutMe
SiteMap|TermsofUse|Links
Sharethispage:
What'sThis?
Enjoythispage?Pleasepayitforward.Here'show...
Search
Web
www.bestmicrocontrollerprojects.com
5430537