开源数控EMC2入门手册.docx
《开源数控EMC2入门手册.docx》由会员分享,可在线阅读,更多相关《开源数控EMC2入门手册.docx(111页珍藏版)》请在冰点文库上搜索。
开源数控EMC2入门手册
开源数控EMC2入门手册(5)
EMC2_Getting_Started_翻译10章11…
(0/29)2011-10-0909:
08
EMC2_Getting_Started_翻译89章
(0/29)2011-10-0809:
12
EMC2_Getting_Started_翻译7章
(0/29)2011-09-2808:
28
EMC2_Getting_Started_翻译456章
(0/49)2011-09-2121:
11
EMC2_Getting_Started_学习心得123…
如果您转载,请包括原作者声明,谢谢!
作者:
dennis丁雷QQ:
1160577904E-mail:
**********************
DISCLAIMER
----------
THEAUTHORSOFTHISLIBRARYACCEPTABSOLUTELYNOLIABILITYFOR
ANYHARMORLOSSRESULTINGFROMITSUSE. ITIS_EXTREMELY_UNWISE
TORELYONSOFTWAREALONEFORSAFETY. Anymachinerycapableof
harmingpersonsmusthaveprovisionsforcompletelyremovingpower
fromallmotors,etc,beforepersonsenteranydangerarea. All
machinerymustbedesignedtocomplywithlocalandnationalsafety
codes,andtheauthorsofthissoftwarecannot,anddonot,take
anyresponsibilityforsuchcompliance.
免责声明
--------
本文作者坚决不对任何读者因使用本文而导致的任何财产损失或者身体伤害承担
任何责任。
仅仅指望计算机软件或技术文件来确保和解决安全问题也是极不明智的表
现。
任何机器,只要它有伤人的可能,就必须制定严格的制度来管理它。
比如可以规
定“在人体进入危险区域之前,必须确保所有电机断电”等条款。
事实上,设计任何
一种机器设备都需要遵循所在国家或地区的各种不同级别的安全标准,本文的作者显
然无法了解和满足如此多的标准要求,所以也就不能承担相关的责任。
MissionStatement
-----------------
EMC2isanoffshootoftheoriginalNISTEnhancedMachine
Controller. Thenewversionis(primarily)aGPL'dproject.
Themajorgoalsare:
1) Maketheprojectmorefriendlytonewdevelopers. This
meansasimplerbuildprocess,aswellasotherchanges
listedbelow.(DONE)
2) Reducecomplexitybyeliminatingsupportforplatforms
otherthanLinuxonx86,witheitherRTAIorRTLinuxfor
realtime.(DONE)
3) IncorporateaHardwareAbstractionLayerthatmakesthe
realtimecodemoremodularandallowspinsandI/Odevices
tobereconfiguredeasily.(DONE)
4) Addsomeofthefeaturesthatwerediscussedatthe2003
NAMESshowonEMCMonday-theseincluderigidtapping
andsinglepointthreading,improvedcontouring,abuilt-
inPLCusingClassicLadder,andothers.(mostlyDONE,yet
newfeatureswillconstantlybeadded)
任务描述
---------
EMC2最初是NISTEnhancedMachineController项目的一个分支,现在它是一
个GPL的项目,EMC2目前致力于以下四个目标:
1)使EMC2项目对新手来说更加易于使用,且易于编译与安装。
2)为了减少复杂度,决定:
除了X86-Linux平台以外,EMC2都不提供支持。
在实时性
方面,也只提供RTAI或者RTLinux的支持。
3)EMC2包括了一个硬件抽象层(HardwareAbstractionLayer),HAL使得硬件相关
的实时代码更加模块化,从而让外部接口(pinsandI/Odevices)更易于配置,这
样就提高了软件的灵活性以及适应能力。
4)增加了一些功能,包括刚性攻丝和单点线程、增强的轮廓功能、用ClassLadder实
现的内置PLC功能(rigidtappingandsinglepointthreading、improved
contouring、built-inPLCusingClassicLadder)等等。
----------------------以上节选自源码包根目录的README文件
第1章 计算机配置
1.1 最小配置
TheminimumsystemtorunEMC2andUbuntumayvarydependingontheexact
usage.Steppersystemsingeneralrequirefasterthreadstogeneratestep
pulsesthanservosystems.UsingtheLive-CDyoucantestthesoftware
beforecommittingacomputer.KeepinmindthattheLatencyTestnumbers
aremoreimportantthantheprocessorspeedforsoftwarestepgeneration.
MoreinformationontheLatencyTestisinSection(7.2.1).
AdditionalinformationisontheEMCWikisite:
http:
//wiki.linuxcnc.org/cgi-bin/emcinfo.pl?
Hardware_Requirements
事实上,最小配置是什么样的并不确定,这取决于具体的应用。
总的来说,分管
线程切换的时间片分配系统(Stepper systems)要足够快,起码要能产生比伺服系
统还要快的步进脉冲才行。
要注意,CPU的速度肯定是越快越好,但不是最终决定因
素,相对而言,Live-CD里面提供的LatencyTest功能反而更加重要,LatencyTest
可以最终判断目标机器是否适合运行EMC2系统。
关于LatencyTest的详细信息参见(
7.2.1)。
要了解更多信息,您还可以去下面的网址去看看:
http:
//wiki.linuxcnc.org/cgi-bin/emcinfo.pl?
Hardware_Requirements
EMC2andUbuntushouldrunreasonablywellonacomputerwiththefollowing
minimumhardwarespecification.Thesenumbersarenottheabsoluteminimum
butwillgivereasonableperformanceformoststeppersystems.
700MHzx86processor(1.2GHzx86processorrecommended).
384MBofRAM(512MBupto1GBrecommended).
4GBharddisk.
Graphicscardcapableofatleast800x600resolution,whichisnotusing
theNVidiaorATIfglrxproprietarydrivers,andwhichisnotanonboard
videochipsetthatsharesmainmemorywiththeCPU.
AnetworkorInternetconnection(notstrictlyneeded,butveryuseful
forupdatesandforcommunicatingwiththeEMCcommunity).
当然,这里还是给出了一个推荐的配置。
虽然这不一定是最合适的,但它在大多数情
况下可以获得相当不错的性能。
700MHzx86处理器(1.2GHzx86更佳).
384MB内存(512MB---1GB更佳).
4GB硬盘空间.
显卡分辨率最低800*600,不要使用NVidia或者ATIfglrx这样专有的驱动程序,
也不要使用集成显卡,因为它们会和CPU抢内存用。
有网络,能上Internet最好,这样可以方便升级,也利于及时从社区里面查找相关
的技术信息。
1.2不推荐的配置
1.2.1Laptops
Laptopsarenotgenerallysuitedtorealtimesoftwarestepgeneration.
AgainaLatencyTestrunforanextendedtimewillgiveyoutheinfoyou
needtodeterminesuitability.
1.2.2VideoCards
Ifyourinstallationpopsupwith800x600screenresolutionthenmost
likelyUbuntudoesnotrecognizeyourvideocardormonitor.Onboardvideo
manytimescausesbadrealtimeperformance.
笔记本一般不适于运行EMC2,当然具体能不能用还是取决于LatencyTest。
如果系统安装后,显示器分辨率是800*600,那多半是Ubuntu没能识别你的显卡或显示
器。
再说一遍,集成显卡通常不适合用于EMC2这样的实时系统。
第2章 关于EMC
2.1 是什么和不是什么
EMC(theEnhancedMachineControl)isasoftwaresystemforcomputer
controlofmachinetoolssuchasmillingmachinesandlathes.
EMCisfreesoftwarewithopensourcecode.CurrentversionsofEMCare
entirelylicensedundertheGNUGeneralPublicLicenseandLesserGNU
GeneralPublicLicense(GPLandLGPL)
EMCprovides:
–agraphicaluserinterface(actuallyseveralinterfacestochosefrom)
–aninterpreterfor"G-code"(theRS-274machinetoolprogramminglanguage)
–arealtimemotionplanningsystemwithlook-ahead
–operationoflow-levelmachineelectronicssuchassensorsandmotordrives
–aneasytouse"breadboard"layerforquicklycreatingaunique
configurationforyourmachine
–asoftwarePLCprogrammablewithladderdiagrams
–easyinstallationwithaLive-CD
Itdoesnotprovidedrawing(CAD-ComputerAidedDesign)orG-code
generationfromthedrawing(CAM-ComputerAutomatedManufacturing)functions.
Itcansimultaneouslymoveupto9axesandsupportsavarietyofinterfaces.
Thecontrolcanoperatetrueservos(analogorPWM)withthefeedbackloop
closedbytheEMCsoftwareatthecomputer,oropenloopwith"step-servos"
orsteppermotors.
Motioncontrolfeaturesinclude:
cutterradiusandlengthcompensation,path
deviationlimitedtoaspecifiedtolerance,lathethreading,synchronizedaxis
motion,adaptivefeedrate,operatorfeedoverride,andconstantvelocitycontrol.
Supportfornon-Cartesianmotionsystemsisprovidedviacustomkinematics
modules.Availablearchitecturesincludehexapods(Stewartplatformsandsimilar
concepts)andsystemswithrotaryjointstoprovidemotionsuchasPUMAor
SCARArobots.
EMCrunsonLinuxusingrealtimeextensions.
EMC(增强机器控制)是一款用来控制机床(铣床、车床等)的计算机软件系统。
EMC是一款开源的自由软件。
当前版本的许可是GPL和LGPL。
EMC特点:
-提供几种不同的用户界面供选择使用
-G代码解释器(基于RS-274机床编程语言)
-带预处理功能的实时运动规划系统
-可直接操作底层的机床电器如传感器、电机驱动器等
-易于使用的“面包板层”("breadboard"layer),使您像使用“面包板”做
电路实验一样很容易的创建适合您机器的独有配置文件
-可用梯形图编程操作的PLC软件(指ClassicLadder)
-所有这些都集成到一张Live-CD上面,易于安装。
不提供CAD和CAM功能,不能画图,也不能从图直接导出G-Code。
9轴联动,支持不同接口。
可以实现闭环运动控制,也可以使用开环控制。
能够控制模拟或PWM接口的伺服电机。
运动控制特点:
刀具半径和长度补偿、路径偏差可限制在给定的误差范围内、车床车
螺纹、多轴联动、自适应进给速度、手动进给覆盖(operatorfeedoverride)、恒
速控制。
通过调整运动学模块的参数,可以提供对非笛卡尔运动系统的支持。
EMC2支持的其他
架构包括:
六足系统(Stewart或类似的机器人平台)、带旋转关节的系统(通常为
PUMA或SCARA机器人提供运动支持)。
EMC运行在使用实时扩展模块(RTAI或者RTLinux)的Linux操作系统中。
2.2 为什么是Ubuntu?
Ubuntuhasbeenchosen,becauseitfitsperfectlyintotheOpenSourceviews
ofEMC2:
Ubuntuwillalwaysbefreeofcharge,andthereisnoextrafeeforthe
"enterpriseedition",wemakeourverybestworkavailabletoeveryoneonthe
sameFreeterms.
EMCispairedwiththeLTSversionsofUbuntuwhichprovidesupportand
securityfixesfromtheUbuntuteamfor3-5years.
Ubuntuusestheverybestintranslationsandaccessibilityinfrastructure
thattheFreeSoftwarecommunityhastooffer,tomakeUbuntuusableforas
manypeopleaspossible.
TheUbuntucommunityisentirelycommittedtotheprinciplesoffree
softwaredevelopment;weencouragepeopletouseopensourcesoftware,
improveitandpassiton.
选择Ubuntu,是因为它和EMC2的开源观点最为契合。
Ubuntu永远不会收费,也没有所谓的“企业版”费用。
而我们也同样尽最大努力把最
好的成果免费展示给每一个人。
EMC2与Ubuntu配套已经3-5年了,Ubuntu一直积极提供技术支持和安全支持。
Ubuntu尽最大努力致力于推广工作,做到了免费软件社区所能做到的一切,这些都使
得越来越多的人使用Ubuntu。
Ubuntu是遵守自由软件开发原则的典范,我们鼓励人们使用、提高、传承开源软件。
第3章 如何获得帮助
3.1 IRC
IRCstandsforInternetRelayChat.ItisaliveconnectiontootherEMC
users.TheEMCIRCchannelis#emconfreenode.
ThesimplestwaytogetontheIRCistousetheembeddedjavaclienton
thispagehttp:
//www.linuxcnc.org/content/view/4/8/lang,en/.
SomeIRCetiquette:
Askspecificquestions...Avoid"Cansomeonehelpme?
","Itwon’trun"
typeofquestions.
Ifyou’rereallynewtoallthis,thinkabitaboutyourquestionbefore
typingit.Makesureyougiveenoughinformationsosomeonecansolveyour
question.
Havesomepatiencewhenwaitingforananswer,sometimesittakesawhile
toformulateanansweroreveryonemightbebusyworkingorsomething.
SetupyourIRCaccountwithyouruniquenamesopeoplewillknowwhoyou
are.Ifyouusethejavaclient,usethesamenameeverytimeyoulogin.
Thishelpspeoplerememberwhoyouareandifyouhavebeenonbeforemany
willrememberthepastdiscussionswhichsavestimeonbothends.
3.1.1SharingFiles
ThemostcommonwaytosharefilesontheIRCistouploadthefiletoone
ofthefollowingorasimilarserviceandpastethelink:
http:
//pastebin.ca=fortext
http:
//imagebin.ca=forpictures
http:
//filebin.ca=forfilesandpdfs
IRC,代表“互联网接力聊天”的意思,它是一个和其它EMC用户实时连接的工具。
(译者注:
事实上这个工具对大部分中国读者没什么帮助,就不翻译了。
)
3.2 邮件列表
AnInternetMailingListisawaytoputquestionsoutforeveryoneonthat
listtoseeandanswerattheirconvenience.Yougetbetterexposuretoyour
questionsonamailinglistthan