您好,欢迎来到刀刀网。
搜索
您的当前位置:首页多工位试验台CAD

多工位试验台CAD

来源:刀刀网
哈尔滨理工大学学士学位论文

多工位实验台设计

摘要

多工位回转工作台式组合机床为广东省东莞力达公司(美国通用电气公司)专门设计制造的,用于加工电机前后端盖六工位回转工作台式组合机床。在本机床完成上料、粗镗、钻孔、攻丝、精镗止口、下料六工序,生产节拍 20 秒钟。

该六工位回转工作台是采用了比较简单的换位斜板和转向盘来实现转位和定位,换位斜板与燕尾形导轨的滑块相连,用气缸推动,换位斜板只能沿导轨作直线运动。

换位斜板是一块多边形,在转向盘底下均匀地分布着一些圆柱定位销,其数量等于分度工位数。当拟制活塞推动斜板向前移动时,斜板的一边推动着定位销,使转向盘回转。转到极限位置时,压缩气体进入拟制的另一腔,使活塞杆带动斜板向后退回。

六工位回转工作是该机床的重要组成之一,它对工件的加工精度有直接的影响。主要是它的定位精度对工件精度影响很大。还有是否有可靠的固定,使加工时工作台能平稳。工作台旋转的快慢,影响机床的工作效率。冲击的大小又直接影响产生的噪音。所以在设计过程中,即要考虑机床的工作效率,准确的工作定位,冲击又不能太大,以免产生太大噪音,影响居民的工作和休息。

关键词: 多工位; 回转工作台; 换位斜板

- I -

哈尔滨理工大学学士学位论文 Multi-position bench CAD

Abstract

Six-Position Rotary Table Machine Tool for the power of the company in Dongguan, Guangdong Province (GE) designed and manufactured specifically for the processing of motor cover six stations around the Rotary Table Machine Tool. In this machine to complete the material, rough boring, drilling, tapping, fine boring only the mouth, cutting six processes, production beat 20 seconds. The six-position rotary table is to use a relatively simple transposition to achieve the ramp and turn the steering wheel position and orientation, with the dovetail-shaped ramp transposition slider rail connected with the cylinder drive, transposition ramp only to a straight line along the rail. Transposition ramp is a polygon, evenly distributed under the steering wheel a number of cylindrical pins, and their number is equal to the median dividing work. When drawing up the piston moves forward to promote the ramp, the ramp side of the driving pins, turn the steering wheel. Go to the limit position, compressed gas into the fiction of the other chamber, the piston rod to drive ramp backwards return. Six-position rotary work is an important component of the machine, the precision of its parts has a direct impact. It is mainly the positioning accuracy of a great impact on the accuracy of the workpiece. There is a reliable fixed, so that processing can smooth table. Table rotation speed, affecting the efficiency of the machine. The size of the impact of a direct impact on noise. So in the design process, that is, to consider the efficiency of the machine, accurate work positioning, impact and can not be too much, to avoid too much noise, the residents work and rest.

Keywords: Six-station; Rotary table; Transposition ramp

- II -

哈尔滨理工大学学士学位论文

目录

摘要 ...................................................................................................................... I Abstract ............................................................................................................... II

第1章 绪论 ........................................................................................................ 1 1.1 课题背景 .................................................................................................. 1 1.2 各设计内容简单介绍 .............................................................................. 2 1.2.1 工作台转位和定位原理 ...................................................................... 2 1.2.2 各构件的设计 ...................................................................................... 2 1.2.3 气压系统的设计 .................................................................................. 2 1.2.4 各构件的设计 ...................................................................................... 2 1.2.5 计算部分 .............................................................................................. 3 第2章 总体方案设计 ........................................................................................ 4 2.1 总体结构 .................................................................................................. 4 2.2 原理方案得设计 ...................................................................................... 4 2.3 轴承的选用 .............................................................................................. 6 2.4 动力的选择 .............................................................................................. 6 2.5 斜板的选用 .............................................................................................. 8 2.6 润滑方式选择 ........................................................................................ 10 第3章 计算分析 .............................................................................................. 11 3.1 工作台回转运动规律分析 .................................................................... 11 3.2 计算工作台的转动惯量及所需动力 .................................................... 11 3.3 在各阶段的受力分析 ............................................................................ 12 3.3.1 在推进过程中 .................................................................................... 12 3.3.2 在回退过程中 ...................................................................................... 13 3.4 行程的计算 ............................................................................................ 14 第4章 气压传动系统 ...................................................................................... 17 4.1 明确系统要求 ........................................................................................ 17 4.2 分析系统工况 ........................................................................................ 17 4.3 确定执行元件的工作压力 .................................................................... 18 4.3.1 初选气压缸的工作压力 .................................................................... 18 4.3.2 确定气压缸的主要参数 .................................................................... 18 4.3.3 计算液压缸的流量和功率 ................................................................ 18 4.4 拟定系统原理图 .................................................................................... 19 结论 .................................................................................................................... 21

- III -

哈尔滨理工大学学士学位论文

致谢 .................................................................................................................... 22 参考文献 ............................................................................................................ 23 附录 .................................................................................................................... 24

- IV -

哈尔滨理工大学学士学位论文

第1章 绪论

1.1 课题背景

本人的毕业设计题目是多工位实验台设计即回转台的设计,回转台是镗床、钻床、铣床和插床等重要附件,用于加工有分度要求的孔、槽和斜面,加工时转动工作台,则可加工圆弧面和圆弧槽等。通用转台按结构不同又分为水平转台、立卧转台和万能转台。

水平转台:在圆台面上有工件定位用的中心孔和夹紧用的T型槽。台面外圆周上刻有360°的等分刻线。台面与底座之间设有蜗杆-蜗轮副(见蜗杆传动),速比为90:1或120:1,用以传动和分度,蜗杆从底座伸出的一端装有细分刻度盘和手轮。转动手轮即可驱动台面,并由台面外圆周上的刻度与细分刻度盘读出旋转角度。分度精度一般为±60″。水平转台的蜗杆伸出端也可用联轴器与机床传动装置联接,以实现动力驱动。

立卧转台:底座有两个相互垂直的安装基面,使台面既可水平也可垂直放置。

万能转台:台面可以在0°~90°范围内倾斜任意角度, 使工件在空间的任何角度都能准确调整。

精密转台用于在精密机床上加工或角度计量。常见的有光学转台、数显转台和超精密端面齿盘转台。

光学转台:主轴上装有玻璃或金属精密刻度盘,经光学系统将刻度细分、放大,通过目镜或光屏读出角度值。数显转台:转台主轴上装有精密圆光栅或圆感应同步器,由数字显示装置读出角度值。上述两种精密转台的分度精度最高可达±1。超精密端面齿盘转台:利用一对经过精密对研的1440齿、720齿或360齿的端面齿盘分度定位,其分度精度最高可达±0.01″,作精密角度计量用。

