It measures the source side voltage and this voltage is subtracted from desired voltage. This voltage is reference voltage that needs to be injected in series. Inverter is employed to inject the voltage. Output votage of inverter is compared to reference voltage and gate signal is generated. Output of inverter is connected in series to line with isolation transformer. In this way, votage sag and swell is compensated.
Niranjan Bhujel (2019). Single Phase Dynamic Voltage Restorer (https://www.mathworks.com/matlabcentral/fileexchange/64109-single-phase-dynamic-voltage-restorer), MATLAB Central File Exchange. Retrieved .
I have problems connecting the dvr to the grid. I can't compensate for the voltage drop, I think I have a problem with the serial transformer between the dvr and the grid. Everyone can help me