当前位置:网站首页>滑轨步进电机调试(全国海洋航行器大赛)(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根线不要接错了(我红绿色盲因为这个调了一上午,血的教训)
- 还有一点就是注意不要堵转了,会烧坏电机的嗷
- 单片机控制板那边安全起见加光耦,防止电流倒灌烧坏单片机,还增加驱动能力。
再见~
边栏推荐
- 红杉中国完成新一期90亿美元基金募集
- ACL 2022 | small sample ner of sequence annotation: dual tower Bert model integrating tag semantics
- PHP calls the pure IP database to return the specific address
- Common text processing tools
- Leetcode skimming: binary tree 23 (mode in binary search tree)
- @Resource和@Autowired的区别?
- AUTOCAD——大于180度的角度标注、CAD直径符号怎么输入?
- The URL modes supported by ThinkPHP include four common modes, pathinfo, rewrite and compatibility modes
- Conversion from non partitioned table to partitioned table and precautions
- Enterprise custom form engine solution (XII) -- experience code directory structure
猜你喜欢
【无标题】
Day22 deadlock, thread communication, singleton mode
关于 appium 启动 app 后闪退的问题 - (已解决)
Aosikang biological sprint scientific innovation board of Hillhouse Investment: annual revenue of 450million yuan, lost cooperation with kangxinuo
Visual stdio 2017 about the environment configuration of opencv4.1
.Net下极限生产力之efcore分表分库全自动化迁移CodeFirst
达晨与小米投的凌云光上市:市值153亿 为机器植入眼睛和大脑
Image pixel read / write operation
DHCP 动态主机设置协议 分析
Differences between MySQL storage engine MyISAM and InnoDB
随机推荐
Ip2long and long2ip analysis
File operation command
Day-17 connection set
聊聊Redis缓存4种集群方案、及优缺点对比
About IPSec
ACL 2022 | small sample ner of sequence annotation: dual tower Bert model integrating tag semantics
PHP calls the pure IP database to return the specific address
Connect to blog method, overload, recursion
Conversion from non partitioned table to partitioned table and precautions
如何将 @Transactional 事务注解运用到炉火纯青?
mysql怎么创建,删除,查看索引?
HZOJ #240. 图形打印四
MySQL导入SQL文件及常用命令
Master公式。(用于计算递归的时间复杂度。)
Common knowledge of one-dimensional array and two-dimensional array
2022-07-07 Daily: Ian Goodfellow, the inventor of Gan, officially joined deepmind
Unity 构建错误:当前上下文中不存在名称“EditorUtility”
Creation and assignment of graphic objects
基于NeRF的三维内容生成
【从 0 开始学微服务】【00】课程概述