首页 > 其他 > 详细

TRIO-basic指令--CAM

时间:2019-05-21 00:40:07      阅读:263      评论:0      收藏:0      [点我收藏+]

大家好,今天更新TRIO的运动指令CAM(也就是CAM函数),CAM指令是控制器直接发送编码器脉冲形成的运动曲线,比如:正弦,余弦曲线,根据自己的精度需求进行描点,但并不一定点数越多精度就越高,以实际为准。

下面是指令及简单的小例子:

 CAM


Type:

  Axis Command


Syntax:

  CAM(start point, end point, table multiplier, distance)     CAM(开始点,结束点,table(table是临时寄存器)  倍率,距离)


Description:

  The CAM command is used to generate movement of an axis according to a table of positions which define a movement profile.  The table of values is specified with the TABLE command. The   movement may be defined with any number of points from 3 up to the maximum table size available.  The controller performs linier interpolation between the values in the table to allow small          numbers of points to define a smooth profile.   

  CAM命令用于根据定义运动轮廓的位置表生成轴的运动。使用TABLE命令指定值表。可以使用从3到最大可用表大小的任意数量的点来定义移动。控制器在表格中的值之间执行线性插值,以允许少量点定义平滑轮廓。

  The TABLE values are translated into positions by offsetting them by the first value and then multiplying them by the multiplier parameter. This means that a non-zero starting profile will be offset          so that the first point is zero and then all values are scaled with the multiplier. These are then used as absolute positions from the start position. 

  通过将它们偏移第一个值然后将它们乘以乘数参数,将TABLE值转换为位置。这意味着非零起始轮廓将被偏移,以便第一个点为零,然后使用乘数缩放所有值。然后将它们用作起始位置的绝对位置。

    Two or more CAM commands executing simultaneously can use the same values in the table. 

     同时执行的两个或多个CAM命令可以使用表中的相同值。

  The speed of the CAM profile is defined through the SPEED of the BASE axis and the distance parameter. You can use these two values to determine the time taken to execute the CAM profile.

   CAM轮廓的速度通过BASE轴的SPEED和距离参数定义。您可以使用这两个值来确定执行CAM配置文件所需的时间。

    As with any motion command the SPEED may be changed at any time to any positive value. The SPEED is ramped up to using the current ACCEL value.  

    与任何运动命令一样,SPEED可以随时更改为任何正值。 SPEED逐渐增加到使用当前ACCEL值。

  To obtain a CAM shape where ACCEL has no effect the value should be set to at least 1000 times the SPEED value (assuming the default SERVO_PERIOD of 1ms). 

  要获得ACCEL无效的CAM形状,应将该值设置为SPEED值的至少1000倍(假设默认SERVO_PERIOD为1ms)。

  When the CAM command is executing, the ENDMOVE parameter is set to the end of the PREVIOUS move 

  执行CAM命令时,ENDMOVE参数设置为PREVIOUS移动的结束


 Parameters:

start point:

The start position of the cam profile in the TABLE

end point:

The end position of the cam profile in the TABLE

multiplier:

The table values are multiplied by this value to generate the positions.

distance:

The distance parameter relates the speed of the axis to the time taken to complete the cam profile. The time taken can be calculated using the current axis speed and this distance parameter (which are in user units). 


起始点:

表中凸轮轮廓的起始位置

结束点:

表格中凸轮轮廓的终点位置

乘值:

表值乘以该值以生成位置。

距离:

距离参数将轴的速度与完成凸轮轮廓所花费的时间相关联。可以使用当前轴速度和该距离参数(以用户单位)计算所花费的时间。


Examples:

  1、需求:用CAM做一个位置弧形的曲线。 网上找的图片 ^_^

  position:

  技术分享图片

  CAM没有跟随轴的概念,所以我们可以直接运行一个虚轴或者实际的轴直接生成你要的位置曲线图。

  打开TRIO编程界面,然后在工具栏 => CamGen => 然后创建一个名称,如下图:

  技术分享图片

  或者:

  技术分享图片

  下一步:

  技术分享图片

  点击OK进入的界面:

  技术分享图片

  点击:选择

  技术分享图片

  选择:yes

 技术分享图片

  注意看下图标注的位置:

  技术分享图片

  上面是简单的介绍,下面我们先规划一条抛物线的位置曲线。

  技术分享图片

 

  下面即可直接复制生成的代码,直接运动。

  技术分享图片

  把上面复制的代码放在运行的程序中,运行即可。

