


Simulink inverter output is square instead of sine wave (SPWM issue)
Hi everyone,
I'm building a PV system in MATLAB Simulink with the following components:
- PV array (12 series × 2 parallel, ~650W modules)
- MPPT (Perturb & Observe)
- Boost converter
- Battery (DC bus)
- H-bridge inverter with SPWM control
The PWM generation is based on comparing a sine wave (50 Hz) with a sawtooth carrier (~10 kHz).
The issue:
The inverter output is not a sine wave. Instead, I'm getting a square/pulsed waveform (~0–50V), even after adding an LC filter.
Parameters:
- PV: Vmp ≈ 48V per module
- DC bus: expected ~350V
- L filter: ~5 mH
- C filter: ~20 µF
- Load: resistive
I suspect one of the following:
Incorrect H-bridge gate signal configuration
LC filter connection issue
Wrong measurement point
I've attached:
- Simulink block diagram
- Output waveforms
- PV array parameters
What am I most likely doing wrong?
Thanks!