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.

SVPWM 5-7 Phase

Guru 55673 points
Part Number: TMS320F280049C
Other Parts Discussed in Thread: DRV8320, C2000WARE

It would seem from previous post the TI engineer has indeed stated a known fact, "the Clark/Park transforms can use the 7 phase table" However.....

The question was why is the ePWM seemingly configured for 5 phase modulation in the InstaSpin hal.c (iso1_intro_hal). That becomes clear hal.c asserting ePWM Action Qualifier forcing 3 B side drives (AKA low side MOSFETS) to forced on state (A-B-C phase) in table below. Seemingly 5 phase ePWM as it has been defined in the table below, similar to industry accepted SVPWM phasing techniques. Should hal.c be an example of 7 phase SVPWM the Embedded SW must be controlling the vectors, not HW as it was configured!

Perhaps it is only during FAST estimator InstaSpin lab1 and ePWM Action Qualifier forces A side NFETS dangerously to the ON state and later changes to a disabled state in other labs?

This is a very important question and needs to answered honestly and confirmed by actual and Recent testing be done by TI engineers without forcing ePWM Action Qualifier in the hal.c code. The SVPWM table is supposed to be SW control of ePWM and not HW control as it has been configured (source_board/hal.c). InstaSpin analysis PDF never explains why HW is forcing A phase high/low was configured or how it may cause electrical issues!

       // setup the Action-qualifier Continuous Software Force Register
        // (AQCSFRC)
        EPWM_setActionQualifierContSWForceAction(obj->pwmHandle[cnt],
                                                 EPWM_AQ_OUTPUT_B,
                                                 EPWM_AQ_SW_OUTPUT_HIGH);

 

1. Why has InsatSpin Lab1 hal.c elected to configure 5 phase SVPWM?

2. Has InstaSpin labs ever confirmed 7 phase SVPWM works with many different PMSM motors?

  

  • I do realize hal.c first disables the 6 ePWM outputs but at some point are again enabled and not being inverted by SW in any written code lines. That still leaves an open window for cross conduction (shoot through) to randomly occur blowing shunts and NFETS clean off the PCB.

    Note too hal.c enabling unused GPIO/EPWM pins creates many little antennas into the MCU for stray EMI to flow inward, even on output pins! It would seem best practice has not been used in SW development of several labs for BosstXL-8320RS. Seemingly the DCDC regulator being disabled with not a single reference note as to what DCDC was disabled by yet other undocumented macro calls is nutz! You guys know what and where but nobody else does. would it not be prudent to simply type DRV8320 or other drivers? 

        //
        // Write 0 to enable bit.
        //
        HWREG(ANALOGSUBSYS_BASE + ASYSCTL_O_DCDCCTL) &= ~ASYSCTL_DCDCCTL_DCDCEN;

    Also the EPWM xBar MUX enable is not being configured in hal.c anywhere visible or even documented by text. How can TI expect the PDF technical manual to align with written code if it is never documented by a simple statement?

        // turns off the outputs of the EPWM peripherals which will put the power
        // switches into a high impedance state.
        EPWM_forceTripZoneEvent(obj->pwmHandle[0], EPWM_TZ_FORCE_EVENT_OST);
        EPWM_forceTripZoneEvent(obj->pwmHandle[1], EPWM_TZ_FORCE_EVENT_OST);
        EPWM_forceTripZoneEvent(obj->pwmHandle[2], EPWM_TZ_FORCE_EVENT_OST);

  • For the questions 1&2 above, as mentioned in some threads you posted. All InstaSPIN labs use the 7-switch SVPWM mode that is generated by software, can not set by the PWM registers directly in all the C28x devices.

    For EPWMxBAR, you can find the application guide in the technical manual, and find some application examples in C2000ware as well. Btw, the code you posted that is not related to EPWMxBAR, is for turning off the PWM according to the trip event, but the trip event if from the EPWMxBAR and comparator.

    We try to add some comments for the code, but it's impossible to explain every line of code in the reference. You may find a more detailed example code for each peripheral and related guide in C2000Ware as below folder. Hope that can help if you can take a look at them.

    C:\ti\c2000\C2000Ware_2_00_00_03\device_support\f28004x\

    or 

    C:\ti\c2000\C2000Ware_MotorControl_SDK_2_01_00_00\c2000ware\device_support\f28004x\docs

  • Yanming Luo said:
    All InstaSPIN labs use the 7-switch SVPWM mode that is generated by software, can not set by the PWM registers directly in all the C28x devices.

    Point again InstaSpin is not producing 7 phase SVPWM if SW forced HW into odd action qualified state that does not match text book disclosures of SVPWM theory! If you don't know the answer please ask around as this SW forced qualifier seems very wrong or is worded incorrectly!

    Again the Action Qualifier is forcing generator outputs HIGH (not inverted) and prior to configuring dead band. Generator Up/Down count defaults center aligned ePWM and should produce complementary A/B outputs, unless the F820049C generator/s have odd errata or lastly inverts B side state which is nowhere documented in technical manual. The SVPWM 7 phase ROM tables expect correct operating generators to function without forcing HW state as the SW is doing via hal.c HAL_setupPWMs().   

    Yanming Luo said:
    the code you posted that is not related to EPWMxBAR, is for turning off the PWM according to the trip event, but the trip event if from the EPWMxBAR and comparator.

    Point again SW disabled PWM A/B outputs to stop from shorting the NEXFETS from the results of the forced qualifier. Seemingly the event should be comparator related (CTR) or (T1/T2) but the HWREG touches ->

            HWREGH(base + EPWM_O_AQCSFRC) =
                    ((HWREGH(base + EPWM_O_AQCSFRC) & ~EPWM_AQCSFRC_CSFB_M) |
                     ((uint16_t)output << EPWM_AQCSFRC_CSFB_S)) ;

    That does not explain why the Action qualifier is forcing the B side to the on state. The action seemingly should be comparative event for duty cycle updates during generator load count interrupts. Unless forcing low side NFETS on was a crude way of charging the the Cboot caps DRV8320RS? If so that is not the proper way to pre-charge boot strap caps milliseconds since the possibility for Shoot Through to occur. Pre-Charge must be done from the PWM microsecond interrupt to be safe! 

    The software forced action is a useful asynchronous event. This control is handled by the AQSFRC and AQCSFRC registers.The action-qualifier submodule controls how the two outputs EPWMxA and EPWMxB behave when a particular event occurs. The event inputs to the action-qualifier submodule are further qualified by the counter direction (up or down). This allows for independent action on outputs on both the count-up and count-down phases.
    The possible actions imposed on outputs EPWMxA and EPWMxB are:
    • Set High:
    Set output EPWMxA or EPWMxB to a high level.
    • Clear Low:
    Set output EPWMxA or EPWMxB to a low level.
    • Toggle:
    If EPWMxA or EPWMxB is currently pulled high, then pull the output low. If EPWMxA or EPWMxB is
    currently pulled low, then pull the output high.
    • Do Nothing:
    Keep outputs EPWMxA and EPWMxB at same level as currently set. Although the "Do Nothing" option prevents an event from causing an action on the EPWMxA and EPWMxB outputs, this event can still trigger interrupts and ADC start of conversion. See the description in theSection 18.10 for details.

  • As replied to another thread you posted.

    It's a different concept between the PWM output and SVPWM output, the PWM output is set by the action control register that should be always the same regardless of 5-SW or 6-SW as you mentioned.

    The PWM configuration code is commonly used for InstaSPIN-FOC as a reference. Of course,  you may change it to get the output state as you want.