回转工作台是六工位回转工作台镗床的重要组成部分,本人的毕业设计就以六工位回转工作台镗床的回转工作台为设计目标。本机床为广东省东莞力达公司(美国通用电气公司)专门设计制造的,用于加工电机前后端盖六工位回转工作台式组合机床。在本机床完成上料、粗镗、钻孔、攻丝、精镗止口、下料六工序,生产节拍20秒钟。该工作设计得好坏直接影响到机床的整体质量,正因为其重要性,所以我在设计过程中以十分认真的态度来对待,尽量满足六工位回转工作台组合机床的性能要求。

在整个设计过程中,主要的工作是:工作台转位和定位原理;各构件的设计;气压系统的设计。在这篇论文中,我主要分为:总体方案设计;计算;各构件设计;气压系统设计;外文资料翻译。

- 1 -

哈尔滨理工大学学士学位论文

图1-1六工位回转工作台式组合机床

1.2 各设计内容简单介绍

1.2.1 工作台转位和定位原理

该六工位回转工作台是采用了比较简单的转位斜板和转向盘来实现转位和定位,转位斜板与燕尾形导轨的划板相连,用汽缸推动,转位斜板只能沿导轨作直线运动。

换位斜板是一块多边形,在转向盘底下均匀地分布着一些圆柱定位销,其数量等于分度工位数。当拟制活塞推动斜板向前移动时,斜板的一边推动着定位销,使转向盘回转。转到极限位置时,压缩气体进入拟制的另一腔,使活塞杆带动斜板向后退回。这时斜板的另一边推着另一个定位销,使分度盘继续朝同一方向回转,当斜板移动后退到重点位置时,斜板上的两个边分别靠在相邻两个定位销上,此时分度盘得以正确定位锁紧。

1.2.2 各构件的设计

主要设计的结构有:换位斜板的设计,分度圆盘的设计,轴承的选择,主轴的设计,燕尾形导轨的设计等,这些构件的具体设计见图纸。

1.2.3 气压系统的设计

本工作台所选的动力为气压推动,气压传动与电机传动和液压传动相比,主要有反应快速、流动阻力低,压力损失小,便于集中供气和远距离运送、对工作环境适应性好等优点。在传动过程中,主要分为推进、停留、回程。所以在设计气压传动时,气流过程分为这三个阶段进行控制。

1.2.4 各构件的设计

所需的设计的主要构件有:上板、立柱、底座、左挡板、右挡板、滑座、滑块、支架、接头、销轴、换位斜板、转盘、滚子轴、滚子、轴承座、中轴、圆盘、上盖。每个零件的设计说明在后面且每个零件的详细资

- 2 -

哈尔滨理工大学学士学位论文

料见图纸。 1.2.5 计算部分

在这部分中主要包括换位斜板在各阶段的所需受力、速度、换位斜板的行程等,主要是为气压传动系统的设计做准备。

- 3 -

哈尔滨理工大学学士学位论文

第2章 总体方案设计

2.1 总体结构

1-圆锥滚子轴承 2-立柱 3-底座 4-左挡板 5-滑座

6-滑块 7-右挡板 8-气缸 9-换位斜板 10-分度圆盘

11-主轴 12-圆盘 13-油杯

图2-1六工位实验台装配图

2.2 原理方案的设计

方案 1:采用了比较简单的转位斜板和转向盘来实现转位和定位。转位斜板与带燕尾形导轨的滑板相连,用气缸推动,转位斜板只能沿导轨作直线运动。

- 4 -

哈尔滨理工大学学士学位论文

1前推起始位置 2前推中间位置

3前推终止位置 4后退起始位置

5后退中间位置 6后退终止位置

图 2-2 换位斜板与转向盘原理图

工作台转位和定位的原理见上图,转位斜板是一块多边形板,在转向盘底下均匀地分布着一些圆柱定位销,其数量等于分度工位数,当气缸活塞推动斜板向前移动时,斜板的一边推动着定位销1。使转向盘回转,如上图的(1)、(2)两图所示。(3)图表示斜板向前终了的位置,然后压缩空气进入气缸的另一腔,使塞杆带动斜板后退。这时,协办的另一边

- 5 -

哈尔滨理工大学学士学位论文

推动着定位销2。使转向盘继续朝同一方向回转,如图(4)、(5)所示。当斜板移到后退极限位置时,斜板上的两个边分别靠在两个相邻定位销上。如图(6)所示。这时,转向盘得以正确定位并锁紧。这种利用斜板回转定位的分度回转工作台,结构比较简单。工作也比较可靠,特别适用于小型分度回转工作台和分度夹具,但由于转位斜板的边都是直线,导致原盘受到不恒定的力矩。很难实现预定的运动规律,而且转位时有较大的冲击现象。

方案 2:采用圆柱形凸轮间歇运动机构,六个滚子均匀分布在转盘端面,当凸轮转过角度2时,转盘以图(2)的运动规律运动。这种方案只要能设计出圆柱形凸轮。就能获得所需的运动规律。与方案1项比较,减少了冲击,运动规律能严格按照要求实现。但圆柱形凸轮设计比较复杂,更不好加工。方案1虽然有些冲力,而且不能严格按照所需的运动规律运动。但由于该工作台工作时,负载不大,而且也不需要严格的运动规律。综合考虑,我选方案1。

2.3 轴承的选用

选择滚动轴承类型时,必须了解轴承的工作载荷(大小、性质、方向)、转速及其他使用要求,以下是选用滚动轴承的基本原理:

1)转速较高、载荷较小、要求旋转精度高时宜选用球轴承:转速较低、载荷较大有冲击载荷时则选用滚子轴承。

2)轴承上同时受径向和轴向载荷,一般选用角接触球轴承或圆锥滚子轴承;若精细那个载荷大,轴向载荷小,可选用深沟球轴承的组合结构。

综上所述,由中轴,中轴上零件及工作台上负载的重力作用,使中轴产生较大的轴向力,轴向力的全部由轴承支承,在众多的轴承中,圆锥滚子轴承能支承较大的轴向力,故选用圆锥滚子轴承。因为滚子轴承能同时承受较大的径向力,轴向联合载荷。又内外可分离,装拆方便。

2.4 动力的选择

方案1:电动机,由后面计算可知,要带动该工作台回转,所需的功率不大,可以采用一小电机。但由于该工作台是间歇式工作的,不适合用电机。

方案 2:采用液压,其优点是:

1)同其他传动方式相比,传动功率相同,液压传动装置的重量轻,结构紧凑。

2)可实现无级变速,调整范围大。

- 6 -

哈尔滨理工大学学士学位论文

3) 运动间的惯性小,能够频繁迅速换向,传动工作平稳;系统容易实现缓冲吸震,并能自动防止过载。

4) 与电气设备配合,容易实现动作和操作和自动化;与微电子技术和计算机配合能实现各种自动控制工作。

5) 原件已基本上系列化,通用化和标准化,适于 CAD 技术的应用,提高工效,降低成本。 其缺点:

