Go to start of banner

# Operating principles

In DC applications, conventional PI controllers provide excellent performance, notably a minimal steady state error, thanks to the (almost) infinite DC gain provided by the integral control action. However, in AC applications, PI controllers inevitably present a delayed tracking response, because their gains cannot be set high enough to avoid a steady-state error.

A well-known countermeasure to this shortcoming is the implementation of the PI controller(s) within a rotating reference frame (dq), which allows to re-locate the (almost) infinite DC gain at the desired frequency. More information is given in:

Alternatively, proportional resonant controllers (PR) have attracted significant interest for AC current/voltage control applications due to the simplicity of their implementation, notably for single-phase systems.

In essence, proportional resonant (PR) controllers are usually designed such that the controller transfer function is similar to:

where $//$ designates the target reference current frequency. In this expression, the denominator term $//$ creates infinite control gain at $//$.

Practically, this expression may be difficult to implement into a digital controller, which is why a more practical alternative is to introduce some damping around the resonant frequency, resulting in:

were $//$ designates the resonant cut-off frequency (i.e. width of the resonant filter). In this second expression, the gain at $//$ is now finite, but still high enough for enforcing a sufficiently small steady-state error. Interestingly, the widening of the bandwidth around $//$ also offer increased tolerance towards slight frequency deviations, such as in most practical grid-tied applications.

## Digital implementation

A practical implementation can be easily derived using the bilinear (Tustin) transform. The resulting discrete transfer function for the resonant term, discretized with a period $//$, yields:

Once transformed into a difference equation, the resonant part yields:

This difference equation can be easily used for generating run-time code. Notably, a possible implementation on Simulink is given below. A similar implementation is given in . ## Tuning and performance evaluation

Proportional resonant controllers can be relatively easily tuned using the controller gains as well as the width of the resonant filter $//$. The side figure illustrates the tuning of the proposed PR controller with various values of the resonant gain, with Kp=15.

Further details regarding the tuning can notably be found in .

 R. Teodorescu, F. Blaabjerg, M. Liserre and P. C. Loh, “Proportional resonant controllers and filters for grid-connected voltage-source converters,” in IEE Proc. on Electr. Power Appl., Vol. 153, N°. 5, Sep. 2006.

 D. G. Holmes, T. A. Lipo, B. P. McGrath and W. Y. Kong, “Optimized Design of Stationary Frame Three Phase AC Current Regulators,” in IEEE Trans. on Pow. Elec., Nov. 2009. # B-Box / B-Board implementation

## C/C++ code

The imperix IDE provides numerous pre-written and pre-optimized functions. Controllers such as P, PI, PID and PR are already available and can be found in the controllers.h/.cpp files.

As for all controllers, PR controllers are based on:

• A pseudo-object PRcontroller, which contains pre-computed parameters as well as state variables.

• A configuration function, meant to be called during UserInit(), named ConfigPrController().

• A run-time function, meant to be called during the user-level ISR, such as UserInterrupt(), named RunPrController().

The necessary parameters are documented within the controller.h header file. They are namely:

• Kp and Ki, proportional and integral gain, respectively.

• wres, which is the nominal frequency (center of the resonant term, in rad/s.), as well as wdamp, the "width" of the resonant term (limits the quality factor of the resonant term).

• tsample, corresponding to the sampling (interrupt) period. Implementation example

#include "../API/controllers.h"
PrController mycontroller;

float Kp = 10.0;
float Kr = 500.0;
float w0 = TWO_PI*50.0;
float wc = 10.0;

tUserSafe UserInit(void)
{
ConfigPrController(&mycontroller, Kp, Kr, w0, wc, SAMPLING_PERIOD);
return SAFE;
}
tUserSafe UserInterrupt(void)
{
//... some code
Evsi = Vgrid + RunPrController(&mycontroller, Igrid_ref - Igrid);
//... some code
return SAFE;
}

The included file provides a Simulink block that uses the above-presented implementation. This block can then easily be integrated with run-time configurable parameters: The configuration mask is shown below. Typical parameters are also indicated: Results

The first graphs show the grid voltage and the stabilized value of the grid pulsation: The small remaining oscillations on the grid pulsation (<0.4% of the nominal value) are an expected consequence of the finite loop gain of the SOGI block at the fundamental frequency.

The measured grid current matches perfectly the given reference: A jump of current reference has been performed in both simulation and experimental modes. The following graphs show a comparison between both results: In simulation, a small overshoot can be observed on the current. This can be explained by the fact that the isolation transformer is not taken into account (modeled) in simulation. Indeed, the transformer increases the total inductance between the converter and the grid, which in turn increases the inertia of the system.

• No labels