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-F28P55X: PWM MACRO and PWM HV modules

Part Number: LAUNCHXL-F28P55X
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hi

Where can I find the explanation and implementation of these two modules in the documents or in the dual_axis_servo_drive code?

Thanks

  • Luca, 

    I have assign this to our motor code expert. He will reply soon on your question. We appreciate your patience.

    Regards,

    Sumit

  • Hi,

    I don't see documentation that explains it further, only other thing is https://www.ti.com/lit/ug/spruip4/spruip4.pdf?ts=1756308970299 

    Here is the related code for SVGEN and PWM comparator value setting. Hope it clarifies it.

    //
    //  MACRO to :-
    //      1. do SVGEN
    //      2. do PWMupdates
    //
    FCL_SVGEN_PWM_PDATE_MACRO();
        
    // FCL MACRO implementing SVGEN and PWM updates
    // used in both PI CONTROL and COMPLEX CONTROL
    //
    #define FCL_SVGEN_PWM_PDATE_MACRO()                                            \
    /*                                                                             \
     * ----------------------------------------------------------------------------\
     * Call the space vector gen. macro                                            \
     * ----------------------------------------------------------------------------\
     */                                                                            \
        svgen2.Tb = (svgen2.Ubeta - svgen2.Ualpha) / 2;                            \
        svgen2.Tc = svgen2.Tb - svgen2.Ubeta;                                      \
                                                                                   \
        svgen2.tmp2 = __fmax(__fmax(svgen2.Ualpha,                                 \
                                           svgen2.Tc), svgen2.Tb);                 \
        svgen2.tmp2 += __fmin(__fmin(svgen2.Ualpha,                                \
                                            svgen2.Tc), svgen2.Tb);                \
                                                                                   \
        svgen2.tmp1  =  ((-svgen2.tmp2) / 2) +                                     \
                                 pMotor->FCL_params.carrierMid;                    \
                                                                                   \
    /*                                                                             \
    * -----------------------------------------------------------------------------\
    * Computed Duty and Write to CMPA register                                     \
    * -----------------------------------------------------------------------------\
    */                                                                             \
         FCL_PWM_UPDATE_STYLE_3();
         
    #define FCL_PWM_UPDATE_STYLE_3()                                               \
        *(pMotor->pwmCompA) = (uint32_t)(svgen2.Tc + svgen2.tmp1);                 \
        *(pMotor->pwmCompB) = (uint32_t)(svgen2.Ualpha + svgen2.tmp1);             \
        *(pMotor->pwmCompC) = (uint32_t)(svgen2.Tb + svgen2.tmp1);

    Best,

    Kevin

  • Thank you.

    But is the code you sent me that of SVGEN or that of PWM MACRO/PWM HV ?

  • Hi,

    It is both. For PWM Macro see FCL_PWM_UPDATE_STYLE_3() function which calculates and sets the PWM compare values based on the SVGEN inputs. And pwmCompA/B/C pointer was already defined in FCL_initPWM() function earlier, so it writes directly to the EPWM CMPA register.

        ptrMotor->pwmCompA = (uint32_t *)(basePhaseU + EPWM_O_CMPA);
        ptrMotor->pwmCompB = (uint32_t *)(basePhaseV + EPWM_O_CMPA);
        ptrMotor->pwmCompC = (uint32_t *)(basePhaseW + EPWM_O_CMPA);

    Best,

    Kevin

  • I ask one more thing.

    The explanation of all modules used in dual_axis_servo_drive can be found by downloading designdrive?

    Because I currently do not have it installed, although the code works since CCS is sufficient 

  • Hi,

    You can import into CCS and reference the below project directory that's in the https://www.ti.com/tool/C2000WARE-MOTORCONTROL-SDK installation.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_5_04_00_00\solutions\boostxl_3phganinv\f28p55x

    Best,

    Kevin