1)容易产生泄露,污染环境。反映速度慢。

2)引有泄露和弹性变形大,不易做精确的定比传动。 3)系统内混入空气,会引起爬行,噪音和振动。 4)使用的环境温度比机械传动小。 5)故障诊断与排除要求较高技术。

方案 3:采用气压传动,气压传动与液压传动相比,虽远不及液压传动应用那样广泛,但它却具有许多其他能源所不能比拟的优点。

1)空气可以从大气中取之不尽,无介质费用和供应上的困难;同时,可以将用过的空气直接放入,处理方便;与液压传动相比较慢不必设置回收液压油的油箱和管道。万一空气管道有泄漏处引起部分能量损失外,不致引起环境污染。

2)空气的粘度很小,在管道中流动时压力损失较小,一般其阻力损失不到油的千分之一,因此,压缩空气便于集中供应和远距离传送。

3)压缩空气的工作压力较低,一般在0.4到0.8Mpa,可降低对气动原件的材质和制造精度的要求,因而结构简单,易于制造,成本低。

4)气压传动动作迅速,反应快。因此,适用于一般机械设备的控制上。

5)气压传动维护简单,工作介质清洁,管道不易堵塞,已不使用安全,可靠。可以在高温、振动、腐蚀、易燃、多灰尘、强磁、辐射等恶劣环境下工作、便于实现过载自动保护。 此外,气压传动上具有液压传动的一些优点,如操作控制方便,元件便于标准化,易于控制和实现供需自动化等。存在介质变质,补充和更换等问题。

气压传动的缺点:

1)由于空气的可压缩性,使工作速度不易稳定,外载变化对速度影响较大,也难于准确地控制与调节工作速度。

2)由于工作压力较低使结构尺寸较大,气压传动装置的总推力较小,一般约到10到40KN。

3)气压传动的总功率低,仅为电机的1/6 到1/7。 因为机构所需的推力不大,对精度也要求不高,有较快的反应速度,也适合间歇式的工作。所以该工作台的动力采用气压传动。

- 7 -

哈尔滨理工大学学士学位论文

2.5 斜板的选用 方案 1:斜板各边都是直线的。

斜板各边设计成直线的,最大的问题就是冲击问题,下面对冲击的现象进行分析。

对分度回转工作台来说,冲击现象可分为两种:一种是开始回转和回转终了及定位是的冲击。现在先分析后一种现象。当斜板的边推动销使回转台回转时,斜板作用力的方向垂直于斜板失去一边的斜面,定位销的运动方向垂直于回转中心O及定位销中心O1的连线,如图2-3所示。斜板作用方向与定位销运动方向之间的夹角A为压力角。当斜板为直线,如图2-3中所示的协办推动定位销的边与水平成75度和30度的直线时,用

图 2-3 直线边换位斜板原理图

01点相似的方法可用作图法求出O2,O3,O4点的压力角,可以看出这种压力角都是不一样的,由于在回转过程中,定位销运动方向的分力也是一样的。由于在回转过程中,定位销中心与协办的相对位置一直在变化。因此沿定位销运动方向也一直在变化,也推动工作台回转的力一直在变化。所以在回转过程中有不平稳现象,就要把这种压力角设计成不变的。

另外一种是开始回转和回转终了及定位销的冲击现象。开始回转时的

- 8 -

哈尔滨理工大学学士学位论文

冲击现象是由于斜板板面与定位销之间有一段不小的距离,斜往前(往后)推动定位销有一定的冲击力,由于斜板的质量较小,这些冲力也不会太大,要消除也不很方便。回转终了时的冲击是由于回转终了时工作台转盘的速度并不等于零,所以有一定的惯性和冲击力。这种冲击力可以用液压缓冲有刚来吸收,也可以把斜板做成比较复杂的曲线来消除。

这种斜板各边都是直线的,虽存在以上问题,但由于会回转速度小,且转动惯量不大,所以影响不大。该斜板设计和制造比较简单。

方案 2:斜板边设计成等压力角斜板曲线的设计方法,

为了消除工作台回转过程中的不平衡现象,可以把压力欠妥设计成相等的。

下面用一个六工位的实例来说明(见图 2-4)。压力角就在70度到 75度之间,在本例中选用了72度。把定位销直径d和回转半径R按比例绘好。

图 2-4 曲线边换位斜板原理图

将两次回转角度α和β(这里是取六等分的1/2,所以各为30度)分别绘出,并将30度分为六等分,分别绘出定位销中心1~7,并以1~7为中心分别绘出定位销直径,再分别绘出斜板作用力方向的直线,分别与径向成 18度角(因为压力角为72度)。此直线与定位销分别相交于 1'~7'点,通过 1'~7'点作水平方向的平行线。再通过1'点作与斜板作用力方向成90度的直线,与第二条水平线相交于 2"(1"点与 1'点重点),从 2"点作与定位销中心2处于与斜板作用方向成 90 度的直线,与第三条水平线相交于3"点:其余依此类推,做出4"~7"点。用曲线或几段弧把1"~7"连接起来。 斜板虽然消除了不平衡现象,但斜板各边用了较复杂的曲线,设计和制造都比较困难。所以我认为方案1更可取。

- 9 -

哈尔滨理工大学学士学位论文

2.6 润滑方式选择 因最上面的圆盘面积比较大,又是旋转的,所以不便于对圆锥滾子轴承进行润滑。故在上面放一油杯,油杯经过中轴的小孔流入轴承,从而对轴承取到润滑的作用。因为本工作台的受力比较小,速度也很小,所以也可用脂润滑。

图 2-5 油 杯

- 10 -

哈尔滨理工大学学士学位论文

第3章 计算分析

3.1 工作台回转运动规律分析

按照工作台的运动要求,工作台每回转π/3时,工作停下来工作一次,在这π/3 时间内的运动规律如下:

0~0.5s 圆盘以恒定加速度旋转 0.5~1.5s 恒角速度旋转

1.5~2s 圆盘以恒角加速度减速,直到停止。

所以原盘的角速度在π/3 内随时间变化规律如下图 3-1:

0 0.5 1.2 2 t(s)

图 3-1

因为在 2s 内转过的角度为π/3。 所以: (1+2)Wmax/2=π/3 得出: Wmax=2/9π

显然 0~0.5s和 1.5~2s 间的角加速度大小都等于4/9rad/s2

3.2 计算工作台的转动惯量及所需动力

把旋转部分按层来分,分为多个圆柱来求。 对单个底面半径r、高为h的圆柱,其转动惯量如表 3-1:

- 11 -

哈尔滨理工大学学士学位论文

R(mm) H(mm)

1 50 8 表 3-1 部分零件尺寸表 2 3 4 300 15 85 17 50 81 5 130 17 另外,在工作时,工作台有 20kg 的负载放在离中心位置 190mm 处,必须考虑进去。 由于还有油杯,圆锥滚子轴承,摩擦等在计算转动惯量时都没有考虑。 所以总转动惯量I总取2.2kg/m2

