Hi Derick,
I understand from your issue that the SPWM frequency is not the same as desired (60 Hz) when you try to generate it with the model shown above using the ePWM block.
The possible reasons for the same and their resolution are mentioned below.
- You have provided the value of "Samples per period" of the Sine Wave block as "floor((2*pi)/(60*1e-5))" which does not implement discrete sine wave of frequency 60 Hz. You can use "floor(1/(60*1e-5))" which will implement 60Hz discrete sine wave as the reference "CMPA" values for the ePWM block.
- Verify the comparison conditions with "CMPA" and "CMPB" in the "ePWMA" and "ePWMB" tabs are selected as required.
You can find more information on Sine Wave and ePWM blocks in the following documentations.
- Sine Wave : https://www.mathworks.com/help/simulink/slref/sinewave.html
- ePWM : https://www.mathworks.com/help/ti-c2000/ref/c280xc2802xc2803xc2805xc2806xc2833xc2834xf28m3xf2807xf2837xdf2837xsf2838xf2800xxepwm.html
Hope this helps in resolving the issue.