Documentation Home Page HYPERSIM Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

EMTP | Control

Simulating EMTP subsystem components in HYPERSIM

A list of basic components from the EMTP libraries that are fully supported in HYPERSIM is presented in EMTP | List of Compatible Components. Note that these basic components (or blocks) are used in EMTP to build high-level models (or subsystems) such as synchronous machine control systems from the Exciters and Governors library (from EMTP 4.1). Therefore, EMTP subsystem components can be compatible in HYPERSIM if all the basic blocks composing the subsystem are supported. This section is intended to help the user to prepare an EMTP control block to be used on HYPERSIM.

Loops on Control Systems

Feedback loops in a control system can introduce algebraic loops, which may require iterative solution methods when nonlinear components are involved. EMTP uses the approximate Newton method to address nonlinear equations and solves the equations of a control system simultaneously. However, since HYPERSIM is aimed at real-time simulations, which require a fast solution of the equations, it avoids iterative methods.

To address nonlinear equations in a control system, HYPERSIM uses a sequential method adapted to discrete control systems. In this method, each control block is solved following an automatically determined order, i.e., sequentially. The internal algorithm detects all the types of loops (linear or not) and introduces a block to break them. The loop breaker block represents a pure delay (one simulation time step) whose output is zero at t = 0 (history) and indicates to HYPERSIM the sequence of calculation blocks in the loop. However, these blocks are not always introduced properly, which may lead to numerical oscillations in the output signal of the controller. The following example illustrates this problem and presents a solution.

Example: Exciter ST1

This example shows how to manually adapt an EMTP controller (Exciter ST1 from library “Exciters and Governors”) to address a numerical oscillation problem caused by a feedback loop. The following figure shows the test model in EMTP. A step function from 1 pu to 1.05 pu (t = 5 s) is used as the VREF input.

The following Figure shows a feedback loop inside the exciter ST1.

For a time-domain simulation, the sequential algorithm in HYPERSIM detects an algebraic loop and automatically introduces a delay block to break it, see the figure above. Note that the pure delay block automatically holds a history value equal to 0 (output = 0 at t = 0). Then, the input of the block Vr at t = 0, which must be “Vin_ic” (history value of the previous block “Vef”), becomes null (history value of the delay block). This produces numerical oscillations at the output EFD during a simulation, as observed in the following Figure.

Adding a loop breaker block manually

To address the problem mentioned above, the user must insert a loop breaker block manually by using one of the two following blocks.

These blocks are located in your HYPERSIM Installation under C:\OPAL-RT\HYPERSIM\%HYPERSIM_VERSION%\Windows\HyperWorksUI\HyLibs\hidden.

To make this library available, just copy and paste the library Control HYP_EMPT.clf to C:\OPAL-RT\HYPERSIM\%HYPERSIM_VERSION%\Windows\HyperWorksUI\HyLibs and restart HYPERSIM.

  • The hyEMTP_LoopBreaker block is a simple connection (gain = 1)
  • The hyEMTP_LoopBreakerDelay replaces a pre-existing pure delay block (1 time step)

Adding loop breaker blocks does not have an impact on the EMTP simulations. These blocks are able to propagate the history (entry h) of the block upstream. Thus, there are two possible solutions to break the algebraic loop in the ST1 exciter properly.

Solution 1: It is noted that the feedback gain Kf  is equal to zero; thus, there is not an actual feedback loop in the system. Therefore, the loop can be broken at the feedback loop as shown in the following Figure.

Solution 2: The loop breaker blocks can propagate the history (entry h) of the block upstream. Thus, the loop breaker can be added as shown in the following Figure. Note that the defined history value Vin_ic is connected to input h of the loop breaker.

The following Figure shows the output results obtained after breaking the loops manually using both solutions. It is observed that numerical oscillations on signal EDF are eliminated.

