I am working with a three phase inverter. I have done a model of the system in DQ axis as follows:
\begin{gather} \dot{I}_{d} =-\frac{R}{L} I_{d} +\omega I_{q} +\frac{V_{dc}}{2L} S_{d}\\ \dot{I}_{q} =-\frac{R}{L} I_{q} -\omega I_{d} +\frac{V_{dc}}{2L} Sq\\ \notag\\ \notag \end{gather}
I have then used a Lyapunov controller to control the states as follows:
\begin{gather*} W=\frac{1}{2} e_{1}^{2} +\frac{1}{2} e_{2}^{2}\\ \dot{W} =e_{1}\dot{e}_{1} +e_{2}\dot{e}_{2} \end{gather*}
Where
\begin{gather*} \dot{e}_{1} =\dot{x_{1}} -\dot{x}_{1desired}\\ \dot{e}_{2} =\dot{x_{2}} -0 \end{gather*}
I then set the states
\begin{equation*} \dot{W} =-k_{1} e_{1}^{2} -k_{2} e_{2}^{2} \end{equation*} by
\begin{gather*} \dot{e}_{1} =-k_{1} e_{1}\\ \dot{e}_{2} =-k_{2} e_{2} \end{gather*}
Finally I get the control inputs as
\begin{gather} S_{d} =\frac{2L}{V_{dc}}\left(\dot{x}_{1d} -\omega x_{2} +\frac{R}{L} x_{1} -k_{1} e_{1}\right)\\ S_{q} =\frac{2L}{V_{dc}}\left(\dot{x}_{2d} \ +\omega x_{1} +\frac{R}{L} x_{2} -k_{2} e_{2}\right) \end{gather}
I am using simulink to test this out, because I want to use a hardware in loop simulation on this. However I keep getting an offset in the output when I simulate this with simulink components.
Model Based:
Component Based:
This is quiet a high switching frequency as well, about 20KHz.
Any thoughts on what could be causing this and how I could rectify it ?
Thanks