Proportional resonant controller
Table of Contents
This article presents the basic theory of operation of proportional resonant controllers, and introduces a possible implementation for the control of single-phase voltage source inverters. The corresponding software is given for Simulink and C++ code and is made available for download.
What is a proportional resonant controller?
Proportional resonant controllers (abbreviated PR controllers) are a particular type of transfer function that are often implemented for the closed-loop control of systems with a sinusoidal behavior. As their name indicates, they possess both a proportional and a resonant term, which can be tuned independently. When needed, additional resonant terms can also be added to attenuate specific harmonics.
In power electronics, proportional resonant controllers (PR) have attracted significant interest for AC current/voltage control applications due to their performance and simple implementation.
Benefits of proportional resonant controllers
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 controller(s) in the stationary reference frame inevitably present a delayed tracking response, because finite gains at the fundamental frequency cannot prevent steady-state error.
A well-known countermeasure to this shortcoming is the implementation of the control within a synchronous reference frame. This means that PI controller(s) are implemented inside a rotating reference frame (dq), which is synchronized with the AC frequency (e.g. of the grid or the electric motor, see TN106). This allows re-locating the (almost) infinite DC gain at the desired frequency, namely 50/60Hz (or the motor rotating speed).
Proportional resonant controllers offer an alternative to this conventional approach. Indeed, as they operate directly in the stationary reference frame, no coordinate transformations are required. Furthermore, their resonant term(s) offer(s) a finite – but very high – gain at the targeted AC frequency, which achieves the same tracking and perturbation rejection capabilities as PI controller(s) in a rotating reference frame (dq-control).
In single-phase systems, the fact that no Park transformation is needed is a further and significant benefit, because the formulation of the direct and quadrature axes is not obvious (see TN124 on fictive axis emulation).
In three-phase systems, controlling unbalanced AC currents and voltages in a stationary reference frame overcomes the need to decouple the controlled variables, which would otherwise be necessary in the rotating reference frame (dq). This presents a significant advantage of the PR controller in a stationary reference frame (abc, or
Operating principles of proportional resonant controllers
In essence, the transfer function of proportional resonant (PR) controllers can be derived from a PI controller in the synchronous reference frame (dq) using the Laplace and Park transformations. The result is as follows [1] :
where
Practically, this expression may be difficult to implement as a digital controller, which is why a more practical alternative is to introduce some damping around the resonant frequency, resulting in:
were
In this second expression, the gain at
Digital control 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
Once transformed into a difference equation, the resonant part yields:
This difference equation can be easily used for generating run-time code. The corresponding block diagram is given below and can be easily replicated in Simulink or PLECS. A similar implementation is given in [2].
It is worth noting that the gains
Tuning and performance evaluation
Proportional resonant controllers can be tuned relatively easily. In fact, three gains must be determined:
Additionally, the following figure illustrates the step response of the proposed resonant controller for various values of the resonant gain
Academic references
[1] D. N. Zmood and D. G. Holmes, “Stationary frame current regulation of PWM inverters with zero steady-state error,” in IEEE Trans. on Pow. Elec., Vol. 18, N°. 3, May 2003.
[2] 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.
[3] 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
Simulink
The Simulink model provided above contains a subsystem that uses the above-presented resonant controller implementation. This block can easily be integrated into any control algorithm. Besides, the provided dialog box offers simple configuration parameters.
C/C++ code
The imperix IDE gives access to a library containing 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, proportional resonant 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()
, namedConfigPrController()
. - A run-time function, meant to be called during the user-level ISR, such as
UserInterrupt()
, namedRunPrController()
.
The necessary parameters are documented within the controller.h header file. They are namely:
Kp
andKi
, proportional and integral gain, respectively.wres
, which is the nominal frequency (center of the resonant term, in rad/s.), as well aswdamp
, 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; #resonant controller object
float Kp = 10.0;
float Ki = 500.0;
float w0 = TWO_PI*50.0;
float wc = 10.0;
tUserSafe UserInit(void)
{
ConfigPrController(&mycontroller, Kp, Ki, w0, wc, SAMPLING_PERIOD);
return SAFE;
}
Code language: C++ (cpp)
tUserSafe UserInterrupt(void)
{
//... some code
Evsi = Vgrid + RunPrController(&mycontroller, Igrid_ref - Igrid);
//... some code
return SAFE;
}
Code language: C++ (cpp)
Experimental results
In order to illustrate the performance of the proposed PR controller implementation, current control results are shown below. A current reference step is performed both in simulation (dark red) as well as using an experimental setup (light red). The following graphs show a comparison between both results :
As it can be seen, the current matches the given reference in steady state. However, slight discrepancies between simulation and experimental results are observed due to harmonic distortions present on the grid.