www.ti.com
Controlling Zero Voltage Switched Full Bridge (ZVSFB) Converter
Example 3-6. Code Snippet for Configuration in Figure 3-15
//=====================================================================
//Config //=====================================================================
//Initialization Time
//======================== |
|
// EPWM Module 1 config |
|
EPwm1Regs.TBPRD = 1200; | // Period = 1201 TBCLK counts |
EPwm1Regs.CMPA = 600; | // Set 50% fixed duty for EPWM1A |
EPwm1Regs.TBPHS = 0; | // Set Phase register to zero |
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP; | // Asymmetrical mode |
EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE; | // Master module |
EPwm1Regs.TBCTL.bit.PRDLD = TB_SHADOW; |
|
EPwm1Regs.TBCTL.bit.SYNCOSEL = TB_CTR_ZERO; | // Sync |
EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; |
|
EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; |
|
EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; | // load on CTR=Zero |
EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; | // load on CTR=Zero |
EPwm1Regs.AQCTLA.bit.ZRO = AQ_SET; | // set actions for EPWM1A |
EPwm1Regs.AQCTLA.bit.CAU = AQ_CLEAR; |
|
EPwm1Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; | // enable |
EPwm1Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | // Active Hi complementary |
EPwm1Regs.DBFED = 50; | // FED = 50 TBCLKs initially |
EPwm1Regs.DBRED = 70; | // RED = 70 TBCLKs initially |
// EPWM Module 2 config |
|
EPwm2Regs.TBPRD = 1200; | // Period = 1201 TBCLK counts |
EPwm2Regs.CMPA.half.CMPA = 600; | // Set 50% fixed duty EPWM2A |
EPwm2Regs.TBPHS = 0; | // Set Phase register to zero initially |
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UP; | // Asymmetrical mode |
EPwm2Regs.TBCTL.bit.PHSEN = TB_ENABLE; | // Slave module |
EPwm2Regs.TBCTL.bit.PRDLD = TB_SHADOW; |
|
EPwm2Regs.TBCTL.bit.SYNCOSEL = TB_SYNC_IN; | // sync |
EPwm2Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW; |
|
EPwm2Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW; |
|
EPwm2Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO; | // load on CTR=Zero |
EPwm2Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO; | // load on CTR=Zero |
EPwm2Regs.AQCTLA.bit.ZRO = AQ_SET; | // set actions for EPWM2A |
EPwm2Regs.AQCTLA.bit.CAU = AQ_CLEAR; |
|
EPwm2Regs.DBCTL.bit.MODE = DB_FULL_ENABLE; | // enable |
EPwm2Regs.DBCTL.bit.POLSEL = DB_ACTV_HIC; | // Active Hi complementary |
EPwm2Regs.DBFED = 30; | // FED = 30 TBCLKs initially |
EPwm2Regs.DBRED = 40; | // RED = 40 TBCLKs initially |
//Run Time (Note: Example execution of one
EPwm2Regs.TBPHS = | // Set Phase reg to 300/1200 * 360 = 90 deg |
EPwm1Regs.DBFED = FED1_NewValue; | // Update ZVS transition interval |
EPwm1Regs.DBRED = RED1_NewValue; | // Update ZVS transition interval |
EPwm2Regs.DBFED = FED2_NewValue; | // Update ZVS transition interval |
EPwm2Regs.DBRED = RED2_NewValue; | // Update ZVS transition interval |
EPwm1Regs.CMPB = 200; | // adjust |
Applications to Power Topologies | 91 |