# 4. Control of the Inverter¶

## 4.1. Structure of the controller¶

In the previous section (dq block diagram), we have built block diagram model of the inverter, in the dq reference frame.

Now, before entering the details of how to implement and tune the controller,
it is important to design the **structure** of the controller.

Thanks to the dq transforms, the equations are almost expressed as two separate channels. This means that separate control blocks can be used for the d and the q channel.

Question

Expand the block diagram of the system (the inverter) to add the controller for each channel, taking the dq current components as inputs.

### 4.1.1. Decoupling the channels¶

In order for the channels to be fully separated, it is needed to add
**feedforward terms**…

### 4.1.2. Feedforward of the grid voltage¶

In order to avoid transcients when starting with zero current as set points, it is also interesting to add the magnitude of the grid voltage as feedforward.

Question

Add the feedforward of the grid voltage on the channel where it is needed.

## 4.2. PLL for grid sync¶

### 4.2.1. Why the need of a PLL ?¶

In order to implement the controller on the real (untransformed) inverter, where variables are measured in the natural (abc) reference frame, we need conversion blocks (abc → dq and dq → abc). These conversion blocks need as an input the phase reference, which comes from the grid voltage.

Notice that when working purely in simulation, where the grid voltage
is a *known voltage with a fixed frequency*, it is possible to artificially use
a phase signal generated by a *ramp block*. Indeed we have:

but such an approach is meaningless is practice, when grid voltage is an *external,
uncontrolled* input of the system.

### 4.2.2. Simplistic implementation¶

A simple (but non robust!) method to estimate the phase of the grid voltage is to take the angle of the space vector, i.e. applying the αβ transform and then computing the angle of the \(v_{\alpha\beta}^{grid}\) vector.

see atan2, the four-quadrant inverse tangent function.

Bonus question

Find an appropriate perturbation to showcase the lack of robustness of this approach.

In practice (i.e. industrial grade inverters), a PLL is used instead of this simple method.

## 4.3. PI control design¶

Thanks to the dq transform, the steady state regime of the inverter
which is a *sinusoidal steady state* at grid frequency, is transformed into
a *constant steady state* in the dq domain.

When working on a regulator for a constant steady state [1], it becomes possible to use a usual controller, like a the Proportional-Integral (PI) controller.

PI equation in Laplace domain:

Aside question

By the way, what is the unit of \(K_p\) and \(T_i\) for this inverter controller (which is a current controller) ?

Question

Define a set of performance criterions for the controller.

Now using the controller’s transfer function along with the system’s tranfer function
(computed in [dq block diagram]), it is possible to tune the PI controller
to match a given performance level using usual tools of **open loop behavior analysis**
(Bode, Black-Nichols, or Nyquist diagram).

An alternative method is to use an algebraic method. The most famous method is the Ziegler-Nichols tuning rule, but I recommend instead the Skogestad tuning rule [Sko2003] (an interesting article to read). It gives a better response (less overshoot) and provides a tuning parameter for the response speed.

Question

Find a suitable PI controller to respect the performance criterions. Controller tuning can be done with frequency based method (tuning of the open loop transfer function) or an algebraic method.

Matlab’s Control System Toolbox functions (e.g `tf`

, `bode`

, `step`

)
can help the analysis.

One aspect of finding a suitable controller is to take care of the controller output. This output should stay between the saturation limits.

Question

Using the Input → Control transfer function, check the step response of the controller output to assess the risk of saturation.

## 4.4. Control testing¶

There are two classical tests for a control loop:

- response to setpoint changes
- response against perturbations

### 4.4.1. Response to setpoint changes¶

The inverter is current-controlled, so it takes to setpoints: Id, Iq.

Question

What is one classical test for studying setpoint changes?

Simulate these Id, Iq setpoint changes. Here are some testing guidelines:

- Use models of
*increasing level of accuracy*(climbing the “V model” design curve Fig. 1.1), from the simple single channel dq domain block diagram to the complete three phase switched model. - Use
*reasonable values for the setpoints*. In particular, what is the value Id which gives the rated active power flow of 20 kW ? - Don’t forget to look at the controller output (inverter voltages Vdq or Vabc). In particular, recall from study of the PWM block what is the maximal voltage to avoid saturation.

### 4.4.2. Response to perturbations¶

Intuitively, any change of the grid voltage affects the current.
More formally, looking at the block diagram model of the inverter,
the grid voltage appears as an additive **perturbation of the system input**.
The controller should **reject** this perturbation, that is keep the currents Id, Iq
around their respective setpoints.

An extreme case of perturbation is a **grid fault**, in particular a short circuit
of a nearby line which would drive the grid voltage close to zero.
Most grid codes (cf. [NGCC] as an example in UK) imposes Low voltage ride through
requirements which basically say that the plant should not disconnect and
continue to inject its rated current.

Question

Test the controller against a severe *voltage dip*, that is
the reduction of the grid voltage down to 10% for 100 ms.

The controller should be able to maintain the correct current injection,
and in particular avoid *big over currents* on transients.

Footnotes

[1] | see book [Zho2013] for examples of controllers adapted to a sinusoidal regime, like Proportional-Resonant control. |