Frequently Asked Question

2) What are the differences between offline and real-time simulation?
Last Updated about a month ago

Typhoon HIL is the market leader in high-fidelity hardware-in-the-loop (HIL) testing solutions. In the HIL framework, a typical testbed can be divided into two main layers: a virtual layer, where part of the system is emulated, and a real layer, comprised of the real devices under test, including their hardware, firmware, and software components.

For example, when testing real controllers, we have what is called controller-HIL (C-HIL) testing. Figure 1 illustrates this concept with a power electronics converter connected to a microgrid and its associated controller. On the left side, we see a representation of the real system, which includes the actual plant and controller(s). On the right side, we see the C-HIL testing setup, where the real controller(s) interface with a simulator that emulates the plant in real-time.

Figure 1. Illustration of a typical controller-HIL (C-HIL) testing system.


In the C-HIL setup, the simulation must provide high-fidelity results in real-time to enable the real controller to operate seamlessly as if it were connected to the real plant. This requires a proper signal interface and presents significant challenges for the simulator, which must respond accurately to the highly dynamic inputs from the controllers in a deterministic way. To achieve this, real-time simulators operate with fixed simulation steps typically ranging from 250 ns to 1 μs, translating to a strictly limited computation time available for each step. This necessitates a dedicated platform with high processing capability and ultra-low latency. Additionally, there is no time for numerical solvers with iterative solution methods, requiring optimized modeling approaches with specialized features and components.

Typhoon HIL overcomes these challenges for demanding applications thanks to high performance and industry-proven advanced capabilities, including our lineup of FPGA-based multi-core real-time simulators and a dedicated toolchain with unparallel ease of use. 

On the other hand, the design phase and early-stage testing in both industry and academia often prioritize flexibility and integration capabilities when building models, as well as affordability, over high-fidelity HIL testing. To address this need and maximize the benefits of model-based engineering early on with genuine model continuity, Typhoon HIL launched TyphoonSim, our true offline simulator.

In comparison to Figure 1 and the C-HIL testing scenario, the offline simulation concept can be illustrated by Figure 2.

Figure 2. Illustration of an offline simulation.

In this setup, both the plant and controller(s) are simulated, eliminating the need for real-time simulation and easing many of the challenges mentioned earlier. For instance, offline simulation can run on a regular PC, with the simulation runtime (i.e. the time it takes to run the simulation) depending on the PC’s performance and specifications. Additionally, the simulation step can be variable, dynamically adjusted during runtime according to user-defined convergence error tolerances, and iterative numerical solvers can be employed. Consequently, although the results are not available in real-time and the testing of real system components is not viable due to the lack of a hardware interface, there is a significant increase in flexibility and affordability, which is ideal for the design phase, early testing, and educational purposes.

In summary, the key points are:

Real-time Simulation:

  • Purpose: Used for high-fidelity hardware-in-the-loop (HIL) testing.
  • Setup: Involves a real controller interfacing with a simulator that emulates the plant in real-time (C-HIL).
  • Operation: Requires fixed simulation steps, high processing capability, and ultra-low latency to provide deterministic responses. Optimized modeling approaches with specialized features are necessary.
  • Hardware: Requires a dedicated platform with high-performance simulator.
  • Application: Suitable for scenarios where real-time interaction and high-fidelity results are critical, typical requirements of the testing phase.

Offline Simulation (TyphoonSim):

  • Purpose: Ideal for design and early-stage testing in both industry and academia, focusing on flexibility.
  • Setup: Both the plant and controllers are simulated, eliminating the need for real-time operation.
  • Operation: Allows variable simulation steps adjusted dynamically, and the use of iterative numerical solvers. Runs on a regular PC with the simulation runtime varying according to the PC’s performance.
  • Hardware: Can be performed on standard PCs, providing a cost-effective solution.
  • Application: Suitable for the design phase, early testing, and educational purposes where real-time results and hardware testing are not yet required.

Please Wait!

Please wait... it will take a second!