0
0
Raspberry-piConceptBeginner · 3 min read

Sinusoidal PWM (SPWM): What It Is and How It Works

Sinusoidal Pulse Width Modulation (SPWM) is a technique where a sine wave is used as a reference to generate pulses with varying widths to control power devices. It creates an output voltage that closely follows a sine wave, making it ideal for AC motor drives and inverters.
⚙️

How It Works

Sinusoidal PWM (SPWM) works by comparing a sine wave reference signal with a high-frequency triangular carrier wave. When the sine wave is higher than the carrier wave, the output pulse is ON; otherwise, it is OFF. This creates pulses of varying widths that, when filtered, produce a smooth sine wave output.

Think of it like controlling the brightness of a lamp by turning it on and off very quickly. The longer the lamp stays ON in each cycle, the brighter it appears. Similarly, SPWM controls the power delivered by adjusting the pulse widths to match the shape of a sine wave.

💻

Example

This Python example simulates SPWM by generating pulse widths based on a sine wave and a triangular carrier wave.

python
import numpy as np
import matplotlib.pyplot as plt

# Parameters
frequency = 50  # Hz, sine wave frequency
carrier_freq = 1000  # Hz, carrier frequency
sampling_rate = 10000  # samples per second
duration = 0.02  # seconds (one cycle of 50Hz)

t = np.linspace(0, duration, int(sampling_rate * duration), endpoint=False)

# Reference sine wave (modulating signal)
sine_wave = np.sin(2 * np.pi * frequency * t)

# Triangular carrier wave
carrier_wave = 2 * np.abs(2 * (carrier_freq * t % 1) - 1) - 1

# SPWM signal: pulse is high when sine_wave > carrier_wave
spwm_signal = (sine_wave > carrier_wave).astype(int)

# Plotting
plt.figure(figsize=(10, 6))
plt.plot(t, sine_wave, label='Sine Wave (Reference)')
plt.plot(t, carrier_wave, label='Triangular Carrier Wave')
plt.step(t, spwm_signal, where='post', label='SPWM Output')
plt.title('Sinusoidal PWM (SPWM) Simulation')
plt.xlabel('Time (seconds)')
plt.ylabel('Amplitude')
plt.legend()
plt.grid(True)
plt.show()
Output
A plot showing the sine wave, triangular carrier wave, and the resulting SPWM pulses where the pulse width varies to match the sine wave shape.
🎯

When to Use

SPWM is commonly used in power electronics to control AC motors, inverters, and uninterruptible power supplies (UPS). It is ideal when you need a clean AC output from a DC source because it produces a voltage waveform close to a pure sine wave, reducing motor noise and improving efficiency.

For example, in an electric vehicle, SPWM controls the motor speed smoothly by adjusting the voltage and frequency. It is also used in renewable energy systems like solar inverters to convert DC power into usable AC power for homes.

Key Points

  • SPWM uses a sine wave reference and a triangular carrier to create pulses with varying widths.
  • The output approximates a sine wave, which is good for AC motor control and inverters.
  • It reduces harmonic distortion compared to simpler PWM methods.
  • SPWM is widely used in industrial and renewable energy applications.

Key Takeaways

Sinusoidal PWM (SPWM) creates pulses that mimic a sine wave to control AC power devices.
It works by comparing a sine reference wave with a high-frequency triangular carrier wave.
SPWM is ideal for smooth motor control and clean AC output from DC sources.
It reduces noise and improves efficiency in power electronics applications.
Common uses include motor drives, inverters, and renewable energy systems.