所以在加速减速时,所需要的力矩为 M=I·β=2.2×4/9π=3.07Nm 从而圆盘在圆柱销处所需的切向力F=3.07/0.08=38.375N

3.3 在各阶段的受力分析

这是设计过程中很重要的部分,只有准确的受力分析,才能合理地选择气压动力。并保证工作台按照要求的运动规律运动,既要准确,又要保证动力足够大,能推动圆盘转动。动力太大,会增加冲击,产生较大的噪音,对环境造成污染,尤其是在大城市,严重影响居民的工作和休息;另外,冲击太大,会严重影响整机的寿命,造成零件过早地失效。所以在这部分,我们要作严格的受力分析,为各设计打好基础。

3.3.1 在推进过程中

要使圆盘以β=4/9π的角加速度加速,必须受到 F=38.375N 的圆周力(前面已算出)。 由上图的受力分析图 3-2 及公式(3-1)可知:

Fn=Ft/cosθ (3-1)

- 12 -

哈尔滨理工大学学士学位论文

图 3-2 推进过程位置1和3的受力

由于Ft恒定,所以Fn与θ成正比。 所以在推进过程中(从位置1 到位置3)。θ角逐渐增大,又因为位置3是推进的极限位置,所以在位置3处的Fn最大。 Fn的方向始终不变,所以在位置3处的动力应需最大。

F气动max=Fnmax×sin3 =143.2N 注:3为推进过程中的最大压力角,即3=75°

3.3.2 在回退过程中

由上图的受力分析可知:

Fn在位置6上力最大才能保证Ft恒定

F气动max=Ft×cos55°/cos65°=52.3N 在这过程中,最大压力角为6=30°+35°=65° 如下图 3-3

- 13 -

哈尔滨理工大学学士学位论文

图 3-3 回程过程位置4和6的受力分析

3.4 行程的计算

行程计算在设计过程中是一项很重要的计算,它决定着 T 型槽的长度选择。太长的话,会造成尺寸过大,对整个结构设计带来不便,同时也浪费材料,从而增加成本;太小的话,更是不行,导致分度圆盘无法在整个圆周上回转,不能实现预期的设计要求。

另外,行程的计算是选择气缸的主要参数来源,只有确定了换位斜板的最大行程,才能正确选择气缸。

以下是行程计算过程:

如下图 3-4,引入未知数 d0、d1、d2、d3、d4、d5。

- 14 -

哈尔滨理工大学学士学位论文

图 3-4 未知数假设

由换位斜板的已知尺寸可知

44+d2·cos35°=178

Sin35°·d2+4+d3·sin30°=113

由以上两式可解出:

d2=163.58 d3=30.35

由上图可知:

d4·tan35°+4+d3·sin30°=100–r–r/sin55°

得出:d4=67.87

又有: 15+(44–76cos75°)+(178 –44)·cos55°=d5 得出:d5=145.09

又: d6=110+110·sin60°=205.26mm 所以行程为:

l=d6–d5+d4=128.04mm

- 15 -

哈尔滨理工大学学士学位论文

气缸使用场合与其使用场合及工作机构的行程比有关。多数情况下不应使用满行程,以免活塞与气缸盖相碰撞,所以按计算行程多加 10~20mm 的行程余量

- 16 -

哈尔滨理工大学学士学位论文

第4章 气压传动系统

4.1 明确系统要求

据加工的需要,该系统的工作循环是:推进—暂停—回程。 调查结果及计算结果表明,推进和回程的速度为 41.9m/min 推进速度就能在0~41.9m/min 范围内无级调速,速度最大行程为 128.04mm,在这近给方向最大力为143.2。在回程过程上,气缸所需的最大力为 16.7N。中间要停留 1 秒。在这过程中,气缸所受的负载为 0。

4.2 分析系统工况

气压在工作过程各阶段的负载为: 启动加速阶段受力图如图 4-1:

图 4-1 启动加速阶段受力图

启动时,分度圆盘的角加速度为β=4/9πrad/s ,此时受到Ft=38.375N的圆周力(后面有计算过程)。

所以F气动=Ft·tan3=88.9N

推进过程中:

由前面计算可知:F气动max=143.2N 回程过程中:

- 17 -

哈尔滨理工大学学士学位论文

由前面计算可知:F气缸max=52.3N; 将气压在各阶段的速度和负载列于下表中。

表 4-1 气压缸在各阶段的速度和负载值 工作阶段 速度v(m/s) 负载F/N 88.9 启动加速 推进 回程 0.698 0.698 52.3 143.2 4.3 确定执行元件的工作压力

4.3.1 初选气压缸的工作压力

由上表可知参考同类型组合机床,取气压缸工作压力 P 为 0.1MP

4.3.2 确定气压缸的主要参数

由上表可看出,最大负载为推进终止位置的负载 F=143.2N

D3F4143.23.140.11000000P42.7

查找设计手册,按液压缸内径径系列将以上计算圆整为标准直径,取 D=70mm

4.3.3 计算液压缸的流量和功率

1)计算气压缸的输入流量

因推进时的速度为0.698m/s,则液压缸各阶段的输入流量为推进和回程过程的速度相同,所以这两阶段的流量相同。

q=π·d2·v=3.14×452×0.698×10-4=26.6L/min

2)计算气压缸的输入

各阶段的输入功也是相等的。

P=p·q=0.1×106×26.6×10-2/60=0.44kw

通过查机械设计手册: 选用气压缸型号:QCJ2B 16-130

- 18 -

哈尔滨理工大学学士学位论文

4.4 拟定系统原理图 根据组合机床的设计任务和工况分析,该机床对调整范围,低速稳定性有一定要求,因此速度控制是该机床要解决的主要问题。速度的换接,稳定性和调节是该机床气压系统设计的核心。

速度控制回路的选择:

本机订的推进运动要求有较好的低速稳定性和速度负载特性,故采用调速阀调速,有三种方案可供选择,即进口节流调速,出口节流调速。本系统为小功率系统,效率和发热问题并不 突出;在整个旋转过程中,负载和速度都不大,而且是正负载,所以冲击不太大,所以不需要加背压阀。在各阶段的速度和负载都不一样,所以要选用节流阀,通过改变节流口通流面积大小来改变局部受力的大小,从而现实对流量的控制,来改变换位斜板的速度。

该气压系统各阶段工作状况分析:

推进过程:此时,电磁阀得电,接通电磁阀的左端,气体从气缸的右腔,推动活塞各左运动。

回程过程:此时二位四通电磁阀不得电,电磁阀的右端接入系统,气体经过节流阀进入气缸的左腔,推动活塞向右运动。如图4-3。

- 19 -

哈尔滨理工大学学士学位论文

1-气缸 2-单向节流阀 3-二位四通电磁阀 4-气源

4-3气压系统图

- 20 -

哈尔滨理工大学学士学位论文 结论

在这一个学期时间内,在孙老师的指导下并通过自己的努力。顺利完成了毕业设计。设计的内容为六工位回转工作台的设计。

