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.

TMS320F28379D: Stuck at level 1 with FCL example

Part Number: TMS320F28379D
Other Parts Discussed in Thread: SFRA, BOOSTXL-DRV8301, DRV8301

Hey all,

I'm having problems with the "Dual-Axis Motor Control Using FCL and SFRA On a Single C2000Tm MCU" design featured in Application Report SPRACO3. I'm using the Launchpad 28379D along with two BoostXL-DRV8301 inverters. I know that the application report uses the 3PhGanInv, and we are going to switch over those soon. As far as I could tell, the vital signals are on the same pins (ADC, PWM, enable).
I can get the isrTicker variable counting in debug mode. However, I cannot generate the correct graphs, because the flag "tripFlagDMC" is set to 1 as soon as the enableFlag is set, indicating overcurrent. Note that there is no load connected to the inverter, thus there are no phase currents. However high I set the currentLimit variable (even as high as 100 A), the overcurrent status is still indicated. In another post I saw someone mentioning overflow in connection to this issue.

I am aware that the gain in the voltage and current sense circuits differ between the two inverters, but I still cannot figure out the problem.

Any help is much appreciated.

  • That means a fault like over/under voltage, over current is detected in runMotorControl(), so you need to configure the GPIOs, PWM, ADC, XBARINPUT, and CMPSS according to the BoostXL-DRV8301.

    And you need to change the M1_XBAR_INPUT_GPIO/M2_XBAR_INPUT_GPIO, and XBARINPUT based on BoostXL-DRV8301 in HAL_setupMotorFaultProtection().

  • Thank you for your reply. I looked into the things you mentioned, however, the flag is still set because of the HAL_setupmotorfaultprotection() function. I'm going to do more debugging next week, as I'm not too familiar with tripzones. I will get back to you soon. Thank you! 

  • Fine. You have to change the settings in the HAL_setupMotorFaultProtection() based on the hardware board. Let's know if you have further questions.

  • I looked into the code that's responsible for generating the trip signals (setupMotorFaultProtection()). I believe that it is correctly set, as I have set the input xbars according to the DRV8031, and the right CMPSS modules are used. However, the trip flag is still set. I tried changing EPWM_setTripZoneDigitalCompareEventCondition to EPWM_TZ_EVENT_DCXH_LOW (so it ought to trigger on the falling edge instead of the rising) but the flag is still set. The nfault pin of the inverters are constantly high, as I checked that with a scope.

  • You might check if the value in the related GPIO data and CMPSS status registers is correct. And check if the nFault and OCTW of the DRV8301 are low-level output. You need to set the INPUT XBAR link to the GPIO for nFault or OCTW.

    BTW, you should set the SAMPLING FREQUENCY to one of the available choices since the low side shunt resistor only supports this mode.

  • I checked the registers. The nFault GPIO's GPIODAT is set to 1 (even though the GPIO pin is specified as TYPE_INVERTED. Unfortunately, I could not find information about the GPIODAT register in SPRS880O, so I'm not sure whether it is supposed to show the actual input, or the inverted value in this case). Also, the low-side comparators output 1, even though their output is inverted in dual_axis_servo_drive_hal.c .

  • 1. Change the definitions for ADC and CMPSS base address and ADC channel for current and voltage in dual_axis_servo_drive_user.h

    // 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

    2.  Change the definition M1_XBAR_INPUT_GPIO for nFault input in ual_axis_servo_drive_user.h

    //Select GPIO24 as INPUTXBAR1
    XBAR_setInputPin(M1_XBAR_INPUT_NUM, M1_XBAR_INPUT_GPIO);

    3. Configure GPIO for nFault input in HAL_setupGPIOs() in hal.c

    GPIO_setMasterCore(24, GPIO_CORE_CPU1);
    GPIO_setPinConfig(GPIO_24_GPIO24);
    GPIO_setDirectionMode(24, GPIO_DIR_MODE_IN);

    GPIO_setPadConfig(24, GPIO_PIN_TYPE_INVERT);

    4. Change the XBAR muxes for CMPSS in HAL_setupMotorFaultProtection() in hal.c

    // Enable Muxes for ored input of CMPSS1H and 1L, mux for Mux0x
    //cmpss1 - tripH or tripL
    XBAR_setEPWMMuxConfig(XBAR_TRIP4, XBAR_EPWM_MUX00_CMPSS1_CTRIPH_OR_L);

    //cmpss3 - tripH or tripL
    XBAR_setEPWMMuxConfig(XBAR_TRIP4, XBAR_EPWM_MUX04_CMPSS3_CTRIPH_OR_L);

    //cmpss6 - tripH or tripL
    XBAR_setEPWMMuxConfig(XBAR_TRIP4, XBAR_EPWM_MUX10_CMPSS6_CTRIPH_OR_L);

    // Enable Mux 0 OR Mux 4 to generate TRIP4
    XBAR_enableEPWMMux(XBAR_TRIP4, XBAR_MUX00 | XBAR_MUX04 | XBAR_MUX10 |
    XBAR_MUX01);

  • Thank you for your answers. I found the error: in case of the DRV8301 the current sense amplifiers are only enabled when EN_GATE signal is high. It takes up to 1.5 ms after EN_GATE is  set to high for the ADC pins to show the correct voltage.