VC++(MFC)编程(doli等控制器使用)高精度双油缸同步控制设计 下载本文

内容发布更新时间 : 2024/10/23 13:36:34星期一 下面是文章的全部内容请认真阅读。

重庆大学本科学生毕业设计(论文) 摘要

摘 要

本论文设计是基于VisualC++6.0软件下实现双油缸同步控制系统的编程,探索同步控制的控制策略,并且完成高精度双油缸同步控制实验。该系统控制界面不仅简洁实用,而且具有良好的人机交流功能。

上位机控制系统所实现的功能有双油缸的通讯、UP、暂停、DOWN、停机、位移显示、曲线显示等,在完成同步控制程序后探究反馈控制策略并编写程序,实现双油缸同步控制。在接口程序编程部分,本文采用EDC220控制器提供的接口函数实现PC机与控制器通讯,数据的发送与接收采用统一通讯协议,这种方法不仅简单,而且实用。本文采用控制器作为下位机来验证上位机控制功能,控制器作为下位机主要负责两个油缸的各种参数数据的采集,然后通过端口把数据发送给上位机,PC机作为上位机主要负责数据的分析处理和显示。本文最后完成高精度双油缸同步控制实验,验证同步控制精度。

关键词:双油缸,VC++,EDC220控制器,反馈,同步控制

重庆大学本科学生毕业设计(论文) ABSTRACT

ABSTRACT

This design's core is under the software of Visual C++6.0, realizes the double hydraulic cylinder synchronous control system programming, explores control strategy of EDC220 controller, and completes experiment for high-precision double hydraulic cylinder synchronous control. This control interface has not only succinct practical, but also has the good man-machine exchange part.

The superior machine system realizes the function has the double hydraulic cylinder's Communication, Up, Pause, Down, Stop, Displacement demonstration, Curve demonstration and so on. After completing synchronous control program, exploreing the feedback control strategy and programming, and Achieve double hydraulic cylinder synchronization control. Interface programming part, EDC220 provides the use of interface functions to achieve PC-controller communication, the data transmission and the receive uses the unified communication protocol, this method is not only simple, but practical. In this article uses the EDC220 controller to confirm the superior machine control function as the lower position machine realization, the EDC220 controller as lower position machine primary cognizance double hydraulic cylinder 's each kind of parameter data gathering. Then through the port the data transmission for the superior machine, PC machine takes the superior machine primary cognizance data the analysis processing and the demonstration. Finally, completed high-precision the double hydraulic cylinder synchronous control experiment, to verify the accuracy of synchronization control.

Key words: Double hydraulic cylinder, VC++; EDC220 controller, feedback, synchronous control

II

重庆大学本科学生毕业设计(论文) 目录

目 录

摘 要 ................................................................................................................................................................... I ABSTRACT .......................................................................................................................................................... II 绪 论 .................................................................................................................................................................. 3 1 同步控制策略 ............................................................................................................................................... 5

1.1 EDC220控制器 ................................................................................................................................ 5

1.1.1 同步化模块 ......................................................................................................................... 6 1.1.2 同步系统命令 ..................................................................................................................... 7 1.1.3 同步数据处理 ..................................................................................................................... 8 1.2 MFC类库 ............................................................................................................................................ 9 1.3反馈控制 .......................................................................................................................................... 10 2 GUI设计 ........................................................................................................................................................12

2.1 主界面 .............................................................................................................................................. 12 2.2 绘图窗口 ......................................................................................................................................... 13 2.3 界面优化 ......................................................................................................................................... 17 3 接口通讯 ......................................................................................................................................................19

3.1 PC机与下位机通信方式 ............................................................................................................ 19 3.2 VC实现接口通讯方法 ................................................................................................................. 19 4 控制系统程序编写 ...................................................................................................................................22

4.1 主要接口程序 ................................................................................................................................ 22

4.1.1 接口编程 ............................................................................................................................ 22 4.1.2 通讯连接 ............................................................................................................................ 23 4.1.3 同步控制 ............................................................................................................................ 24 4.1.4 数据采集 ............................................................................................................................ 25 4.2 定时器模块 .................................................................................................................................... 26 4.3 定点状态显示 ................................................................................................................................ 27 4.4 反馈控制 ......................................................................................................................................... 28 4.5 数据处理 ......................................................................................................................................... 30

4.5.1 实时曲线绘制 ................................................................................................................... 30 4.5.2 数据显示与保存 .............................................................................................................. 31

5 验证实验 ......................................................................................................................................................33

5.1 实验设备 ......................................................................................................................................... 33

1