经过这一个学期做毕业设计,使我在原来理论知识基础上得到了升华。不仅进一步巩固了以前三年所学的理论知识,还让我了解了设计机械产品的整个过程:怎样去收集、理解各种资料、怎样具体设计、怎样去编写、整理论文。同时也让我深深体会到,现实中设计一机械产品是多么艰辛,并不像理论说的那么简单。不仅要扎实的理论知识,还要考虑到许多现实因素。这些收获都为我以后的学习和工作取到很大的指导作用。

在设计六工位回转工作台过程中,我采用了论文中的方案。如论文中所诉,该方案由很多优点。但也未必是最好的,其中不可避免地存在一些问题。首先,在推进和回程过程中,推力是不变的,而换位斜板各边都是直线,使在各处的压力角不相等。最后导致分度圆盘所受的圆周力不一样,即旋转的角速度一直在变,从而工作台不能严格实现预期的运动。其次,分度圆盘旋转一工位的开始和结束时,都有比较明显的冲击现象,不过该工作台的负载较小,问题不大,如果负载较大的话,那该方案就不可取了,应该选用等压力角斜板曲线的设计方法。

- 21 -

哈尔滨理工大学学士学位论文 致谢

时光的流逝也许是客观的,然而流逝的快慢却纯是一种主观的感受。当自己终于可以从考研、找工作、毕业设计的压力下解脱出来,长长地吁出一口气时, 我忽然间才意识到,原来四年已经过去,到了该告别的时候了。一念至此,竟有些恍惚,所谓白驹过隙、百代过客云云,想来便是这般惆怅了。 可是怅然之后, 总要说些什么。 大学四年, 生活其实很简单, 只是一些读书、 写字和考试的周而复始。如果把这种单调的生活看作一场场循环的演出,那么我只是一个安静的演员。这篇毕业设计也绝称不上什么精彩的台词,只不过是这种循环演出即将告一段落时的谢幕词。但是无论多么蹩脚的演员,无论台下有多少观众,即使是只说给自己听,在他谢幕时也总要感激一些人,是这些人帮助他 走上舞台,成功或者不那么成功地―演出‖ 。 我在这里首先要感谢的是我的毕业设计指导老师——孙全颖老师。这份毕业设计从开题、资料查找、修改到最后定稿,如果没有他的心血,尚不知将以何等糟糕的面目出现。我很自豪有这样一位老师,为了指导我们的毕业论文,他放弃了自己的休息时间,他的这种无私奉献的敬业精神令人钦佩也值得我感激和尊敬。 感谢和我共度四年美好大学生活的哈理工机械07-11班的全体同学。感谢机械学院和其他学院的所有授课老师,感谢他们的教诲,让我知道在社会上懂得怎样去做好自己,端正 自己的位置,为社会贡献出我自己的力量。感谢所有关心、鼓励、支持我的家人和朋友。

- 22 -

哈尔滨理工大学学士学位论文 参考文献

1 邱宣怀编.机械设计. 第四版. 高等教育出版社 2 高常识编.液压与气压传动. 高等教育出版社

3 哈尔滨工业大学理论力学教研组编.理论力学. 高等教育出版社. 4 机械工程手册编委会编.机械设计手册.第二版.北京:机械工业出版社 1997

5 姜海,宋锦春等.液压与气压传动.高等教育出版社,2002,1(1) 5~310 6 高鑫,姚玉春,李林贵主编.机械设计.沈阳:东北工学院,1988: 10~213 7 徐瀛主编.机械设计手册第二版.北京:化学工业出版社,1985: 1~315 8 邱宣怀主编.机械设计.第四版.高等教育出版社,1997,(4): 1~250

9 大连理工大学工程画教研室编.机械制图.第四版.高等教育出版社,1995: 1~269

10 徐福玲,陈尧明主编.液压气压传动.机械工业出版社,1999: 1~257 11 Hydraulic pressure pneumatic actuator machine parts design handbook (sequel) -

hydraulic transmission and pneumatic actuator - metallurgical industry publishing house,1994,(4) : 56~175

12 H.Liu J,Butterfass S,Knoch P,Meusel G.Hirzinger.A New Control Strategy for DLR Multisensory Articulated Hand.13 H.Liu J,Butterfass S,Knoch P,Meusel G.Hirzinger.A New Control Strategy for DLR Multisensory Articulated Hand,19,(5) : 19~66

- 23 -

哈尔滨理工大学学士学位论文 附录

Development of a PLC Virtual Machine orienting

IEC 61131-3 Standard

Abstract—Programmable Logic Controller (PLC) plays a more and more important role in the field of industry. To deal with the heterogeneity of manufacture-dependent programming languages, IEC 61131-3 international standard has promoted the PLC openness to developing. In this paper, we present a proposal to implement the IEC 61131-3 standard in a PLC virtual machine (VM), which is a new kind of high-level language VM and takes Instruction List (IL) as the intermediate code. We discuss the syntax and semantics of IL, and show the design architecture for the emulation engine using both interpretation and translation methods. The PLC VM enables developers to rapidly porting an IEC-61131-3 application onto different platforms. We have implemented the PLC VM on a C51 based embedded PLC platform.

Keywords-Programmable logic controller; virtual machine; IEC 61131-3 I. INTRODUCTION

With the accelerating popularity of networked control system, as a main type of discrete controller, the PLC has been unprecedentedly applied in industry field. Traditional programming languages for PLC had several drawbacks, including : weak software structure, limited control over program execution, and in particular, limited facilities for software porting due to the lack of unified syntax and semantics between PLC products. The IEC 61131-3 standard is a global standard that tries to overcome these problems to improve software quality . However, the software porting problem is still outstanding because of different addressing schemes, various tasks scan rates, and a lack of standard file format to store IEC 61131-3 applications. In this paper, we focus

- 24 -

哈尔滨理工大学学士学位论文 on proposing a virtualization based solution to such a software porting problem. Virtual machine provides a way of enhance software interoperability, system impregnability, and platform versatility , which are used in a number of disciplines ranging from programming languages to processor architectures. When a system (or subsystem), e.g. a processor, memory, or I/O device, is virtualized, its interface and all resources visible through the interface are mapped onto the interface and resources of a real system actually implementing it. With this concept, the PLC VM is the traditional PLC system in abstract, using the hardware-independent instruction set and shielding the application logic from hardware. When hardware platform changes, only the PLC VM needs to be transplanted, and the user's application does not require any changes in procedures. Hence, The VM provides an effective way to port the IEC 61131-3 based application logic onto different platforms. Therefore, our virtual machine is orienting PLC programming standard - IEC 61131-3. One of the standard languages - IL is taken as the intermediate code to cope with hardware-independent control logic. Meanwhile, unified local API interfaces are designed to deal with hardware-dependent calls in the instruction interpretation process. In short, Pre-compiling the local resources, real time interpreting the IL logic and on-demand calling the local interfaces are the main characteristics of our PLC VM. The rest of this paper is organized as follows: Section II overviews the related work in two aspects: IEC 61131-3 standard and embedded virtualization technology; Section III shows the virtualized system architecture for PLC VM. Section IV analyzes the syntax and semantics of IL, describes the VM hardware-dependent configuration process and details the implementation of instruction emulation engine. The implementation and test of PLC VM on a C51 based PLC platform is presented in Section V. This is followed by a conclusion and future work in section VI.

