完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,
我成功地使用3.4库来驱动使用STM32F103和3个电流分流电阻的小型无刷电机。我的新设计使用STM32F303CB和板载PGA进行电流检测。这个新的303版本不起作用,电机在启动期间旋转,但当它切换到FOC时,它会出现“启动失败”错误。所有其他库设置(电机参数,pwm频率等)保持不变,所以我只能认为它是电流感应的问题。 我对板载电流感应有点困惑。我选择3个分流电阻,但每个电机只分配2个运算放大器。我是否应该在第3阶段使用外部运算放大器? 我已经附加了我的STMCWB项目和电机2的电流检测波形。这些电流检测波形看起来是否符合预期,我是否遗漏了一些明显的东西?我还附上了原理图,显示了我连接的引脚和电流检测电阻。 非常感谢任何帮助,谢谢。 #FOC-3.4-stm32f303 以上来自于谷歌翻译 以下为原文 Hi, I successfully used the 3.4 Library to drive a small brushless motor using an STM32F103 and 3 current shunt resistors. My new design uses the STM32F303CB and onboard PGA for current sensing. This new 303 version does not work, the motor spins during startup but as it switches to FOC it gives a ''Start-up Failure'' error. All of the other library settings (motor parameters, pwm freq etc) remain the same so I can only think it is a problem with the current sensing. I am a bit confused by the onboard current sensing. I select 3 shunt resistors, but it only assigns 2 op amps per motor. Was I supposed to use an external op amp for the 3rd phase? I have attached my STMCWB project and the current sense waveforms for motor 2. Do these current sense waveforms look as expected, am I missing something obvious? I have also attached the schematic showing which pins I hooked up and the current sensing resistors. Any help would be greatly appreciated, thanks. #foc-3.4-stm32f303 |
|
相关推荐
5个回答
|
|
找到了有问题的错误。我选择了PB5作为电机2相3低侧pwm,但是库错误地设置了备用功能寄存器。 PB5上TIM8的备用功能是3。
GPIOB_AFRL设置为0x00244000,应为0x00344000。 问题在于STMCWB,而不是库。它在''控制阶段参数电机2'中生成以下错误行: #define PHASE_WL_GPIO_AF2 GPIO_AF_2 现在的解决方法是将模板文件编辑为GPIO_AF_3 以上来自于谷歌翻译 以下为原文 Found the bug that was at fault. I have selected PB5 as the motor 2 phase 3 low side pwm, but the library sets the alternate function register incorrectly. The alternate function for TIM8 on PB5 is 3. GPIOB_AFRL is set to 0x00244000, it should be 0x00344000. The problem is with STMCWB, not the library. It generates the following incorrect line in ''Control stage parameters motor 2'': #define PHASE_WL_GPIO_AF2 GPIO_AF_2 Workaround for now is to edit the template file to GPIO_AF_3 |
|
|
|
现在我有它的工作,我有另一个问题。当我使用STM32F103时,我能够获得更高的pwm值,这对于我的小型电机来说效果很好。我发现32 - 36 kHz效果很好。
使用SMT32F303,我最多只能达到27500 Hz,之后我收到一个错误: ERR 12:02:09 1 511最大结果调制指数被钳位到电机M1的最小允许值(81%) ERR 12:02:09 2 511最大结果调制指数被钳位到电机M2的最小允许值(81%) 是否有任何其他参数可以改变以获得更高的PWM,或者这是否是使用板载电流感应放大器的限制? 以上来自于谷歌翻译 以下为原文 Now that I have it working, I have another question. When I used the STM32F103, I was able to go to much higher pwm values which worked well for my small motor. I found that 32 - 36 kHz worked well. With SMT32F303 I can only go up to a maximum of 27500 Hz, after which I get an error: ERR 12:02:09 1 511 Maximum resulting modulation index clamped to minimum allowed (81%) for motor M1 ERR 12:02:09 2 511 Maximum resulting modulation index clamped to minimum allowed (81%) for motor M2 Are there any other parameters I can change to get to a higher PWM, or is this a limitation of using the onboard current sensing amplifiers? |
|
|
|
另一个问题:现在我有2台电机在运行,我无法弄清楚如何让它们同时运行。我可以启动电机1,但是一启动电机2它就会停止。我可以启动电机2但是一启动电机就会停止1.通过UART协议没有收到任何错误,只是成功确认了启动命令。
图书馆明确表示同时控制双电机。我在这里想念的是什么?请帮忙。 以上来自于谷歌翻译 以下为原文 Another question: now that I have 2 motors running I cannot figure out how to get them to run simultaneously. I can start motor 1, but it stops as soon as I start motor 2. I can start motor 2 but it stops as soon as I start motor 1. No errors are received over the UART protocol, just a successful acknowledge of the start command. The library clearly says simultaneous control of dual motors. What am I missing here? Please help. |
|
|
|
Ciao Joevn,
谢谢你的宝贵意见。 正如您可能已经了解的那样,只有两个嵌入式OPAMP足以用于三个分流电流检测,因为三个输入在内部多路复用。 我向你报告了下一个版本的WB设计师的问题。你提出的解决方法是好的。 最大调制指数(MMI)由WB根据PWM频率,死区时间,Tnoise / TRise和选择的当前采样时间计算。用于避免6-PWM开关引起的噪声。 WB / Lib支持的最小MMI存在限制。这是81%,这不依赖于所使用的微控制器,而是取决于算法。您可以尝试减少上述参数,以便使用更高的PWM频率。 您提到的双驱动器的行为不是预期的行为。双驱动意味着双同时。可能您遇到了与高FOC速率相关的一些问题,在这种情况下,您可以尝试将执行速率提高到2或3个PWM周期。或者它只是与串行通信相关的问题,请在WB的监视器页面中验证“所有电机”复选框是否已选中。 再见 梁咏琪 以上来自于谷歌翻译 以下为原文 Ciao Joevn, thank for you valuable feedback. As you probably already understand just two embeded OPAMP are sufficient for the three shunt current sensing because the three inputs are multiplexed inside. I reported the issue you submited to the WB designer for the next version. The workaround you popose is ok. The maximum modulation index (MMI) is calculated by WB according PWM freq, Dead time, Tnoise/TRise and selected current sampling time. Is used to avoid the noise caused by the 6-PWM switching. There is a limitation in the minimum MMI supported by WB/Lib. that is 81% and this don't depend on the microcontroller used but by the algorithm. You can try to reduce the mentioned paramenters in order to use higher PWM frequencies. The behaviour you mention for the dual drive is not the one expected. Dual drive means dual simultaneous. Probably you are facing with some issue related to an high FOC rate, in this case you can try to increase the execution rate to 2 or 3 PWM period. Or it is just an issue related to the serial communication, please verify that the ''All motor'' check box is chceckd in the monitor page of WB. Ciao Gigi |
|
|
|
谢谢你,将执行率改为2个pwm周期就可以了。现在两个电机同时旋转。
以上来自于谷歌翻译 以下为原文 Thank you, changing the execution rate to 2 pwm periods did the trick. Now both motors spin simultaneously. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2725 浏览 1 评论
3237 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1807 浏览 1 评论
3646 浏览 6 评论
6034 浏览 21 评论
1337浏览 4评论
197浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
350浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
442浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
273浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 19:45 , Processed in 1.202981 second(s), Total 85, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号