## 5 Hierarchical Control Development
### MPPT Controller
#### 5.1.4 DC-AC Bidirectional Full Bridge Converters Controllers Development  
The controller for DC-AC bidirectional converter must be able to regulate DC bus and, at the same time, operates with unitary power factor, both tasks performing as rectifier. The other way, besides inject power to mains, converter is able to compensate reactive power and harmonics operating in inverter mode. Controller structure is composed by two stages, reference signal generation and voltage-current cascade controller, controller output is a set of sinusoidal signal \(u\) that is processed in a SPMW modulator to obtain a 3 \(\phi\) switching pattern for converter power devices. The complete schematic is shown in Figure 9.  
Figure 8: Cuk controller structure. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Version** & \(V_{in}\) & \(V_{out}\) & \(K_{1}\) & \(K_{2}\) & \(K_{I}\) \\ \hline
400 W & 190 V & 48 V & 0.065227 & 0.098410 & 364.003904 \\
1.2 kW & 380 V & 190 V & 0.020290 & 0.039492 & 35.027654 \\
3.3 kW & 380 V & 190 V & 0.032890 & 0.054304 & 117.792483 \\
3.3 kW & 190 V & 380 V & 0.008089 & 0.027744 & 5.407997 \\
2.5 kW & 380 V & 250 V & 0.013945 & 0.033055 & 31.541976 \\
2.5 kW & 250 V & 380 V & 0.009073 & 0.032140 & 12.959751 \\
1.25 kW & 190 V & 125 V & 0.029152 & 0.047667 & 83.196595 \\
1.25 \(KW\) & 125 V & 190 V & 0.0018966 & 0.047627 & 39.884327 \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Gain values for all the vesions of DC–DC full bridge bridge converter. Single phase \(dq\) transformation is applied to current circulating in AC side, \(i_{z}\), to place it in a rotating the variable in a rotating reference frame (see Figure 10). The \(dq\) transform is applied to current circulating in AC side, \(i_{z}\), to place it in a rotating reference frame, mathematically depicted as:  
\[ \begin{bmatrix}i_{d}\\ i_{q}\end{bmatrix} = \begin{bmatrix}sin\phi&-cos\phi\\ cos\phi&sin\phi\end{bmatrix}\begin{bmatrix}i_{z}\\ i_{z+90^{\circ}}\end{bmatrix} \]  
In this rotating frame \(i_{z}\) current components can be separated in: \(I_{d}\), term corresponds to active power and \(I_{q}\) referred to reactive power; the sum of the remaining terms meet current harmonics components, \(i_{h}\). After transformation, \(i_{d}\) and \(i_{q}\) are:  
\[i_{d} = I_{d}+\tilde{i_{d}}\] \[i_{q} = I_{q}+\tilde{i_{q}} \tag{10}\]  
Resultating signal are composed by a constant levels of \(I_{d}\) and \(I_{q}\) and several frequencies components, \(\tilde{i_{d}}\) y \(\tilde{i_{q}}\); it can de expressed as (10). In order to do nonactive power compensation, \(I_{d}\) is filtered; this way, active power is separated. Then, the obtained signal is subtracted from \(i_{d}\) and takes back to the time reference frame through \(dq\) inverse transform; this mapping operation is defined by:  
\[ \begin{bmatrix}i_{d}^{*}+i_{h}^{*}\\ (i_{d}^{*}+i_{h}^{*})+90^{\circ}\end{bmatrix} = \begin{bmatrix}sen\phi&cos\phi \\ -cos\phi&sen\phi\end{bmatrix}\begin{bmatrix}i_{d}-I_{d}\\ i_{q}\end{bmatrix} \]  
For this application, control objectives are: DC bus regulated and active power management. The control structure shown in Figure 11 includes two PI classical controllers in a cascade configuration. The external loop regulates DC bus to reference value \(v_{dc}^{*}\), and its output is a part of current signal reference \(i_{d}^{*}\) referred to active power demanded by load. Figure 10: Reference signal generator. Figure 9: Converter and controller scheme. The complete expression for inner loop reference is the sum of \(i_{d}^{*}\), non-active terms \(i_{q}^{*}+i_{h}^{*}\) and a compensation term \(\frac{2}{V_{g}}\). Considerations for controller design are: first, current inner loop is, at least, ten times faster than voltage external loop; second, for tuning, external loop PI controller gain must be selected carefully to avoid important current transients if an excessive value were selected.