# Efficient Wireless Monitoring and Control of a Grid-Connected Photovoltaic System
## 3 Description and Design of the Photovoltaic System
### Wireless Smart Photovoltaic System (WSPS)
#### 3.1.3 Adaptive Lyapunov Control for the DC/DC Converter  
The adaptive Lyapunov control is designed to regulate the voltage at the PV modules' output and to reach the MPP under any environmental condition. This controller is applied to the DC/DC converter, in this case, the boost converter. Thus, the equations of the converter are required (Equations (1) and (2)). Then, an inner control loop is needed to manage the inductor current and an outer control loop for the DC/DC converter input voltage. Thus, the definition of the errors and the time derivative of the errors are in (3)-(6), where \(e_{1}\) is the voltage error, and \(e_{2}\) is the current error. \[e_{1}=V_{in}-V_{pv,\ ref} \tag{3}\]  
\[e_{2}=i_{L}-i_{L,ref} \tag{4}\]  
\[\dot{e}_{1}=\dot{V}_{in}-\dot{V}_{pv,\ ref} \tag{5}\]  
\[\dot{e}_{2}=\dot{i}_{L}-\dot{i}_{Li,ref} \tag{6}\]  
\(V_{PV,ref}\) is the reference voltage that must be reached at the boost converter input, and \(i_{L,ref}\) is the reference current that must be tracked by the inductor current. The procedure now requires the definition of the Lyapunov function as \(V_{1}=\frac{1}{2}e_{1}^{2}+\frac{1}{2}e_{2}^{2}\). Then, the time derivative of the Lyapunov function is presented in Equation (7). \[\dot{V}_{1}=e_{1}\underbrace{\left(\frac{i_{in}-i_{L}}{C_{in}}-\dot{V}_{pv, \ ref}\right)}_{=-K_{1}e_{1}}+e_{2}\underbrace{\left(-\frac{1}{C_{in}}e_{1} +\frac{1}{L}V_{in}-\dot{i}_{L,ref}\right)}_{=-K_{2}e_{2}} \tag{7}\]  
The time derivative of the Lyapunov function must be negative and for that, the two terms of Equation (7) must be equal to \(-K_{1}e_{1}\) and \(-K_{2}e_{2}\), with \(K_{1}>0\) and \(K_{2}>0\). Thus, the inductor current controller is achieved using Equation (8). \[i_{L,ref}=i_{L}=i_{in}-C_{in}\dot{V}_{pv,\ ref}+C_{in}K_{1}e_{1} \tag{8}\]  
Differentiating Equation (8) with respect to time yields (9),  
\[\dot{i}_{Li,ref}=\dot{i}_{in}-C_{in}\ddot{V}_{pv,\ ref}-K_{1}e_{2}-C_{in}K_{1 }^{2}e_{1} \tag{9}\]  
and after substituting (9) in Equation (7), the expression becomes (10). \[-\frac{1}{C_{in}}e_{1}+\frac{1}{L}V_{in}-V_{o}\gamma-\dot{i}_{in}+C_{in}\ddot {V}_{pv,\ ref}+K_{1}e_{2}+C_{in}K_{1}^{2}e_{1}=-K_{2}e_{2} \tag{10}\]  
Then, the control law is (11). \[\gamma=\frac{1}{V_{o}}\left(-\frac{1}{C_{in}}e_{1}+\frac{1}{L}V_{in}-\dot{i} _{in}+C_{in}\ddot{V}_{pv,\ ref}+(K_{1}+K_{2})e_{2}+C_{in}K_{1}^{2}e_{1}\right) \tag{11}\]To include the adaptive part of the parameters \(C_{in}\) and \(L\), it is required to define the new parameters (12) and their errors (13), taking into consideration the estimated parameters \(\hat{\theta},\hat{\varnothing},\ \hat{\omega}\). Thus, the controller does not depend on any physical parameter and adjusts itself automatically. \[ \begin{array}{l}C_{\text{in}}=\theta\\ \frac{1}{L}=\varnothing\\ \frac{1}{C_{\text{in}}}=\omega\\ \end{array}  \tag{12}\]  
\[ \begin{array}{l}\widetilde{\theta}=\theta-\hat{\theta}\\ \widetilde{\varnothing}=\varnothing-\hat{\omega}\\ \widetilde{\omega}=\omega-\hat{\omega}\\ \end{array}  \tag{13}\]  
Now it is necessary to update the control law to include the estimation of the adaptive parameters, \(\widetilde{\theta},\ \ \widetilde{\varnothing},\ \widetilde{\omega}\), yielding (14). \[\gamma=\frac{1}{V_{o}}\big{(}-\hat{\omega}e_{1}+\partial V_{in}-\dot{i}_{in}+ \hat{\theta}\big{(}\breve{V}_{pv,\ ref}+K_{1}^{2}e_{1}\big{)}+(K_{1}+K_{2})e_ {2}\big{)} \tag{14}\]  
By including Equation (14) in (7), operating, and taking into account the adaptive parameters, the Lyapunov function becomes (15). \[\dot{V}_{1}=-K_{1}e_{1}^{2}-K_{2}e_{2}^{2}+e_{2}\big{(}-e_{1}\widetilde{\omega }-V_{in}\widetilde{\varnothing}-\big{(}\breve{V}_{pv,\ ref}+K_{1}^{2}e_{1} \big{)}\widetilde{\theta}\big{)} \tag{15}\]  
Finally, the complete Lyapunov function is formulated in (19), taking into consideration all the errors, with \(\{\rho,\ \sigma,\tau\}\in\Re^{+}\) as constant adjustment parameters (16)-(18). For that, three new Lyapunov functions are required--\(V_{2}\), \(V_{3}\), and \(V_{4}\).