完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我想运行PWM频率大于65kHz的无传感器FOC固件。
我的硬件配置: Nucleo-F446RE - > X-Nucleo-IHM09M1 - >定制功率级,带ICS电流传感器和总线电压测量。 我的软件配置: ST MC SDK4.3 - > STM32F4xx_MC库 - > STM32F4xx_UserProject - SM32446E-EVAL IAR Embedded Workbench IDE 我已经成功配置,编译,上传和测试了无频率FOC固件,PWM频率为30kHz。但是,一旦PWM频率增加到65kHz以上,编译器就会产生许多警告,并且控制器无法驱动测试电机。 我检查了固件的源代码。 PWM_FREQUENCY在Drive_parameters.h中声明,没有类型。所有后续调用都将值转换为uint16_t,这解释了65kHz的限制。 我试图改变将PWM_FREQUENCY和TF_REGULAtiON_RATE转换为uint32_t的变量声明。我一个接一个地研究了变量,检查一切是否仍能以30kHz的PWM频率工作。我可以改变除一个以外的所有电话: 一旦我将SpeednPosFdbkClass.h中的SpeednPosFdhkParams_t结构的'hMeasurementFrequency'成员从uint16_t更改为uint32_t,代码将编译但电机将无法运行。我没有尝试识别使用.hMeasurementFrequency的操作并确定它们不能使用uint32_t值的原因。 如果对SDK(以及一般的软件调试)有更深入了解的人能够帮助我弄清楚如何修改代码,我将非常感激。 先谢谢你! 格雷格 #foc-4.3#foc-sdk-4.3.0#motor-control-foc-library 以上来自于谷歌翻译 以下为原文 I would like to run the Sensorless FOC firmware with a PWM frequency greater than 65kHz. My hardware configuration: Nucleo-F446RE -> X-Nucleo-IHM09M1 -> Custom power-stage with ICS current sensors and bus voltage measurement. My software configuration: ST MC SDK4.3 -> STM32F4xx_MC Library -> STM32F4xx_UserProject - SM32446E-EVAL IAR Embedded Workbench IDE I have successfully configured, compiled, uploaded and tested the sensorless FOC firmware with a PWM frequency of 30kHz. However, once the PWM frequency is increased above 65kHz, the compiler produces a number of warnings, and the controller is not able to drive the test motor. I have inspected the source code for the firmware. The PWM_FREQUENCY is declared in Drive_parameters.h, with no type. All subsequent calls cast the value to uint16_t, which explains the 65kHz limit. I have attempted to change the declaration of variables that will take the PWM_FREQUENCY and TF_REGULATION_RATE to uint32_t. I have worked through the variables one-by-one to check that everything still works with a PWM frequency of 30kHz. I can change all calls apart from one: Once I change the 'hMeasurementFrequency' member of the SpeednPosFdhkParams_t structure in SpeedNPosFdbkClass.h from uint16_t to uint32_t, the code will compile but the motor will not run. I have unsuccessfully tried to identify operations that use .hMeasurementFrequency and determine why they won't work with a uint32_t value. I would be incredibly grateful if someone with a more in-depth understanding of the SDK (and software debugging in general) would be able to assist me with figuring out how to modify the code. Thank you in advance! Greg #foc-4.3 #foc-sdk-4.3.0 #motor-control-foc-library |
|
相关推荐
7个回答
|
|
格雷格你好,
你是对的,使用MC SDK4.3进行调试并不容易。 除此之外,这是ST从5.x开始使用MC SDK的主要原因;-)。 仅供参考,如果是MC SDK5.1.1,可以使用最新版本。也许你应该试试这个版本。 干杯, PBO 以上来自于谷歌翻译 以下为原文 Hello Greg, You're right, debugging with the MC SDK4.3 is not so easy. Among other things, this is a main reason why ST has started with the MC SDK from 5.x ;-). FYI, the latest release available if MC SDK5.1.1. Maybe you should try from this version. Cheers, PBo |
|
|
|
你好PBo,
我不愿意放弃SDK4.3,因为我让configure-build-upload链工作得很舒服。但是,我做的第一件事就是检查SpeedNPosFdbkClass.h和VirtualSpeedSensor_SpeednPosFdbkClass.c是否已更新。尽管已重命名变量,但代码的功能/结构看起来是相同的。 我已经从我的自定义硬件切换到STEVAL-ESC001V1,因为这允许调试和单独的串行链接进行控制(虽然我想我可以使用Nucleo板上的用户按钮来启动电机)。 “好消息”是问题仍然存在于适用于STEVAL-ESC001V1的完全干净的SDK4.3版本中。将hMeasurementFrequency的声明从uint16_t更改为uint32_t可防止虚拟速度传感器工作。虽然在这种情况下电机至少旋转。 我正在进行调试工作,而且随着时间的推移,我正慢慢地把它搞砸了。我目前的工作假设是,当hMeasurementFrequency的大小加倍时,SpeednPosFdbkParams_t结构会发生奇怪的事情。 格雷格 以上来自于谷歌翻译 以下为原文 Hi PBo, I'm reluctant to move away from the SDK4.3, as I have the configure-build-upload chain working comfortably. However, one of the first things I did was check whether SpeedNPosFdbkClass.h and VirtualSpeedSensor_SpeednPosFdbkClass.c had been updated. Although the variables have been renamed, the functionality/structure of the code appears to be the same. I've switched from my custom hardware to the STEVAL-ESC001V1, as this allows debugging and a separate serial link for control (although I guess I could have used the user button on the Nucleo board to start the motor). The 'good news' is that the problem still exists on a completely clean version of the SDK4.3 suitable for the STEVAL-ESC001V1. Changing the declaration of hMeasurementFrequency from uint16_t to uint32_t prevents the virtual speed sensor from working. Although in this case the motor does at least spin. I have debugging working, and I'm slowly plugging away at this as time permits. My current working hypothesis is that something odd is happening with the SpeednPosFdbkParams_t structure when the size of hMeasurementFrequency doubles. Greg |
|
|
|
嗨格雷格,
你能分享你的硬件配置吗? 你提到了STEVAL-ESC001V1,所以我猜你正在构建一个无人机应用程序。您的定制板是否也基于STM32F303? 我想了解为什么需要如此高的PWM频率? 我们正在使用30 Khz PWM测试无人机电机。 请注意,对于FOC操作,我们在每个PWM周期计算下一个PWM周期的所有参数。因此,如果将PWM频率乘以2,我们将没有时间执行FOC算法(这是您从WB中看到的FOC持续时间问题)。 (我们只有每两个时期计算FOC算法的技巧,但......) 最后一句话。 ST下载提供的4.3 ESC001是定制版本。 5.1.1尚未支持ESC001。最初的支持是5.1.2的计划,5.2的完全支持 问候 塞德里克 以上来自于谷歌翻译 以下为原文 Hi Greg, Could you share your hardware configuration ? you mentioned STEVAL-ESC001V1, so I guess you are building a drone application. Is your custom board based on a STM32F303 too ? I would like to understand why you need a such high PWM frequency ? we are testing drone motor nicely with a 30 Khz PWM. Be aware that for FOC operation, we compute at each PWM cycle all the parameters for the next PWM cycle. So if you multiply the PWM frequency by 2, we will not have the time to execute the FOC algorithm (this is the FOC duration issue you see from the WB). (We have tricks to compute the FOC algo only each 2 periods but ...) Last remark. the 4.3 ESC001 that is available from the ST download is a customized version. The 5.1.1 does not support ESC001 yet. initial support is plan for 5.1.2, and full support in 5.2 regards Cedric |
|
|
|
塞德里克
我的目标硬件配置是运行在180MHz的STM32F446RE。功率级使用三个LMG3410-HB-EVM模块,目标PWM频率为175kHz,死区时间为50ns。使用三个ACS722霍尔效应传感器进行相电流测量。使用简单的分压器进行总线电压测量。 使用Nucleo STM32F446RE板,硬件工作正常,PWM频率为64kHz。 目标是为一个非常小的涡轮压缩机驱动一台1.2kW,500krpm的电动机。控制带宽要求不高(控制器只需要将电机带到目标速度并保持在那里,压缩机上的负载将保持不变),因此每两到三个计算一次FOC算法应该是可以接受的。 PWM周期。 我选择使用STEVAL-ESC001V1调试SDK,因为我需要单独的串行和调试线,而Nucleo板使用虚拟串行链路,它不能与调试器同时运行。 感谢您的帮助。 格雷格 以上来自于谷歌翻译 以下为原文 Cedric, My target hardware configuration is an STM32F446RE running at 180MHz. The power stage uses three LMG3410-HB-EVM modules, with a target PWM frequency of 175kHz and 50ns dead time. Phase current measurements are made using three ACS722 hall-effect sensors. Bus voltage measurement is made using a simple potential divider. The hardware works fine with a PWM frequency of 64kHz, using a Nucleo STM32F446RE board. The objective is to drive a 1.2kW, 500krpm motor for a very small turbo-compressor. The control bandwidth requirements are not high (the controller only needs to take the motor to a target speed and hold it there, and the load on the compressor will be constant), so it should be acceptable to compute the FOC algorithm every two or three PWM periods. I have chosen to debug the SDK using the STEVAL-ESC001V1 because I need separate serial and debug lines, and the Nucleo board uses the virtual serial link, which can't operate at the same time as the debugger. Thank you for your help. Greg |
|
|
|
亲爱的格雷格,
可以通过使用不同的重定义uint32来修复它,而不是你提到的uint16。 请在107 + 817和95/754行的文件'Parameters conversion_F30x.h'和'Parameters conversion_F30x motor 2.h'中查看。 & sharpdefine TF_REGULATION_RATE(uint16_t)((uint16_t)(PWM_FREQUENCY)/ REGULATION_EXECUTION_RATE) => & sharpdefine TF_REGULATION_RATE(uint16_t)((uint32_t)(PWM_FREQUENCY)/ REGULATION_EXECUTION_RATE) & sharpdefine PWM_PERIOD_CYCLES(uint16_t)(ADV_TIM_CLK_MHz * (无符号长整数)1000000u /((uint16_t)(PWM_FREQUENCY))) => & sharpdefine PWM_PERIOD_CYCLES(uint16_t)(ADV_TIM_CLK_MHz * (无符号长long)1000000u /((uint32_t)(PWM_FREQUENCY))) 对于第二个电机是类似的。 最好的祝福, Giuseppe Scuderi 以上来自于谷歌翻译 以下为原文 Dear Greg, It can be fixed by the using different redefinition uint32 instead uint16 as you have mentioned. Please check it in the files 'Parameters conversion_F30x.h' and 'Parameters conversion_F30x motor 2.h' on the rows 107+817 and 95/754. &sharpdefine TF_REGULATION_RATE (uint16_t) ((uint16_t)(PWM_FREQUENCY)/REGULATION_EXECUTION_RATE) => &sharpdefine TF_REGULATION_RATE (uint16_t) ((uint32_t)(PWM_FREQUENCY)/REGULATION_EXECUTION_RATE) &sharpdefine PWM_PERIOD_CYCLES (uint16_t)(ADV_TIM_CLK_MHz* (unsigned long long)1000000u/((uint16_t)(PWM_FREQUENCY))) => &sharpdefine PWM_PERIOD_CYCLES (uint16_t)(ADV_TIM_CLK_MHz* (unsigned long long)1000000u/((uint32_t)(PWM_FREQUENCY))) For the second motor is similar. Best Regards, Giuseppe Scuderi |
|
|
|
朱塞佩
我会试一试。然而,虽然这将允许PWM_FREQUENCY> 65kHz,但TF_REGULATION_RATE仍然需要 65kHz?这样我可以尝试使用REGULATION_EXECUTION_RATE = 2? 谢谢! 格雷格 以上来自于谷歌翻译 以下为原文 Giuseppe, I will give this a try. However, while this will allow the PWM_FREQUENCY to be >65kHz, the the TF_REGULATION_RATE will still need to be <65kHz because it is still cast as uint16_t. For my application, where I am aiming for a PWM frequency of 175kHz, this will require that REGULATION_EXECUTION_RATE is set to 3. This should be acceptable, but is it possible to allow TF_REGULATION_RATE to be >65kHz as well? So that I could try with REGULATION_EXECUTION_RATE = 2? Thank you! Greg |
|
|
|
朱塞佩
我做了更改,并使用我的硬件进行了测试。 电机启动并以PWM_FREQUENCY = 167kHz和REGULATION_EXECUTION_RATE = 3运行。但是,如果我将PWM_FREQUENCY增加到此值以上,则控制面板上会出现FOC_DURATION故障。 这个PWM_FREQUENCY是我目标的95%,所以它可能是可以接受的。假设初始测试成功,我可能会重新访问固件以提高性能。 感谢您的帮助, 格雷格 以上来自于谷歌翻译 以下为原文 Giuseppe, I have made the changes, and tested with my hardware. The motor starts and runs with PWM_FREQUENCY = 167kHz and REGULATION_EXECUTION_RATE = 3. However, if I increase the PWM_FREQUENCY above this, I get an FOC_DURATION fault on the control panel. This PWM_FREQUENCY is 95% of my target, so it is probably acceptable. Assuming initial testing is successful, I may revisit the firmware to improve the performance. Thank you for your help, Greg |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2741 浏览 1 评论
3244 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1813 浏览 1 评论
3653 浏览 6 评论
6044 浏览 21 评论
1342浏览 4评论
203浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
356浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
446浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
275浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-26 18:26 , Processed in 1.325056 second(s), Total 90, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号