Hi @Faria,
I looked closely at your Simulink setup and the waveforms you shared, after doing thorough research — the noisy Vinj and slightly distorted Vload are very likely caused by the powergui sample-time configuration. That’s a common issue when modeling DVRs or other power-electronic systems.
Right now, it looks like your model is using a large discrete step (around 0.1 s), which is far too coarse for the fast switching dynamics in a DVR. You can fix this by setting the powergui block to Discrete mode and choosing a much smaller sample time, typically in the range of 5e-6 s to 2e-5 s. Then, go into Simulation → Configuration Parameters → Solver and match the fixed-step size to the same value.
Once you do that, re-run the simulation and zoom in on the Vload waveform. You should see a clean sine wave again — only small, short transients during DVR injection. The Vinj waveform will still show rapid switching (that’s normal for a compensator), but the noise-like distortion should disappear.
In short:
- Discrete powergui with Ts ≈ 5e-6 s
- Fixed-step solver with same step size
- Keep controller and PWM sample times synchronized
That change alone usually resolves the “weird noisy injection” issue you mentioned. If not, the next step would be checking how the FLC (fuzzy logic controller) and PWM blocks are sampled relative to your main system — but let’s stabilize the powergui first.
Once your simulation runs cleanly, Vload should appear as a proper sine wave, while Vinj just handles compensation transients.
Hope this helps!




