完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
步进电机能完成一次正常加速和减速,但是当步进电机在减速中再进行加速,电机就有点堵了(给我的感觉就是电机是转的,但是感觉到没力气来带动负载,然后用手轻轻的转下,就能正常加速了),然后电机又可以加速到正常状态了,到底是什么问题引起的,之前我判断是电机加速起始频率引起的,但后来经测试不是,求高手指点啊...............
|
|
相关推荐
5个回答
|
|
你是怎么实现加减速的?用T型还是S型加减速,还是在软件中给定一系列频率来加减?
|
|
|
|
下面是执行加速的
if (motor->CurrPos >= Motor_GetAccTotal(motor->CurrSpd) )//(CurrPos这是走的步数,是重0开始的),要满足这个条件速度才变一次 { if (motor->CurrSpd >= motor->CurrentAction.Speed) { ///motor->CurrSpd = motor->MaxSpd; motor->Status.tBits.SpeedStatus = e_MotorSpeed_Cons; break; } motor->CurrSpd ++; Motor_SetStepTimer(motor,1);//这个函数是取去对应的频率(也就是速度)(在这个数组里取SpdLevTab) } 下面这是个速度表(也就是改变频率表) uint32 SpdLevTab[]={ #ifdef NEW_SPEEDTAB 17578, 8789, 5859, 4395, 3516, 2930, 2511, 2197, 1953, 1758, 1758, 879, 586, 439, 352, 293, 251, 220, 195, 176, 160, 146, 135, 126, 117, 110, 103, 98, 93, 88, 84, 80, 76, 73, 70, 68, // 72, 73 #else #if 0 ///12000,6000,3000, 1500, 900, 700, 583, 468, // 1 ~ 8 432, 432, 416, 400, 400, 384, 483, 368, 368, 368, 352, 352, 352, 336, 336, 336, // 9 320, 320, 320, 320, 304, 304, 304, 304, // 17 288, 288, 288, 288, 272, 272, 256, 256, // 25 256, 192, 128, 96, #else 7031, 7027, 7009, 6960, 6860, 6685, 6415, 6041, // 1~8 5570, 5022, 4434, 3843, 3282, 2772, 2324, 1942, // 9~16 1620, 1352, 1132, 950, 801, 678, 577, 493, // 17~24 423, 365, 316, 275, 240, 211, 185, 164, // 25 145, 129, #endif #endif /*64, 56, 48, 40, // 36~ -- 76~ 32, 30, 28, 26, 25, 24, 23, 23, // 41 29, 29, 29, 28, 27, 26, 25, 24, // 49 23, 22, 21, 20, 19, 18, 17, 16, // 57 31, 30, 29, 28, 27, 26, 25, 24, // 65 23, 22, 21, 20, 19, 18, 17, 16, // 73 31, 29, 27, 25, 23, 21, 19, 17, // 81 31, 30, 29, 28, 27, 26, 25, 24, // 89 23, 23, 22, 22, 21, 21, 20, 20, // 97 19, 19, 18, 18, 17, 17, 16, 16, // 105*/ 64, 56, 48, 40, // 36~ -- 76~ 32, 30, 28, 26, 25, 24, 23, 23, // 41 29, 29, 29, 28, 27, 26, 25, 24, // 49 23, 22, 21, 20, 19, 18, 17, 16, // 57 31, 30, 29, 28, 27, 26, 25, 24, // 65 23, 22, 21, 20, 19, 18, 17, 16, // 73 31, 29, 27, 25, 23, 21, 19, 17, // 81 31, 30, 29, 28, 27, 26, 25, 24, // 89 23, 23, 22, 22, 21, 21, 20, 20, // 97 19, 19, 18, 18, 17, 17, 16, 16, // 105 /* 115, 103, 93, 83, 75, 68, // 33 62, 56, 51, 47, 43, 39, 36, 33, // 41 30, 28, 26, 24, 22, 21, 19, 18, // 49 17, 15, 14, 27, 25, 24, 22, 21, // 57 20, 19, 17, 16, 15, 29, 28, 26, // 65 25, 23, 22, 21, 20, 19, 36, 34, // 73 33, 31, 30, 28, 27, 26, 25, 23, // 81 22, 21, 41, 39, 38, 36, 35, 33, // 89 32, 30, 29, 28, 27, 26, 25, 24, // 97 23, 22, 21, 21, 20, 19, 19, 18, // 105 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, //16 zero*/ }; Motor_GetAccTotal(motor->CurrSpd) )这个函数取的值是这个表里的值 根据上面这点怎样才能看出加速是T型还是S型 ,我是个菜鸟,大侠帮帮忙讨论下啊,自己一个搞了快一个月,没搞出来,上面那个问题,我一直找不到。。 |
|
|
|
Motor_GetAccTotal(motor->CurrSpd) 这个函数是根据这个CurrSpd速度返回的为以下对应
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,16,32,48,64,80,96,112,114,176,208,240,272, 320,368,416,464,512,576,640,704,800,912,1024,1152,1296,1440,1584,1744, 1968,2208,2448,2736,3024,3328,3632,3952,4352,4832,5344,5872,6400,6944,7504,8080, 9248,10448,11664,12912,14176,15472,16784,18128,20864,23648,26480,29360,32288,35264,38288,41360, 43504,44944,46384,47824,49968,52112,54256,56400,58544,60688,62832,64976,67120,69264,71408,73552, |
|
|
|
|
|
|
|
节拍时间越短速度越快吧
|
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1712 浏览 0 评论
如何解决MPU-9250与STM32通讯时,出现HAL_ERROR = 0x01U
887 浏览 1 评论
hal库中i2c卡死在HAL_I2C_Master_Transmit
1269 浏览 1 评论
LL库F030进行3个串口收发,2个串口为232,一个为485,长时间后,会出现串口1停止运行,另外两个正常,只有重启复原
1740 浏览 1 评论
552 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-13 14:26 , Processed in 0.699261 second(s), Total 84, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号