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.
Hello,
I am a University Professor on Power Electronics, using Simulink - C2000 Microcontroller Blockset to develop control algorithms for power converters. We have been recently working on a modular converter, consisting of several half-bridge modules, each modulated by an ePWM block. The duty cycles for these blocks need to change from 0 to 100% (as well as intermediate values) and vice-versa every few PWM cycles. That is, the duty cycles do not vary smoothly, as in conventional converters. The important point is that these sudden changes need to happen concurrently for all ePWM blocks. We are using a model where all ePWM blocks are in a subsystem triggered by ADC interrupts, and have enabled synchronization of all PWM modules (1-6) based on ePWM1, selecting "Pass through" for the rest of the modules. (Also, the PWM frequency is constant and no phase shift is introduced among the PWMs). Based on this, we expected that each ePWM block would generate pulses with the duty cycle calculated and provided to it at each interrupt. However, it appears that all modules apart from ePWM1 update their duty cycles at different time instants. Reading about this issue, we understand that it relates to the global and one shot load registers.
1. Could you please confirm that this is correct? If not, how can we make all PWM blocks take in the provided duty cycles concurrently?
2. If the solution is indeed through the global and one shot load registers, can you confirm whether these are accessible through Simulink (v. R2023a)? If not, can you advise how custom code can be added to the model to set them properly?
Thank you,
Sincerely,
George Orfanoudakis
Hi George,
The PWM synchronization (using sync-in and sync-out signals) is used to sync PWM counter values whereas the loading of new PWM configuration values for each individual module (e.g. a new counter compare value or action qualifier setting) will happen according to your shadow loading settings. When are you trying to update the values and also what are your loading settings for the values that you are changing?) (sometimes a diagram drawing the timing of any ISRs, loading events, action qualifiers, etc can be helpful if you feel the need).
If you are wanting to change the same configuration values for multiple PWM modules simultaneously, it sounds like you should try using EPWM linking (see the device TRM section below). Please let me know if the below fits what you are trying to do (are you trying to load the same values?).
I unfortunately cannot speak to the Simulink aspect of this, but please take a look at MathWorks FAQ at this link below:
If you have further questions, the best way to get support on MathWorks products is to contact MathWorks live tech support.
You can also search for answers or post a question on MATLAB Answers C2000 forum. Additionally, there is info on MathWorks support C2000 in Documentation and Examples.
Best Regards,
Allison