www.ti.com
Controlling Dual
Example 3-3. Code Snippet for Configuration in Figure 3-7
//=====================================================================
//Config //=====================================================================
//Initialization Time
//======================== |
|
|
// EPWM Module 1 config |
|
|
EPwm1Regs.TBPRD = 600; |
| // Period = 1200 TBCLK counts |
EPwm1Regs.TBPHS = 0; |
| // Set Phase register to zero |
EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Symmetrical 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.AQCTLB.bit.ZRO = AQ_CLEAR; | // set actions for EPWM1B | |
EPwm1Regs.AQCTLB.bit.CAD = AQ_SET; |
| |
// EPWM Module 2 config |
|
|
EPwm2Regs.TBPRD = 600; |
| // Period = 1200 TBCLK counts |
EPwm2Regs.TBPHS = 0; |
| // Set Phase register to zero |
EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN;// Symmetrical 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 EPWM1A | |
EPwm2Regs.AQCTLA.bit.CAU = AQ_CLEAR; |
| |
EPwm2Regs.AQCTLB.bit.ZRO = AQ_CLEAR; | // set actions for EPWM1B | |
EPwm2Regs.AQCTLB.bit.CAD = AQ_SET; |
| |
//============================================================ | ||
EPwm1Regs.CMPA.half.CMPA = 400; // adjust duty for output EPWM1A & EPWM1B | ||
EPwm1Regs.CMPB = 200; | // adjust | |
EPwm2Regs.CMPA.half.CMPA = 500; // adjust duty for output EPWM2A & EPWM2B | ||
EPwm2Regs.CMPB = 250; | // adjust |
3.6Controlling Dual 3-Phase Inverters for Motors (ACI and PMSM)
The idea of multiple modules controlling a single power stage can be extended to the
As in the cases shown in the previous sections, we have a choice of running each inverter at a different frequency (module 1 and module 4 are masters as in Figure
80 | Applications to Power Topologies |