完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,
我想将最新的FOC库用于小型PMSM电机。我正在使用STM32F303VCT6 MCU,我想使用内部PGA。但是马达根本没有运转。启动序列开始,但具有非常高的电流消耗(我在WB中设置的更高)。我最终认为AD转换器可能没有给出正确的值。我主要看Vbus电压测量。测量值不正确。它应该是~325V,但从MCU读取给我一个~189V的值,并在几秒钟后下降到~21V。板载电压是正确的,MCU ADC工作正常 - 我的意思是板上没有任何损坏。我在StdLib中为STM32F3修改了示例项目,并从Vbus引脚转换了值。所以在我看来,在库中设置AD转换器有问题。 ADC不能测量Vbus的正确值,也可能测量相电流,这就是为什么电机在启动时会产生大电流并且不能运行的原因。 我在WB中附加我的设置。 也许我应该提一下,我使用KEIL MDK来编译库。 任何帮助/提示都会有所帮助。 谢谢。丹尼尔 #foc-adc #mcu#foc-adc #foc#foc-adc 以上来自于谷歌翻译 以下为原文 Hello, I would like to use the latest FOC library for small PMSM motor. I'm using STM32F303VCT6 MCU and I would like to use internal PGA. But motor doesn't run at all. Start sequence starts, but with very high current consuption (higher that I set in WB). I finaly fount that probably AD converter doesn't give a correct value. I see it mainly on Vbus voltage measurement. Measured value is not correct. It shoul be ~325V but reading from MCU give me a value ~189V and it fall down to ~21V after few seconds. Voltage on board is corrent, also MCU ADC works correct - I mean nothing is damaged on the board. I've check it with modified example project in StdLib for STM32F3 and it converts value from Vbus pin. So it seems to me, that something is wrong with setting of AD converter in library. ADC does not measure correct values of Vbus and probably also phase currents and that's why motor has during start so big current consuption and doesn't run. I'm attaching my settings in WB. Maybe I sould mention, that I use KEIL MDK to compile library. Any help/tips would be helpfull. Thanks. Daniel #foc-adc #mcu #foc-adc #foc #foc-adc |
|
相关推荐
17个回答
|
|
亲爱的丹尼尔,
您使用的是哪些硬件,ST评估板还是定制?你有双重检查功率级总线电压感应分频器? FW引起的任何错误? 分配给总线电压检测的引脚 - 我看 - 是ADC2上的ADC12_IN9,您可以尝试分配ADC1吗? Vmcu = 3.3V?你可以仔细检查实际的硬件匹配FW配置吗?问候, 迪诺 以上来自于谷歌翻译 以下为原文 Dear Daniel, which hardware are you using, ST evaluation boards or custom? have you double checked the power stagebus voltage sensing divider? any error raised from FW? The pin assigned for bus voltage sensing - i see - is ADC12_IN9 on ADC2 , could you try assigning ADC1 instead? Is Vmcu = 3.3V? could you double check the actual HW matches the FW configuration?Regards, Dino |
|
|
|
你好迪诺,
我正在使用自定义硬件。我检查了硬件,我可以在MCU的引脚上看到正确的电压。 我还尝试用另一个代码检查AD转换器,转换器给我一个正确的值。硬件还可以。 在电机启动期间FW给我一个故障MC_UNDER_VOLT。这是事实,因为VBS_GetAvBusVoltage_V返回的值很小 (在开始~189,几秒钟后~21)并且它应该是325。 ADC2上的ADC12_IN9是手动设置的。原始值是ADC1,但是然后FW给我总线电压~1。 关于库的一些注意事项:我无法编译和运行代码而无需在文件中手动将常量BKIN2_MODE更改为NONE 控制阶段参数.h和文件控制阶段参数motor2.h中的常量PWM_TIMER_SELECTION2到TIM1。 其中一个更改使我能够编译它而另一个更改以运行代码而不会以HardFault中断结束。 MCU电压为3.3V。 除此之外,我已尝试使用IAR编译器 - 行为完全相同。 我的最后一次尝试是使用joevn的配置 - 我在这个论坛上找到了它。这是两个电机(好吧我只使用一个) 当然我不得不为我的HW修改它(我附加了这个文件)。 Workbench生成的文件可以毫无问题地编译它,但是在调试代码期间,在MCboot函数中结束。 当我停止MCU时它停留在功能ADC_GetFlagStatus中。 也许这是这个特定MCU的问题。我想使用F3xx系列中的另一种类型的MCU - 我知道我没有其他MCU和时间 |
|
|
|
所以我尝试使用Discovery工具包。我使用的是与STM32F3Discovery套件中使用的相同类型的MCU。我只添加了晶体和下载的代码到套件中,我将三聚体放在PC3上,我正常测量总线电压。它有效。 FW给我正确的值,它似乎真的测量电压。
MCU内部可能存在一些差异吗?的确如此,我所拥有的MCU很久以前就买了。 MCU中是否有一些勘误表或“变更”列表,因为它是在时间内产生的? 丹尼尔 以上来自于谷歌翻译 以下为原文 So I have tried to use Discovery kit. I'm using the same type of MCU as it is used in STM32F3Discovery kit. I only added crystal and downloaded code to kit and I put trimer on pin PC3 at which I normaly measure bus voltage. And it works. FW give me correct values and it seems it really measures voltage. Is it possible that there are some difference inside MCU? The true is, that MCU that I have were bought long time ago. Is there some errata or list of ''changes'' for MCU as it is produced during time? Daniel |
|
|
|
Ciao Daniel
您可以在ST.com中找到勘误表。 无论如何,如果可能的话,尝试获得一个新的micro并在自定义HW中替换它,以便了解问题是否真的存在于该特定部分中。 再见 梁咏琪 以上来自于谷歌翻译 以下为原文 Ciao Daniel You can find the Errata Sheet in the ST.com. Anyhow, if is possible, try to get a new micro and replace it in the custom HW in order to understand if the problem is really in that particular part. Ciao Gigi |
|
|
|
你好吉吉
问题解决了。我买了新的MCU,重新焊接它,它首先尝试工作。 那很有意思。我有很多这些旧的MCU。很遗憾,但我宁愿为新项目购买新样品。 丹尼尔 以上来自于谷歌翻译 以下为原文 Hello Gigi Problem solved. I bought new MCU, resolder it and it works at first try. That's interesting. I have a lot of these old MCUs. That is pity, but I rather buy a new samples for new projects. Daniel |
|
|
|
亲爱的Daniel,我试图从MC工作台为PMSM单驱动器生成代码,我提供了4个头文件和一个MC_it.c文件。我正在使用基尔u_vision4。当我添加这4个头文件和一个c文件并编译它会给出错误。你能告诉我编写代码和运行PMSM的程序,我的控制器是STM32F303VcT6。
还能请你提供源代码吗? 以上来自于谷歌翻译 以下为原文 Dear Daniel , i m trying to generate code for PMSM single drive from MC work bench, i gives 4 header files and one MC_it.c file. i m using Kiel u_vision4 . when i add these 4 header files and one c file and compile it it give error. can you please tell me the procedure to comiple the code and run PMSM, my controller is STM32F303VcT6. also can you please provide me source code ? |
|
|
|
亲爱的Gigi,我试图从MC工作台为PMSM单驱动器生成代码,我提供了4个头文件和一个MC_it.c文件。我正在使用基尔u_vision4。当我添加这4个头文件和一个c文件并编译它会给出错误。你能告诉我编写代码和运行PMSM的程序,我的控制器是STM32F303VcT6。
还能请你提供源代码吗? 以上来自于谷歌翻译 以下为原文 Dear Gigi , i m trying to generate code for PMSM single drive from MC work bench, i gives 4 header files and one MC_it.c file. i m using Kiel u_vision4 . when i add these 4 header files and one c file and compile it it give error. can you please tell me the procedure to comiple the code and run PMSM, my controller is STM32F303VcT6. also can you please provide me source code ? |
|
|
|
|
|
|
|
你好拉扎,
这很常见,当您尝试修改源代码时会收到很多错误消息。我能给你的只是一般规则。 使用与FOC库和Workbench相同的(兼容的或最新的)版本。 将头文件复制到FOC库。为什么你还要重写.c文件? Mayber我应该简要介绍一下如何使用这个库。 您必须从ST下载FOC库和Workbench软件。 Workbench软件用于为您的电机定制库。最后它只生成头文件。 FOC库是一组源代码,编译库和一些其他附件。 您必须将此生成的头文件复制到文件夹System_and_Drive_Params。你只需重写原始文件。 然后你必须在KEIL中打开项目 - FOC 4.0已经在文件夹 Project KEIL 中有KEIL的项目文件。你必须编译整个项目,就是这样。 如果您看到一些错误,则必须阅读错误消息并找出导致这些错误的原因和原因。 请提供有关错误的更多详情。 丹尼尔 以上来自于谷歌翻译 以下为原文 Hello Raza, It is quit common, that you get a lot of error messages when you try to modify source code some how. What I can give you are just generall rules. Use the the same (compatible or bether the latest) versions of FOC library and Workbench. Copy just header files to FOC library. Why you also rewrite .c file? Mayber I should give you short explanation how to use this library. You have to download FOC library and Workbench software from ST. Workbench software is use to customize library for your motor. At the end it generates only header files. FOC library is set of souce codes, compiled libraries and some other accesories. You will have to copy this generated header files to folder System_and_Drive_Params. You just rewrite the original files. Then you have to open project in KEIL - FOC 4.0 has already project files for KEIL in folder ProjectKEIL. You wil have to compile the whole project and that's it. If you see some errors you have to read the error message and find out why and what cause these errors. Please provide more details about errors. Daniel |
|
|
|
|
|
|
|
亲爱的丹尼尔,我在构建代码时发现了这些错误。我已经附加了MC WB项目,以及错误图片。请指导我
谢谢 以上来自于谷歌翻译 以下为原文 dear daniel , i have found these error while building my code. i have attached MC WB project and , pic of errors as well. please guide me thanks |
|
|
|
亲爱的丹尼尔,请告诉我是否必须使用批量构建或仅用于编译项目?我使用网络分发库不保密
以上来自于谷歌翻译 以下为原文 dear daniel , please tell me whether i have to use batch build or just build for compiling the project? i am using web distribution library not confidential |
|
|
|
你好拉扎,
对不起,我不会帮你解决这个问题。我使用KEIL而不是IAR编译器。我想,你应该按照库中的说明进行操作。它不取决于您使用的是Web还是机密版本。 丹尼尔 以上来自于谷歌翻译 以下为原文 Hello Raza, I'm sorry but I will not help you with this question. I'm using KEIL not a IAR compiler. I think, you should follow instruction included in library. It doesn't depend on whether you use web or confidential version. Daniel |
|
|
|
请告诉我在图书馆里的行为在哪里?
最后一个问题 pwm生成需要电流感应反馈吗? 因为当我将代码下载到控制器中时,gpio引脚上没有生成pwm 以上来自于谷歌翻译 以下为原文 kindly tell me where are the insturction in the libraray? one last question is current sensing feedback is necessary for the pwm generation? because when i download the code into the controller ,no pwm generated at the gpio pins |
|
|
|
您将在自述文件中找到说明,或者有一个doc文件夹,其中包含一个名为Quick Start for STM32 PMSM MC Library v4.0.pdf的精美pdf文件。在那里你会发现很多关于如何使用库的信息。除此之外,还有很多培训,尤其是FOC库。我记得,两年前我参观了其中一项培训。这次是在捷克共和国的布拉格。我记得世界各地都有更多的培训。请尝试检查ST网站。
电流测量对控制至关重要。 丹尼尔 以上来自于谷歌翻译 以下为原文 You will find instruction in readme file or there is a doc folder with nice pdf file called Quick Start for STM32 PMSM MC Library v4.0.pdf. There you will find a lot of information how to use library. Beside of these, there is a lot of trainings especially for FOC library. As I remember, two years ago I visited one of these trainings. These time it was in Prague in Czech republic. As I remember there were more trainings around the world. Please try to check ST web. Current measurement is essential for control. Daniel |
|
|
|
|
|
|
|
好的。
但在我的国家,没有培训机构的stm图书馆。即使只有一个小办公室,这只是为了销售硬件。请你能告诉我..在任何网站都有任何教程(vedios)吗? 以上来自于谷歌翻译 以下为原文 okay. but in my country there is no training institutes of stm library.even there is only a small office , that is only for sales of hardware. please can you tell me.. Is there any tutorials (vedios) at any website? |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2632 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1783 浏览 1 评论
3607 浏览 6 评论
5987 浏览 21 评论
939浏览 4评论
1315浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
582浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1302浏览 3评论
1357浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 06:30 , Processed in 1.374665 second(s), Total 81, Slave 74 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号