欢迎来到天天文库
浏览记录
ID:11415025
大小:317.00 KB
页数:4页
时间:2018-07-11
《运动控制器的坐标变换》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、运动控制器的坐标变换Trio运动控制器的另一个非常有用的功能是坐标变换。主要在2维或3维系统中,用标准TrioBasic运动功能来确定位置时需要。当系统中轴和轴不是独立的是,坐标变换可以指定当前参考坐标,使多轴插补可以顺利完成。SCARA机器人是一个很好的例子,在X-Y平面上,电机需要按照有机器人几何关系决定的特定的特定模式下进行运动,来控制机器人手臂尾部的位置。在一个机械系统中可以指定几个不同的坐标系统。当前的坐标系统由系统参数FRAME指定。默认FRAME=0,意思是轴独立系统。FRAME=
2、0(默认)下面的图示给出了FRAME=0时轴独立的二维系统,在这种模式下,插补指令move(0,100)只需要在Y轴产生动作,竖直升起负载。注意,Y轴的重量必须由X轴承担。FRAME=1(保留)FRAME=2此时指定的是由一根皮带配置的两轴系统(如图所示)在这种模式下,插补指令MOVE(0,100)会同时在两轴上产生动作,竖直提起重物。注意到两个电机都是安装在X轴上的,这样就最大限度的减小了Y轴的负荷。X轴和Y轴变换后的坐标是:Xtransformed=(MPOSAXIS(0)+MPOSAXIS
3、(1))*0.5Ytransformed=(MPOSAXIS(0)-MPOSAXIS(1))*0.5变换后的坐标是通过轴0和轴1的MPOS计算出来的,计算过程是在FRAME=2时,由系统软件自动计算的。FRAME=?坐标变换要想实现更多的功能要改变底层软件,如果确有需要,请联系TRIO。FRAME=0时示意图:FRAME=2时示意图:在FRAME=2时,软限位不能用。'SetupSOFTlimitpositionin"RealWorld"positions(FRAME=2)BASE(0,1)'S
4、etreferenceaxespos_limit_x=100'realworldEOTposinuserunits-xaxisforwardneg_limit_x=-100'realworldEOTposinuserunits-xaxisreversepos_limit_y=100'realworldEOTposinuserunits-yaxisforwardneg_limit_y=-100'realworldEOTposinuserunits-yaxisreverse'============
5、===================MAINLOOP=====================================loop:'ConvertindividualencoderpositionstoTransformedpositions(actual)mposx=(MPOSAXIS(0)+MPOSAXIS(1))*0.5mposy=(MPOSAXIS(0)-MPOSAXIS(1))*0.5'CheckforovertravelintheXDIMENSIONIF(mposx6、limit_x)OR(mposx>pos_limit_x)THENIFSGN(mposx)=1THENFS_LIMIT=MPOSAXIS(0)'ForceaxistogointoSoftForwardLimitELSERS_LIMIT=MPOSAXIS(0)'ForceaxistogointoSoftReverseLimitENDIFGOSUBstopallmovesENDIF'CheckforovertravelintheYDIMENSIONIF(mposy7、osy>pos_limit_y)THENIFSGN(mposy)=1THENRS_LIMIT=MPOSAXIS(1)‘ForceaxistogointoforwardSoftLimitELSEFS_LIMIT=MPOSAXIS(1)'ForceaxistogointoReverseSoftLimitENDIFGOSUBstopallmovesENDIFGOTOloopSTOP'===============================ENDMAINLOOP==================8、========'Subroutinesstopallmoves:BASE(0)'Cancelmovesonbaseaxisold_decel=DECELDECEL=10000000'IncreaseDeceltoreduceovershootREPEATRAPIDSTOP'Canceltheremainingmove(s)WAITIDLEUNTIL((MTYPE=0)AND(NTYPE=0))DECEL=old_decel'setbacktheolddecelrateRETURN'Endofs
6、limit_x)OR(mposx>pos_limit_x)THENIFSGN(mposx)=1THENFS_LIMIT=MPOSAXIS(0)'ForceaxistogointoSoftForwardLimitELSERS_LIMIT=MPOSAXIS(0)'ForceaxistogointoSoftReverseLimitENDIFGOSUBstopallmovesENDIF'CheckforovertravelintheYDIMENSIONIF(mposy7、osy>pos_limit_y)THENIFSGN(mposy)=1THENRS_LIMIT=MPOSAXIS(1)‘ForceaxistogointoforwardSoftLimitELSEFS_LIMIT=MPOSAXIS(1)'ForceaxistogointoReverseSoftLimitENDIFGOSUBstopallmovesENDIFGOTOloopSTOP'===============================ENDMAINLOOP==================8、========'Subroutinesstopallmoves:BASE(0)'Cancelmovesonbaseaxisold_decel=DECELDECEL=10000000'IncreaseDeceltoreduceovershootREPEATRAPIDSTOP'Canceltheremainingmove(s)WAITIDLEUNTIL((MTYPE=0)AND(NTYPE=0))DECEL=old_decel'setbacktheolddecelrateRETURN'Endofs
7、osy>pos_limit_y)THENIFSGN(mposy)=1THENRS_LIMIT=MPOSAXIS(1)‘ForceaxistogointoforwardSoftLimitELSEFS_LIMIT=MPOSAXIS(1)'ForceaxistogointoReverseSoftLimitENDIFGOSUBstopallmovesENDIFGOTOloopSTOP'===============================ENDMAINLOOP==================
8、========'Subroutinesstopallmoves:BASE(0)'Cancelmovesonbaseaxisold_decel=DECELDECEL=10000000'IncreaseDeceltoreduceovershootREPEATRAPIDSTOP'Canceltheremainingmove(s)WAITIDLEUNTIL((MTYPE=0)AND(NTYPE=0))DECEL=old_decel'setbacktheolddecelrateRETURN'Endofs
此文档下载收益归作者所有