# Bus Plant Controller Model: REPC_D

**NOTE: REPC_D is in the same family of controller as the Generator Plant Controllers such as REPC_A, however the REPC_D model is assign to a Bus object instead of a Generator object. **

Thus to create the object you must go to Stability tab on the Bus dialog or look in the Model Explorer under Transient Stability\Bus Models

Following checks and corrections are applied during Validation and AutoCorrection.

- The following parameter pairs should have a maximum value that is positive and a minimum value that is negative:

Femax/Femin, Emax/Emin, and frmax/frmin

If both values are positive, then we will assume the minimum value should have had a negative sign.

If both values are negative, then we will assume the maximum value should have had a positive sign.

If the Max < 0 AND Min > 0, then we will assume the numbers have been entered backwards and we will swap the values. - The following parameter pairs should have a maximum value that is greater or equal to than the minimum value:

Qvmax/Qvmin, Pmax/Pmin, vrefmax/vrefmin, Qrefmax/Qrefmin, dprefmax/dprefmin, qvrmax/qvrmin, dprmax/dprmin, pfmax/pfmin, Prmax/Prmin, PImax/PImin

If the Max < Min then the values will be swapped by the Auto Correction. - dbd1 and fdbd1 represent low side deadbands which should always be negative. We will assume a parameter equal to the negative of the absolute value entered.
- dbd2 and fdbd2 represent high side deadbands which should always be positive. We will assume a parameter equal to the positive of the absolute value entered.
- For Tfltr, Tp, Tlag, Tc, and Tfrq

If 0.0 < X < 0.5*Mult*TimeStep then X = 0, ElseIf 0.5*Mult*TimeStep < x < Mult*TimeStep then X = Mult*TimeStep - When (RefFlag=1) AND (VcompFlag=0) AND (Kc<>0), a branch should be specified on which to measure Qbranch to perform voltage control with reactive droop. If none is specified then the output of the generator

Mult represents the user-specified value **Minimum time constant size as multiple of time step** option on the Validation page of the Transient Stability Dialog

TimeStep represents the integration time step being used as described on TimeStep

Model Equations and/or Block Diagrams

**Object Parameters:**

MeasVBus | OtherObject:0 | Measurement VBus. Bus at which voltage is measured. If not specified then the bus at which the REPC_D model is defined is used. |

MeasFreqBus | OtherObject:1 | Measurement Freq Bus. Bus at which frequency is measured. If not specified, then it will use the same bus as the voltage measurement. |

MeasBranch | OtherObject:2 | Measurement Branch. Branch on at which Qbranch, Pbranch, and Ibranch is measured. |

MeasBus | OtherObject:3 | Measurement Bus. This is the terminal bus of the Measurement Branch at which Qbranch, Pbranch and Ibranch are measured. Note that the parameter MeasFlag determines whether the flow is measured into or out of the branch. |

MeasQBranch2 | OtherObject:4 | Measurement Q Branch 2. Branch on which Qbranch2 is measured. |

MeasQBus2 | OtherObject:5 | Measurement Q Bus. This is the terminal bus of the Measure Q Branch 2 at which Qbranch2 is measured. Note that the parameter MeasQFlag determines whether the flow is measured into or out of the branch. |

Control Shunt Device 1 | OtherObject:6 | Switched Shunt controlled by REPC_D (up to 12 can be specified) |

Control Shunt Device 2 | OtherObject:7 | Switched Shunt controlled by REPC_D (up to 12 can be specified) |

... | ... | ... |

Control Shunt Device 12 | OtherObject:17 | Switched Shunt controlled by REPC_D (up to 12 can be specified) |

Control Device 1 | OtherObject:18 | Generator 1 which receives output Po1 and Qo1 from the REPC_D model |

Control Device 2 | OtherObject:19 | Generator 2 which receives output Po2 and Qo2 from the REPC_D model |

... | ... | ... |

Control Device 50 | OtherObject:67 | Generator 50 which receives output Po50 and Qo50 from the REPC_D model |

**Parameters:**

MeasFlag | MeasFlag: 0 indicate that positive flow for MeasBranch is leaving MeasBus going out to the line. 1 indicate that positive flow for MeasBranch is arriving at MeasBus coming in from the line. |

MeasQFlag | MeasQFlag: 0 indicate that positive flow for MeasQBranch2 is leaving MeasQBus2 going out to the line. 1 indicate that positive flow for MeasQBranch2 is arriving at MeasQBus2 coming in from the line. |

VcompFlag | VcompFlag: Selection of droop (0) or line drop compensation (1) |

RefFlag | RefFlag: Reference Flag: 0 = reactive power control; 1 = voltage control; 2 = constant power factor |

Freqflag | Freqflag: Flag to turn on (1) or off (0) the active power control loop within the plant controller |

Pefd_Flag | Pefd_Flag: Enable (1) or disable (0) electrical power feedback |

Ffwrd_Flag | Ffwrd_Flag: Feedforward flaf (1) include feedforward and (0) disable |

MSSFlag | MSSFlag: 0 means shunt switching is disabled; <> 0 means shunt switching is enabled. |

QVFlag | QVFlag: 0 means Q/V control is a fixed output; <> 0 means QV control is enabled. |

Tfltr | Tfltr: Voltage or reactive power measurement filter time constant |

Kp | Kp: Proportional gain |

