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.

[参考译文] TMS320F28388D:在 FCL 库中使用未定义的电机

Guru**** 2386620 points
Other Parts Discussed in Thread: TMDXIDDK379D, C2000WARE
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1017016/tms320f28388d-using-undefined-motor-in-fcl-library

器件型号:TMS320F28388D
主题中讨论的其他器件:TMDXIDDK379DC2000WARE

您好!

我在自己的实验板中使用28388 MCU 运行 FCL 项目。

我有一个 FCL 代码中不存在的不同规格电机。 (不是 ESTUN_EMJ04APB222、TEKNIC_2310PLN04K!!)

我有带 T-format 编码器的三相交流伺服电机。 我想使用 您的 FCL 代码运行该电机。

我修改了 fcl_f2838x_tmdxiddk_settings_cpu1.h 中的一些代码

//
//将电机参数设置为可用的参数
//
#define ESTUN_EMJ04APB222 1.
#define TEKNIC_2310PLN04K 2.
已  修改#define TSM3003_N7364_E600 3 //

//#define USER_MOTOR_ESTUN_EMJ04APB222 // TEKNIC_2310PLN04K //
已 修改#define USER_MOTORTSM3003_N7364_E600 //

//
//定义电机参数(Tamagawa Servomotor )//已修改
//
#if (USER_MOTOR== TSM3003_N7364_E600)
#define RS 2.35 //定子电阻(欧姆)
#define RR NULL //转子电阻(欧姆)
#define LS 0.0065 //定子电感(H)
#define LR NULL //转子电感(H)
#define LM NULL //磁化电感(H)
#define 极点8 //极点数
#define ENC_SLOTS 2500 //编码器中插槽的数量

#define M_ID_START 0.1 //对齐参考 d 轴电流
#define M_IQ_LI5 0.05 //电平5的基准 q 轴电流
#define M_IQ_LN5 0.03 //参考 q 轴电流、无 LEVEL5

未精确指定/*参数。 *

但是 、在重建它时、    会在[源-> FCL_f2838x_tmsdxiddk_cpu1.c]中导致29个错误

" C:/ti/c2000/C2000Ware_MotorControl_SDK_3_02_00_00/solutions/tmdxiddk379d/f2838x/include/fcl_f2838x_tmdxiddk_settings_cpu1.h "、第47行:错误#38:缺少此指令的#endif

"C:/ti/c2000/C2000Ware_MotorControl_SDK_3_02_00_00/solutions/tmdxiddk379d/f2838x/source/fcl_f2838x_tmdxiddk_cpu1.c "、第347行:错误#60:常量表达式中不允许函数调用"

"C:/ti/c2000/C2000Ware_MotorControl_SDK_3_02_00_00/solutions/tmdxiddk379d/f2838x/source/fcl_f2838x_tmdxiddk_cpu1.c、第420行:错误#20:标识符"M_ID_START"未定义

" gmake:目标'all'不会由于错误而重做。"

等等

我想我应该修改[user.h]文件中的一些代码,但我找不到该文件.... 产生的

#ifndef USER_MOTOR
user.h 中未定义#ERROR 电机类型
#endif

告诉我如何  使用您的代码驱动我的电机!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您可以参考以下代码来添加您的电机。

    //
    // set the motor parameters to the one available
    //
    #define ESTUN_EMJ04APB222        1
    #define TEKNIC_2310PLN04K        2
    #define TSM3003_N7364_E600       3
    
    #define USER_MOTOR               TSM3003_N7364_E600 //TEKNIC_2310PLN04K  // ESTUN_EMJ04APB222   //
    
    //
    // Define the electrical motor parameters (Estun Servomotor)
    //
    #if(USER_MOTOR == ESTUN_EMJ04APB222)
    #define RS          2.35                // Stator resistance (ohm)
    #define RR          NULL                // Rotor resistance (ohm)
    #define LS          0.0065              // Stator inductance (H)
    #define LR          NULL                // Rotor inductance (H)
    #define LM          NULL                // Magnetizing inductance (H)
    #define POLES       8                   // Number of poles
    #define ENC_SLOTS   2500                // Numer of slots in the encoder
    
    #define M_ID_START  0.1                 // alignment reference d-axis current
    #define M_IQ_LI5    0.05                // reference q-axis current for level5
    #define M_IQ_LN5    0.03                // ref q-axis current for no level5
    
    //
    // Define the electrical motor parameters (Teknic Servomotor)
    //
    #elif(USER_MOTOR == TEKNIC_2310PLN04K)
    #define RS          0.381334811         // Stator resistance (ohm)
    #define RR          NULL                // Rotor resistance (ohm)
    #define LS          0.000169791776      // Stator inductance (H)
    #define LR          NULL                // Rotor inductance (H)
    #define LM          NULL                // Magnetizing inductance (H)
    #define FLUX        0.0398557819        // BEMF constant (V/Hz)
    #define POLES       8                   // Number of poles
    #define ENC_SLOTS   1000                // Numer of slots in the encoder
    
    #define M_ID_START  0.2                 // alignment reference d-axis current
    #define M_IQ_LI5    0.10                // reference q-axis current for level5
    #define M_IQ_LN5    0.10                // ref q-axis current for no level5
    
    #elif(USER_MOTOR == TSM3003_N7364_E600)
    
    #define RS 2.35             // Stator resistance (ohm)
    #define RR NULL             // Rotor resistance (ohm)
    #define LS 0.0065           // Stator inductance (H)
    #define LR NULL             // Rotor inductance (H)
    #define LM NULL             // Magnetizing inductance (H)
    #define POLES 8             // Number of poles
    #define ENC_SLOTS 2500      // Numer of slots in the encoder
    
    #define M_ID_START 0.1      // alignment reference d-axis current
    #define M_IQ_LI5 0.05       // reference q-axis current for level5
    #define M_IQ_LN5 0.03       // ref q-axis current for no level5
    
    #else
    #error No motor type specified
    #endif
    
    #ifndef USER_MOTOR
    #error Motor type is not defined in user.h
    #endif