Other Parts Discussed in Thread: TIDA-010062, SFRA, C2000WARE
各位专家好!
关于TIDA-010062(基于F28003x)参考设计LLC的EPWM配置,有些问题要请教下:
1、函数void LLC_HAL_setupPWM(void)中调用了LLC_HAL_setupPWM_upDownCount函数,该函数配置了EPWM1和EPWM2,对于其中的周期值配置有些不理解,如下:
EPWM_setTimeBasePeriod(base, LLC_PERIOD_INIT_TICKS / 2);
#define LLC_PERIOD_INIT_TICKS (uint32_t)286
按照EPWM的时钟配置为120MHz,这个EPWM的开关频率是不是太高了?
//
// LLC_HAL_setupPWM() - configures the primary and secondary switching
// for the LLC converter.
//
void LLC_HAL_setupPWM(void)
{
//
// Configure primary switching for LLC stage - PH1, PRI
// Configure synchronous rectification - PH1, SEC
// Set the PWMs in a disabled state
//
LLC_HAL_setupPWM_upDownCount(LLC_PRI_PWM_BASE,
EPWM_SYNC_IN_PULSE_SRC_DISABLE,
1,
LLC_PERIOD_INIT_TICKS / 2 - 1,//CMPB = (286/2) -1
LLC_DBRED_PRI_INIT,
LLC_DBFED_PRI_INIT);
LLC_HAL_setupPWM_upDownCount(LLC_SEC_PWM_BASE,
EPWM_SYNC_IN_PULSE_SRC_SYNCOUT_EPWM1,
LLC_PERIOD_INIT_TICKS / 2 - 11,//(286/2) -1
10,//CMPB = 10
LLC_DBRED_SEC_INIT,
LLC_DBFED_SEC_INIT);
LLC_HAL_disablePhase(LLC_PRI_PWM_BASE, LLC_SEC_PWM_BASE);
//
// Configure the action qualifier submodules for primary switching and
// synchronous rectification to give 180 degree phase shift between the
// two interleaved phases.
//
//
// === Action Qualifier SubModule - PH1, PRI === //
//
// EPWMA low on CTR = 0
// EPWMA high on CTR = CMPA, in up-count mode
// EPWMA low on CTR = PRD
//
// EPWMB AQ output is inverted by DB for RED on EPWMB output
// EPWMB high on CTR = 0
// EPWMB high on CTR = PRD
// EPWMB low on CTR = CMPB, in down-count mode
//
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
//
// === Action Qualifier SubModule - PH1, SEC === //
//
// EPWMA high on CTR = 0
// EPWMA low on CTR = CMPA, in up count
// EPWMA low on CTR = PRD
//
// EPWMB high on CTR = 0
// EPWMB low on CTR = PRD
// EPWMB high on CTR = CMPB, in down count
//
EPWM_setActionQualifierAction(LLC_SEC_PWM_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
EPWM_setActionQualifierAction(LLC_SEC_PWM_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(LLC_SEC_PWM_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
EPWM_setActionQualifierAction(LLC_SEC_PWM_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
EPWM_setActionQualifierAction(LLC_SEC_PWM_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
EPWM_setActionQualifierAction(LLC_SEC_PWM_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);
}
2、关于EPWM1和EPWM2的驱动波形不是很理解,比如初级侧的驱动设置代码,能给个大概的驱动波形吗?特别是CTR值的变化和波形的关系。
//
// === Action Qualifier SubModule - PH1, PRI === //
//
// EPWMA low on CTR = 0
// EPWMA high on CTR = CMPA, in up-count mode
// EPWMA low on CTR = PRD
//
// EPWMB AQ output is inverted by DB for RED on EPWMB output
// EPWMB high on CTR = 0
// EPWMB high on CTR = PRD
// EPWMB low on CTR = CMPB, in down-count mode
//
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_A,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_HIGH,
EPWM_AQ_OUTPUT_ON_TIMEBASE_PERIOD);
EPWM_setActionQualifierAction(LLC_PRI_PWM_BASE, EPWM_AQ_OUTPUT_B,
EPWM_AQ_OUTPUT_LOW,
EPWM_AQ_OUTPUT_ON_TIMEBASE_DOWN_CMPB);







