ePWM setting for C2000 DSP, output not the right frequency
33 views (last 30 days)
Mike Buba on 12 Jul 2018
I am trying to generate PWM pulses for a three-phase inverter using C28335 DSP and Matlab Simulink. My switching frequency is set to 6 kHz and DPS is 150 Mhz (Timer period TBPRD = 12500). I am sending a 50 Hz sinusoidal reference, but my measured AC voltage output is 12,5 Hz! Why is this happening? Is there a setting I missed in ePMW block.
Also, if I look at ePWMA and ePWMB panes setting, is there a mistake for ePWMB output pane -- should CMPA on up-count (CAU) be set to Do nothing instead of Set? I don't know where this four times lower frequency comes from. I assume even the phases are not 120° deg shift.
Interestingly enough, when I connect with External mode and record data, the output voltage is 50 Hz. But on an oscilloscope with a differential probe is 12,5 Hz!
Venkatesh Chilapur on 16 Jul 2018
Regarding your point of 'Also, if I look at ePWMA and ePWMB panes setting, is there a mistake for ePWMB output pane -- should CMPA on up-count (CAU) be set to Do nothing instead of Set?' the configuration for CAU field for ePWMB is independent of CAU field for ePWMA. So this configuration on one output will not impact output.
And going by your model it is very likely that since you have used Simulink 'Sine wave' blocks, it will generate code that is not optimized for embedded applications. This can result in overrun scenario as you clearly identified. We encourage you to use TI Math Library to generate the Sine values.
The following link provides some insight in to the same.
To interface to external C/C++ code from Simulink, like in this case you will need to call the Sin() function from Math library, please following the link:
You can also quickly do the real time execution profiling of the generated code by following link: