煤矿巡检机器人控制系统设计

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.

     

/

返回文章
返回