DOI:10.3969/j.issn.1003-5060.2025.06.005
基于 STM32 的步进电机管道直径测量系统的设计
王明亮 $ ^{1} $,鲍晓华 $ ^{1} $,周虎 $ ^{2} $,郭帅 $ ^{3} $
(1. 合肥工业大学 电气与自动化工程学院,安徽 合肥 230009;2. 乐山职业技术学院 智能制造学院,四川 乐山 614013;3. 合肥工业大学 土木与水利工程学院,安徽 合肥 230009)
摘要
针对市政工程应用中地下管道直径测量难以及测量不够精准的问题,文章设计一种步进电机驱动下的管道直径测量系统,以 STM32F108C8T6 作为主控制器,数字式 HPD322 作为步进电机驱动器,并采用蓝牙通信。系统上位机发出开始命令,单片机接收到信号后发出脉冲让驱动器工作,驱动步进电机运动;当两侧触发开关同时触发时,单片机接收到信号后发出反转信号,步进电机反向旋转,将测量装置收回。该测量系统工作时前进与后退的步数一致,确保装置总能回到初始位置,从而保证下一次可以直接使用。
中图分类号:TP23
文献标志码:A
文章编号:1003-5060(2025)06-0744-06
Design of pipe diameter measurement system driven by stepper motor based on STM32
WANG Mingliang $ ^{1} $, BAO Xiaohua $ ^{1} $, ZHOU Hu $ ^{2} $, GUO Shuai $ ^{3} $
(1. School of Electrical Engineering and Automation, Hefei University of Technology, Hefei 230009, China; 2. Intelligent Manufacturing Academy, Leshan Vocational and Technical College, Leshan 614013, China; 3. School of Civil and Hydraulic Engineering, Hefei University of Technology, Hefei 230009, China)
Abstract
In municipal engineering applications, underground pipe diameter measurement is difficult and inaccurate. To address this problem, this paper designs a pipe diameter measurement system driven by stepper motor, which is based on STM32F108C8T6 as the main controller and digital HPD322 as the driver of the stepper motor, using Bluetooth for communication. The upper computer issues a start command, and the single-chip microcomputer receives the signal and sends a pulse to let the driver work, so as to drive the stepper motor to move. When the trigger switches on both sides are triggered at the same time, the single-chip microcomputer receives the signal and sends a reversal signal, the stepper motor rotates in reverse and retracts the measuring device. The number of steps forward and backward is the same, so as to ensure that the device can always return to the initial position, enabling the immediate reuse.
Keywords
stepper motor; driver; Bluetooth communication; pipe diameter measurement
收稿日期:2023-07-24
修回日期:2023-08-22
基金项目:国家自然科学基金资助项目(51977055);安徽省重点研究与开发计划资助项目(202104i07020012)