Part Number: TMS320F2800137
Other Parts Discussed in Thread: CONTROLSUITE
Hi,
We already have a Universal Motor Control lab based on the TMS320F2800137 chip, but we want to drive both PMSM and ACIM motors. Since Universal Motor Control's ACIM support is limited, we want to use the ACIM-supported code found in HVMotorCtrl+PfcKit_v2.0 within the control suite (ti\controlSUITE\development_kits\HVMotorCtrl+PfcKit_v2.1\HVACI_Sensored). There are differences between Universal Motor Control and HVMotorCtrl+PfcKit_v2.0 (HVACI_Sensored), and we need to ask about the changes we've made. How should we resolve the discrepancy we've found in the PWM initialize section?
Relevant pwm init section:
1.HVMotorCtrl+PfcKit_v2.0 (HVACI_Sensored):
#define AQCTLA_INIT_STATE ( CAD_SET + CAU_CLEAR )
#define PWM_INIT_MACRO(ch1,ch2,ch3,v) \
/* Setup Sync*/ \
.......Other init codes
........Other init codes
........Other init codes
/* Init Action Qualifier Output A Register for EPWM1-EPWM3*/ \
(*ePWM[ch1]).AQCTLA.all = AQCTLA_INIT_STATE; \
(*ePWM[ch2]).AQCTLA.all = AQCTLA_INIT_STATE; \
(*ePWM[ch3]).AQCTLA.all = AQCTLA_INIT_STATE; \
\
......Other init codes
.....Other init codes
..... Other init codes
2.Universal Motor Control
EPWM_setActionQualifierAction(obj->pwmHandle[cnt],
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(obj->pwmHandle[cnt],
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
EPWM_setActionQualifierAction(obj->pwmHandle[cnt],
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPA);
EPWM_setActionQualifierAction(obj->pwmHandle[cnt],
EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
-------------------------------------------------------------------------------
How should the difference in the QualifierAction be resolved?
We tried reversing the trigger time by writing period - pPWMData->cmpValue[pwmCnt] instead of pPWMData->cmpValue[pwmCnt].
uint16_t period = EPWM_getTimeBasePeriod(obj->pwmHandle[0]);
for(pwmCnt=0; pwmCnt<3; pwmCnt++)
{
// cmpValue will already be calculated in the main file.
// Direct writing to CMPA and CMPB
EPWM_setCounterCompareValue(obj->pwmHandle[pwmCnt],
EPWM_COUNTER_COMPARE_A,
period - pPWMData->cmpValue[pwmCnt]);
EPWM_setCounterCompareValue(obj->pwmHandle[pwmCnt],
EPWM_COUNTER_COMPARE_B,
period - pPWMData->cmpValue[pwmCnt]);
};
Is this solution appropriate?