set the phase offset epwm using c2000 F28379D

94 views (last 30 days)
Hi,
I'm trying to set the phase shift if ePWM (1, 2, 3) to 0, 120 , 240 deg using ePWM block but I don't know why it is not working properly it provides wrong phase shift in scope. I would appriciate if any one can help. simple model is attached
Thanks

Answers (3)

deiaaldeen
deiaaldeen on 26 Oct 2023
hello sir,
I want to do phase shift between the two legs of full brige inverter. I did exactly what you did but still no phase shift. could you please post your file or teach me ?

Vishwa
Vishwa on 20 Apr 2023
For counting mode set to up-down, phase shift should be given with respect to time period of 2*20e3. Since the timer period is only the period of up-counter/down-counter.
Above pics shows ePWM blocks configurations and the waveforms as seen from scope using external mode.
Hope it helps.
  3 Comments
Long Th
Long Th on 26 May 2023
How do you show 3 PWMs and Can you help me to do it?
Vishwa
Vishwa on 27 May 2023
Sure,
You can follow these steps to visualize ePWM signals in Simulink:
  1. Under Model Settings > Hardware Implementation > Target Hardware Resources > ePWM; find which GPIO Pins your ePWM channels are multiplexed to (you can set your preferred applicable GPIO Pins here also). Refer to below figure.
  2. Add a Digital Input block, this block can configure a GPIO Pin as an input pin. We will use these GPIO Input pins to receive signals from ePWM output pins. In the Digital Input block, configure pin 8, 14 and 15 as Input pins. See below figure.
  3. Now on the launchpad, short the ePWM MUXed GPIO Pins to the GPIO Input pins using jumper cables. In this particular case, I would have shorted GPIO 0 with GPIO 8, GPIO 2 with GPIO 14 and so on.
  4. Under Model Settings > Hardware Implementation > Target Hardware Resources; check External Mode settings.
  5. On Simulink Run the model on hardware using "Monitor and Tune".
Now you should be able to visualise the signals either on scope or on Data Inspector. Please refer to the following documentation for reference: Signal Monitoring and Parameter Tuning over XCP on Serial - MATLAB & Simulink (mathworks.com)
Good luck!
Regards,
Vishwa

Sign in to comment.


Cristina
Cristina on 27 Feb 2024
Hi, I have tried to see a PWM signal following the above steps but when simulating I get a 0 signal all the time.
I attach screenshots
I have connected pin 40 to pin 74 which are the GPIO0 and GPIO14 pins.
I know that the "ePWM" block is well configured because I have been able to see the output signal with an oscilloscope, so I think the problem is in executing these steps.
I hope you can help me, thank you in advance.

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!