You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
It would be nice to simulate a complete hydropower system with different kinds of power system controllers #101
OpenHPL already provides strong hydropower component models, but it would be useful to support a more complete end-to-end simulation setup where the hydropower plant is coupled with several power system control strategies. This would make it easier to study grid-support behavior, controller interactions, and closed-loop dynamics in realistic scenarios rather than evaluating each controller in isolation.
A practical implementation path would be to define a common test package that includes the hydraulic system, turbine, generator, grid-side frequency input, and interchangeable controller blocks such as transient droop, permanent droop, isochronous control, AGC, and FCR-related controllers. The package should expose comparable interfaces and reusable experiment setups so that the same disturbance cases, metrics, and plots can be applied across controller variants. This would make controller benchmarking and validation much easier for both research and development use.
One initial attempt in this direction already exists in the branch hydropower-and-power-system-controllers, where the NewTest package and validation artifacts have been pushed for further development and review.
Equation-Based Models of the OpenHPL NewTest Controllers
This note documents the six reusable Modelica blocks in OpenHPLTest/NewTest/Controllers on the hydropower-and-power-system-controllers branch. The equations below describe the implementation in that branch.
Gate positions and frequency errors normalized by $f_{\mathrm{ref}}$ are dimensionless. Parameters retain the names used in the Modelica source where practical.
Isochronous PI governor
Source: IsochronousGovernor.mo.
The frequency error and unsaturated gate command are
The second term in $\dot{x}$ tracks the actual actuator position and reduces windup during position or rate limiting. At an unsaturated steady state with $g=u$ and $K_i>0$, $e_f=0$ and therefore $f=f_{\mathrm{ref}}$.
Permanent-droop PI governor
Source: PermanentDroopGovernor.mo.
Measured power contributes to the governing error:
It responds while the gate changes and decays to zero after the gate settles; permanent droop still determines the unsaturated steady-state characteristic. Initialization imposes $z=g$ to avoid an artificial initial transient.
FCR governor
Source: FCRGovernor.mo.
The measured frequency passes through a first-order filter:
Underfrequency produces a positive gate increment. The source computes trackingCorrection = (gate - y)/Tt, but this variable does not influence any state or output. The implemented block is therefore a filtered proportional frequency response with deadband and limits; its tracking correction is currently inactive.
Secondary AGC
Source: SecondaryAGC.mo.
The secondary controller integrates normalized frequency error:
The limits constrain the output shift, but $x_{\mathrm{AGC}}$ continues to integrate when the limit is reached. The current block has no anti-windup feedback. In AGCControl.mo, this output supplies the permanent-droop governor’s P_ref input.
Gate actuator
Source: GateActuator.mo.
The actuator first limits the incoming command to its permitted position range:
The source calls the input u, the output y, and the limited command target; the symbols above distinguish actuator position $g$ from governor command $y$. Initialization imposes $g=g_{\mathrm{target}}$.
Connection in the NewTest examples
The example models connect each governor command to the actuator. The actuator position goes to the turbine and returns to the governor’s gate input:
flowchart LR
F["Frequency and power"] --> C["Governor"]
C -->|"command y"| A["Gate actuator"]
A -->|"actual gate g"| T["Turbine"]
A -->|"tracking g"| C
The isochronous, permanent-droop, transient-droop, and FCR examples use their respective governors with this actuator. The AGC example also connects the secondary controller’s $P_{\mathrm{ref}}$ output to the permanent-droop governor. Turbine, waterway, generator, and load dynamics complete the simulated plant; they are outside the six controller equations documented here.
Hi @pandeysudan1 that looks very interesting. I need to have a proper look. I had started something similar but not finalised. So I need to investigate how this can be incorporated in a good way. I can not promise to get to it right away. I will keep you updated here.
Activity
pandeysudan1 commentedon Sep 26, 2026
Equation-Based Models of the OpenHPL NewTest Controllers
This note documents the six reusable Modelica blocks in OpenHPLTest/NewTest/Controllers on the hydropower-and-power-system-controllers branch. The equations below describe the implementation in that branch.
Notation
For compactness, define the limiter
Gate positions and frequency errors normalized by$f_{\mathrm{ref}}$ are dimensionless. Parameters retain the names used in the Modelica source where practical.
Source: IsochronousGovernor.mo.
The frequency error and unsaturated gate command are
The output and integral state satisfy
The second term in$\dot{x}$ tracks the actual actuator position and reduces windup during position or rate limiting. At an unsaturated steady state with $g=u$ and $K_i>0$ , $e_f=0$ and therefore $f=f_{\mathrm{ref}}$ .
Source: PermanentDroopGovernor.mo.
Measured power contributes to the governing error:
The PI and tracking equations are
At an unsaturated steady state with$g=u$ and $K_i>0$ , $e=0$ :
For example,$R=0.04$ corresponds to a $0.04$ per-unit frequency deviation for a $1$ per-unit power deviation on the selected base.
Source: TransientDroopGovernor.mo.
A first-order state$z$ filters the actual gate position. The difference between the gate and its filtered value produces transient droop:
The complete governing error is
The remaining governor equations are
For small-signal changes about an operating point, the transient-droop path is a washout filter:
It responds while the gate changes and decays to zero after the gate settles; permanent droop still determines the unsaturated steady-state characteristic. Initialization imposes$z=g$ to avoid an artificial initial transient.
Source: FCRGovernor.mo.
The measured frequency passes through a first-order filter:
For a symmetric deadband$d$ in Hz, the active deviation is
The incremental reserve request and commanded gate position are
Underfrequency produces a positive gate increment. The source computes trackingCorrection = (gate - y)/Tt, but this variable does not influence any state or output. The implemented block is therefore a filtered proportional frequency response with deadband and limits; its tracking correction is currently inactive.
Source: SecondaryAGC.mo.
The secondary controller integrates normalized frequency error:
Its output shifts the scheduled power reference:
The limits constrain the output shift, but$x_{\mathrm{AGC}}$ continues to integrate when the limit is reached. The current block has no anti-windup feedback. In AGCControl.mo, this output supplies the permanent-droop governor’s P_ref input.
Source: GateActuator.mo.
The actuator first limits the incoming command to its permitted position range:
Its actual gate position evolves according to a first-order tracking law with asymmetric rate limits:
The source calls the input u, the output y, and the limited command target; the symbols above distinguish actuator position$g$ from governor command $y$ . Initialization imposes $g=g_{\mathrm{target}}$ .
Connection in the NewTest examples
The example models connect each governor command to the actuator. The actuator position goes to the turbine and returns to the governor’s gate input:
flowchart LR
F["Frequency and power"] --> C["Governor"]
C -->|"command y"| A["Gate actuator"]
A -->|"actual gate g"| T["Turbine"]
A -->|"tracking g"| C
The isochronous, permanent-droop, transient-droop, and FCR examples use their respective governors with this actuator. The AGC example also connects the secondary controller’s$P_{\mathrm{ref}}$ output to the permanent-droop governor. Turbine, waterway, generator, and load dynamics complete the simulated plant; they are outside the six controller equations documented here.
dietmarw commentedon Oct 7, 2026
Hi @pandeysudan1 that looks very interesting. I need to have a proper look. I had started something similar but not finalised. So I need to investigate how this can be incorporated in a good way. I can not promise to get to it right away. I will keep you updated here.
pandeysudan1 commentedon Oct 7, 2026
Hi @dietmarw, thanks for the comment. It would be great if you could take a proper look at this.