This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
您好、Luo、
这是以下主题的续篇
大家好、感谢您的回复、
我们遵循了上述文档、成功将代码移植到49C、并使用 FAST 和编码器旋转电机(供参考:使用 HV-kit 旋转 Estun_EMJ_04APB22_A 电机)。
2.众所周知、在 HV-KIT 中、只提供将编码器 A、B、R (连接到 eQEP)连接起来。
我们观察到、在通用实验中、转子角度是根据脉冲计数(eQEP 计数)计算的。
我们需要根据编码器模拟 信号(C、D)(正弦和余弦信号)计算转子位置。
4.是否有任何示例代码可根据编码器模拟信号计算转子位置?
将 A/B/I (Z)连接到 C2000的 QEP 的增量编码器。 通用实验中的 QEP 使用 需要 A、B 和 I 输入信号的正交解码器单元。
[引用 userid="461371" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1136164/tms320f280039c-sensored-foc_tms320f280039c。我们需要根据编码器模拟 信号(C、D)(正弦和余弦信号)计算转子位置。目前、Universal Lab 和 Motor Control SDK 中没有此类示例。 我们计划在明年年初的下一个版本中支持此类编码器。
罗致光感谢您的回复、
我们在下面的路径中获得了来自 controlSUITE 的示例项目
" C:\ti\controlSUITE\libs\app_libs\position_manager\v01_00_00_00\sincos\examples\PM_sincos_example "
我们参考了以下路径中提供的应用手册
" C:\ti\controlSUITE\libs\app_libs\position_manager\v01_00_00_00\sincos\Doc"
从#1、#2开始、我们决定使用 PM_SINCOS 库。
4.我已将该库添加到我的项目中(代码如下所示)。
a.包含文件映像
B.
#include "common.h" #include "F28x_Project.h" #include "main.h" void main(void) { Device_init(); Device_initGPIO(); enableInterrupts(); init_gpio(); init_ADCs(); InitPWM(); initADCSOC(); uart0_init(); sincos_init(); PM_sincos_initLib(&mySincos); //library function Interrupt_RegisterEnable(); EINT; ERTM; while (1) { } } __interrupt void adcA1ISR(void) { Read_ADCdata(); clear_ADCinterrupts(); } void enableInterrupts(void) { Interrupt_initModule(); Interrupt_initVectorTable(); } void Interrupt_RegisterEnable(void) { Interrupt_register(INT_ADCA1, &adcA1ISR); Interrupt_enable(INT_ADCA1); }
但我得到的错误如下面所示
6.是否可以将 PM_SINCOS 库用于39c 控制器?
是的、您可以参考示例代码、并将其移植到 F280039C 中。
[引用 userid="461371" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1136164/tms320f280039c-sensored-foc_tms320f280039c/4218188 #42188"]但我收到了下面所示的错误您可以使用此文件夹中的示例、该示例可为 F280039C 轻松移植。 您只需要使用"PM_SINCOS_lib.c"和 "PM_SINCOS_lib.h"文件。
还没有。 但您可以通过下面的链接来查看 TID。
https://www.ti.com/tool/TIDA-00176
TI Designs 设计具有高分辨率位置插值的正弦/余弦编码器接口
[引用 userid="461371" URL"~/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1136164/tms320f280039c-sensored-foc_tms320f280039c/4219452 #4219452]3..在该示例代码中,我们不知道 eQEP 初始化的原因是什么? 以及如何根据正弦和余弦信号 ADC 读数计算角度?[/QUERT]一些正弦/余弦编码器输出增量信号 A 和 B 以及零信号 R、以及每转一个正弦波 C 和 D 周期。 如 上面的 TID 所示、A、B 和 R 可被转换为连接到 QEP 的信号。