set the phase offset epwm using c2000 F28379D

40 次查看(过去 30 天)
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

回答(3 个)

deiaaldeen
deiaaldeen 2023-10-26
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 2023-4-20
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 个评论
Long Th
Long Th 2023-5-26
How do you show 3 PWMs and Can you help me to do it?
Vishwa
Vishwa 2023-5-27
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

请先登录,再进行评论。


Cristina
Cristina 2024-2-27
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.
  2 个评论
PAULRAJ
PAULRAJ 2024-5-30
first, try to run your model on external mode using 'monitor and tune' option. if you are able to do that, then you can see the output waveform in the matlab scope. check for the jumper connection to enable the USB/UART serial connectivity.

请先登录,再进行评论。

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by