II. RELATED WORK

A. IEC 61131-3 overview The IEC 61131 standard is a general

- 25 -

哈尔滨理工大学学士学位论文 framework that tries to establish the rules to which all PLCs should adhere to, encompassing mechanical, electrical, and logical aspects. The third part, IEC 61131-3 , deals with the programming aspect of the industrial controllers, defining the logical programming blocks and the programming languages. IEC61131-3 has stipulated five kinds of programming languages, including instruction list (IL), ladder diagram (LD), sequential function diagram(SFC), function block diagram (FBD) and structured text (ST). IL is a simple typed, low-level, assembly language, frequently used whenever it is necessary to have compact, ime-critical code. In particular, it can act as the intermediate carrier for the other four languages, LD, SFC, FBD and ST. For instance, the famous IEC 61131-3 compiler Open PCS [4]takes the IL as the basic component to support the internal translation between high-level languages. B. Embedded virtualization technology VMs can be divided into two categories [3]: process virtual machine and system virtual machine. The former can only provide a virtual environment to a single system process, such as Java, Smalltalk and the other high-level language (HLL) VM. The latter is to virtual system as a whole, such as VM Ware and Virtual PC.

Over the years, designers have developed a number of HLL VMs targeted at specific languages. A well known example was Java virtual machine (JVM) [5]. To deal with platform dependent, Java programs should first be compiled to java binary classes, and then JVM loads and executes it. By applying Java technology, Grabner [6] proposed Virtual PLC architecture to be platform independent. However, its implementation is focused on realizing remote supervision and maintenance through general purpose computer. PLC is a typical kind of embedded device, whose architecture is different from general purpose computer. Yuki Kinebuchi [7] has discussed the benefits of applying virtualization techniques on embedded systems. Much to our regret, the performance of its implementation was not enough to meet the strict resource requirements, and also lacking in the support of real-time guarantee. Heiser [8]

- 26 -

哈尔滨理工大学学士学位论文 argued that virtualization is unable to meet the special requirements of embedded systems. Hence, when we think in virtual machines we always remember the overhead of the interpretation. Nowadays, apart from this thought, virtualization constitutes a valid approach to be applied to another typical embedded application field - wireless sensor network (WSN). The proof is the broad range of software proposals for WSNs based on virtual machines [9]. As we’ve seen, there is still lack of work to apply embedded virtualization technologies for PLC. Our work is focused on designing a HLL VM to support IEC 61131-3 languages, called PLC VM. It enables users to rapidly port applications to different platforms, specially the restricted embedded environment.

III. PLC VIRTUAL MACHINE

A. Design goals The overall goal is to enable developers to rapidly implement back ends of PLC applications. We identified the two specific PLC VM design goals: x Provide programming support for IEC 61131-3 standard, through interpreting IL code. x Provide a unified set of local resource interfaces to shield the differences between PLC platforms, such as addressing schemes, task scan rates, peripheral devices driver and so on.

B. System Architecture Full cross-platform portability is more easily achieved by designing it into overall system architecture. Here, as the illustration of VM-based system architecture (Figure.1), the application environment does not directly correspond to real platform. Instead, it is designed for ease of portability and to match the features of VM. The VM is focused on minimizing hardware-specific and OS-specific features, which would compromise platform independence. Specially, a compiler front-end generates abstract machine code, called portable code. This portable code is in essence the machine code for VM. It could be distributed onto different platforms. For each platform, an interpreter in VM takes each instruction, decodes it, and then performs the required state transformations involving memory and stack. I/O

- 27 -

哈尔滨理工大学学士学位论文 and peripheral functions are performed via a set of standard API calls which are defined as a part of the VM.

IV. IMPLEMENTATION OF VIRTUAL MACHINE

A. Portable code – IL language IEC 61131-3 defines five standard programming languages for PLC. Among them, IL is the only assemble language which could be direct interpreted as an intermediate code. Other type of languages can be translated to IL program. Therefore, we choose IL as the portable code to support the full-set of IEC 61131-3.

1) Syntax IL is executed line by line. Each instruction line is corresponding to an executable PLC order. Apart from the variable declarations, IL programs are sequences of statements. A statement mainly consists of a command and a series of operands. Sometimes, a statement begins with a label to denote the command location in the program. Additionally, programs can be augmented by annotations.

2) Semantics Semantics analysis is to determine what statement is legitimate. The matching rules are listed in Table I. In general, we considers the following three major points: x Read the command line by line and record the start and the end point. x Identify the command and operand types. x Check whether the scope of the operations beyond the limit. Firstly, the appearance of denotes the beginning of an instruction line, and \"\\n\" is the end. Secondly, identifying the COMMAND is to match the first ―string‖ with definition of IL Code. Following COMMAND strings is categorized to different types of operands. For instance, ―LD S1‖ is identified as the pattern ―string+string1‖, an indirect operand, and then translated to the pattern ―%+string+num‖ according to variable definitions. ―LD %IX1.1‖ is usually interpreted as the 1st bit of the 1st input channel. If the operand pattern is not matched, the semantics analyzer should step into error process .The major components of a PLC VM are shown in:

VM loader: writes the IL code as input ‖data‖ into a region of memory

- 28 -

哈尔滨理工大学学士学位论文 holding the interpretation and translation routines.

Initialization: allocates memory space for the code cache, operand stack and matching rule table used during the emulation process.

Emulation engine: uses both interpretation and binary translation to emulate the IL instructions. The emulation is mainly performed via interpretation with a prerecorded intermediate form. And the translation is responsible for dealing with the local operations which happened in interpretation progress.

Local API manager: provides a unified local call interfaces for code interpretation, and decides which translations should be flushed out to make room for new translations.

OS call emulator: translates the VM activity into an appropriate call on the OS and then handles any associated information returned as a result of the call.

I/O & Peripheral emulator: translates the I/O or peripheral operations into an appropriate call on the local resource code library and then handles any associated information returned as a result of the call. Moreover, which has been denoted in the Fig.3, toachieve the platform-independent, there are three steps should be completed before the run of PLC VM:

VM environment configuration, that is to allocate memory for storing IL code and set operand stack.

Replacement of the indirect operands with the actual system IO address, the decoupling of the relationship between the local related operations and the control logic.

Encapsulation of the peripheral driver package under a unified set of interfaces, to allocate the special code cache for operation of the local resource library.

C. Emulation engine The following detailed the PLC VM design (Figure. 4). PLC_VM is a factory class, which is responsible for the creation of the other four components of VM, while an interface function Interpret Codes to

