## 3 Proportional Resonant Controller Model  
In order to develop an effective control method to ensure the tracking of a sinusoidal reference, as well as the rejection of disturbances related to non-linear loads and harmonic compensation, new methodologies have been developed. In this work, proportional resonant controllers [21], based on  
Figure 2: Inverter block diagram with filter and load. the Internal Model Principle [22], are used. The proportional resonant compensators impose poles on the imaginary axis at frequencies equal to those of the reference, and show infinite gain in the resonance frequency. As real loads do not drain current linearly (with a waveform equal to the waveform of the applied voltage), the use of only one compensator at the fundamental frequency is not sufficient to keep a satisfactorily low THD. In particular, for DERs, typical non-linear loads can be seen as current disturbances in the frequency of the output voltage and in its multiples. The rejection of this type of disturbance will be fundamental for the good performance of a DER system. Consequently, a set of resonant compensators is used to reject each multiple harmonic frequency of the fundamental, by allocation of gain in multiple frequencies [23; 24]. The following transfer function is usually used in the implementation of the ideal resonant controller. \[C_{Rh}(s)=\frac{s^{2}}{s^{2}+\omega_{h}^{2}} \tag{20}\]  
where \(\omega_{h}\) is the frequency of the signal to be followed or rejected. In some applications a damping factor \(\xi\) is inserted at the poles of Equation (20) to avoid discrete implementation problems regarding the position of resonant poles at the edge of the unit circle [25]. Given a resonant controller with transfer function:  
\[C_{Rh}(s)=\frac{s^{2}}{s^{2}+2\xi\omega_{h}s+\omega_{h}^{2}} \tag{21}\]  
Note that by making \(\zeta=0\) the controller (21) reduces to (20). Controllers like this allocate imaginary pole pairs at the frequency of the reference to be traced and the frequencies of the disturbances to be rejected. To represent the multiple compensators, Equation (21) that models the resonant compensator in general is repeated in parallel in the block diagram of the control system, as shown in Figure 3. The multiple-resonant gain controller in (21) with proportional gain can be rewritten as  
\[G_{PR_{h}}(s)=k_{2}+\sum_{h=1}^{n}\frac{k_{h+1}+k_{h+2}s}{s^{2}+2\xi_{h}^{2} \omega_{h}s+\omega_{h}^{2}} \tag{22}\]  
where \(k_{h+1}\) and \(k_{h+2}\) are the gains to be determined for each mode and \(k_{2}\) is a direct transmission term applied to the input signal from the controller. _Controller Based on the Principle of the Internal_  
Model The design of controllers that guarantee follow-up of references and the rejection of disturbances is of great practical interest, being one of the main study topics for a number of authors over the years. The Principle of the Internal Model (IMP) [22] is an essential theoretical result for the design of a control system aiming at the follow-up of reference signals and rejection of disturbance signals. Its fundamental idea is to generate, within the control loop, a signal with the same  
Figure 3: Block diagram of closed loop system for proportional resonant controller and inverter with LCL filter. characteristics as the signals to be followed and/or rejected. The closed-loop system must contain all persistent modes (which do not tend to zero at steady state) of the reference and disturbance signals in order to guarantee perfect tracking/rejection [26]. Using the principle of superposition, a controller based on the internal model principle simultaneously includes the reference and disturbance poles for the asymptotically stable system and without the cancellation of mentioned poles and zeros, the reference follow-up and rejection of disturbances with multiple harmonics, which occur in DERs with typical non-linear loads, with zero error in steady state.