SPECIFICATION *** WORKING DRAFT ***
Please review, edit and comment as necessary.
Overview
The secondary controller object has a structure illustrated in Figure 1, and is very similar to textbook examples like Figure 2.
The basic idea is that the frequency error <math>\Delta f</math> is
- Converted to a power error via bias factor <math>B</math>
- Adjusted with respect to the current deviation from schedule of participating units (and potentially intertie flows) via <math>\epsilon_{\text{unit}}</math>
- Integrate the error via a PID controller, where by default only the integrator branch is non-zero.
- Distribute the output <math>\Delta P</math> to participating units via participation factor <math>\alpha_i</math>.
Additionally, sampling blocks are added to allow for different information input and output rates. A low pass filter is also possible on each unit channel to smooth out the signal to individual units.
Inter-Tie Modelling
Inter-tie modeling is incorporated into the unit error input, as illustrated in Figure 3. The scheduled flow, <math>P^{\star}_i</math>, and actual flow <math>P_i</math>, on this inter-tie are positive if they correspond with the definition and negative otherwise. A multiplier <math>c_i</math> is introduced to account for this directionality, and is equal to 1 for all generators. Considering Microgrid A:
- When <math>P^{\star}_i - P_i</math> is positive, either not enough power is exported (<math>P^{\star}_i > 0</math>) or too much power is imported (<math>P^{\star}_i<0</math>). Either way, more generation from the units in Microgrid A is needed, which is achieved by increasing its error signal, <math>P_{\text{err}}^A</math>. Therefore, <math>P^{\star}_i - P_i</math>, should be multiplied by <math>c_i = -1</math>, to negate the minus sign in the summation point.
- When <math>P^{\star}_i - P_i</math> is \emph{negative}, either too much power is exported (<math>P^{\star}_i > 0)</math>, or too little power is imported (<math>P^{\star}_i<0</math>). Either way, less generation from the units in Microgrid A is needed, which is achieved by decreasing its error signal, <math>P_{\text{err}}^A</math>. This is similarly achieved by setting multiplier <math>c_i = -1</math>.
The logic for Microgrid B is equal and opposite to that of Microgrid A, and therefore <math>c_i=1</math>. These rules are summarized in the following table:
<math>P^{\star}_i-P_i > 0</math> | <math>P^{\star}_i-P_i < 0 </math> | ||
---|---|---|---|
Link from end (Microgrid A) |
Desired | <math>P_{\text{err}}\uparrow</math> | <math>P_{\text{err}}\downarrow</math> |
<math>c_i</math> | -1 | -1 | |
Link to end (Microgrid B) |
Desired | <math>P_{\text{err}}\downarrow</math> | <math>P_{\text{err}}\uparrow</math> |
<math>c_i</math> | 1 | 1 |
Anti-Windup
Since the secondary controller predominantly works as an integrator and various sampling intervals are also involved, some anti-windup functionality is important. A few different options are considered.
Zero In Deadband
This option simply zeros the integrator state, xi
when the the frequency is within its deadband and all tie-line flows are within tolerance.
Feedback PID Output
This is a common feedback mechanism[2] used on sampled outputs, and is shown in Figure 1. The difference of the PID output, <math>\text{PID}_{\text{output}}</math> and the sampled output <math>\Delta P</math> is fed back to the weighted error signal prior to the integration stage. If we consider <math>K_d = K_p = 0</math> then there are two cases:
- Sampling: In this case <math>\text{PID}_{\text{output}} = \Delta P</math>, the feedback signal is 0 and the the integration step is
<math>x_i[t+1] = \text{PID}_{\text{output}}[t+1] = \text{PID}_{\text{output}}[t] + \Delta t \cdot (K_i\epsilon[t])</math>
- No Sampling: In this case <math>\Delta P = 0</math> and the feedback signal is <math>-\text{PID}_{\text{output}}</math>, leading the integration step to be:
<math>x_i[t+1] = \text{PID}_{\text{output}}[t+1] = \text{PID}_{\text{output}}[t] + \Delta t \cdot (K_i\epsilon[t] - \text{PID}_{\text{output}}[t])</math>
Note the the no-sampling case looks very similar to a low pass filter, which helps keep the integrator output from increasing too rapidly between sample instances. In a more general case where <math>K_d \neq K_p \neq 0</math>, the integrator output and PID output don't line up as neatly, but the concept behind the method remains the same.
Feedback Integrator
This is the same as the Feedback PID Ouput except that the integrator output is fed back rather than the whole PID output. The relationship to a low pass filter will therefore be preserved even if <math>K_d \neq K_p \neq 0</math>, however, the feedback might not be as effective if the integrator gain is relatively small compared to the other two PID gains.
Requirements/Limitations
- The secondary control object operates in deltamode only, but will transition back to QSTS.
- Currently only inverter_dyn and diesel_dg are supported as generators. Any power flow link object can be used as an inter-tie.
- The frequency is currently only measured at the parent node of the secondary controller object.
Parameters
Global Secondary Controller Object Parameters
The following parameters are general to the secondary controller object.
Parameter | glm | units | Default | Description |
---|---|---|---|---|
<math> i </math> | participant_input |
Set of participating objects in secondary control, see unit specific parameters. | ||
<math>f_0</math> | f0 |
Hz | 60 | Nominal frequency |
<math>\Delta f_{\text{max}}</math> | underfrequency_limit |
Hz | 57 | The upper limit <math>\Delta f_{\text{max}}</math> on <math>\Delta f</math> is f0 - underfrequency_limit
|
<math>\Delta f_{\text{min}}</math> | overfrequency_limit |
Hz | 62 | The lower limit <math>\Delta f_{\text{min}}</math> on <math>\Delta f</math> is f0 - overrfrequency_limit
|
<math>\epsilon</math> | deadband |
Hz | 0.2 | Frequency error dead band. As long as <math> -\epsilon \leq \Delta f \leq +\epsilon</math> the propagated error is 0. |
<math>\epsilon_{\text{tie}}</math> | tieline_tol |
p.u. | 0.05 | Generic tie-line error tolerance in p.u. w.r.t set schedule in link parameter pdispatch + pdispatch_offset .
|
<math>B</math> | B |
MW/Hz | 1 | Frequency bias: converts frequency error signal to a power signal. |
<math>K_p</math> | KpPID |
p.u. | 0 | PID Proportional gain. |
<math>K_i</math> | KiPID |
p.u./s | 0.0167 | PID Integral gain. |
<math>K_d</math> | KdPID |
p.u.<math>\cdot</math>s | 0 | PID derivative gain. |
<math>T_s</math> | Ts |
s | <math>\Delta t</math> | PID output sampling period. |
<math>T_{s,f}</math> | Ts_f |
s | <math>\Delta t</math> | Input frequency sampling period. |
<math>T_{s,P}</math> | Ts_P |
s | <math>T_s</math> | Input unit error (includes tie-line) sampling period. |
<math>T_{\text{lp}}</math> | Tlp |
s | 0 | Default for <math>T_i</math>, time constant for low pass filters to participating units. Zero means inactive. |
anti-windup | anti_windup |
FEEDBACK_PIDOUTPUT |
Integrator anti-windup options: NONE, ZERO_IN_DEADBAND, FEEDBACK_PIDOUT, FEEDBACK_INTEGRATOR .
|
Unit Specific Parameters
The unit specific parameters are provided via the participant_input
parameter (access via player).
Properties are provided in a specific order, which is listed below in column Pos (1 indexed).
Pos | Parameter | Units | Range | Default | Description |
---|---|---|---|---|---|
1 | name | Object name (used to get a pointer to the object internally) | |||
2 | Generator Object: <math> \alpha_i </math> Link Object: <math> c_i </math> |
Generator Object: <math> (0,1] </math> Link Object: <math> \{1,-1\} </math> |
Generator Object: unit participation factor Link Object: directionality indicator 1 = Link to zone, -1= Link from zone | ||
3 | <math>\Delta P_{\text{dn}}</math> | MW | <math> [0, (P_{\text{max}} - P_{\text{min}})P_r] </math> | <math>(P_{\text{max}} - P_{\text{min}})P_r</math> | Maximum change from original setpoint in the downward direction. If output is <math>P^{\star} = P_{\text{set}} + \Delta P^{\star}</math> then <math>\Delta P^{\star} \geq -\Delta P_{\text{dn}}</math>. Note: Not used for link objects. |
4 | <math>\Delta P_{\text{up}}</math> | MW | <math> [0, (P_{\text{max}} - P_{\text{min}})P_r] </math> | <math>(P_{\text{max}} - P_{\text{min}})P_r</math> | Maximum change from original setpoint in the upward direction. If output is <math>P^{\star} = P_{\text{set}} + \Delta P^{\star}</math> then <math>\Delta P^{\star} \leq \Delta P_{\text{up}}</math>. Note: Not used for link objects, since <math>\Delta P^{\star} = 0</math> always. |
5 | <math> P_{\text{max}} </math> | p.u. | [-1,1][3] | diesel_dg: 1 Grid Forming: Pmax Grid Following: Pref_max link: <math>\epsilon_{\text{tie}}</math> |
Generator Object: Maximum allowable output w.r.t rating <math>P_r</math>. Link Object: positive tie-line tolerance <math> (P_i^{\star} - P_{i})/P^{\star} \leq P_{\text{max}} </math>. |
6 | <math> P_{\text{min}} </math> | p.u. | [-1,1][3] | diesel_dg: 0 Grid Forming: Pmin Grid Following: Pref_min link: <math>-\epsilon_{\text{tie}}</math> |
Generator Object: Minimum allowable output w.r.t rating <math>P_r</math>. Link Object: negative tie-line tolerance <math> (P_i^{\star} - P_{i})/P^{\star} \geq P_{\text{min}} </math>. |
7 | <math> T_i </math> | s | <math>[\Delta t, \infty)</math> | <math> T_{\text{lp}} </math> | Low pass filter time constant. Note: Note used for link objects. |
There are three different key words that can be specified when passing unit specific parameters:
ADD
: is used to add new objects to the secondary controllerMODIFY
: is used to modify parameters of objects already participating in secondary controlREMOVE
: is used to to remove an object from the secondary controller
To pass information to the secondary controller:
- Specify the appropriate key word
- List the unit name and relevant properties (to skip a property simply leave it blank)
- List additional units, separated by a line in csv or
;
in glm. - Repeat steps 1-3 for more key words as necessary
There are two possible input formats:
- glm
- csv
The csv method is recommended in general as it is more robust, easy to read, and does not risk exceeding the allotted array buffer of 1024 characters.
The syntax is demonstrated using the following example.
Initially (at t0
) the secondary controller contains:
Name | <math>\alpha_i</math> | <math>\Delta P_{\text{dn}}</math> [MW] | <math>\Delta P_{\text{up}}</math> [MW] | <math> P_{\text{max}} </math> [p.u.] | <math> P_{\text{min}} </math> [p.u.] | <math> T_i </math> [s] |
---|---|---|---|---|---|---|
gen1 | 0.7 | default | default | 0.9 | 0.3 | default |
gen2 | 0.3 | 0.5 | 0.5 | default | default | 1 |
tie1 | -1 | N/A | N/A | 0.1 | 0.1 | N/A |
At t1
gen2 is removed from secondary control.
In response gen1's <math>\alpha_i = 1</math> and <math> P_{\text{max}} = 1 </math>, and the tie line tolerance is changed to <math>\pm 15\%</math>
glm syntax
The syntax for direct glm input is:
t0 ADD gen1, 0.7, , , 0.9, 0.3; gen2, 0.3, 0.5, 0.5, , , 1; tie1, -1, , , 0.1, 0.1; t1 REMOVE gen2; MODIFY gen1, 1, , , 1; tie1, , , , 0.15, 0.15;
csv syntax
For the csv input two files would be needed:
t0.csv
ADD gen1, 0.7, , , 0.9, 0.3 gen2, 0.3, 0.5, 0.5, , , 1 tie1, -1, , , 0.1, 0.1
which looks something like:
ADD | ||||||
gen1 | 0.7 | 0.9 | 0.3 | |||
gen2 | 0.3 | 0.5 | 0.5 | 1 | ||
tie1 | -1 | 0.1 | 0.1 |
and t1.csv
REMOVE gen2 MODIFY gen1, 1, , , 1 tie1, , , , 0.15, 0.15
which looks something like:
REMOVE | |||||
gen2 | |||||
MODIFY | |||||
gen1 | 1 | 1 | |||
tie1 | 0.15 | 0.15 |
The player would then have contain:
t0 t0.csv t1 t1.csv
Generator Properties
The following properties are implemented in the inverter_dyn and diesel_dg models to allow interaction with the secondary controller.
Note: Any future object that should also be capable of interaction with the secondary object will likely need these properties.
Object | Parameter | glm | units | Default | Description |
---|---|---|---|---|---|
diesel_dg | <math>P_{\text{set}}</math> | pdispatch |
p.u. | GGOV with Rselect=1: <math> P_{\text{ref}}/R </math> | Power set point |
GGOV with Rselect=-1 or -2: <math> K_{\text{turb}}(P_{\text{ref}}/R - w_{\text{fnl}}) </math> | |||||
DEGOV1: <math> (\omega_{\text{ref}} - 1)/R </math> | |||||
P_CONSTANT: <math> P_{\text{ref}} </math> | |||||
<math>\Delta P^{\star}</math> | pdispatch_offset |
p.u. | 0 | Offset to <math>P_{\text{set}}</math>. This is the quantity that the secondary controller manipulates | |
inverter_dyn | <math>P_{\text{set}}</math> | pdispatch |
p.u. | GRID_FORMING, PSET_MODE: <math>P_{\text{set}}</math> | Power set point |
GRID_FORMING, FSET_MODE: <math>(2\pi f_{\text{set}} - \omega_{\text{ref}})/m_p</math> | |||||
GRID_FOLLOWING or GFL_CURRENT_SOURCE: <math> P_{\text{ref}}/S_{\text{base}} </math> | |||||
<math>\Delta P^{\star}</math> | pdispatch_offset |
p.u. | 0 | Offset to <math>P_{\text{set}}</math>. This is the quantity that the secondary controller manipulates |
The current set point, <math> P^{\star} </math>, is calculated as
<math> P^{\star} = P_{\text{set}} + \Delta P^{\star} </math>
Link Properties
The following properties are implemented in the link object to allow interaction with the secondary controller as a tie-line.
Parameter | glm | units | Description |
---|---|---|---|
<math>P_{\text{set}}</math> | pdispatch |
W | Scheduled flow. Positive flow matches the links from-to definition. |
<math>\Delta P^{\star}</math> | pdispatch_offset |
W | Offset to the scheduled flow. Note: currently unused. |
set dispatch trigger | set_dispatch |
true/false | Trigger to set schedule to current power flow value. When True will set: <math>P_{\text{set}} = (P_{\text{in}} + P_{\text{out}})/2 </math> |
Interaction with QSTS Mode
Initialization
Since QSTS mode is a steady state formulation there is no frequency error. Therefore, all states are initialized to zero.
Return to QSTS Operation
The controller keeps track of two conditions:
- Frequency within deadband: <math> -\epsilon \leq \Delta f \leq \epsilon </math>
- Tie-lines within tolerance: <math> P_{\text{min}} \leq (P^{\star}_i - P_i)/P^{\star}_i \leq P_{\text{max}} \forall i</math>
When both of these conditions are met for the length of two output sampling periods (<math> 2T_s</math>) then the secondary controller requests to return to QSTS mode.
Examples
Multiple Secondary Controllers With Inter-Ties
The following glm snippet shows how to set up a controller including inter-ties as shown in Figure 4. Only the controller for Microgrid 2 is shown for brevety.
Main .glm
:
// Controller Parametrization object sec_control { name secondary_controller_MG2; flags DELTAMODE; parent meter_50; deadband 0.001; //1 mHz deadband B 1.7476; //MW/Hz kiPID 0.04; // pu/s; kpPID 0; //pu Ts 0.2; // 200ms output sample time Ts_f 0.1; // 100ms frequency sample time Ts_P 0.2; // 200ms unit error and inter-tie sample time anti_windup FEEDBACK_PIDOUT; participant_input "sec_cntrl_MG2_part_init.csv"; }; //Triggers to set the tie-line schedules object player{ name MG1_MG2_tie_set; flags DELTAMODE; parent microgrid_switch1; file "tielineset.player"; property set_pdispatch; }; object player{ name MG2_MG3_tie_set; flags DELTAMODE; parent microgrid_switch4; file "tielineset.player"; property set_pdispatch; };
sec_cntrl_MG2_part_init.csv
:
ADD Inv2, 1 microgrid_switch1, 1 microgrid_switch4, -1
tielineset.player
:
2001-08-01 12:00:00, true
Low Pass Filter
The following example uses the low pass filter option via a default value.
The participan_input
also shows a custom value for <math>P_{\text{min}}</math> for Gen4.
Main .glm
:
object sec_control { name secondary_controller; flags DELTAMODE; parent node_150; deadband 0.001; //1 mHz deadband B 12.1187; //MW/Hz kiPID 0.2; // pu/s; kpPID 0; //pu Ts 1; Tlp 1; anti_windup FEEDBACK_PIDOUT; participant_input "sec_cntrl_part_init.csv"; };
sec_cntrl_part_init.csv
:
ADD Gen1, 0.3 Gen4, 0.2,,,,0.3 Inv1, 0.2 Inv3, 0.3
References
- ↑ "Wood, Allen J., Bruce F. Wollenberg, and Gerald B. Sheblé. Power generation, operation, and control. John Wiley & Sons, 2013."
- ↑ See, for example Aström, Karl (2002). Control System Design (PDF). pp. 228–231.
- ↑ 3.0 3.1 Negative values possible for inverters if a battery is assumed that can also charge