Design of coal mine inspection robot control system
-
摘要: 针对传统煤矿巡检机器人控制系统多采用裸机程序进行控制,导致实时性差、数据易丢失等问题,设计了一种基于QT和RT−Thread的煤矿巡检机器人控制系统。该系统按照功能划分为上位机−人机交互控制台和下位机−微控制器2个部分。利用QT软件开发了巡检机器人控制系统上位机,为用户提供人机交互界面,完成对巡检机器人的远程控制,显示传感器数据与报警记录,提升了人机交互性能;利用RT−Thread实时操作系统开发了巡检机器人控制系统下位机,通过线程调度器以时间片轮转方式调度传感器数据采集、以太网通信、雷达信号处理、指示灯报警等线程任务,实现了机器人自动巡检过程中多线程任务之间的宏观并行,提高了控制系统实时性;在控制系统中设计环形队列数据缓冲区,解决上下位机之间运行时钟不同步引起的数据丢失问题,并通过引入内核对象信号量对环形队列数据缓冲区进行优化,解决线程任务间的资源互斥问题,实现上下位机之间数据长时间稳定、可靠传输。测试结果表明,该系统线程切换延迟时间平均值为1.08 μs,在数据传输周期为100 ms时的数据丢失率仅为0.06%,具有很高的实时性,且线程切换过程稳定性好,保证了大量数据快速传输时的可靠性。Abstract: The traditional control system of coal mine inspection robot uses bare metal program. There are problems such as poor real-time performance and easy data loss. In order to solve the above problems, a coal mine inspection robot control system based on QT and RT-Thread is designed. The system is divided into two parts according to the function, including the upper computer-human-computer interaction console and the lower computer-microcontroller. The upper computer of the inspection robot control system is developed by using QT software. The upper computer provides a human-computer interaction interface for users, completes remote control of the inspection robot, displays sensor data and alarm records, and improves the human-computer interaction performance. The lower computer of the inspection robot control system is developed by using RT-Thread real-time operating system. Through the thread scheduler, thread tasks such as sensor data acquisition, Ethernet communication, radar signal processing and indicator light alarms are scheduled in a time-slice rotation manner. The macro parallelism between multithreaded tasks in the process of robot automatic inspection is realized, and the real-time performance of the control system is improved. The circular queue data buffer is designed in the control system to solve the problem of data loss caused by the asynchronous running clock between the upper and lower computers. The kernel object semaphore is introduced to optimize the circular queue data buffer, solve the problem of resource mutual exclusion between thread tasks. Therefore, it realizes the stable and reliable data transmission between upper and lower computers for a long time. The test results show that the average delay time of thread switch is 1.08 μs, and the data loss rate is only 0.06% when the data transmission period is 100 ms. The system has high real-time performance, and the stability of thread switching process is good. The system ensures the reliability of mass data transmission.
-
Key words:
- inspection robot /
- control system /
- real time operating system /
- RT-Thread /
- QT
-
表 1 数据传输测试结果
Table 1. Data transmission test results
系统 数据传输周期/ms 发送字节个数 接收字节个数 本文控制系统 500 247 200 246 000 100 1 129 000 1 128 319 传统控制系统 500 246 820 240 800 100 1 128 730 1 101 200 -
[1] 刘峰,曹文君,张建明,等. 我国煤炭工业科技创新进展及“十四五”发展方向[J]. 煤炭学报,2021,46(1):1-15.LIU Feng,CAO Wenjun,ZHANG Jianming,et al. Current technological innovation and development direction of the 14th Five-Year Plan period in China coal industry[J]. Journal of China Coal Society,2021,46(1):1-15. [2] 蒋卫良,郗存根,宋兴元,等. 煤矿带式输送机关键技术发展现状与展望[J]. 智能矿山,2020,1(1):98-104.JIANG Weiliang,XI Cungen,SONG Xingyuan,et al. Development status and prospect of key technology of coal mine belt conveyor[J]. Journal of Intelligent Mine,2020,1(1):98-104. [3] 毛清华,毛金根,马宏伟,等. 矿用带式输送机智能监测系统研究[J]. 工矿自动化,2020,46(6):48-52,58.MAO Qinghua,MAO Jingen,MA Hongwei,et al. Research on intelligent monitoring system of mine-used belt conveyor[J]. Industry and Mine Automation,2020,46(6):48-52,58. [4] 张涛,吴高镇. 带式输送机故障巡检机器人系统设计[J]. 工矿自动化,2018,44(10):72-76.ZHANG Tao,WU Gaozhen. Design of fault inspection robot system for belt conveyor[J]. Industry and Mine Automation,2018,44(10):72-76. [5] 周东旭,谢明佐,宣鹏程,等. 煤矿轻型协作机械臂逆运动学解算与验证[J]. 煤炭学报,2019,44(增刊2):791-799.ZHOU Dongxu,XIE Mingzuo,XUAN Pengcheng,et al. Inverse kinematics solution and verification of light-duty collaborative manipulator in coal mine[J]. Journal of China Coal Society,2019,44(S2):791-799. [6] 张树生,马静雅,岑强,等. 煤矿综采工作面巡检机器人系统研究[J]. 煤炭科学技术,2019,47(10):136-140.ZHANG Shusheng,MA Jingya,CEN Qiang,et al. Research on inspection robot system for fully-mechanized mining face in coal mine[J]. Coal Science and Technology,2019,47(10):136-140. [7] 赵建伟,马啸飞,刘成祥,等. 煤矿巡检机器人设计及模糊控制研究[J]. 电子制作,2021(13):33-37,100. doi: 10.3969/j.issn.1006-5059.2021.13.010ZHAO Jianwei,MA Xiaofei,LIU Chengxiang,et al. Research on design and fuzzy control of coal mine inspection robot[J]. Practical Electronics,2021(13):33-37,100. doi: 10.3969/j.issn.1006-5059.2021.13.010 [8] 裴文良,张树生,岑强,等. 轨道式巡检机器人系统设计与应用[J]. 煤矿机械,2016,37(6):142-144.PEI Wenliang,ZHANG Shusheng,CEN Qiang,et al. Design and application of tracked inspection robot system[J]. Coal Mine Machinery,2016,37(6):142-144. [9] 潘亚文,李宏华,蒋紫韵,等. 嵌入式裸机程序的启动及运行[J]. 物联网技术,2021,11(2):66-68,71.PAN Yawen,LI Honghua,JIANG Ziyun,et al. Embedded bare-metal program start and run[J]. Internet of Things Technologies,2021,11(2):66-68,71. [10] 邱栋. 基于DSP的矿用巡检机器人控制系统设计[J]. 煤矿机械,2020,41(11):12-15.QIU Dong. Design of mine inspection robot control system based on DSP[J]. Coal Mine Machinery,2020,41(11):12-15. [11] 张美玉,张倩颖,孟子琪,等. 实时嵌入式双操作系统架构研究综述[J]. 电子学报,2018,46(11):2787-2796. doi: 10.3969/j.issn.0372-2112.2018.11.029ZHANG Meiyu,ZHANG Qianying,MENG Ziqi,et al. A survey of research on real-time dual-OS architecture for embedded platform[J]. Acta Electronica Sinica,2018,46(11):2787-2796. doi: 10.3969/j.issn.0372-2112.2018.11.029 [12] 高金艳,李冬辉. VxWorks平台下的火控系统设计与仿真[J]. 哈尔滨工业大学学报,2015,47(9):42-45. doi: 10.11918/j.issn.0367-6234.2015.09.008GAO Jinyan,LI Donghui. Fire control system design and simulation based on VxWoks[J]. Journal of Harbin Institute of Technology,2015,47(9):42-45. doi: 10.11918/j.issn.0367-6234.2015.09.008 [13] 马后权,施华君. 实时操作系统RT−Thread Smart在STM32MP1上的移植[J]. 单片机与嵌入式系统应用,2021,21(8):14-18.MA Houquan,SHI Huajun. Porting RTOS RT-Thread Smart to STM32MP1[J]. Microcontrollers & Embedded Systems,2021,21(8):14-18. [14] 张帝,权悦,国海,等. 基于LoRa与RT−Thread的多功能矿灯设计[J]. 工矿自动化,2021,47(6):96-102.ZHANG Di,QUAN Yue,GUO Hai,et al. Design of multifunctional miner lamp based on LoRa and RT-Thread[J]. Industry and Mine Automation,2021,47(6):96-102. [15] 赵海明. 矿井运输系统巡检机器人应用研究[J]. 自动化应用,2021(2):138-140.ZHAO Haiming. Application research on inspection robots for mine transportation system[J]. Automation Application,2021(2):138-140.