Problem Facing in MATLAB SIMULINK using ePWM block to generate SPWM (Sinusoidal Pulse width modulation) using TMS320f28335

17 Ansichten (letzte 30 Tage)
To generate the SPWM, when we use ePWM block in MATLAB SIMULINK, at that time whether we need to compare triangular generating pulse and sinusoidal pulse using " Triangular Generating block and Sine block ". or it is possible to generate the SPWM using only the ePWM block.
If so, then if we want to add another pulse with the previous pulse i.e., SPWM and combine of all two pulses, to reflect in the DSO. Then what we have to do in that case.

Antworten (2)

Karan Singh
Karan Singh am 9 Nov. 2023
Hi, Subha
To generate a Sinusoidal Pulse Width Modulation (SPWM) signal, you typically need to compare a sinusoidal reference signal with a triangular carrier signal. This comparison can be done using a Compare block in Simulink.
Here's a basic way to set up an SPWM in Simulink:
1. Use a Sine Wave block to generate your sinusoidal reference signal.
2. Use a Sawtooth Wave or a custom subsystem to generate your triangular carrier signal.
3. Use a Compare block to compare the two signals. This will generate a PWM signal where the pulse width is modulated according to the sinusoidal reference signal.
Regarding your second question, if you want to add another pulse to the SPWM signal, you can use an Add block in Simulink. You would connect the output of the Compare block and the other pulse to the inputs of the Add block. The output of the Add block would then be the sum of the SPWM signal and the other pulse.
Attached below is the documentation link that you may find helpful:
Hope this helps!
Karan Singh Khati

jimin am 25 Nov. 2023
% Define parameters
frequency = 1000; % Frequency in Hertz
dutyCycle = 50; % Duty cycle in percentage
% Time vector
t = 0:1/(10*frequency):1; % 10 times oversampling
% Generate PWM wave
pwmWave = pwm(t, frequency, dutyCycle);
% Plot the PWM wave
plot(t, pwmWave);
title('PWM Waveform');
xlabel('Time (s)');




Community Treasure Hunt

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

Start Hunting!

Translated by