当前位置:
文档之家› 基于STM32的步进电机加减速优化算法
基于STM32的步进电机加减速优化算法
基于 STM32的步进电机加减速优化算法
张海超1,黄风光2,3,曹建树1* ,钟 君1,王 庆1
(1. 北京石油化工学院 机械工程学院,北京 102617;2. 民政部一零一研究所,北京 100070; 3. 民政部污染控制重点实验室,北京 100070)
摘要:为了优化步进电机的控制方式,对其加减 速 曲 线 的 控 制 性 能 进 行 了 研 究。 通 过 分 析 步 进 电 机 的 匀 加 速
72
北京石油化工学院学报
步进电机的原 理 是 通 过 接 受 电 能,将 其 转 化 为 机械能的控制元 件。 在 正 常 工 作 的 情 况 下,步 进 电 机工作只由脉冲数以及脉冲频率决定。当下一个脉 冲信号被驱动器接 收 到 时,步 进 电 机 就 被 控 制 在 设 定的方向上转动 一 定 的 角 度。 在 实 现 的 过 程 中,如 果 脉 冲 频 率 过 高 ,电 机 的 电 动 势 将 会 增 加 ,致 使 电 机 失 步 或 堵 塞 。 因 此 ,必 须 考 虑 适 当 的 控 制 脉 冲 方 案 , 以实现步进电机的正确定位。
收 稿 日 期 :2018-12-11;修 回 日 期 :2019-04-05 基 金 项 目 :北 京 市 自 然 基 金 资 助 项 目 (3182008) 作者简介:张海超(1994—),男,硕士研究生,主要从事管道无损检测方面的 研 究,E-mail:zallw605014917@;曹 建 树 (1971—),男,博 士 ,教 授 ,主 要 从 事 管 道 无 损 检 测 方 面 的 研 究 ,通 信 联 系 人 ,E-mail:jianshu@。
第27卷 第2期
北京石油化工学院学报
Vol.27 No.2
2019 年 6 月
ቤተ መጻሕፍቲ ባይዱ
JournalofBeijingInstituteofPetrochemicalTechnology
Jun.2019
췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍췍
文 章 编 号 :1008-2565(2019)02-0071-06
Abstract:Inordertooptimizethecontrolmodeofsteppingmotor,thecontrolperformanceofacceleration and deceleration curve is studied. By analyzing the shortcomings of uniform accelerationandvariableaccelerationofsteppermotorsintherisingandfallingfrequencycurve, analgorithm,whichcanensurethestepper motorto worksteadilyintherisingandfalling frequencyphase,isproposed by using STM32.Thealgorithm iscompared withthetypical uniform acceleration and deceleration curve algorithm and the exponentialacceleration and decelerationcurvealgorithm.Finally,binedwithpractical application,thealgorithmisoptimized.Thesimulationandexperimentalresultsshowthat:it takesupasmallamountofmemoryspacetousetheSigmoidfunctionfittedinthispaper,which can be adjusted according to the current situation,and the flexibility of acceleration and decelerationisstrong.This methodhasthefunctionsrelatedtothesmoothnessoftheSigmoid function,whichissimpletoapplyandeasyto maintain. Keywords:stepping motor;STM32;sigmoidfunction;optimization;algorithm
情况进行调整,加减速的灵活性强。该方法具有与 Sigmoid函数平滑性相关的功能,应用简单,易于后期的维护。
关 键 词 :步 进 电 机 ;STM32;Sigmoid 函 数 ; 优 化 ; 算 法
中 图 分 类 号 :TE88
文 献 标 志 码 :A
DOI:10.12053/j.issn.1008-2565.2019.02.013
OptimizationAlgorithmofStepperMotorIncreaseand DecreaseSpeedBasedonSTM32
ZHANG Haichao1,HUANGFengguang2,3,CAOJianshu1* ,ZHONGJun1,WANG Qing1
(1.Schoolof MechanicalEngineering,BeijingInstituteofPetrochemicalTechnology,Beijing102617,China; 2.101InstituteoftheMinistryofCivil,Beijing100070,China;3.KeyLaboratoryofPollution ControloftheMinistryofCivilAffairs,Beijing100070,China)
运动以及变加速运动在升降频曲线中存在的不足,应用 STM32 提 出 了 一 种 能 够 保 证 步 进 电 机 在 升 降 频 阶 段 稳 定
工作的算法,与典型的匀加减速曲线算法、指数型加减速曲线算法进行了仿真比 较 分 析,最 后 结 合 实 际 应 用 对 该 算
法进行了优化。仿真以及实验结果表明:使用本文中拟合的 Sigmoid函 数,其 占 用 少 量 的 内 存 空 间,可 以 根 据 当 前