Generation of SPWM waveform with dead-time for a new circuit topology inverter using MATLAB

30 views (last 30 days)
Silumin on 20 Jun 2023
Commented: Suraj Kumar on 18 Aug 2024 at 12:11
Hello MathWorks Community,
I am currently working on a project where I need to generate a Sinusoidal Pulse Width Modulation (SPWM) waveform that includes dead-time for a new inverter circuit topology. I intend to use MATLAB for this task, but I am having difficulty figuring out how to get started.
An important aspect of this problem is that the reference signal (sinusoidal) I want to use is not the typical M*sin(ωt), but rather (1/(2-M*sin(ωt))). I would appreciate if you could consider this when giving me advice on how to proceed.
Does MATLAB have built-in functions that can be used for generating such SPWM waveforms? If so, what are these functions and how can they be utilized effectively? Also, are there any recommended methods for handling the dead-time and the peculiar reference waveform in this context?
If you have examples or tutorials that are closely related to this problem, I would be very grateful if you could share them.

Suraj Kumar on 8 Aug 2024 at 10:17
Hi Silumin,
To generate a Sinusoidal Pulse Width Modulation (SPWM) waveform with dead-time for inverter circuit topology, follow these detailed steps:
1. Define the necessary parameters like frequencies, modulation index, dead-time, and the time vector. Using these parameters and reference signal create a triangular carrier signal using the “sawtooth function.
fs = 50000; % Sampling frequency (Hz)
fc = 2000; % Carrier frequency (Hz)
fm = 50; % Modulating signal frequency (Hz)
M = 0.8; % Modulation index
t = 0:1/fs:0.05; % Time vector
omega_m = 2 * pi * fm;
ref_signal = 1 ./ (2 - M * sin(omega_m * t));
carrier_signal = sawtooth(2 * pi * fc * t, 0.5);
2. Generate the SPWM signal by comparing the reference signal with the carrier signals.
% Generate the SPWM signal
spwm_signal = ref_signal > carrier_signal;
3. Introduce dead time by delaying the SPWM signal to ensure that there is a brief period during which both switches are off, preventing short circuits.
4. Plot the reference signal, carrier signal, and both the original and delayed SPWM signals to visualize the results.
figure;
subplot(3,1,1);
plot(t, ref_signal, 'LineWidth', 1.5);
grid on;
subplot(3,1,2);
plot(t, carrier_signal, 'LineWidth', 1.5);
grid on;
subplot(3,1,3);
plot(t, spwm_signal, 'LineWidth', 1.5);
hold on;
plot(t, spwm_signal_delayed, 'LineWidth', 1.5);
grid on;
You may refer to the output for better understanding:
Hope this works for you!
Silumin on 16 Aug 2024 at 11:23
Thank you for your wonderful answer. I will put into practice what I have learned and do better research.
Suraj Kumar on 18 Aug 2024 at 12:11
You are welcome.

Categories

Find more on Waveform Generation in Help Center and File Exchange

R2023a

Community Treasure Hunt

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

Start Hunting!