基于.net的五自由度机械手控制软件的设计与实现
景鑫,陆瑶
(无锡职业技术学院 机器人研究所 江苏 无锡 214121)
关键字:五自由度机械手;机械手;统一建模语言;.net 框架
The Design and Implementing of Operation Software Based On .Net For Five-Degree-of-Freedom Manipulator
Jing Xin, Lu Yao
Abstract: The electric operation card operates the electric motor to implement the movement of five-degree-of-freedom manipulator, the control software of upper monitor just runs the basic moving-unit functions which the card just offers in programmer directly foretime, therefore the programmer itself didn’t have the managing logic. The article describes a design of the software construct of five-degree-of-freedom manipulator which is developed by Robot laboratory of Wu xi Institute of Technology, and implements the programmer under the .net environment in C# language. In the end, the article summarizes the method, and describes the shortage and improvement.
Keywords: five-degree-freedom manipulator; manipulator; UML; .net framework
中图分类 :TP241 文献标识码:A
1 引言
2 软件设计
2.1设计理念
机械手的一次运动行为是由单关节运动(也称单轴运动)或多关节联动(也称多轴联动)组成。通过多个单轴运动和多轴运动组成机械手的一次运动行为[2]。因此,在软件设计中需要设计实现机械手运动姿态的一系列接口以及各种运动方式的有序连接。
图1 五自由度机械手
(Fig.1 Five-Degree-of-Freedom Manipulator diagram)
2.2 设计方案
图2 软件结构图
(Fig.2 The structure diagram of software)
通过以上分析可以可知,整个机械手的运动控制实际上全部由电机类的提供,机械手的任何行为都可以通过其软件结构逐步传递给电机类,由电机类中的基本运动函数实现其运动姿态。
3重点和难点
3.1 控制卡函数的调用
通过运行MPC07卡的安装程序,其函数库以动态链接库(dll)的形式安装到本机的windows操作系统。该卡提供的函数库基于MFC框架,并不能直接被.net framework调用,所以,必须首先把这些函数导入到开发程序中才能保证其正常运行。在此背景下,通过使用微软的DLL Import技术,可以将不兼容的函数库导入到应用程序中,从而解决该问题[5]。
这种技术允许用户使用规定的语法调用WIN32 API以及任何基于MFC的dll。因此,在机械手控制程序中创建一个ManipulatorDynamicLib类用于专门保存MPC07.dll提供的运动函数。如自动设置函数的导入。
public class ManipulatorDynamicLib{
[DllImport(“MPC07.dll”)]
public static extern int auto_set();
}
3.2边界的预判断
五自由度机械手除基座关节可以360度运动外,其他关节有运动极限,所以,在实现其运动姿态时应考虑到关节运动的极限位置,否则可能因过度运动而造成的机械损害。因此,在实现其运动功能函数时,需用多线程或者计时器实时判断其运动矢量是否到达了临界位置[6]。
3.3 运动顺序的安排
机械手的运动因周围环境的影响需要设置其关节的运动顺序,所以,最优运动姿态不一定是最好的运动方式[7-8]。例如,机械手向斜上方做直线运动时,可能会碰到周围环境中的物体,所以,需控制大臂和小臂联动将手臂抬高,然后再控制基座做旋转运动。因此,在设计控制程序的过程中,应有手动控制单元,避免周围环境对机械手造成损害。
软件界面如图3。
图3 软件界面
(Fig.3 The interface of software diagram)
4 结论
其次,电机的类型也可设计为电机接口,而不是实例化的直流电机或者步进电机。将电机类型设置为电机接口可以提高软件的扩展性,有利于软件的后期开发和功能扩展。
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!