Ki | Ki: Integral gain |

Tft | Tft: Lead time constant |

Tfv | Tfv: Lag time constant |

Vfrz | Vfrz: Voltage below which plant control integrator state is frozen |

Rc | Rc: Line drop compensation resistance |

Xc | Xc: Current compensation constant (to emulate droop or line drop compensation) |

Kc | Kc: Gain on reactive current compensation |

emax | emax: Maximum error limit |

emin | emin: Minimum error limit |

dbd1 | QV Deadband lower threshold <= 0 |

dbd2 | QV Deadband upper threshold >= 0 |

Qvmax | Qvmax: Maximum Q control output |

Qvmin | Qvmin: Minimum Q control output |

Kpg | Kpg: Proportional gain for power control |

Kig | Kig: Integral gain for power control |

Tp | Tp: Lag time constant on Pgen measurement |

fdbd1 | fdbd1: Deadband downside |

fdbd2 | fdbd2: Deadband upside |

femax | femax: Maximum error limit |

femin | femin: Minimum error limit |

Pmax | Pmax: Maximum Power |

Pmin | Pmin: Minimum Power |

Tlag | Tlag: Lag time constant on Pref feedback |

Ddn | Ddn: Downside droop (>= 0) |

Dup | Dup: Upside droop (>= 0) |

Vrefmax | Vrefmax: Maximum voltage reference, pu |

Vrefmin | Vrefmin: Minimum voltage reference, pu |

Qrefmax | Qrefmax: Maximum Q-reference, pu |

Qrefmin | Qrefmin: Minimum Q-reference, pu |

dqrefmax | dqrefmax: Maximum rate if increase of Q-reference, pu/s |

dqrefmin | dqrefmin: Maximum rate if decrease of Q-reference, pu/s |

qvrmax | qvrmax: Maximum rate if increase of Qext (Vext), pu/s |

qvrmin | qvrmin: Maximum rate if decrease of Qext (Vext), pu/s |

dprmax | dprmax: Maximum rate if increase of Plant Pref, pu/s |

dprmin | dprmin: Maximum rate if decrease of Plant Pref, pu/s |

pfmax | pfmax: For positive Mvar, the minimum power factor setpoint allowed |

pfmin | pfmin: For negative Mvar, the minimum power factor setpoint allowed |

Prmax | Prmax: Maximum rate if increase of Pref, pu/s |

Prmin | Prmin: Maximum rate if decrease of Pref, pu/s |

PImax | PImax: Maximum output of the active power PI controller, pu |

PImin | PImin: Minimum output of the active power PI controller, pu |

Tc | Tc: Reactive-current compensation time-constant, sec |

Qdn1 | Qdn1: First stage of capacitor (reactor) switching out (in), pu |

Qdn2 | Qdn2: Second stage of capacitor (reactor) switching out (in), pu |

Qup1 | Qup1: First stage of capacitor (reactor) switching in (out), pu |

Qup2 | Qup2: Second stage of capacitor (reactor) switching in (out), pu |

Tdelay1 | Tdelay1: Time delay after which if Q < Qdn1 (or Q > Qup1) a capacitor (reactor) is switched, sec |

Tdelay2 | Tdelay2: Time delay after which if Q < Qdn2 (or Q > Qup2) a capacitor (reactor) is switched, sec |

Tmssbrk | Tmssbrk: Time it takes to switch in (out) a mechanically switched shunt, sec |

TOUT | TOUT: Time for discharging of a capacitor that has just beed switched out; the same capacitor cannot be switched back in until Tout (sec) has elapsed |

Tfrz | Tfrz: A time delay during which the states are kept frozeen even after the filtered voltage recovers above Vfrz. This can be used to ensure the plant controller does not iteract with the inverter LVRT |

Tfrq | Tfrq: Frequency time constant, sec |

Vfreq | Vfreq: Voltage in pu below which measured frequency is set to 1 pu. |

dfmax | dfmax: Maximum frequency error, pu |

dfmin | dfmin: Minimum frequency error, pu |

MVABase | MVABase: Model MVA base |

frmax | frmax: Maximum rate limit on measured frequency, pu/s |

frmin | frmin: Minimum rate limit on measured frequency, pu/s |

Vfrzhigh | Vfrz: Voltage above which plant control integrator state is frozen |

Kz1 | Real path weight for control device 1 |

Tz1 | Time Delay for real power 1 |

Pmax1 | Real Power Maximum (pu) 1 |

Pmin1 | Real Power Minimum (pu) 1 |

Kw1 | Reactive path weight for control device 1 |

Tw1 | Time Delay for reactive power 1 |

Qmax1 | Reactive Power Maximum (pu) 1 |

Qmin1 | Reactive Power Minimum (pu) 1 |

... | |

... | repeat parameters Kz*, Tz*, Pmax*, Pmin*, Kw*, Tw*, Qmax*, Qmin* for up to 50 generators |

... | |

Kz50 | Real path weight for control device 50 |

Tz50 | Time Delay for real power 50 |

Pmax50 | Real Power Maximum (pu) 50 |

Pmin50 | Real Power Minimum (pu) 50 |

Kw50 | Reactive path weight for control device 50 |

Tw50 | Time Delay for reactive power 50 |

Qmax50 | Reactive Power Maximum (pu) 50 |

Qmin50 | Reactive Power Minimum (pu) 50 |