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.
Tool/software: Code Composer Studio
Hi,
what is better to stop ePWMs, use trip zone or change the counter mode to freeze mode? in my case i control my ePWMs with a voltage source and want all ePWMs output to be zero when U=0volt.
Best Regards
Hi,
I have used the Time Base Counter Freeze as shown below:
for trip zone, I don't know exactly how to program in this case. you have an idea about this?
Ud1 = ADC_readResult(ADCARESULT_BASE, ADC_SOC_NUMBER6); // Messung der ADC
if (Ud1<819)
{
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_STOP_FREEZE);
EPWM_setTimeBaseCounterMode(EPWM2_BASE, EPWM_COUNTER_MODE_STOP_FREEZE);
}
else
{
EPWM_setTimeBaseCounterMode(EPWM1_BASE, EPWM_COUNTER_MODE_UP_DOWN);
EPWM_setTimeBaseCounterMode(EPWM2_BASE, EPWM_COUNTER_MODE_UP_DOWN);
dutyCycle =(Ud1*EPWM_TIMER_TBPRD/4095); // Formel Duty_Cycle
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_A, dutyCycle); //DutyCycle ePWM1A
EPWM_setCounterCompareValue(EPWM1_BASE, EPWM_COUNTER_COMPARE_B, (EPWM_TIMER_TBPRD-dutyCycle)); //DutyCycle ePWM1B
EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_A, dutyCycle); //DutyCycle ePWM2A
EPWM_setCounterCompareValue(EPWM2_BASE, EPWM_COUNTER_COMPARE_B, dutyCycle);
That works. You could also set up CMPSS and a threshold. Then use the output of the comparator and the TripZone module to turn off the output!
Nima
Hi Nima,
about the turn off all ePWMs, i need how to connect my CMPSS with a GPIO. can you please write me a function about that, or how to compare my Adcresult with a compare ?
Regards
You can take a look at how to set up CMPSS,
http://dev.ti.com/tirex/explore/node?node=ANitrqhsIFh2iKi74mDV8g__gYkahfz__LATEST
Also for Trip Zone check out,
http://dev.ti.com/tirex/explore/node?node=AGQH5zZ6qpYvuEiMHzgF8A__gYkahfz__LATEST