Registry Mirror
Skip to content

It would be nice to simulate a complete hydropower system with different kinds of power system controllers #101

Open

Description

@pandeysudan1

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.

OpenHPL_research_briefing.pdf

Branch link: https://github.com/pandeysudan1/OpenHPL/tree/hydropower-and-power-system-controllers

Activity

  1. pandeysudan1 commented on Sep 26, 2026

    @pandeysudan1
    ContributorAuthor

    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

    Symbol Meaning Unit
    $f$, $f_{\mathrm{ref}}$ Measured and nominal frequency Hz
    $P$, $P_{\mathrm{ref}}$, $P_{\mathrm{base}}$ Measured power, power reference, and power base W
    $y$ Governor command sent to the actuator per unit
    $g$ Actual gate position returned by the actuator per unit
    $u$ Governor command before position limiting per unit
    $x$ Governor integral contribution per unit
    $T_t$ Actuator-tracking time constant s

    For compactness, define the limiter

    $$ \operatorname{clip}(v,a,b)=\min!\left(b,\max(a,v)\right). $$

    Gate positions and frequency errors normalized by $f_{\mathrm{ref}}$ are dimensionless. Parameters retain the names used in the Modelica source where practical.

    1. Isochronous PI governor

    Source: IsochronousGovernor.mo.

    The frequency error and unsaturated gate command are

    $$ e_f=\frac{f_{\mathrm{ref}}-f}{f_{\mathrm{ref}}}, \qquad u=K_p e_f+x. $$

    The output and integral state satisfy

    $$ y=\operatorname{clip}(u,y_{\min},y_{\max}), \qquad \dot{x}=K_i e_f+\frac{g-u}{T_t}. $$

    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}}$.

    1. Permanent-droop PI governor

    Source: PermanentDroopGovernor.mo.

    Measured power contributes to the governing error:

    $$ e=\frac{f_{\mathrm{ref}}-f}{f_{\mathrm{ref}}} -R\frac{P-P_{\mathrm{ref}}}{P_{\mathrm{base}}}. $$

    The PI and tracking equations are

    $$ u=K_p e+x,\qquad y=\operatorname{clip}(u,y_{\min},y_{\max}),\qquad \dot{x}=K_i e+\frac{g-u}{T_t}. $$

    At an unsaturated steady state with $g=u$ and $K_i>0$, $e=0$:

    $$ \frac{f_{\mathrm{ref}}-f}{f_{\mathrm{ref}}} =R\frac{P-P_{\mathrm{ref}}}{P_{\mathrm{base}}}. $$

    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.

    1. Transient-droop governor

    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:

    $$ T_r\dot z=g-z,\qquad d_t=R_t(g-z). $$

    The complete governing error is

    $$ e=\frac{f_{\mathrm{ref}}-f}{f_{\mathrm{ref}}} -R\frac{P-P_{\mathrm{ref}}}{P_{\mathrm{base}}}-d_t. $$

    The remaining governor equations are

    $$ u=K_p e+x,\qquad y=\operatorname{clip}(u,y_{\min},y_{\max}),\qquad \dot{x}=K_i e+\frac{g-u}{T_t}. $$

    For small-signal changes about an operating point, the transient-droop path is a washout filter:

    $$ \frac{\Delta D_t(s)}{\Delta G(s)} =R_t\frac{T_rs}{1+T_rs}. $$

    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.

    1. FCR governor

    Source: FCRGovernor.mo.

    The measured frequency passes through a first-order filter:

    $$ T_m\dot f_{\mathrm{filt}}=f-f_{\mathrm{filt}},\qquad \Delta f=f_{\mathrm{filt}}-f_{\mathrm{ref}}. $$

    For a symmetric deadband $d$ in Hz, the active deviation is

    $$ \Delta f_{\mathrm{active}}= \begin{cases} \Delta f-d, & \Delta f>d, 0, & |\Delta f|\le d, \Delta f+d, & \Delta f<-d. \end{cases} $$

    The incremental reserve request and commanded gate position are

    $$ r=-K_f\Delta f_{\mathrm{active}},\qquad r_{\mathrm{lim}}=\operatorname{clip}(r,-r_{\mathrm{down}},r_{\mathrm{up}}), $$

    $$ y=\operatorname{clip}(y_{\mathrm{bias}}+r_{\mathrm{lim}},y_{\min},y_{\max}). $$

    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.

    1. Secondary AGC

    Source: SecondaryAGC.mo.

    The secondary controller integrates normalized frequency error:

    $$ e_f=\frac{f_{\mathrm{ref}}-f}{f_{\mathrm{ref}}},\qquad \dot x_{\mathrm{AGC}}=K_{i,\mathrm{AGC}}e_f. $$

    Its output shifts the scheduled power reference:

    $$ P_{\mathrm{ref}}=P_{\mathrm{schedule}}+P_{\mathrm{base}} \operatorname{clip}(x_{\mathrm{AGC}},\Delta p_{\min},\Delta p_{\max}). $$

    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.

    1. Gate actuator

    Source: GateActuator.mo.

    The actuator first limits the incoming command to its permitted position range:

    $$ g_{\mathrm{target}}=\operatorname{clip}(y,g_{\min},g_{\max}). $$

    Its actual gate position evolves according to a first-order tracking law with asymmetric rate limits:

    $$ \dot g=\operatorname{clip}!\left( \frac{g_{\mathrm{target}}-g}{T}, -v_{\mathrm{close}},v_{\mathrm{open}} \right). $$

    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.

  2. dietmarw commented on Oct 7, 2026

    @dietmarw
    Collaborator

    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.

  3. pandeysudan1 commented on Oct 7, 2026

    @pandeysudan1
    ContributorAuthor

    Hi @dietmarw, thanks for the comment. It would be great if you could take a proper look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions