Other Parts Discussed in Thread: BOOSTXL-3PHGANINV, TMDXIDDK379D, TMDSCNCD28379D, , BOOSTXL-POSMGR
Hi Texas Instruments,
I hope you can help with this, I will outline this to convey the message a bit better
What we want to do
I am currently trying to drive a PMSM with an SPI Absolute Encoder using boostXL-3phganinv
I know TMDXIDDK379D is probably a better board, but we really want to test this using GaN inverter instead of regular MOSFETs
Also, we have HSEC 180 Pin Docking Card and TMDSCNCD28379D Control Card, but decided not to use it as we do not have a proper PCB to interface the BoostXl-3phganinv other than some jumper cables.
What we evaluated
- Initially tried to use the dual-axis servo drive project
- However, I'm not very familiar with CLA's and it was difficult to figure out how we can disable the eQEP saving to pangle from CLA
- Any suggestion on where to put disable macro for eQEP would be appreciated if possible
What we tried
- So i decided to use the TMDXIDDK FCL project on LaunchXL-F28379D
- I copied over all of the PWM and ADC masks as seen below
// // 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)
- Configured all of the GPIO for my needs
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; }
- And flashed it on the LaunchXL-F28379D
What Happened
- ADCIN14 works and measures VDC properly
- SPI port works and gets SPI data properly
- ADC for UVW phase works properly (I think)
- BuildLevel1 PWM output DOES NOT work
- Tried to interface quadrature encoder and set the encoder type to QEP Encoder. EPWM1 still will NOT execute even at buildLevel 1
- HOWEVER, when interfacing the GPIO's from the HSEC card to the BoostXL-3phganinv, the PWM signal is LIVE.
- I find this weird, aren't these two the same chip? Also, either dual-axis servo drive and tmdxiddk both has the same gpio's defined for the PWM
Any help would be greatly appreciated and let me know if you'd like to see more of the code. We just have SPI function called in the motorcontrolISR this is the only modification to the code
Thanks!
Hansol