DIM tablestart, points AS INTEGER
Start CamGen Sector1->ProfileClass=PiecewiseCurve->ProfileName=CAM->OutputType=Points->MinLogicalX=0->MaxLogicalX=100->CamLinkInput=500->Segment=0;0;0.0000;0.0000;0.0000;Point->Segment=1;0.5;200.0000;0.0000;0.0000;Point->Segment=2;1;0.0000;0.0000;0.0000;Point->TableStart=1000->TableLength=100 set the variables
tablestart = 1000
points = 100
 store the table points
TABLE(tablestart,0.0000,0.0160,0.1241,0.4057,0.9316,1.7615,2.9456,4.5241)
TABLE(tablestart + 8,6.5283,8.9810,11.8967,15.2822,19.1375,23.4556,28.2235)
TABLE(tablestart + 15,33.4224,39.0284,45.0129,51.3427,57.9814,64.8890,72.0227)
TABLE(tablestart + 22,79.3375,86.7865,94.3217,101.8938,109.4536,116.9518)
TABLE(tablestart + 28,124.3396,131.5696,138.5958,145.3741,151.8632,158.0247)
TABLE(tablestart + 34,163.8238,169.2295,174.2156,178.7606,182.8486,186.4694)
TABLE(tablestart + 40,189.6196,192.3025,194.5286,196.3166,197.6934,198.6948)
TABLE(tablestart + 46,199.3659,199.7615,199.9468,199.9980,199.9980,199.9468)
TABLE(tablestart + 52,199.7615,199.3659,198.6948,197.6934,196.3166,194.5286)
TABLE(tablestart + 58,192.3025,189.6196,186.4694,182.8486,178.7606,174.2156)
TABLE(tablestart + 64,169.2295,163.8238,158.0247,151.8632,145.3741,138.5958)
TABLE(tablestart + 70,131.5696,124.3396,116.9518,109.4536,101.8938,94.3217)
TABLE(tablestart + 76,86.7865,79.3375,72.0227,64.8890,57.9814,51.3427,45.0129)
TABLE(tablestart + 83,39.0284,33.4224,28.2235,23.4556,19.1375,15.2822,11.8967)
TABLE(tablestart + 90,8.9810,6.5283,4.5241,2.9456,1.7615,0.9316,0.4057,0.1241)
TABLE(tablestart + 98,0.0160,0.0000)
Stop CamGen Sector1

test_cam position
BASE(0)
ATYPE = 0
UNITS = 200
SPEED = 200
ACCEL = 999
DECEL = 999
FE_LIMIT = 999
FE_RANGE = 990
DEFPOS(0)
SERVO = 1

WHILE TRUE
    WA(1000) yan shi 1s
    TRIGGER catch curve
    CAM(1000,1099,1,200)AXIS(0)
    WA(1000) yan shi 1s
WEND

  运行的曲线结果:

  技术分享图片

  下面是详细介绍 CAM 参数值

  CAM(1000,1099,1,200)AXIS(0)

  CAM(“规划曲线的时候,我们填的 TABLE start的值”,
    “Points 里面的值,相当于 从 1000开始 100个TABLE表 1000~1099”,
    “倍率:相当于轴的脉冲数 * 当前的值。上面我们测试的脉冲是 200 * 1 实际电机走的位置为200 ,如果填 2 就相当于 200 * 2 实际电机走的位置就是 400 ”,
    “此值就是:时间 * 当前的速度值,更据测试解释 我希望 1s完成 200的速度,1*200 = 200. 如果我希望0.5s完成200的速度,就是 0.5 * 200 = 100,上面的值就可以填写100,更据实际情况而定”
    ) 运动的轴号

 上面是一个简单的应用,如果大家用项目用到,可以当做一个简单的参考,大神请路过。上面有表述有问题的地方,可在评论区留言,本人会更据实际情况进行修改。后期会介绍一些项目中其他的指令,如:MOVELINK , REGIST等指令。

TRIO-basic指令--CAM

原文:https://www.cnblogs.com/httpcc/p/10778259.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!