ePWM setting for C2000 DSP, output not the right frequency
20 次查看(过去 30 天)
显示 更早的评论
Hi All,
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!
0 个评论
采纳的回答
Venkatesh Chilapur
2018-7-16
Hi Mike,
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.
https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/40262?Sine-function-on-F28335
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:
https://in.mathworks.com/matlabcentral/answers/51908-how-can-i-implement-coder-ceval-in-simulink
You can also quickly do the real time execution profiling of the generated code by following link:
https://in.mathworks.com/help/supportpkg/texasinstrumentsc2000/examples/real-time-code-execution-profiling.html
HTH,
0 个评论
更多回答(1 个)
Venkatesh Chilapur
2018-7-13
Please share your model and provide MATLAB version details, and Hardware version details for further investigation.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!