- 29 -

哈尔滨理工大学学士学位论文 explain the IL-code, using the pointer C code Based for the location of each command to call the command execution function. As the IL-code interpretation is designed based on object-oriented idea, each command is a subclass which is derived from super class C Code Base. C Code Base is to provide a pure virtual function. Each command subclass inherits it, rewrite the function and realize the semantic itself. In this way, there is no need change the interface code for the interpretation of each command. The major four components in VM are listed below:

Stack of function calls: to record the point of function call and the context switch.

Stack of operands:used for buffering the immediate results of computing, similar to the Evaluation Stack in .NET CLR framework.

Data sector: responsible for the storage of local and global variables. When accomplishing the interpretation of one instruction line, the data sector would be recovered immediately.

Code buffer area: responsible for the maintenance of IL code, load and remove.

The IL program decoded process in the emulation engine is described in Figure.5. Firstly, the Load_ IL Codes () loads the IL program. Then, the VM runs a process to analyze the variable and function definitions in the head of source code, and translate the indirect operands to be immediate operand (actual address). Following that, by matching command code, if the CAL or JMP are found, the information of functions blocks and the jump target address in the IL program will be collected. Based on it, the source IL code would be rearranged to be an optimized form which is to reduce the work of interpretation and improve the efficiency. Finally, the interpretation process is to execute the optimized code line by line, since each line represents a logic command execution or a local call.

V. EXPERIMENTS AND ILLUSTRATION

- 30 -

哈尔滨理工大学学士学位论文 Our platform consists of three parts: an embedded hardware platform; a compact micro-kernel to provide real-time task scheduling and interfaces for secondary development; and a PLC VM to execute IL code.

1)Hardware As shown in Figure.6, The proposed hardware platform is based on: a high-performance micro-controller chipset, including a CPU C8051f120 (MPS peak is 100MHz), 128K program memory (Flash) on chip and 256K data storage areas (expand RAM). In accordance with the requirements, I/O port can be reuse as SPI, I2C interface, external interrupt, external counter, AD/DA port. Besides, the communication interfaces, such as CAN, UART and Ethernet, are also available on the embedded platform.

2)Micro-kernel The kernel is a reduced and compact OS, which has been used in our previous implementation of embedded PLC [10]. The main characteristics are as follows: Task scheduling: scheduling on the interpretation tasks of VM and the asynchronous events on ports. Normally, the CPU is released to the code interpretation cycle in PLC VM. When the asynchronous event takes place, the PLC VM task will be suspended and executed the asynchronous task. If a number of external events occurred, the kernel employs priority-based scheme to deal with the collision.

Inter-process communication: allocates a special data resources for the IL program interpretation, part of which named the file index table (local file area).The external events are formed as a set of local files. Through the index table, the interpretation of IL can communicates and deals with the external events.

Conflict resolution: for the hard real-time tasks, the priority is depend on the response time; for the soft real-time tasks, the priority arranged in a polling way, which is to check the task flag bits and execute one by one when there is no hard real-time task request. When task drove resource to the limit, the system will respond to the delay. To meet real-time requirements, the kernel queries the implementation status of the tasks and adjusts the task priorities.

- 31 -

哈尔滨理工大学学士学位论文 B. Implementation With respect to the reconfigurable of PLC VM, the VM runtime environment and the hardware-dependent local resource library were developed separately. The embedded developing tool Keil C51 compiled the local resource library to be HEX file. During interpretation progress, the HEX file would response to the calls of hardware-dependent operations through the unified local manager interface. HEX file is often used to transfer the program and data that would be stored in a ROM. It is composed of any number of HEX records. Each record is made up of five fields that are arranged in the following format: Headings, or heads, are organizational devices that guide the reader through your paper. There are two types: component heads and text heads. :llaaaatt[dd...]cc : is the colon that starts every Intel HEX record. ll is the record-length field that represents the number of data bytes (dd) in the record. aaaa is the address field that represents the starting address for subsequent data in the record.

tt is the field that represents the HEX record type: 00 - data record; 01 - end-of-file record; 02 - extended segment address record; 04 - extended linear address record [dd…] is the data field. cc is the checksum field that represents the checksum of the record. In order to extract the target code from HEX file, we defined a data structure as follows:

typedef struct Hex {int len; int addr; unsigned char data ; struct Hex *next; } hexformat;

We designed a HEX file reading process as follows: The first step is to define a set of linked lists Hex list with the structure type of hex format, and load the records of HEX file into the list of nodes one by one .The second step is to sort the linked lists by the Hex List.addr in ascending order. The third step is to read the Hex List.data at the beginning of linked lists, repeat the above executions in turn, whose times is decided by HexList.len, and write the results to some specific procedures according to the unified set of call interfaces – local API manager. Finally, these specific procedures are the execution files which act

- 32 -

哈尔滨理工大学学士学位论文 as responses to the VM call.

C. Test results Firstly, PLC VM implementation cost on C8051F120 platform is presented in the following table II. It shows that the PLC VM totally costs 67150 bytes code space and 15248 bytes data space in current implementation. In fact, the PLC VM procedure is written in C language for the ease of implementation on C8051f120, although the virtualization architecture is illustrated in component based idea. The interpretation of each command line is a call to corresponding execution function. Additionally, in order to decrease the overhead induced by VM, the division of data space is static and allocated manually before the system run. Secondly, we measured the IL instruction execution time. As listed in Table III, the results are range from 0.025ms to 0.131ms. Except for the floating math (costs 0.131ms), all the instruction will be interpreted within 0.05ms. It shows that when given the highest priority, the interpretation process in VM would bring little influence on the kernel, since the 0.1ms level real time scheduling was supported in our kernel.

VI. CONCLUSION AND OUTLOOK

In this paper, we have presented a HLL VM to support IEC 61131-3, called PLC VM. It enables users to rapidly porting IEC 61131-3 applications to different platforms, specially the restricted embedded system. The implementation also presents several other features. First, the other four IEC 61131-3 languages (LD, ST, FBD, and SFC) are supported through the intermediate code - IL indirectly. Second, rapid second-development of PLC VM is enabled, because various peripheral drivers or user configurations can be loaded without affecting the architecture. Third, since applications could not directly perform on the OS-kernel or hardware, the virtualized architecture provides a good protection on the lower-level code. Further research can included at least three aspects:

Further code optimization.

Interface to IEC61131-3 development tools, such as Open PCS.

- 33 -

哈尔滨理工大学学士学位论文 Implementation on other platform architectures.

- 34 -

哈尔滨理工大学学士学位论文

开发一个面向PLC的IEC 61131-3的标准虚拟机

摘要——可编程控制器(PLC)在工业领域中的作用越来越重要。为了应对生产依赖编程语言的情况,IEC 61131-3国际标准改进了PLC的开放性。在本文中,我们提出了一个建议,在PLC虚拟机中实施61131-3标准(VM),这是一个高级的语言,并采取一种新的虚拟机指令表(IL)作为中间代码。我们讲述IL的语法和语义,并展示它的软件设计架构。PLC虚拟机可以使开发人员能够迅速地把IEC - 61131 - 3应用到不同的平台。我们用一个嵌入C51的 PLC平台来实现PLC虚拟机的运行。

