Technical Introduction and Overview of EtherCAT.docx
《Technical Introduction and Overview of EtherCAT.docx》由会员分享,可在线阅读,更多相关《Technical Introduction and Overview of EtherCAT.docx(50页珍藏版)》请在冰点文库上搜索。
TechnicalIntroductionandOverviewofEtherCAT
TechnicalIntroductionandOverview
EtherCAT—EthernetControlAutomationTechnology
Thissectionprovidesanin-depthintroductionintoEtherCAT,theEthernet-basedfieldbussystem.
EtherCATsetsnewperformancestandards.Handlingisstraightforwardandsimilartoafieldbus,thankstoflexibletopologyandsimpleconfiguration.Moreover,sinceEtherCATcanbeimplementedverycost-effectively,thesystemenablesfieldbussestobeusedinapplicationswherefieldbusnetworkingwasnotanoptioninthepast.
1.
Introduction
1.1
Ethernetandreal-timecapability
2.
EtherCAToperatingprinciple
3.
EtherCATfeatures
3.1
Protocol
3.2
Topology
3.3.
Distributedclocks
3.4
Performance
3.5
Diagnosis
3.6
Highavailability
3.7
Safety-over-EtherCAT
3.8
EtherCATinsteadofPCI
3.9
Deviceprofiles
3.9.1
CANopenoverEtherCAT(CoE)
3.9.2
Servodrive-ProfilaccordingtoIEC61491overEtherCAT(SoE)
3.10
EthernetoverEtherCAT(EoE)
3.11
FileAccessoverEtherCAT(FoE)
4.
Infrastructurecosts
5.
Summary
6.
Literature
7.
ImplementationAspects
7.1
Master
7.1.1
Masterimplementationservices
7.1.1
MasterSampleCode
7.2
Slave
7.3.
SlaveEvaluationKit
1.Introduction
Fieldbusseshavebecomeanintegratedcomponentofautomationtechnology.Theyhavebeentriedandtestedandarenowwidelyestablished.Itwasfieldbustechnologythatenabledthewide-scaleapplicationofPC-basedcontrolsystems.WhiletheperformanceofcontrollerCPUs-particularlyforIPCs-isincreasingrapidly,conventionalfieldbussystemstendtorepresent"bottlenecks"thatlimittheperformancecontrolsystemscanachieve.Anadditionalfactoristhelayeredcontrolarchitectureconsistingofseveralsubordinate(usuallycyclic)systems:
theactualcontroltask,thefieldbussystemandperhapslocalexpansionbusseswithintheI/Osystemorsimplythelocalfirmwarecycleintheperipheraldevice.Reactiontimesaretypically3-5timeshigherthanthecontrollercycletime-anunsatisfactorysolution(seeFig.1).
Figure1:
Responsetimesofconventionalfieldbussystems
Abovethefieldbussystemlevel,i.e.fornetworkingcontrollers,Ethernethasalreadybeenthestateoftheartforsometime.WhatisrelativelynewisitsapplicationatthedriveorI/Olevel,i.e.inareasthatweredominatedbyfieldbussystemsinthepast.Themainrequirementsforthistypeofapplicationarehighreal-timecapability,suitabilityforsmalldataquantities,andnaturallycost-effectiveness.EtherCATmeetstheserequirementsandatthesametimemakesinternettechnologiesavailableattheI/Olevel.
1.1Ethernetandreal-timecapability
Therearemanydifferentapproachesthattryandprovidereal-timecapabilityforEthernet:
forexample,theCSMA/CDmediaaccessprocedureisdisabledviahigherlevelprotocollayersandreplacedbythetimesliceprocedureorpolling;otherpropositionsusespecialswitchesthatdistributeEthernetpacketsinapreciselycontrolledtimelymanner.WhilstthesesolutionsmaybeabletotransportdatapacketsmoreorlessquicklyandaccuratelytotheconnectedEthernetnodes,thetimesrequiredfortheredirectiontotheoutputsordrivecontrollersandforreadingtheinputdatastronglydependontheimplementation.
IfindividualEthernetframesareusedforeachdevice,theusabledatarateisverylowinprinciple:
TheshortestEthernetframeis84byteslong(incl.inter-packetgapIPG).If,forexample,adrivecyclicallysends4bytesofactualvalueandstatusinformationandaccordinglyreceives4bytesofcommandvalueandcontrolwordinformation,at100%busload(i.e.withinfinitelyshortresponsetimeofthedrive)ausabledatarateofonly4/84=4.8%isachieved.Atanaverageresponsetimeof10µs,theratedropsto1.9%.Theselimitationsapplytoallreal-timeEthernetapproachesthatsendanEthernetframetoeachdevice(orexpectaframefromeachdevice),irrespectiveoftheprotocolsusedwithintheEthernetframe.
2.EtherCAToperatingprinciple
EtherCATtechnologyovercomestheseinherentlimitationsofotherEthernetsolutions:
theEthernetpacketisnolongerreceived,theninterpretedandprocessdatathencopiedateverydevice.TheEtherCATslavedevicesreadthedataaddressedtothemwhiletheframepassesthroughthenode.Similarly,inputdataisinsertedwhilethetelegrampassesthrough(seeFig.2).Theframesareonlydelayedbyafewnanoseconds.
Figure2:
Processdataisinsertedintelegrams
SinceanEthernetframecomprisesthedataofmanydevicesbothinsendandreceivedirection,theusabledatarateincreasestoover90%.Thefull-duplexfeaturesof100BaseTXarefullyutilized,sothateffectivedataratesof>100Mb/s(>90%of2x100Mb/s)canbeachieved(seeFig.3).
Figure3:
ComparisonofBandwidthUtilisation
TheEthernetprotocolaccordingtoIEEE802.3remainsintactrightuptotheindividualdevice;nosub-busisrequired.Inordertomeettherequirementsofamodulardevicelikeanelectronicterminalblock,thephysicallayerinthecouplingdevicecanbeconvertedfromtwistedpairoropticalfibretoLVDS(alternativeEthernetphysicallayer,standardizedin[4,5]).Amodulardevicecanthusbeextendedverycost-efficiently.SubsequentconversionfromthebackplanephysicallayerLVDStothe100BASE-TXphysicallayerispossibleatanytime-asusualwithEthernet.
3.EtherCATfeatures
3.1Protocol
TheEtherCATprotocolisoptimizedforprocessdataandistransporteddirectlywithintheEthernetframethankstoaspecialEthertype.ItmayconsistofseveralEtherCATtelegrams,eachservingaparticularmemoryareaofthelogicalprocessimagesthatcanbeupto4gigabytesinsize.ThedatasequenceisindependentofthephysicalorderoftheEthernetterminalsinthenetwork;addressingcanbeinanyorder.Broadcast,Multicastandcommunicationbetweenslavesarepossible.DirectEthernetframetransferisusedincaseswheremaximumperformanceisrequiredandtheEtherCATcomponentsareoperatedinthesamesubnetasthecontroller.
However,EtherCATapplicationsarenotlimitedtosingleasubnet:
EtherCATUDPpackagestheEtherCATprotocolintoUDP/IPdatagrams(seeFig.4).ThisenablesanycontrolwithEthernetprotocolstacktoaddressEtherCATsystems.Evencommunicationacrossroutersintoothersubnetsispossible.Inthisvariant,systemperformanceobviouslydependsonthereal-timecharacteristicsofthecontrolanditsEthernetprotocolimplementation.TheresponsetimesoftheEtherCATnetworkitselfarehardlyrestrictedatall:
theUDPdatagramonlyhastobeunpackedinthefirststation.
Figure4:
EtherCAT:
StandardFramesaccordingtoIEEE802.3[3]
Inadditiontodataexchangeaccordingtothemaster/slaveprinciple,EtherCATisalsoverysuitableforcommunicationbetweencontrollers(master/master).Freelyaddressablenetworkvariablesforprocessdataandavarietyofservicesforparameterization,diagnosis,programmingandremotecontrolcoverawiderangeofrequirements.Thedatainterfacesformaster/slaveandmaster/mastercommunicationareidentical.
Forslavetoslavecommunication,twomechanismsareavailable.Upstreamdevicescancommunicatetodownstreamdeviceswithinthesamecycle,andthusextremelyfast.Sincethismethodistopologydependent,itisparticularlysuitableforslavetoslavecommunicationrelationshipsgivenbymachinedesign-e.g.inprintingorpackagingapplications.Forfreelyconfigurableslavetoslavecommunication,thesecondmechanismapplies:
thedataisrelayedbythemaster.Heretwocyclesareneeded,butduetotheextraordinaryperformanceofEtherCATthisisstillfasterthananyotherapproach.
EtherCATonlyusesstandardframesaccordingto[3]-theframesarenotshortened.EtherCATframescanthusbesentfromanyEthernetMAC,andstandardtools(e.g.monitor)canbeused.
3.2Topology
Line,treeorstar:
EtherCATsupportsalmostanytopology(seeFig.5).ThebusorlinestructureknownfromthefieldbussesthusalsobecomesavailableforEthernet,withoutthequantitylimitationsimpliedbycascadedswitchesorhubs.
Figure5:
FlexibleTopology:
Line,TreeorStar
Particularlyusefulforsystemwiringisthecombinationoflineandbranchesorstubs:
therequiredinterfacesexistonmanydevices(e.g.onI/Omodules);noadditionalswitchesarerequired.Naturally,theclassicswitch-basedEthernetstartopologycanalsobeused.
Wiringflexibilityisfurthermaximisedthroughthechoiceofdifferentcables.FlexibleandinexpensivestandardEthernetpatchcablestransferthesignalsin100BASE-TXmode.Plasticopticalfibres(POF)complementthesystemforspecialapplications.ThecompletechoiceofEthernetwiring-suchasdifferentopticalfibresandcoppercables-canbeusedincombinationwithswitchesormediaconverters.
TheFastEthernetphysics(100BASE-TX)enablesacablelengthof100mbetweentwodevices.Sinceupto65535devicescanbeconnected,thesizeofthenetworkisalmostunlimited.
3.3.Distributedclocks
Accuratesynchronizationisparticularlyimportantincaseswherespatiallydistributedprocessesrequiresimultaneousactions.Thismaybethecase,forexample,inapplicationswhereseveralservoaxescarryoutcoordinatedmovementssimultaneously.
Themostpowerfulapproachforsynchronizationistheaccuratealignmentofdistributedclocks,asdescribedintheIEEE1588standard[6].Incontrasttofullysynchronouscommunication,wheresynchronizationqualitysuffersimmediatelyintheeventofacommunica