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.

LAUNCHXL-F28379D: Dual Axis Servo Drive with BOOSTXL-DRV8301

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: BOOSTXL-DRV8301, DRV8301, C2000WARE, SFRA, TIDM-02007, BOOSTXL-3PHGANINV, CONTROLSUITE

Hi

I am referring to this post from the E2E-Forum: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/997461/tms320f28379d-stuck-at-level-1-with-fcl-example.

I would also like to adapt the example to be able to run with the BOOSTXL-DRV8301.

Following the steps from the mentioned post, I have made these changes:

  • As the DRV8301 Gate is high-active, I have inverted all the gate disable and enable
  • Changed the nFault Pin to GPIO19
  • Changed the OT to the GPIO18 (OCTW)
  • set GPIO18 as INPUTXBAR1
  • changed the scaling of the voltage ADC (division by 3)
  • changed GPIO18 from output to input
  • Activated the gate before running the offset calibrations

The offset calibration runs fine (offsets around 0.5 pu), and the Vbus voltage gets measured correctly, but the trip zone keeps indicating an overcurrent. When I reset the trip flag, it gets immediately reactivated.

I have made the changes in steps 1-3 from the post, but I don't understand what has to be changed exactly in the code.

Could you help me here?

Best regards

Pavel

  • You may refer to the example in motor control SDK if you want to implement the FCL for dual-axis that's the update one and is suitable to be as a starting project.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_<version>\solutions\boostxl_3phganinv\f2837x\ccs\sensored_foc

    Dual-axis motor drive using fast current loop (FCL) and SFRA on a single MCU reference design

    TIDM-02007: https://www.ti.com/tool/TIDM-02007

  • Hi

    I have already used your mentioned example as the base Project and managed to run the example with the BOOSTXL-3PhGaNInv.

    But because my final custom hardware uses the DRV8301 chip, I would like to adapt the project to be capable of running with the BOOSTXL-DRV8301. As already described, there are some problems with the trip zone.
    Could you help me to resolve this? 

  • Which example lab are using? In controlSUITE? Or in Motor Control SDK? Currently, we recommend the customer to use the example in motor control SDK if they want to start a new design.

    Did you change the device configuration codes according to the hardware kits you used? And use build level 1 to verify the ADC and PWM configuration? And then run the motor with open-loop in build level 2.

  • I have used the "Dual Axis Servo Drive" example from the "C2000Ware_MotorControl_SDK_4_02_00_00".

    As described in my initial post, I think I have made all the necessary changes to run the BOOSTXL-DRV8301.

    Since my initial post, I have gotten closer to the reason for the overcurrent trip.
    In the function "void HAL_setupMotorFaultProtection(HAL_MTR_Handle handle,
    const float32_t currentLimit)" of the file "dual_axis_servo_drive_hal.c", the fault protection is set up. Trip 4 is set up to trip when the Value from the ADC gets below or above the limits. In addition to the currents, trip 4 is set to trip the OT GPIO24 in the original project. I have changed this for the GPIO18 (OCTW on BOOSTXL-DRV8301). If I remove the following line, the trip stops tripping.

    //inputxbar1 trip
    //XBAR_setEPWMMuxConfig(XBAR_TRIP4, XBAR_EPWM_MUX01_INPUTXBAR1);

    So I think something is misconfigured with this pin. According to the documentation of the BOOSTXL-3PhGaNInv and the BOOSTXL-DRV8301, both pins should be low-active. I have also checked the configuration of the GPIOs, and both are set up as input pins. Is there something that I am missing here?

    Thank you for your help!

    Best Regards
    Pavel

  • Do you configure the SPI for configuring the DRV8301? And set the right GPIO to enable the DRV8301 as well? 

    As mentioned above, you may try to run the code in build level 1 to verify the configuration first. The EPWMXBAR is for the nFAULT pin of the DRV8301. You don't need to change the code, and just need to change the GPIO linked to the INPUTXBAR.

  • Do you configure the SPI for configuring the DRV8301? And set the right GPIO to enable the DRV8301 as well? 

    No, I do not configure the DRV8301 with SPI. I use it in stock configuration.

    As mentioned above, you may try to run the code in build level 1 to verify the configuration first

    I am using the example above and running it in the build level 1.

    The EPWMXBAR is for the nFAULT pin of the DRV8301.

    Thank you, I have changed from the OCTW to the nFAULT pin (GPIO18 -> GPIO19).

    You don't need to change the code, and just need to change the GPIO linked to the INPUTXBAR.

    Unfortunately, the trip still gets activated without having any motor connected and in Build Level 1.

    This is now my function:

    void HAL_setupMotorFaultProtection(HAL_MTR_Handle handle,
                                       const float32_t currentLimit)
    {
        HAL_MTR_Obj *obj = (HAL_MTR_Obj *)handle;
    
        uint16_t  cnt;
    
        EPWM_DigitalCompareTripInput tripInSet = EPWM_DC_TRIP_TRIPIN4;
    
        // High and Low Compare event trips
        uint16_t curHi = 0;
        uint16_t curLo = 0;
    
        if(handle == &halMtr[MTR_1])
        {
            tripInSet = EPWM_DC_TRIP_TRIPIN4;
    
            curHi = 2048 + M1_CURRENT_SCALE(currentLimit);
            curLo = 2048 - M1_CURRENT_SCALE(currentLimit);
    
            //Select GPIO19 as INPUTXBAR1
            //XBAR_setInputPin(M1_XBAR_INPUT_NUM, M1_XBAR_INPUT_GPIO);
            XBAR_setInputPin(M1_XBAR_INPUT_NUM, M1_nFAULT_GPIO);
    
            // Configure TRIP 4 to OR the High and Low trips from both
            // comparator 1 & 3, clear everything first
            EALLOW;
            HWREG(XBAR_EPWM_CFG_REG_BASE + XBAR_O_TRIP4MUX0TO15CFG) = 0;
            HWREG(XBAR_EPWM_CFG_REG_BASE + XBAR_O_TRIP4MUX16TO31CFG) = 0;
            EDIS;
    
            // 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);
    
            //inputxbar1 trip
            XBAR_setEPWMMuxConfig(XBAR_TRIP4, XBAR_EPWM_MUX01_INPUTXBAR1);
    
            // Disable all the muxes first
            XBAR_disableEPWMMux(XBAR_TRIP4, 0xFFFF);
    
            // Enable Mux 0  OR Mux 4 to generate TRIP4
            XBAR_enableEPWMMux(XBAR_TRIP4, XBAR_MUX00 | XBAR_MUX04 | XBAR_MUX10 |
                                           XBAR_MUX01);
        }
        else if(handle == &halMtr[MTR_2])
        {
            // some code for motor 2
        }
    
    
        //
        // Configure TRIP for motor inverter phases
        //
        for(cnt = 0; cnt < 3; cnt++)
        {
            // comparator references
            // Set DAC-H to allowed MAX +ve current
            CMPSS_setDACValueHigh(obj->cmpssHandle[cnt], curHi);
    
            // Set DAC-L to allowed MAX -ve current
            CMPSS_setDACValueLow(obj->cmpssHandle[cnt], curLo);
    
            //Trip 4 is the input to the DCAHCOMPSEL
            EPWM_selectDigitalCompareTripInput(obj->pwmHandle[cnt],
                                               tripInSet,
                                               EPWM_DC_TYPE_DCAH);
    
            EPWM_setTripZoneDigitalCompareEventCondition(obj->pwmHandle[cnt],
                                                         EPWM_TZ_DC_OUTPUT_A1,
                                                         EPWM_TZ_EVENT_DCXH_HIGH);
    
            EPWM_setDigitalCompareEventSource(obj->pwmHandle[cnt], EPWM_DC_MODULE_A,
                                              EPWM_DC_EVENT_1,
                                              EPWM_DC_EVENT_SOURCE_ORIG_SIGNAL);
    
            EPWM_setDigitalCompareEventSyncMode(obj->pwmHandle[cnt],
                                                EPWM_DC_MODULE_A,
                                                EPWM_DC_EVENT_1,
                                                EPWM_DC_EVENT_INPUT_NOT_SYNCED);
    
            EPWM_enableTripZoneSignals(obj->pwmHandle[cnt], EPWM_TZ_SIGNAL_DCAEVT1);
    
            // Emulator Stop
            EPWM_enableTripZoneSignals(obj->pwmHandle[cnt], EPWM_TZ_SIGNAL_CBC6);
    
            // What do we want the OST/CBC events to do?
            // TZA events can force EPWMxA
            // TZB events can force EPWMxB
    
            // EPWMxA will go low
            // EPWMxB will go low
            EPWM_setTripZoneAction(obj->pwmHandle[cnt],
                                   EPWM_TZ_ACTION_EVENT_TZA,
                                   EPWM_TZ_ACTION_LOW);
    
            EPWM_setTripZoneAction(obj->pwmHandle[cnt],
                                   EPWM_TZ_ACTION_EVENT_TZB,
                                   EPWM_TZ_ACTION_LOW);
        }
    
        // clear EPWM trip flags
        DEVICE_DELAY_US(1L);
    
        for(cnt = 0; cnt < 3; cnt++)
        {
            // clear any spurious  OST & DCAEVT1 flags
            EPWM_clearTripZoneFlag(obj->pwmHandle[cnt], (EPWM_TZ_FLAG_OST |
                                                         EPWM_TZ_FLAG_DCAEVT1 |
                                                         EPWM_TZ_FLAG_CBC ));
    
            // clear any spurious  HLATCH - (not in TRIP gen path)
            CMPSS_clearFilterLatchHigh(obj->cmpssHandle[cnt]);
    
            // clear any spurious  LLATCH - (not in TRIP gen path)
            CMPSS_clearFilterLatchLow(obj->cmpssHandle[cnt]);
        }
    
        DEVICE_DELAY_US(1L);
    
        return;
    }

    Is there still something that I am missing?

  • Is there still something that I am missing?

    You have to take a look at the datasheet of the DRV8301, and add the driver for DRV8031 in this example project to configure the control registers of the DRV8301 by using SPI.

  • You have to take a look at the datasheet of the DRV8301, and add the driver for DRV8031 in this example project to configure the control registers of the DRV8301 by using SPI.

    Why do I need to configure the DRV8301? Can't I use all the control registers in their default configuration?

    Is there a demo project configuring the DRV8301, or is there a file with the drivers for the DRV8301?

  • Why do I need to configure the DRV8301? Can't I use all the control registers in their default configuration?

    It's better to configure the control register for setting the PWM mode and current limitation.

    Is there a demo project configuring the DRV8301, or is there a file with the drivers for the DRV8301?

    No DRV8301 example code for this  dual-axis project, but you can find the driver file of DRV8320RS in Motor Control SDK. You can refer to the InstaSPIN project to add the driver file into the dual-axis project.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_<version>\solutions\boostxl_drv8320rs\f28004x\ccs

    Recommend that you can use the supporting kit, boostxl_3phganinv in the example project that could help to start the design.