关键词:可编程逻辑控制器,虚拟机; IEC 61131-3标准 一.引言

随着网络控制系统的加速普及,作为一个的控制器的主要类型,PLC空前的广泛应用于工业领域。传统的PLC编程语言,包括了几个缺点:脆弱的软件结构,对计划执行的控制能力有限,特别是移植能力受到PLC产品之间的语法和语义软件设施。国际电工委员会61131-3标准是一个全球性的标准,也试图克服这些问题,提高软件质量。但是,软件移植的问题仍然存在,因为不同的存址方法,不同的工作扫描率,以及缺乏标准的文件格式存储IEC 61131-3的申请。在本文中,我们着重在提出一个虚拟化的解决方案来应对软件移植的问题。总之,预编译的本地资源,实时解释的IL逻辑和按需调用本地接口是我们的PLC虚拟机的主要特点。本文的其余部分组织如下:第二节概括了两方面的相关工作类型:IEC 61131-3标准和嵌入式虚拟化技术,第三节给出了PLC的虚拟机的虚拟化的系统架构。第四部分分析了语法和语义的IL,描述了虚拟机的硬件相关的配置过程和细节的仿真引擎的实现。在第五节中提出实施以C51为的基础的PLC可编程序控制器虚拟机试验平台,第六节是最后的总结。

二.相关工作

IEC 61131-3标准的概述 国际电工委员会61131标准是一个通用的框架,要确定所有的PLC都要遵循,包括机械,电气和逻辑方面的规则。第三部分,IEC 61131-3标准,涉及的工业控制器编程方面,确定合理的编程模块和编程语言。IEC61131 - 3规定的五种编程语言,包括指令表(IL),梯形图(LD),顺序功能图(),功能块图缓冲(FBD)和结构化文本(ST)。指令表是一种简单类型的,低层次的,汇编语言,经常使用时,必须有结构紧凑,输入法的关键代码。特别是,它可以作为中间载体,转换其他四种语言,梯形图(LD),顺序功能图(SFC),功能块图缓冲(FBD)和结构化文本(ST). 例如,著名的IEC 61131-3遍及打开器需要IL为基本单位支持内部翻译双方高层语言。二嵌入式虚拟化技术的虚拟机可分为两大类:系统进程的虚拟机和虚拟机。前者可以只提供一个虚拟的环境,以单一系统的过程中,如Java,Smalltalk和其他高级

- 35 -

哈尔滨理工大学学士学位论文

语言的VM。后者是虚拟系统作为一个整体,例如VM Ware和Virtual PC。

三.PLC的虚拟机

A.设计目标 总的目标是使开发人员能够迅速的应用PLC。我们确定了两个具体的PLC虚拟机设计目标:X提供编程为IEC 61131-3标准的支持,解释IL代码。 X提供了一套统一的本地资源,以屏蔽接口之间的差异,如PLC平台解决方案,任务扫描速度,外围设备的驱动程序等。

B.系统架构 全跨平台的可携性设计更容易被纳入整体系统架构。在这里,作为虚拟机为基础的系统架构图,应用程序环境不直接对应到实际的平台。相反,它是专为携带方便,并配合虚拟机的功能。虚拟机的重点是减少硬件和操作系统的具体的特定功能,这将损害的平立性。特别地,一个编译器前端生成抽象机代码,称为可移植代码。这种便携式的代码是在虚拟机机器代码的本质。它可以分配到不同的平台。对于每个平台,需要在虚拟机解释每个指令,解码,然后进行必要的转变,涉及状态和堆栈内存。 I / O和外设功能是通过执行一个标准API,它是作为虚拟机的一部分定义的要求设置。

四.实现虚拟机

A:可移植代码 - IL语言 IEC 61131-3标准定义了五个标准的PLC编程语言。其中,IL语言是唯一的汇编语言可直接作为一种中间代码解释。其他类型的语言可以翻译成IL语言方案。因此,我们选择IL语言作为的移植代码,以支持全的IEC 61131-3的集。

初始化:分配的代码缓存的内存空间,操作数堆栈和匹配规则表,在仿真过程中使用。

仿真引擎:使用二进制翻译口译和效仿的IL指令。该仿真主要是通过执行一个预先录制的中间形式的解释。而翻译与解释的进步而发生在当地业务负责处理。

本地API代理:提供一个统一的代码解释本地电话接口,并决定哪些翻译应该输出,为新的翻译腾出空间。

操作系统调用仿真器:转换成相应的操作系统上调用虚拟机的活动,然后处理任何相关的信息作为调用的结果返回。

五.实验和插图

我们的平台包括三个部分:一个嵌入式硬件平台,一个紧凑的微内核,提供实时任务调度和二次开发接口,以及PLC的虚拟机来执行IL代码

1)硬件 建议硬件平台是基于:一个高性能的微控制器芯片,包括一个CPU C8051F120单片机(峰值为100MHz),128K的内存芯片方案和256K数据(存储区域(闪存)扩大内存)。按照要求,I / O端口可以作为的SPI,I2C接口,外部中断,外部计数器的AD / DA端口重

- 36 -

哈尔滨理工大学学士学位论文

用。此外,通信接口,如CAN,UART和以太网,也可在嵌入式平台。 2)微内核 内核是操作系统的一个收缩,结构紧凑,一直在我们的嵌入式PLC [10]前面的实现中使用。其主要特点如下:

任务调度:调度的虚拟机的解释任务和港口的异步事件。通常情况下,CPU是释放到代码解释周期在PLC虚拟机。当异步事件发生时,PLC虚拟机的任务将暂停执行异步任务。如果发生外部事件的数量,内核采用基于优先级的计划,以应付相撞。

typedef struct Hex { int len; Int addr;

unsigned char data[16]; struct Hex *next; } hex format; 六.结论与展望

在本文中,我们已经提出了初步试验成功,虚拟机支持IEC 61131-3标准,被称为PLC的虚拟机。它使用户能够迅速移植到不同的IEC 61131-3标准的应用平台,特别是受的嵌入式系统。实施还带来若干其他功能。首先,其他4个IEC 61131-3语言(LD, ST, FBD, 和SFC)是透过中间代码 - IL语言代码间接的支持。二,快速的第二期PLC虚拟机的发展是启用的,因为各种外设驱动程序或用户配置可以在不影响建筑加载。第三,由于不能直接申请执行在OS内核或硬件,虚拟化的架构提供了一个良好的保护级别的代码就低。进一步的研究至少可以包括三个方面:

进一步代码优化。

接口,以IEC61131–3标准为开发工具,如开放的 PCS。 实现对其它平台的架构。

- 37 -

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- gamedaodao.com 版权所有 湘ICP备2022005869号-6

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务