低成本陀螺.docx
《低成本陀螺.docx》由会员分享,可在线阅读,更多相关《低成本陀螺.docx(13页珍藏版)》请在冰豆网上搜索。
低成本陀螺
低成本陀螺-加速度混合传感器
作者:
EarlW.Bollinger 文章来源:
http:
//www.dprg.org/projects/ 更新时间:
2006年04月17日 打印此文 浏览数:
9053
Clickforfull-sizedimage
ProjectSummary
Inbuildingabalancingrobotyouneedagyroscopeunitandanaccelerometerunitinordertogetittobalance.ButIalsowantedittobereasonablylowincostwithhighperformanceandeasilyinterfacedtoaMCU.Someoftheothersolutionsareprohibitivelyexpensive,eveniftheymayworkwell.AlsothesolutionIhadinmindhadtobefairlysmallanduseuplittlespaceanduseuplittlepowertoo.SowhenAnalogDevicesrecentlycameoutwiththeirADXRS150andADXRS300piezo-gyroscopeintegratedcircuit,Inowhadasolutionthathadlowcostandlowpowerwithhighperformancetoo.Thegyroisverysmallatabout5mmsquare(about0.3inchessquare).YoucanseethesmallcombogyroPCBmountedverticallyinthecentersectiononthebalancingrobotphotobelow.
Clickforfull-sizedimage
IalsotookadvantageofthesmallsizeandcombinedanAnalogDevicesaccelerometerintegratedcircuitonthesamePCBtomaximizeperformance.Plustherearenomovingpartspersetocomplicatetheissue.Allthegoodstuffiscontainedinsidethechips.UsingthetwoAnalogDevicesADXRS150andADXL202wecanbuildacomboPCBforunder$100.00inparts.InthiscaseattheAnalogDeviceswebsite,theyaresellingthegyroforabout$39.90insinglesandtheaccelerometerforabout$29.90insingles.IknowthattheExpressPCBservicechargesabout$62forthreemini-boards,sooneboardcostsabout$20,thenwehaveabout$20foralltheotherparts,sincethePCBusesuponlyasmallportionofthewholePCBblank,youcanputinafewotherneededlayoutsforotherthingsonthesamePCBandcutthemoutlaterasyouneedthem.IusuallyuseascrollsawtocutoutthesmallPCBs.Insomecasesyoucouldobtainsamplesofthesechips,orastheystarttofillinthevendorpipeline,you'llbeabletogetthematbetterpricesthroughthevendorsanddistributors.
TraditionalGryoSolutions
Youcan,offandon,getniceMurataPiezoGyrosfor$40eachfromsomevendors.Butthesetendtogotothemanufacturersfirst,sosometimesitisdifficulttogetone.Gyrationsellsamicrogyrofor$450.Thereisalsoaspecialacademicversionofthekitfor$35.Ithasthreegyrosandsupportingchipsincludedinthekit.
Microstrainsellsanumberofdifferentgyromodulesstartingat$295uptoaround$1495.
TheoldclassicapproachistoobtainRChobbymodelaircraftgyrosandusethem.Thesegyrosrunincostfromabout$69.00onuptoseveralhundreddollars,dependingonthemodelortype.AsourcetocheckoutisTowerHobbiesormaybeaRCspecialtystorelikeHelicopterWorld.SometimesServoCityhasRCmodelplaneGyrostoo.
Thenthemostbasicmethodistouseapotentiometerwithapoleorpendulumattachedtoit.YoufeedthewiperoutputfromthepotentiometertoanADCandthenyoucandetermineyourpositionortiltangle.Thisisthestandardclassicapproachtobalancingrobotsthatbalanceapoleontopofthem.Butyoucouldinvertitaswell.Usuallyyouwouldstillhavetohavesomekindofareferencetothefloorortabletopfortherobottoknowwheretheflooris.Butyoucouldtrailapotentiometerwithasmallarmtouchingthefloorbehindtherobotforthispurposeaswell.
AlthoughaRChobbygyroscopeiscosteffective,itisabitdifficulttointerfacetoaMCU.ThegyroisdesignedforRCmodelairplaneservosthatworkwitha1to2ms-widthpulsetrain.Thus1.5msisneutral,1msfullonewayand2msfulltheotherway.UsingaMCUyouhavetotransmitthe1.5msneutralsignaltothegyro,thenreceivethepulsesfromthegyroandtranslatethemintosomethingmoremeaningfulforyoutouse.ThenextproblemisyoubasicallyhavetohavetheMCUstopforupto2mstoreadapulsewidth,beforeyoucandosomethingwithit.DependingontheMCUyoumighthavetohavetheMCUsendthethe1.5mspulseaswell,eatingupevenmoretime.That2msmaybeverycriticaltootherthingsgoingon.Butifweusethegyrochip,wecanuseaADC(analogdigitalconverter)toconverttheanalogvoltageleveltoanumericalvaluemuchfaster,plusyoucould,insomecases,starttheADCtogetavalue,andcomebacklaterfortheresult.Wecannowreducethetimetogetanumericalvaluedowntomicrosecondsinsteadofmilliseconds.Thuswegetbetteraccuracy,andfasterperformance.IfyouuseahighperformanceDSPprocessor,youmaybeabletogetthisdowntolessthanamicrosecondtoreadavoltagelevel.
Themoreexpensivegyroscopesystems,unfortunately,tendtobeprohibitivelyexpensive.Soalthoughtheyarereallyneatsolutions,Ididn'tpursuethemanyfurther.
ADXRSGryoscope
Withoutgoingintoalltheengineeringgobblygook,thebasicwaytheADXRS150or300gyroscopeIC'swork,istheyoutputa2.5voltlevelatrest.Ifthegyroistiltedonewayortheother,thenitwilloutputuptoa+/-voltagechangefromreference.Thisisananaloglevelthatyouneedtofeedintoananalogdigitalconverter(ADC)foraMCUtouse.TheADXRS150hasabouta12.5mvperdegreeofsensitivity,foruptoabout150degreespersecondoftilting.Thiscanbeadjustedsomemoreasneededtoo.Thevoltagechangeisproportionaltothespeedorrateofthetiltangle.Thefastertherobottiltsthelargerthechangeinvoltage.TheADXRS300,asahigherperformancedevice,givesabout300degreespersecondoftilting.
Thefollowingsequenceofphotosillustratethevoltagechangewhenthegryoistitled.(thephotosareanexaggerationasIcouldn'ttiltandsnapthephotofastenough)
Above:
Gryoisatrest
Above:
Gryotitledforward
Above:
Gryotitledbackwards
ThisshortMPEGvideoalsoshowstheoscilliscopemeasurementsofthegyrocircuitatrest,tiltedoneway,andthentiltedtheotherway.
Ifyouwantmoreinformationaboutthechips,pleasegototheAnalogDeviceswebsiteanddownloadthespecsheetsanddocumentationonthechips.Alsogetthedocumentationontheaccelerometerevaluationboardaswell.IexpectAnalogDevicestohaveanevaluationboardforthegyroscopeICprettysoonaswell.
ADXL202accelerometer
TheADXL202accelerometerisareallyneatdeviceinitself.Itbasicallyoutputsapulsestring,andchangesthedutycycleastheunitistilted.Plusthechangestaysatthetiltedangleuntilyouchangeittoadifferentangle.Thusitmakesforareallyhandyreferencepointtypeofdevice,suchaswhereis"up"versuswhereis"down".
Usingagyroscopebyitselfseemsreasonable,butthegyrodevelopsaslowcreepingtilterrorthatcontinuestoincrease.Anexampleofthisiswhenyoutiltthegyroyou'llseeachangeintheoutputvoltage,butitquicklyreturnstoit'srestinglevel,ifthetiltdoesn'tchange.Thusifyourrobotwastotiltforwardafewdegreesandstayatthatangle,thegyrowillreportthattherobotisstandingstraightupafterasecond.Soeventuallytheerrorsaddupandtherobotfallsover.Usinganaccelerometerhelpstosolvethisproblem.Theaccelerometeroutputsasteadydutycyclewhentherobotisstandingstraightup,andiftherobottiltsonewayortheotherthedutycyclechanges,andstayschanged,untilyouhavetherobot'scomputercorrectforthetilt.Nowonthesurfaceitlookslikeyoucoulduseonlytheaccelerometer,butthegyroreactsmuchfastertotiltchangesthantheaccelerometercan.Sothegyrogivesyouthefastresponseandtheaccelerometerhelpstocorrectforthecreepinggyroerrorsthatwilloccurandtellsyouwhenyourlevelornot,orwhereupanddownis.
IbasicallyfollowedthedesignsasputforthbyAnalogDevices,butIdidaddmorefilteringintothepowerlineforthegyroscopechip.Withouttheadditionalfilteringyouruntheriskofnoisecausingtoomanyspuriousreadings,whichwouldcausemoreproblems.Ialsokeptthetwocircuitssomewhatseparateinordertoensurethatthenoisegeneratedbytheaccelerometerdoesn'tinterferewiththegyroscopeorviceversa.PlustheadditionalfilteringisneedsastheMCUorelectricmotorswillgenerateadditionalpowerlinenoiseaswell.
PCBoard
ExceptformountingthegyroscopeIC,buildingthePCBisfairlystraightforwardandsimple.Butdobeextremelycarefulwiththesurfacemountcapacitorsastheyarenotmarkedandtheytypicallyalllookalike.Iwouldsuggesttakingthecapacitorsfromtheirpackageoneatatimeandsolderingthemdownoneatatimetoensureyoudon'tmixanyup.AlsonotethatthetwoICchipsarecomplexandsensitivetostaticelectricitysoyouneedtobecarefulwiththem.IuseasmallX-ActoknifetohelpholdthelittlepartsdownasIamsolderingthem.Sometimesabitofairgetstrappedunderthepartandit'llpopofffromtheheatasyousolderit.WhenthepartgoespoofandpopsoffthePCByoucan'tfinditonthedeskorfloor,soyouhavetogogetanotherone.
MountingthegyroscopeICisabigproblemasitisaBGA(BallGridArraypackage)thatisabout1/4"squareinsize.The32littlepinsare.020"indiameterandareabout.015"apart.Inlookingatthechip,ithadmespookedforquiteawhile.Theremaybeotherwaysofdoingit,butthethreethatIknowofare:
One)youcanuseaIRovendesignedforsolderingthesepartsontoPCBs;Two)youcanuseahotairSMDreworkstationtoheatupthepartsandsolderthem;Three),youcouldheatupatoasterovento300degreesorsoandthenstickthePCBwiththegyroonitintotheovenandcookitforafewminutesorso(Ihavenotevertriedthismethodthough).Intheovenmethods,I'veseenthemusesomekindofaPCBpre-heatertoheatthePCBuptonear300degrees,butjustshortofwherethesolderstart