ControlEngineeringofChinaSep.2007Vol.14,No.520079145:167127848(2007)0520548204:2006206230;:2006207213:(19832),,,,;(19402),,,,,,(,200030):,,,IPO,,,:;;:TP212:AApplicationofAbsoluteEncodertoMotorPositionDetectionSystemsCHENGXiao2li,XIEJian2ying,WANGLin(AutomationDepartment,ShanghaiJiaotongUniversity,Shanghai200030,China)Abstract:Basingonthefeaturethatabsoluteencodercancountnumberofrevolutionduringpowerfailure,theapplicationofabsoluteencoderinmotorrotatingpositiondetectionisdiscussed,andarealizingschemeofembeddedsystemisintroduced.Combiningthecharacteristicsofsin2glechipprocessorandabsoluteencoder,thehardwareandsoftwaredesigningschemeisexplainedindetail.Singlechipprocessorcontrolsitsoutputpintosimulatetheclocksignaltocommunicatewithabsoluteencoder.Thismethodnotonlysuccessfullysolvestheinterfaceproblemofabsoluteencoder,butalsocanbeusedinothercommunicationsystems.Practicaloperationresultshowsthatthesystemisstableandcanrealizethereal2timedetectionofrotatepositionaccurately.Keywords:absoluteencoder;singlechipprocessor;rotatepositiondetection1,,[1],,,,,,[2],[3],,2MAX488RS2422,EIARS2422,,A,BA,B26V,,-2-6V,,AABB,AB+200mV,,-200mV,0126VMAX488+5V,RS2422RS2485IPOTTL,MAX488TTLRS2422,11Fig11Hardwarecircuitdiagram,(nMT+nST)PA1,MAX488RS2422(SCLK+SCLK2)(DATA+DATA2),MAX488RS2422TTLPA0,PA0,3(nMT)(nST),,22Fig12Timingcharacteristicsofabsoluteencoderpsdatatransmission,(nMT+nST),(MSB),(LSB)IPO[4],PA0,PA11100ms,,331Fig13FlowchartofTimer1overflowinterruptserviceroutine1,1sPA1,015MHz,(PA1),(PA1),PA0PA0,temp1;PA0,temp0,temp,(nMT+nST)PA0,temp,PA1,IPO,CPUI2CRS2422,,,,9455:,:,,[5],IPO,,,,,,(1),,;,41):P3333333333PvoidReadingData(void){SRCLKSET;PPasm(nop);PP8MHz,1s,PP015MHzSRCLKCLR;PP,asm(nop);PP1swhile(FlagBit25)PP,25{SRCLKSET;asm(nop);SRCLKCLR;if(PING&0x08)PPTemp=Temp|0x00000001;elsePPTemp=Temp&0xfffffffe;Temp=Temp1;PPFlagBit++;PPasm(nop);}SRCLKSET;PP,for(i=0;i40;i++)PP40s,PP40sasm(nop);Temp=Temp1;PP}2):P3333333333,temp,y3333333333PlongintGraytoBinary(longinttemp){longinty=temp;while(temp)PP,{temp=temp1;PPtempy=y^temp;PPytempy}returny;PP}3):P3333,TempPre,Temp3333PBOOLIsValid(longintTempPre,longintTemp){TempPre=TempPre13;PPTempPreTemp=Temp13;PPTempif(fabs(TempPre2Temp)PTMaxVelocity)PPreturnTRUE;PPelsePPreturnFALSE;PP}5,,25(12,13),0101%,IPO,,,,(554)05514,,2),m(7)(9)r(k)r(k)Mallat,WTr(a,t)WTr(a,t),,,1655,,,,,(),,(3)uj(k)zj(k),(References):[1]SilvaRA,BuiattiCM,CruzSL,etal.Pressurewavebehaviorandleakdetectioninpipelines[J].ComputersandChemicalEngineering,1996,20(S1):4912496.[2]LiouJCP.Physicalbasicofsoftware2basedleakdetectionmethods[C].Alberta,Canada:ProceedingsoftheInternationalPipelineConfer2ence,1998.[3]FengJ,ZhangHG,LiuDR.Applicationsoffuzzydecision2makinginpipelineleaklocalization[C].Budapest,Hungary:IEEEInternationalConferenceonFuzzySystems,2004.[4],.[J].,2005,12(S0):2032205.(ChenFeng,FuXingwu.Researchandapplicationofreal2timeleakagedetectionandlocationinpetroleumpipeline[J].ControlEngineeringofChina,2005,12(S0):2032205.)[5]SilvaDaHV,MorookaCK,GuilhermeIR,etal.Leakdetectioninpetroleumpipelinesusingafuzzysystem[J].JournalofPetroleumSci2enceandEngineering,2005,49(3,4):2232238.[6]MallatS,HwangWL.Singularitydetectionandprocessingwithwave2lets[J].IEEETransactionsonInformationTheory,1992,38(2):6172643.(531),,,(SNR)11Table1SNRimprovementforvariousnoiselevelSNRT(j)SNRTSNR+510dB+9115dB+8177dB0dB+6183dB+5134dB-510dB+2125dB+1182dB1,,,5,,,(References):[1]JohnstoneIM,SilvermanBW.Waveletthresholdestimatorsfordatawithcorrelatednoise[J].JRoyStatistSoc,1997,B(59):3192351.[2]ChangSW,KwonY,YangSI,etal.Speechenhancementfornon2stationarynoiseenvironmentbyadaptivewaveletpacket[C].Orlando,USA:ICASSP,2002.[3].[M].:,2003.(ZhaoLi.Speechsignalproccessing[M].Beijing:MechanismIndustryPress,2003.)[4],.[J].(),2001,36(2):2012204.(JiangMingyan,HaoYu.Denoisemethodofspeechenhancingbasedonwavelettransform[J].ShandongUniversityJournal(NatureScienceEdition),2001,36(2):2012204.)[5]SarikayaR,PellomBL,HansenJHL.Waveletpackettransformfea2tureswithapplicationtospeakeridentification[C].Denamrk:IEEENordicSignalProcessingSymposium,1998.[6]ReyonldsDA,RichardRC.Robusttextindependentspeakerindenti2ficationusingGaussianmixturesperakermodel[J].IEEETransactiononSpeechandAudioProcessing,1995,1(1):72283.[7]MartinR.Spectralsubtractionbasedonminimustatistics[C].Eding2burg,UK:EUSIPCO294,1994.(550)(References):[1]SugimotoH,IchikawaT,HosoiK,etal.Magneticpolepositiondetec2tionmethodandcontrolofabrushlessDCservomotorwithincrementalencoder[J].ElectricalEngineerinJapan,2003,145(4):64277.[2]WekhandeS,AgarwalV.High2resolutionabsolutepositionverniershaftencodersuitableforhigh2performancePMSMservodrives[J].IEEETransactionsonInstrumentationandMeasurement,2006,55(1):3572363.[3]OrloskyS.Basicsofrotaryopticalencoders[J].ControlEngineering,1997,44:72282.[4],,.[J].,1997,39(4):43247.(ZhuJianhong,MaoChao,WangPing.Thebasictheoryofcompactabsoluteencoderanditscommunicationmethod[J].ElectricDrive,1997,39(4):43247.)[5],,.[J].,1999,41(3):36237.(ZhangDongning,YangXiao,NiJiancheng.ApplicationofGrayrotaryenc