Frequently Asked Question
Arithmetic overflow (AO) in a digital computer is the condition that occurs when a calculation produces a result that is greater than a given register or storage location can store or represent.
Within the Typhoon HIL toolchain, it can typically manifest in two ways:
- An overflow occurs in a single register, under a specific condition (for example, an injection of a fault). Simulation results in this case are accurate, and the AO flag can be cleared by resetting it.
- Due to numerical divergence, an overflow occurs in a wide range of registers. Simulation results in this case are completely erroneous and erratic, and the AO flag is constantly raised, even after being reset.
While AO can be traced to several causes, the two most common are:
- Unstable IT core coupling
- Electrical machine instability
Other causes include:
- Time-varying elements
- Nonlinear inductor
- TLM Coupling
- High execution rate
- Signal processing
Unstable IT core coupling. This is the most common cause. It is a consequence of poor positioning, orientation, or snubber parametrization of core couplings. The following links are a must read to understand how to properly partition circuits with core couplings:
- Circuit partitioning
- Is there a need for circuit partitioning
- Circuit partitioning components
- IT coupling placement
- Topological conflicts
- Coupling snubber parametrization
The coupling stability analysis feature of the circuit solver should be of great help for pinpointing and resolving unstable core couplings.
Once enabled, the compiler console will show a stability report during compilation. As long as you have unstable couplings in the report, it is highly likely that you will receive an AO either at simulation start or when a particular model state is triggered.
Electrical machine instability
Electrical machine AO usually occurs in the following cases:
1) The snubber is badly parametrized.
- In this case, you should try reducing the machine snubber value. The best way to determine the proper machine snubber value is to check the operation of the machine for different snubber values. The machine snubber value should be a compromise between stability and the quality of the results, or the power consumption of the snubber which is the source of error. As a rule of thumb, the simulation step and snubber value are inversely proportional, meaning that achieving stability for a smaller simulation time step allows for higher snubber values.
- Alternatively, you can try using voltage behind reactance (VBR) machine models. If a VBR model is not available for your machine, let us know.
2) Potential load type used in Machine Settings
When the potential load type is selected, attention must be paid to the upper limit of this torque. If the load torque exceeds the motor torque, the rotor speed rapidly increases in the opposite direction until the calculation limit, indicated by the AO flag, is reached. This can be prevented by applying appropriate values of linear and/or square load torque.
3) Speed is greater than the upper limit for real-time simulation on HIL devices.
- When selecting the speed load type, please note that the upper limit of emulated machine mechanical speed on all HIL devices is 20,000 rad/s. If the speed exceeds this value, an arithmetic overflow flag will occur.
Time-varying elements. When using time-varying elements such as variable resistors, inductors and capacitors, an arithmetic overflow is likely to occur when the time constant of the circuit is smaller than the simulation time step. This means that each of these time-varying elements comes with its own critical operating point in relation to the time constant; AO can happen either by an increase or a decrease of R, L, or C, depending on the circuit.
Bear in mind that this isn’t the only condition that should be considered when defining the normal operating range of these components. This condition should be used to determine the critical operating point, and the normal operating range should be determined in such a way so that these values are a compromise between model stability and their sensibility from an electrical standpoint in the context of the circuit.
With this in mind, let's assume that N = τ/Tss is the ratio between the time constant of the circuit and the simulation step. Theoretically, following the Nyquist-Shannon theorem, N>2 is a sufficient condition to uniquely represent a continuous signal of finite bandwidth with a discrete sequence of samples. However, this theorem only applies to a specific class of mathematical functions. In practice, as a rule of thumb, N>10 should be considered to achieve suitable simulation results.
Critical operating points for different time-varying elements are presented below. Please note that these expressions should be used as guidelines when deciding on operating ranges of time-varying elements. They are proposed having in mind both the stability of the system, as well as the advised resolution of simulation result (as mentioned in the paragraph above). Increasing (or decreasing) the values of these elements beyond the advised values doesn’t have to result in an AO immediately, but AO is likely to occur with a further change of values.
Time-varying element | Critical operating point |
Variable resistor | |
Variable inductor | |
Variable capacitor |
Where:
Tss - Simulation time step.
Additionally, parameters beyond the variable component itself should also be considered, such as the frequency of the system and the influence of other passive elements for larger circuits.
A good practice would be to limit these components in the modeling stage using the Limit component, which should prevent any eventual occurrences of AO.
Nonlinear inductor. As is the case for time-varying elements, AO is likely to occur when the time constant of the circuit is smaller than the simulation step. The non-linear inductor (like time-varying elements) comes with its own critical operating point in relation to the time constant. The normal operating range defined by current and inductance/flux should be determined in such a way that these values are a compromise between model stability and their sensibility from an electrical standpoint in the context of the circuit.
TLM Coupling. TLM couplings can cause an AO, particularly in cases where Trapezoidal and especially Euler discretization methods are used. AO is known to occur for large values of Inductance when using the Inductive coupling type. On the other hand, AO is known to occur for small values of capacitance when using the Capacitive coupling type. In situations where there is no need to use these methods, it is recommended to use Exact or Bilinear discretization methods instead.
High execution rate. Setting values of Signal Processing Execution Rates in DER components much larger than their default values can cause AO. This applies to both Legacy and Generic components. For such large execution rates, the control algorithm inside of the components cannot provide stable operation, which leads to numerical collapse, and can lead to AO. The set execution rate must have the same order of magnitude as its default value. If the value of this execution rate is much larger than the default one, significant oscillations and erroneous behavior will occur. On the other hand, for values much smaller than the default one, a Computing Interval Overrun (CIO) flag will be raised.
Signal processing. Sometimes, the signal processing part of the model can be a direct or an indirect cause of AO.
Directly, a pure Signal processing model will not cause an AO flag to be raised on a real HIL device. Instead, the following although a Data Validation warning will be raised with information that Inf values are detected in the simulation:
Additionally, an appropriate Exception (EXC) flag might raise. Let's consider the case when a Signal processing model includes division by zero. In this case, the following exception will appear:
Indirectly, values from Signal Processing can propagate through the electrical part of the system through certain components (for example, signal-controlled sources). An example of an AO flag of this type that can occur is when the signal processing part includes division by zero. In this case, in addition to the Exception shown above, the AO flag will also raise.
In some cases, an undefined variable in the C block can also cause propagation of exceptionally large values from the Signal Processing part into the electrical part of the model and cause an AO.
Troubleshooting multiple causes of AO
The SCADA returns the general AO flag. If the model contains a combination of the above-mentioned causes, it is difficult to pinpoint. For example, you might have solved the coupling stability issue and the compiler reports that all couplings are stable. However, on simulation start you still experience AO. Only later you may find out that the source of instability is also in your machine's snubber parametrization.
There is a System component called the HIL Flags Status that can differentiate between the SPC (core coupling) and the machine AO, which may assist you with troubleshooting.
Since it is a Signal Processing component you can use its outputs to design some logic that can actively handle the model in case of AO.