Difference between revisions of "Program Examples:Camming by Virtual Master/zh-hans"
(Created page with "{{Languages}} == Introduction == Slave axis is driven by a virtual(simulated) master axis. Example of cam usage |600px == Setup == Both master and slav...") |
|||
Line 1: | Line 1: | ||
− | {{Languages}} | + | {{Languages|Program_Examples:Camming_by_Virtual_Master}} |
− | == | + | == 简介 == |
− | + | 从轴由虚拟(模拟)主轴驱动。 | |
[[File:CAMDEMO.PNG|Example of cam usage |600px]] | [[File:CAMDEMO.PNG|Example of cam usage |600px]] | ||
− | == | + | == 设置 == |
− | + | 主轴和从轴都按照前面的例子进行设置。 | |
− | == | + | == 程序示例 == |
− | == | + | == 创建凸轮表 == |
− | + | 声明一个凸轮表类型的全局变量: | |
<pre> | <pre> | ||
common shared CamTable1 as cam | common shared CamTable1 as cam | ||
</pre> | </pre> | ||
− | + | 创建一个空的凸轮表: | |
− | * | + | * 这个表是循环的: |
<pre> | <pre> | ||
CamTable1.Cycle = -1 | CamTable1.Cycle = -1 | ||
</pre> | </pre> | ||
− | * | + | * 没有链接到任何其他的凸轮表: |
<pre> | <pre> | ||
Line 33: | Line 33: | ||
</pre> | </pre> | ||
− | * | + | * 使其10000点 |
<pre> | <pre> | ||
Line 40: | Line 40: | ||
</pre> | </pre> | ||
− | * | + | * 定义360度正弦表: |
<pre> | <pre> | ||
Line 49: | Line 49: | ||
</pre> | </pre> | ||
− | * | + | * 将新创建的文件存储到闪存盘中: |
<pre> | <pre> | ||
Line 55: | Line 55: | ||
</pre> | </pre> | ||
− | + | 一旦表存储在闪存上,它可以重新加载: | |
<pre> | <pre> | ||
loadcamdata ct1.cam CamTable1 | loadcamdata ct1.cam CamTable1 | ||
</pre> | </pre> | ||
− | == | + | == 创建主从轴关系 == |
− | + | 轴'''a2'''是轴'''a1'''的从轴。 凸轮的源变量是主轴的外部位置(外部编码器)'''pext'''。 它们通过'''CamTable1'''凸轮乘以1.0的齿轮比连接。 | |
<pre> | <pre> | ||
Line 72: | Line 72: | ||
</pre> | </pre> | ||
− | == | + | == 完整例子 == |
− | + | 查看: [[Program Examples:Camming by Virtual Master/Full Example| '''Camming by Virtual Master/Full Example''']] |
Latest revision as of 01:58, 17 July 2017
语言: | English • 中文(简体) |
---|
简介
从轴由虚拟(模拟)主轴驱动。
设置
主轴和从轴都按照前面的例子进行设置。
程序示例
创建凸轮表
声明一个凸轮表类型的全局变量:
common shared CamTable1 as cam
创建一个空的凸轮表:
- 这个表是循环的:
CamTable1.Cycle = -1
- 没有链接到任何其他的凸轮表:
CamTable1.Next = none CamTable1.Prev = none
- 使其10000点
dim camsize as long = 10000 createcamdata camsize CamTable1
- 定义360度正弦表:
for i = 1 to CamTable1.Size CamTable1.MasterData [i] = 360*(i-1)/CamTable1.Size ' Master in degrees CamTable1.SlaveData [i] = cam_amplitude *sin (CamTable1.MasterData [i] * pi/180) next
- 将新创建的文件存储到闪存盘中:
storecamdata ct1.cam CamTable1
一旦表存储在闪存上,它可以重新加载:
loadcamdata ct1.cam CamTable1
创建主从轴关系
轴a2是轴a1的从轴。 凸轮的源变量是主轴的外部位置(外部编码器)pext。 它们通过CamTable1凸轮乘以1.0的齿轮比连接。
a2.MasterSource = a1.PExt a2.GearRatio = 1.0 a2.CamOffset = 0 a2.FirstCam = CamTable1 a2.slave = cam