主题中讨论的其他器件:BOOSTXL-3PHGANINV、 TMDXIDDK379D、 TMDSCNCD28379D、BOOSTXL-POSMGR
您好、德州仪器
希望您对此有所帮助、我将对此进行概述、以便更好地传达消息
我们要做的事
我目前正在尝试使用 boostXL-3phganinv 并借助 SPI 绝对编码器来驱动 PMSM
我知道 TMDXIDDK379D 可能是一个更好的电路板、但我们真的想使用 GaN 逆变器而不是常规 MOSFET 来测试这一点。
此外、我们还有 HSEC 180引脚扩展坞卡和 TMDSCNCD28379D 控制卡、但我们除了一些跳线电缆外、没有用于连接 BoostXl-3phganinv 的合适 PCB、因此决定不使用。
我们的评估结果
- 我们最初尝试使用双轴伺服驱动器项目、
- 不过、我不太熟悉 CLA、也很难弄清楚如何禁用 eQEP、从而防止从 CLA 进行倾斜
- 如果可能、希望收到任何关于在何处禁用 eQEP 宏的建议
我们尝试的东西
- 因此我决定在 LaunchXL-F28379D 上使用 TMDXIDDK FCL 项目、
- 我复制了所有 PWM 和 ADC 掩码、如下所示
// // ADC and PWM Related defines for M1 // #define M1_IU_ADC_BASE ADCC_BASE //C2, NC: Set up based board #define M1_IV_ADC_BASE ADCB_BASE //B2, NC: Set up based board #define M1_IW_ADC_BASE ADCA_BASE //A2, NC: Set up based board #define M1_VDC_ADC_BASE ADCD_BASE //D14, NC: Set up based board #define M1_IU_ADCRESULT_BASE ADCCRESULT_BASE //C2, NC: Set up based board #define M1_IV_ADCRESULT_BASE ADCBRESULT_BASE //B2, NC: Set up based board #define M1_IW_ADCRESULT_BASE ADCARESULT_BASE //A2, NC: Set up based board #define M1_VDC_ADCRESULT_BASE ADCDRESULT_BASE //D14, NC: Set up based board #define M1_IU_ADC_CH_NUM ADC_CH_ADCIN2 //C2, NC: Set up based board #define M1_IV_ADC_CH_NUM ADC_CH_ADCIN2 //B2, NC: Set up based board #define M1_IW_ADC_CH_NUM ADC_CH_ADCIN2 //A2, NC: Set up based board #define M1_VDC_ADC_CH_NUM ADC_CH_ADCIN14 //D14, NC: Set up based board #define M1_IU_ADC_SOC_NUM ADC_SOC_NUMBER0 //C2, NC: Set up based board #define M1_IV_ADC_SOC_NUM ADC_SOC_NUMBER0 //B2, NC: Set up based board #define M1_IW_ADC_SOC_NUM ADC_SOC_NUMBER0 //A2, NC: Set up based board #define M1_VDC_ADC_SOC_NUM ADC_SOC_NUMBER0 //D14, NC: Set up based board #define M1_IU_ADC_PPB_NUM ADC_PPB_NUMBER1 //C2, NC: Set up based board #define M1_IV_ADC_PPB_NUM ADC_PPB_NUMBER1 //B2, NC: Set up based board #define M1_IW_ADC_PPB_NUM ADC_PPB_NUMBER1 //A2, NC: Set up based board #define M1_VDC_ADC_PPB_NUM ADC_PPB_NUMBER1 //D14, NC: Set up based board #define M1_U_CMPSS_BASE CMPSS6_BASE // NC: Set up based board #define M1_V_CMPSS_BASE CMPSS3_BASE // NC: Set up based board #define M1_W_CMPSS_BASE CMPSS1_BASE // NC: Set up based board #define M1_ADC_TRIGGER_SOC ADC_TRIGGER_EPWM1_SOCA // NC: Set up based board #define M1_U_PWM_BASE EPWM1_BASE // NC: Set up based board #define M1_V_PWM_BASE EPWM2_BASE // NC: Set up based board #define M1_W_PWM_BASE EPWM3_BASE // NC: Set up based board // // Analog scaling with ADC // #define M1_ADC_PU_SCALE_FACTOR 0.000244140625 // 1/2^12 #define M1_ADC_PU_PPB_SCALE_FACTOR 0.000488281250 // 1/2^11 // Current Scale // #define M1_MAXIMUM_SCALE_CURRENT 27.0 #define M1_CURRENT_SF (M1_MAXIMUM_SCALE_CURRENT / 4096.0) #define M1_CURRENT_INV_SF (4096.0 / M1_MAXIMUM_SCALE_CURRENT) // // Voltage Scale // #define M1_MAXIMUM_SCALE_VOLATGE 74.1 #define M1_VOLTAGE_SF (M1_MAXIMUM_SCALE_VOLATGE / 4096.0) #define M1_VOLTAGE_INV_SF (4096.0 / M1_MAXIMUM_SCALE_VOLATGE)
- 已根据我的需要配置所有 GPIO
void configureGPIO(void) { uint16_t pin; // // main inverter PWM GPIO init // PWM1 - U // PWM2 - V // PWM3 - W // // GPIO0->EPWM1A->UH_M1 GPIO_setMasterCore(0, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_0_EPWM1A); GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD); // GPIO1->EPWM1B->UL_M1 GPIO_setMasterCore(1, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_1_EPWM1B); GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD); // GPIO2->EPWM2A->VH_M1 GPIO_setMasterCore(2, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_2_EPWM2A); GPIO_setPadConfig(2, GPIO_PIN_TYPE_STD); // GPIO3->EPWM2B->VL_M1 GPIO_setMasterCore(3, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_3_EPWM2B); GPIO_setPadConfig(3, GPIO_PIN_TYPE_STD); // GPIO4->EPWM3A->WH_M1 GPIO_setMasterCore(4, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_4_EPWM3A); GPIO_setPadConfig(4, GPIO_PIN_TYPE_STD); // GPIO5->EPWM3B->WL_M1 GPIO_setMasterCore(5, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_5_EPWM3B); GPIO_setPadConfig(5, GPIO_PIN_TYPE_STD); // // Configure GPIO8 as ePWM5A for SD1, Ch1/2 clock // Configure GPIO9 as ePWM5B for SD1, Ch3 clock // GPIO_setPadConfig(8, GPIO_PIN_TYPE_STD); GPIO_setPinConfig(GPIO_8_EPWM5A); GPIO_setPadConfig(9, GPIO_PIN_TYPE_STD); GPIO_setPinConfig(GPIO_9_EPWM5B); // // GPIO18 is used as PushPull output to indicate the end of computation when // compared against the SOC signal GPIO_setMasterCore(18, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_18_GPIO18); GPIO_setPadConfig(18, GPIO_PIN_TYPE_STD); GPIO_setDirectionMode(18, GPIO_DIR_MODE_OUT); // // Setup GPIO for QEP operation // // QEP1A GPIO_setMasterCore(20, GPIO_CORE_CPU1); GPIO_setPadConfig(20, GPIO_PIN_TYPE_STD); GPIO_setDirectionMode(20, GPIO_DIR_MODE_IN); GPIO_setQualificationMode(20, GPIO_QUAL_3SAMPLE); GPIO_setPinConfig(GPIO_20_EQEP1A); // QEP1B GPIO_setMasterCore(21, GPIO_CORE_CPU1); GPIO_setPadConfig(21, GPIO_PIN_TYPE_STD); GPIO_setDirectionMode(21, GPIO_DIR_MODE_IN); GPIO_setQualificationMode(21, GPIO_QUAL_3SAMPLE); GPIO_setPinConfig(GPIO_21_EQEP1B); // QEP1I GPIO_setMasterCore(23, GPIO_CORE_CPU1); GPIO_setPadConfig(23, GPIO_PIN_TYPE_STD); GPIO_setDirectionMode(23, GPIO_DIR_MODE_IN); GPIO_setQualificationMode(23, GPIO_QUAL_3SAMPLE); GPIO_setPinConfig(GPIO_23_EQEP1I); // GPIO28->SCIRXDA GPIO_setMasterCore(28, GPIO_CORE_CPU1); GPIO_setPadConfig(28, GPIO_PIN_TYPE_STD); GPIO_setPinConfig(GPIO_28_SCIRXDA); // GPIO29->SCITXDA GPIO_setMasterCore(29, GPIO_CORE_CPU1); GPIO_setPadConfig(29, GPIO_PIN_TYPE_STD); GPIO_setPinConfig(GPIO_29_SCITXDA); // Configure GPIO used for Trip Mechanism // GPIO input for reading the status of the LEM-overcurrent macro block // (active low), GPIO40 could trip PWM based on this, if desired // Configure as Input GPIO_setPinConfig(GPIO_40_GPIO40); // choose GPIO for mux option GPIO_setDirectionMode(40, GPIO_DIR_MODE_IN); // set as input GPIO_setPadConfig(40, GPIO_PIN_TYPE_INVERT); // invert the input //Select GPIO40 as INPUTXBAR2 XBAR_setInputPin(XBAR_INPUT2, 40); // Clearing the Fault(active low), GPIO41 // Configure as Output GPIO_setPinConfig(GPIO_41_GPIO41); // choose GPIO for mux option GPIO_setDirectionMode(41, GPIO_DIR_MODE_OUT); // set as output GPIO_writePin(41, 1); // Forcing IPM Shutdown (Trip) using GPIO58 (Active high) // Configure as Output GPIO_setPinConfig(GPIO_58_GPIO58); // choose GPIO for mux option GPIO_setDirectionMode(58, GPIO_DIR_MODE_OUT); // set as output GPIO_writePin(58, 0); // GPIO31->LED GPIO_setMasterCore(31, GPIO_CORE_CPU1); GPIO_setPadConfig(31, GPIO_PIN_TYPE_STD); GPIO_setPinConfig(GPIO_31_GPIO31); GPIO_setDirectionMode(31, GPIO_DIR_MODE_OUT); // // BoostXL enable GPIO17 // compared against the SOC signal GPIO_setMasterCore(124, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_124_GPIO124); GPIO_writePin(124, 1); GPIO_setDirectionMode(98, GPIO_DIR_MODE_OUT); GPIO_setPadConfig(98, GPIO_PIN_TYPE_PULLUP); // // SDFM GPIO configurations // for(pin = 48; pin <= 53; pin++) { GPIO_setMasterCore(pin, GPIO_CORE_CPU1); GPIO_setDirectionMode(pin, GPIO_DIR_MODE_IN); GPIO_setPadConfig(pin, GPIO_PIN_TYPE_STD); GPIO_setQualificationMode(pin, GPIO_QUAL_ASYNC); } // GPIO58->SPISIMOA_M1 GPIO_setMasterCore(58, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_58_SPISIMOA); GPIO_setDirectionMode(58, GPIO_DIR_MODE_OUT); GPIO_setPadConfig(58, GPIO_PIN_TYPE_STD); // GPIO59->SPISOMIA_M1 GPIO_setMasterCore(59, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_59_SPISOMIA); GPIO_setDirectionMode(59, GPIO_DIR_MODE_IN); GPIO_setPadConfig(59, GPIO_PIN_TYPE_STD); // GPIO60->SPICLKA_M1 GPIO_setMasterCore(60, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_60_SPICLKA); GPIO_setDirectionMode(60, GPIO_DIR_MODE_OUT); GPIO_setPadConfig(60, GPIO_PIN_TYPE_STD); // GPIO61->SPISTEA_M1 GPIO_setMasterCore(61, GPIO_CORE_CPU1); GPIO_setPinConfig(GPIO_61_SPISTEA); GPIO_setDirectionMode(61, GPIO_DIR_MODE_OUT); GPIO_setPadConfig(61, GPIO_PIN_TYPE_STD); // SD1 Ch1 - Ishunt - V GPIO_setPinConfig(GPIO_48_SD1_D1); GPIO_setPinConfig(GPIO_49_SD1_C1); // SD1 Ch2 - Ishunt - W GPIO_setPinConfig(GPIO_50_SD1_D2); GPIO_setPinConfig(GPIO_51_SD1_C2); // SD1 Ch3 - DC Bus GPIO_setPinConfig(GPIO_52_SD1_D3); GPIO_setPinConfig(GPIO_53_SD1_C3); return; }
- 并在 LaunchXL-F28379D 上刷写了该代码
发生了什么事
- ADCIN14正常工作并测量 VDC
- SPI 端口正常工作并正确获取 SPI 数据
- 用于 UVW 相的 ADC 正常工作(我认为)
- 构建级1 PWM 输出 DOES NOT 工作
- 尝试连接正交编码器并将编码器类型设置为 QEP 编码器。 即使在 buildLevel 1中、EPWM1也不会执行
- 不过、当将 GPIO 从 HSEC 卡连接到 BoostXL-3phganinv 时、PWM 信号是实时的。
- 我发现这很奇怪、这两个芯片不是同在吗? 此外、双轴伺服驱动器和 tmdxiddk 都具有为 PWM 定义的相同 GPIO
我们非常感谢您提供任何帮助、如果您希望了解更多代码、敬请告知。 我们在 motorcontrolISR 中调用了 SPI 函数、这是对代码进行的唯一修改
谢谢!
汉索尔