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-F280049C: SDK OffsetsCalculation

Guru 54057 points
Part Number: LAUNCHXL-F280049C

Motor SDK v3.01 (FOC)

There is issue of runOffsetsCalculation() remains locked into ePWM 50% dutycycle output signals (phase A, B, C) when >3 interrupt ticks configured user.h, define shown below.

#define USER_NUM_PWM_TICKS_PER_ISR_TICK (6)

It seems odd to call runOffsetsCalculation() internal ADC offsets for so many mainISR() interrupt periods. Might it be better to have offsets call placed outside mainISR() tick periods?

You would think mainISR() only calls one time to runOffsetsCalculation() but have SCIAprintf() show how many, it really is highly re-entrant.

An adverse effect of offset call re-entrance also causes ePWM overcurrent trip event fault, must be cleared each time in the loop if trip event occurs. 

My guess is the ePWM tick count being slower for mainISR() interrupt, the wait time need to be made less too.

offsetCalcCount++;

if(offsetCalcCount >= offsetCalcWaitTime)
{

}

  • What was causing the offset run issue was from extending mainISR() ISR time, oddly offset for loop runs indefinitely.

    The work around with >3 ePWM ticks requires to reduce offset calculation wait time counts value respectively.

    #define USER_NUM_PWM_TICKS_PER_ISR_TICK (6)

    uint32_t offsetCalcWaitTime = 1250; //!< Wait time setting for current/voltage
    //!< offset calibration, unit: ISR cycles