当前位置:网站首页>滑轨步进电机调试(全国海洋航行器大赛)(STM32主控)
滑轨步进电机调试(全国海洋航行器大赛)(STM32主控)
2022-07-07 10:58:00 【梦想当极客的小芦】
提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
前言
航行器比赛中:滑轨步进电机调试经验
一、滑轨步进电机?
它长这个样子
某宝叫精密梯形丝杆直线导轨滑台模组数控移动模组平台步进电机…
二、使用
1.滑轨作用
看,滑轨的位置就在这个航行器的前面一点的位置,主要用来调航行器俯仰角。
2.驱动器(我用的DM542)
它长这样
这是他的手册:http://www.yunkong.com/upload/file/contents/2019/09/5d71f45d04867.pdf
DM542需要注意的点就是工作电流了,不要超过步进电机的额定电流就行。
细分参数会影响同样脉冲电机转的圈数。
3.我使用的最简单的驱动方法(用GPIO延时产生脉冲)
/**
* @brief 步进电机旋转
* @param tim 方波周期 单位MS 周期越短频率越高,转速越快 细分为1时最少10ms
* @param angle 需要转动的角度值
* @param dir 选择正反转(取值范围:0,1)
* @param subdivide 细分值
* @note 无
* @retval 无
*/
void stepper_turn(int tim,float angle,float subdivide,uint8_t dir)
{
int n,i;
/*根据细分数求得步距角被分成多少个方波*/
n=(int)(angle/(1.8/subdivide));
if(dir==CW) //顺时针
{
MOTOR_DIR(CW);
}
else if(dir==CCW)//逆时针
{
MOTOR_DIR(CCW);
}
/*开使能*/
MOTOR_EN(HIGH);
/*模拟方波*/
for(i=0;i<n;i++)
{
MOTOR_PLU(HIGH);
Delay_us(tim/2); //tim我设置的1000 就是延时0.5ms
MOTOR_PLU(LOW);
Delay_us(tim/2);
}
/*关使能*/
MOTOR_EN(LOW);
}
还有中断产生脉冲、或者PWM外设产生脉冲、我用的STM32F407完全可以使用外设,但我懒。
总结
好久没写博客了,写一篇博客记录…大家看我的博客,也是我更新的动力。
- 一定要记的步进电机4根线不要接错了(我红绿色盲因为这个调了一上午,血的教训)
- 还有一点就是注意不要堵转了,会烧坏电机的嗷
- 单片机控制板那边安全起见加光耦,防止电流倒灌烧坏单片机,还增加驱动能力。
再见~
边栏推荐
- Visual stdio 2017 about the environment configuration of opencv4.1
- 飞桨EasyDL实操范例:工业零件划痕自动识别
- 【无标题】
- 【无标题】
- 人均瑞数系列,瑞数 4 代 JS 逆向分析
- Unity 构建错误:当前上下文中不存在名称“EditorUtility”
- 明星企业普渡科技大裁员:曾募资超10亿 腾讯红杉是股东
- NPM instal reports agent or network problems
- . Net ultimate productivity of efcore sub table sub database fully automated migration codefirst
- HZOJ #235. 递归实现指数型枚举
猜你喜欢
达晨与小米投的凌云光上市:市值153亿 为机器植入眼睛和大脑
Visual stdio 2017 about the environment configuration of opencv4.1
《开源圆桌派》第十一期“冰与火之歌”——如何平衡开源与安全间的天然矛盾?
What if does not match your user account appears when submitting the code?
Leetcode skimming: binary tree 22 (minimum absolute difference of binary search tree)
Day-14 common APIs
[statistical learning method] learning notes - support vector machine (Part 2)
- Oui. Migration entièrement automatisée de la Sous - base de données des tableaux d'effets sous net
Common knowledge of one-dimensional array and two-dimensional array
COSCon'22 社区召集令来啦!Open the World,邀请所有社区一起拥抱开源,打开新世界~
随机推荐
【从 0 开始学微服务】【02】从单体应用走向服务化
Sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
CMU15445 (Fall 2019) 之 Project#2 - Hash Table 详解
《ASP.NET Core 6框架揭秘》样章[200页/5章]
Visual stdio 2017 about the environment configuration of opencv4.1
【无标题】
共创软硬件协同生态:Graphcore IPU与百度飞桨的“联合提交”亮相MLPerf
test
[crawler] avoid script detection when using selenium
智云健康上市:市值150亿港元 SIG经纬与京新基金是股东
Day21 multithreading
[difficult and miscellaneous]pip running suddenly appears modulenotfounderror: no module named 'pip‘
2022 examination questions and online simulation examination for safety production management personnel of hazardous chemical production units
HZOJ #235. Recursive implementation of exponential enumeration
[爬虫]使用selenium时,躲避脚本检测
Sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
What kind of methods or functions can you view the laravel version of a project?
[learn micro services from 0] [02] move from single application to service
详解ThinkPHP支持的URL模式有四种普通模式、PATHINFO、REWRITE和兼容模式
. Net ultimate productivity of efcore sub table sub database fully automated migration codefirst