Note: The user can consult the HYPERSIM console after analyzing the model to identify the location where the algebraic loops are broken by default. Then, a visual inspection of the model would be required to identify which loop contains a block with initial values. The initial values must be transferred correctly to the other side of the loop.

Managing f(u) component

This section presents a note to be considered when using the EMTP component f(u) from library Control. The expression of a mathematical function in blocks f(u), must have an equal number of opening and closing parentheses.

For example, the syntax of the following expression:

(u[1] <= #EFDN#) * (u[1]) * #KF#) + (u[1] > #EFDN#) * (u[1] * #KN#)

is accepted on EMTP despite having 4 opening parentheses and 5 closing parentheses. However, in HYPERSIM the expression would be rejected because it does not have an identical number of parentheses. Therefore, the user must correct the expression in HYPERSIM. For example:

(u[1] <= #EFDN#) * (u[1] * #KF#) + (u[1] > #EFDN#) * (u[1] * #KN#)

Notion of Time

As opposed to EMTP, the end of a simulation in HYPERSIM is undefined. In HYPERSIM, the simulation is stopped manually by the user and the time is defined as absolutely or relatively.

The absolute time (t0) is defined in relation to the beginning of the simulation. This can be used to program the initialization of control blocks using the time variable (e.g., t, time). The relative time (t0') is defined, in a recording interval (e.g., by ScopeView), in relation to a point on the wave of a reference signal. This is used for setting the time for the beginning and the end of disturbances (e.g., fault circuit breaker, circuit breaker). Note that the acquisition is not synchronized with the beginning of the simulation.

The following figure describes a chronological sequence in both software.

Differences Between EMTP and HYPERSIM

  • A shows an EMTP simulation where the EMTP chronology of a fault [t2, t3] is followed by a maneuver [t4, t5]. The recording is done for the duration of the simulation or recording (acquisition).
  • B shows the simulation of A in HYPERSIM, where we program these same disturbances for the same recording.
  • The start of recording (t0') is set to the point on the waveform of a reference signal. It is clear that the sequences of the events of A and B will not be in synch.
  • C shows the HYPERSIM simulation where both disturbances are recorded separately by waiting for the steady-state. 
  • HYPERSIM allows the user to program and execute B and C sequences without stopping the simulation.


1) The initialization of the control systems will be done only through mathematical expressions referring to the variable "time" (t). The blocks f(u) or switches controlled by an external signal and dependent on t are used.

2) In EMTP the time of the disturbance defined in a switch is an absolute time (delays compared to the beginning of the simulation). It will not be in synch with HYPERSIM in which it is considered a relative time (delay with respect to a point on the wave of a signal in the recording interval). The interval is not in sync with the beginning of the simulation but with the activation of a recording.

3) Examples for source-type components.

Current source (type cI) or voltage source (tupe cV) controlled over time

HYPERSIM only accepts a continuously operating source such as:

Tstart = 0 s and Tstop = 1E15 s.

Current source (type Isine) or voltage sources (type Vsine and Vsine_z)

HYPERSIM only accepts a continuously operating source such as:

Tstart = -1 s and Tstop = 1E15 s.

4) Examples for breaker-type components.

Circuit breakers (type Sw0)The times Tclose and Topen must take a positive value within the time interval of the simulation/recording, less than tmax.
Series-connected circuit-breakers (e.g., for line maneuvers)The externally-controlled switches must be used (see note below) and the closing and opening times must have a positive value within the time interval of the simulation/recording.

Note: HYPERSIM needs to know the initial state (steady-state) of the circuit breaker and the definition of a sequence of at least two maneuvers. This is only possible with the externally controlled EMTP circuit breaker or the one used to simulate a ground fault (initial state implicitly open and a first closing maneuver and a second opening).

For series-connected circuit-breakers (e.g., for line maneuvers): These must be replaced manually by the circuit-breakers in HYPERSIM if they are not externally controlled. The definition of T1 and T2 is accordingly to reproduce the sequence of events to obtain results similar to EMTP.

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | | +1 514-935-2323