Difference between revisions of "Program Examples:Camming by Virtual Master/zh-hans"

From SoftMC-Wiki
Jump to: navigation, search
(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}}
== Introduction ==
+
== 简介 ==
  
Slave axis is driven by a virtual(simulated) master axis.
+
从轴由虚拟(模拟)主轴驱动。
  
 
[[File:CAMDEMO.PNG|Example of cam usage |600px]]
 
[[File:CAMDEMO.PNG|Example of cam usage |600px]]
  
== Setup ==
+
== 设置 ==
Both master and slave axes are set as in previous examples
+
主轴和从轴都按照前面的例子进行设置。
  
== Program Example ==
+
== 程序示例 ==
  
  
== Creating Cam Table ==
+
== 创建凸轮表 ==
  
Declaring a cam-table type global variable:
+
声明一个凸轮表类型的全局变量:
 
<pre>
 
<pre>
 
common shared CamTable1 as cam
 
common shared CamTable1 as cam
 
</pre>
 
</pre>
  
Creating an empty cam table:
+
创建一个空的凸轮表:
  
* This table is cyclic:
+
* 这个表是循环的:
 
<pre>
 
<pre>
 
     CamTable1.Cycle = -1  
 
     CamTable1.Cycle = -1  
 
</pre>
 
</pre>
  
* Not linked to any other cam-tables:
+
* 没有链接到任何其他的凸轮表:
  
 
<pre>
 
<pre>
Line 33: Line 33:
 
</pre>
 
</pre>
  
* Making it 10000 points
+
* 使其10000点
  
 
<pre>
 
<pre>
Line 40: Line 40:
 
</pre>
 
</pre>
  
* Defining a 360 deg sine table:
+
* 定义360度正弦表:
  
 
<pre>
 
<pre>
Line 49: Line 49:
 
</pre>
 
</pre>
  
* Store the newly created file onto flash disk:
+
* 将新创建的文件存储到闪存盘中:
  
 
<pre>
 
<pre>
Line 55: Line 55:
 
</pre>
 
</pre>
  
Once the table is stored on the flash it can be reloaded as:
+
一旦表存储在闪存上,它可以重新加载:
 
<pre>
 
<pre>
 
   loadcamdata ct1.cam CamTable1
 
   loadcamdata ct1.cam CamTable1
 
</pre>
 
</pre>
  
== Creating Master-Slave Relationship ==
+
== 创建主从轴关系 ==
  
Axis '''a2''' is slave axis of axis '''a1'''. The source varaible for the camming is the master's external position (external encoder) '''pext'''. They are connected through '''CamTable1''' cam multiplied by a gear-ratio of 1.0.
+
'''a2'''是轴'''a1'''的从轴。 凸轮的源变量是主轴的外部位置(外部编码器)'''pext'''。 它们通过'''CamTable1'''凸轮乘以1.0的齿轮比连接。
  
 
<pre>
 
<pre>
Line 72: Line 72:
 
</pre>
 
</pre>
  
== Full Example ==
+
== 完整例子 ==
  
See: [[Program Examples:Camming by Virtual Master/Full Example| '''Camming by Virtual Master/Full Example''']]
+
查看: [[Program Examples:Camming by Virtual Master/Full Example| '''Camming by Virtual Master/Full Example''']]

Latest revision as of 01:58, 17 July 2017

语言: English  • 中文(简体)‎

简介

从轴由虚拟(模拟)主轴驱动。

Example of cam usage

设置

主轴和从轴都按照前面的例子进行设置。

程序示例

创建凸轮表

声明一个凸轮表类型的全局变量:

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

完整例子

查看: Camming by Virtual Master/Full Example