Are you new to HIL Testing Electric Drives?


Find out all you need to know about the key challenges and solutions to motor drives software development and testing.


Fill out the form below to download your exclusive copy of this page (with bonus content) to take offline.
1. Introduction to HIL Testing of Electric Drives
2. Challenges to HIL Testing Motor Drives Controls​
3. Model-based Software Development and C-HIL
4. Typhoon HIL Integration with Third-Party Design Tools​
5. 4th Gen HIL404: Built for Advanced Motor Drives
6. Empower
BONUS CONTENT: ABB MV Drives and Indrivetec DFIM Case Studies



Let’s Get Started. Why do you need HIL to design and test Electric Drives?

Electric Motor drives are accelerating


As electric motor drives continue to increase in performance and functionality, motor drives manufacturers are struggling to keep existing product lines relevant.


There is pressure to reduce: 1) development cost, 2) lifecycle maintenance costs, and 3) time to market to stay competitive.

Enabling OEMs and system integrators to simplify and speed up motor drives design and testing have never been more important. From electric vehicles and electric trains, all the way to wind turbines and industrial automation, electric motor drives are accelerating the global shift to efficient and sustainable energy systems.


Percentage of embedded projects behind schedule

Fig. 1. Published in “HIL TESTED Powerful Performance, Functionality, and Quality from Model-Based Testing,” 2019 VDC Research

To design and test motor drive embedded controllers, as control software size and functionality is ballooning, Hardware-in-the-Loop (HIL) and model-based design practices are becoming critically important.


HIL testing (and MIL/SIL/HIL model-based software testing in general) helps design and validate embedded software (e.g. industrial drives software, automotive ECUs software, wind turbine software etc.) using simulation to 1) shorten test time, 2) reduce cost of testing, 3) improve test coverage (especially for test cases that are difficult to recreate in the lab including a variety of fault conditions), 4) improve repeatability, and 5) improve overall software quality.


Benefits of Mode-based Software Testing with HIL

Fig. 2. Published in “HIL TESTED Powerful Performance, Functionality, and Quality from Model-Based Testing,” 2019 VDC Research

Motor drives for industrial applications


The 4th Industrial revolution is transforming motor drives into intelligent and rapidly evolving edge devices with formidable computational power.


As software is emerging as a key differentiator and value generator for Variable Frequency Drives (VFD) manufacturers, new use cases and value generation streams are opening for both OEMs and operators. Indeed, the 4th Industrial Revolution (or Industry 4.0 or Industrial IoT) is transforming motor drives into intelligent and rapidly evolving edge devices with formidable computational power, thus enabling:

  • Advanced sensing, extensive data analytics, and cloud interfaces
  • Machine learning and AI computation
  • Seamless external sensor connectivity
  • Communication gateway capability (drives connectivity w/ cloud, sensors, neighboring drives etc.)


In addition to data-driven process optimization services, advanced variable frequency drives create extra value from their enhanced software features by improving:

  • Interoperability (both with other drives and with industrial processes)
  • Ease of use and versatility, including ease of system integration
  • Situational awareness
  • Performance and fault prediction functionality.


Industrial IoT opens a vast new field of opportunities but also challenges for VFD manufacturers. It brings challenges such as the need for rapid adoption of advanced software development tools and practices due to:

  • Shrinking time to market requirements
  • Limited development budgets
  • Shortage of engineering talent


High-performance drive controllers today have around 200,000 standard lines of code (SLOC)—which is a little bit more than software size of a typical pacemaker or approximately one half of the Space Shuttle’s control software size. Most VFD’s will operate networked with 10’s or 100’s of drives (from same or diverse manufacturers) and sensors.

These industrial networks with 100s of drives, sensors, and process controllers easily exceed the total control code size of ~20M SLOC’s that becomes comparable to the Boeing 787 control software size.

This control code complexity, especially if we consider cybersecurity requirements, requires fully automated model-based control software testing and verification processes. Naturally, advanced software requires disciplined, state of the art, model-based testing and lifecycle maintenance processes.

Hence the use of model-based software development and Hardware-in-the-Loop (HIL) testing becomes paramount to guarantee control software quality, seamless interoperability while managing cost and complexity.

Motor drives for Electric Vehicles (EV)


The quest for integrated, efficient, lightweight, compact, and reliable motor drive is paramount for all EVs.


HIL testing is used to test and validate embedded software for automotive electronic control units (ECUs) which enables:

  • Testing to start early and progress during the whole design cycle, from MIL to SIL to C-HIL.
  • Increased test coverage, especially for faults and test cases that are hard or impossible to replicate and repeat in the lab or in the field.
  • Ensure the reliability of rapidly evolving EV and ADAS/Active safety systems.
  • Testing connectivity and interdependence between sub-systems as they jointly contribute to key vehicle performance and safety.


Motor drives for Trains


From lightweight city trains to high speed trains, new motor drives are pushing the envelope of efficiency, reliability, comfort, and weight reduction.


Variable frequency drives are the main workhorse behind electrification of railway transportation. The key drivers for continued improvements of electric drives are:

  • Reduced noise level: to increase passenger comfort and minimize noise for communities living next to tracks.
  • Efficiency improvements: to reduce lifecycle energy consumption of the train.
  • Compact and lightweight design: to produce structurally sound trains with ever decreasing weight.
  • Improving reliability: guarantee passenger safety and minimize unplanned maintenance and service disruption.
  • Lifecycle maintenance reduction: to streamline maintenance work and reduce cost of operation.


Design Challenges


A lot is at stake. What are the key motor drive software development challenges?

HIL Testing Variable Speed Drives


Advanced control software requires state-of-the-art model-based testing and lifecycle maintenance processes.


VFD Design Challenges Context

Traditionally, motor drive controllers were compact embedded devices comprising of a fast controller (cascaded type comprising modulator and current/torque/speed/position loops) and a fieldbus communication unit, both implemented on a bare metal DSP processor microcontroller often combined with a CPLD or FPGA .

Today, motor drives are undergoing similar transformation that cars have undergone over the past decade. They have become literally “supercomputers” on wheels while the complexity of automotive software have increased more than 10 times in a decade.

Driven by new applications and fueled by advanced Finite Element Analysis (FEA) software tools, such as JMAG FEA, new and enhanced electric motor designs are constantly developed. These new designs require new and improved control algorithms that encompass control of both existing motor types/designs and new ones.

Faster embedded processors enable executing more complex and more demanding fault detection and isolation algorithms that were not computationally feasible until recently.


The 6 key Challenges to designing and testing VSDs:
1. Control Software is becoming a key value generator

Adding new software functionality is an opportunity for product differentiation and value generation without the need for long design cycles that are the hallmark of industrial drives development. It is a great opportunity for VFD product differentiation and new value generation. Today, the core drive control functionality is vastly expanded with:

  • Industrial Ethernet and wireless communication
  • Predictive diagnostics,
  • Fault detection and isolation
  • Data analytics,
  • Machine learning
  • Process safety and optimization functions.


2. Need for new control algorithm developments

Although control of motor drives is considered mature, there is a constant push for new algorithm developments driven by:

  • Support for new types of electric motors
  • Deployment of new computationally demanding control algorithms (e.g. Model Predictive Control or MPC)
  • Better fault detection, isolation, and runtime adaptation
  • New semiconductor switches (e.g. wide-bandgap SiC and GaN devices) with faster switching capability
  • New or existing topologies that better leverage semiconductor features.


Wide-bandgap devices can operate at much higher switching frequencies and require different control strategies including faster execution rates. Also, multilevel topologies when used with wide-bandgap or silicon devices can deliver improved efficiency, performance, and smaller size and weight.


3. System level interoperability requirements

High-performance drive controllers need to interface with process level controllers and to communicate with cloud applications without a glitch. Today the most prevalent communication standards are Industrial Ethernet (IE) protocols that provide determinism and control such as:

  • EtherCAT
  • EtherNet/IP
  • Powerlink
  • Modbus TCP.


4. Modular and Flexible VFD Design

Most VFD’s are designed in a modular fashion in order to cover wider range of power levels and performance requirements. VFD controllers must guarantee seamless operation for any given drive configuration and ensure stability and performance for all electric motor types and all load types under any operating condition. The motor drives configurations can include:

  • Input stage can be configured using either passive front end or active front end modules.
  • Power can be adjusted by paralleling multiple modules.
  • DC link capacitor bank can be flexibly configured depending on the application.
  • Inverter modules can be paralleled to increase the output power level.


Testing controller software for all configurations and under all operating conditions (including faults) can only be done efficiently using test automation coupled with C-HIL real-time simulation approach.


5. Grid Code Compliance

Today’s MV and HV drives must meet more stringent power quality and grid codes:

  • Current/voltage distortion
  • Power factor
  • Flicker control
  • Power quality
  • Grid fault performance


Testing against different grid codes that are constantly evolving can be a daunting and expensive quality assurance task unless testing is automated with a model-based HIL approach.


6. Control Lifecycle Maintenance Cost and Complexity

Drives manufacturers today are also facing massive challenges related to control lifecycle maintenance cost and complexity due to an expanding variety of products lines resulting in the need for:

  • Management of all software/firmware updates
  • Upgrades across the product lifecycle
  • Infrastructure for remote deployment of software and firmware updates
  • Improving complex control algorithms with each update


At the same time, vendors are under relentless pressure to lower the cost and achieve results with ever shrinking engineering teams.

These orthogonal requirements can only be met through adoption of the state-of-the-art tools and processes from the software industry. For such tools to be effective, test rigs must be reallocated from physical laboratories to HIL environment. Only then, software test automation and life cycle processes can really bring value.

HIL Testing Drives with Induction Machines


Industrial Drives are often complex systems with several components from different vendors that need to be integrated.


When commissioning such systems, you want to avoid surprises on-site and test all functionalities before commissioning such as drive control, process control, fault scenarios, protective functions, control tuning, and robustness.


Complexity and Risk

For drives with induction machines, grid faults are one of the major challenges because the motor is directly coupled with the grid. The motor drive controls need to be designed and tested for optimal performance considering real operational conditions: thermal losses, switching delays, and various fault scenarios such as low-voltage ride through (LVRT). It can also be demanding for converter manufacturers to develop and validate complex controls functionalities including process control, protective functions, control tuning and robustness.


For drives with induction machines, grid faults are one of the major challenges because the motor is directly coupled to the grid and all grid disturbances are immediately reaching through to the power electronic devices with potentially destructive effects.

Andreas Dittrich, Owner and CEO of Enerdrive GmbH
Accurate Models for Thermal and Switching Loss Calculation

Among the biggest challenges for motor drives is designing and testing the adequate cooling system. There is only one way to prevent semiconductor overload: loads and thermal losses need to be well shared among all semiconductors within the system. This requires the use of precise models for thermal loss calculation. Cost-effective design is achieved by properly sharing the load of the thermal losses in semiconductors and by building the correct cooling system for the whole converter.


The reliability of the models was very important to us.

Aiko Classe, Senior Software engineer at ConverterTec Gmbh
Simulating Grid Faults

Recreating test scenarios with real equipment and power hardware can potentially have destructive effects. Transient currents, for example, are multiple times the rated current of the motor. This means that during the design process, you must find and limit the stress on power semiconductors and protection circuits which is used to dissipate energy when the machine slows or shuts down.  After the design, you need to test the components accordingly and verify protection mechanisms.

Meeting Customer Demands

While customer acceptance tests cover the basic functionality testing, standards compliance tests are more complex, as they are specific to the customer and local market demands. These tests are done to ensure product quality and guarantee reliable operation in the customers’ environment. Such testing is very demanding due to a high variability in environments in different countries.


C-HIL for Drives


Dive deeper. What is Model-based Software Development with C-HIL?

Model-based Software Development with C-HIL


C-HIL provides comprehensive software testing. Most of the tests can be classified in following categories: functional testing, performance testing, interoperability, grid disturbances, protection, fault injection.


Model-based software development has been a widely accepted practice in the automotive industry, motivated by the software’s safety critical nature and the need for the development and testing process to comply with the ISO 26262 standard. With the availability of accurate physical plant models (e.g. motor drive), software testing can start early in the development process, allowing you to discover and fix problems as soon as they arise.

Hardware-in-the-Loop testing and model-based design and testing practices helps:

  • Validate embedded software (e.g. drives software, automotive ECUs software, wind turbine software etc.) using simulation to shorten test time
  • Reduce cost of testing
  • Improve test coverage (especially for test cases that are difficult to recreate in the lab including a variety of fault conditions)
  • Improve overall software quality


Fig. 3. A comparison of test fidelity and test coverage between different testing methodologies.



A model-based software development, workflow usually goes through these successive software development stages:

  1. Model-in-the-Loop (MIL)
  2. Software-in-the-Loop (SIL)
  3. Controller Hardware-in-the-Loop (C-HIL)


Maintaining the same high-fidelity model across design and test stages, from MIL to C-HIL, has been the holy grail of model testing. However, for motor drives and power electronics, this has not been possible until ultra-high fidelity HIL simulations were introduced by Typhoon HIL.

Ultra-high fidelity, real-time simulation in Typhoon now enables software developers to use the same models with the same level of fidelity for design, testing, and system integration. Now, complete software design and testing can be done in Typhoon HIL, from MIL to SIL and all the way to C-HIL.

Fig. 4. A comparison in the coverage span of V-curve stages between different testing methodologies.



System integration with C-HIL


C-HIL enables a fully automated testing of drives controls software for various motor configurations in real-time.


Using C-HIL, you can test the real unmodified controller with its real hardware, software, and firmware. So the controller under test can not ‘feel’ any difference whether it is controlling a real motor drive or an ultra-high fidelity real-time simulation. It receives current/voltage signals, temperature signals and position sensor signals from the real-time HIL simulator and sends the gate drive signals back to the real-time HIL simulator.

 It was very easy to integrate our solution into the overall system real-time simulati

Pieder Joerg, Senior Drives Expert at ABB Switzerland

Fig. 5. The diversity of testing possibilities with C-HIL



Compared to lab testing, there is no concern for damaging equipment, test coverage is orders of magnitude higher, and you can automate software regression testing. It gives you the highest test coverage paired with a very high testing fidelity.

C-HIL enables our drives customers to expand control testing coverage beyond what was possible in the test lab environment, at a fraction of the cost:

  • More than 1000 test runs per SW build
  • Orders of magnitude lower cost per test run
  • Rapid incorporation of system integration issues into test processes


VFD Functional Testing Taxonomy



VFD Performance Testing Taxonomy


Automate Motor Drives Controls Testing


Define tests early based on requirements and run them from the very beginning of the development process.


Typhoon HIL provides an integrated test automation software environment called TyphoonTest which is coupled with the flexibility of open-source testing and Python library ecosystem. With a Pytest framework, TyphoonTest makes it easy to write small tests, yet scales to support complex functional testing for applications and libraries.

Write and run automated tests in the easiest way possible.

The TyphoonTest library is supported by TyphoonTest IDE and makes test automation a simple and efficient task. Use the intuitive graphical user interface to create tests scenarios, capture signals, apply transformations and analyze your data. Then run them with a click of a button and follow the test progress in real-time.

Fig. 6. The TyphoonTest framework with Python and Allure reporting.


Here are examples of domain-specific TyphoonTest library functions:

  • Window_rms
  • Frequency_content
  • THD
  • Transformations (Symmetrical Components, Alpha-beta-gamma/dq0)



Test automation is becoming more and more important due to the significantly higher complexity of the devices.

Dr. Stephan Engelhardt, Principal System Engineer Woodward/ConverterTec

Fig. 7. The TyphoonTest flowchart with HIL SCADA, Typhoon Test, and CI tools

Moreover, with TyphoonTest IDE, coding is reduced to an absolute minimum. Just drag and drop a function to your script and parametrize it using the template. You can also use the wizard to create test scripts in an interactive way.

TyphoonTest also includes several additional basic and industrial premium toolboxes that are built-in to help accelerate your testing procedures. These include communication protocols (i.e. Modbus, CANbus, IEEE C37.118), certification testing (i.e. BDEW, UL1741, PV MPPT) and an expert power electronics toolbox:

We can test more and much faster.

Aiko Classe, Senior Software engineer at ConverterTec GmbH

System Integration


No need to start from scratch. Integration with Third-Party Design tools.

JMAG-Typhoon HIL Integration

High-Fidelity machine models from JMAG RT are imported into HIL and simulated in real-time.


JMAG-Typhoon HIL integration now enables EV software developers to have the same fidelity level plant model across MIL/SIL and HIL. Indeed, model continuity is maintained across the whole software development workflow using high-fidelity machine models generated from the Finite Element Model.

This dramatically improves testing efficiency and effectiveness, and communication between hardware and control design teams. Model-based design and testing successfully streamlines the product development processes, improves project schedule performance, and reduces the number of software defects.

The high-fidelity FEA motor model is as close of a representation of an actual physical motor as it gets. You can extract and import a look-up table of your model’s lumped circuit parameters directly into the Typhoon HIL Software Toolchain with one click.

Fig. 8. Methods for creating the JMAG RT model


Then, we simulate your motor in real time in the loop with the actual ECU (engine control unit). Motor model includes non-linear flux saturation effects, spatial harmonics, and loss data. This enables your HIL simulation to emulate the behaviors of the physical system as close as possible and lets you automate the testing of the embedded software through a wide range of scenarios and operating conditions, including faults, in a repeatable manner.

There are several ways to generate motor model data (see Fig. 1). JMAG – Designer gives you the widest options for setting up your FEA model, while JMAG – Express can help with pre-made templates. You can also use measurements or data from a library.

JMAG RT generates an RTT file in a form of a look-up table, sometimes referred to as the 1D model or lumped circuit motor model. This file can be directly imported and added to the remaining electric drive system built in the Typhoon HIL Schematic Editor.

Fig. 9. The JMAG RT modeling workflow


PSIM and Matlab-Simulink Integration


Enables direct import of power stage models and controller code via C-code or FMI/FMU model import to TyphoonTest software.


The seamless PSIM and Matlab-Simulink Integration workflow will:

  • Enable model-sharing between different design tools
  • Save time and avoid errors throughout the entire product lifecycle
  • Reduce dramatically the effort to create and maintain two separate models
  • Utilize the power of PSIM and Matlab-Simulink code generation


Previously, if users wanted to export models to the Typhoon HIL system and verify their control code in real-time, they had to redo the power stage (inverters, loads etc.) in the Typhoon environment. And that takes some time. With the PSIM and Matlab-Simulink Integration, users can directly import of power stage models and controller code into Typhoon HIL’s real-time simulator platform.


Fig. 10. JMAG RT-Typhoon HIL integration: A better way to design and test motor drives.



We put ourselves in the user’s perspective and did our best to make this integration very user-friendly.

Adrien Genic, Head of Modeling Team at Typhoon HIL





When you are ready to start testing your controller code, you can import your C-Code, DLL files or FMI/FMU Model from Matlab-Simulink directly via the interface as well. This way, you can test your real control code on your real model, with the high fidelity needed to catch problems before they happen.

The user will end up with a complete controller Hardware-in-the-Loop setup with few clicks of a button. So C-HIL is the intermediate step between pure offline simulation and testing in a power laboratory. 

Fig. 11. PSIM-Typhoon integration: from offline simulation to real-time testing


The Typhoon HIL unit is important because it is a high-fidelity system that allows you to generate proper output signals for the DSP to work with. There’s no slowdown’s or compromises.

Albert Dunford, Power Electronics Application Engineer at Powersim






Functional Mock-Up Unit (FMU) import enables import of models based on the FMI standard into the Typhoon Schematic Editor. With FMU importing, you can design and test in a real-time simulation environment. Importing models from different tools has never been easier. There is no need to redesign everything all over again in Typhoon HIL.

4th Gen HIL Advantage


Speed. Power. Built for the Most Advanced Motor Drives Applications.

HIL Testing in EV Applications


Fast switching devices in electric vehicles pose a significant challenge for real-time simulation fidelity.


High switching frequency converters, new wide-bandgap semiconductors, and new topologies are fueling the need for next generation controllers that are demanding HIL testing with ever smaller simulation time steps; faster gate drive sampling times; smaller loop-back latencies; and increasing model fidelity (including nonlinearities, spatial harmonics etc.).

The two most demanding power electronics applications for HIL testing are in the Electric Vehicle (EV) domain, namely: high performance motor drive, and battery chargers. Such applications pose a significant challenge for real time simulation fidelity.

This is especially true for high switching frequency DC-DC converter applications (e.g. Dual Active Bridge (DAB)) where power transfer is carried out at high frequencies. For some practical applications of this type, even when the time resolution enhancement methods are employed, a 500ns simulation step is simply not good enough leading to prohibitively high simulation errors.


Time resolution counts

In power electronics HIL applications, the real-time simulator time resolution plays an important role. Since real-time simulators typically employ fixed time step solvers and there is no synchronization between the simulator operation and the outputs of the connected digital controller, inadequate simulator resolution can adversely affect the simulation accuracy.

An obvious way to achieve high accuracy sampling of the controller inputs is to simply use a simulation step value that is significantly shorter (three orders of magnitude or better) than the controller switching period. However, in real-time applications where we usually cannot trade the simulation step for slower simulation rate, this is sometimes not possible.

Due to excessive computational requirements of the real-world power electronics plant models, even today’s fastest FPGA based simulators are practically limited to the triple digit nanosecond simulation steps. This means that the simulation accuracy can be significantly compromised for higher controller switching frequencies (exceeding roughly 10kHz), regardless of the plant model fidelity.


Ultra-high Fidelity Redefined


The HIL404 is an ultra fast Typhoon HIL machine with a 200ns simulation time step and 3.5ns digital input sampling.


For traditional internal combustion engine vehicles, the model fidelity of the physical subsystem is easy to maintain throughout development stages (it is relatively easy to achieve real-time simulation). However, in electric vehicles (EV), it has been challenging to obtain the required model fidelity for real-time HIL simulation.

Key Highlights of the 4th Gen HIL404 technical capabilities: 

  • 200ns simulation time step.
  • 3.5 ns digital input sampling.
  • The most accurate 100kHz Dual-active bridge (DAB) model.
  • JMAG-RT FEM machine model import.
  • HIL connectivity exploded: USB3.0, Ethernet, GB/s serial link, JTAG, General Purpose IO (GPIO)


Fig. 12. Power transfer error reduction for Dual Active Bridge (DAB)


To illustrate some of the benefits of HIL404, we did a comparative analysis of the relative power errors between the HIL402 and the HIL404 for a Dual Active Bridge (DAB) application. The model is controlled by an external open-loop controller switching at 100 kHz and with a dead time of 50ns.

Power transfer is measured and compared against the analytical model for a given phase shift. The error is mainly caused by the limited time resolution of the simulator. Here we can clearly see the benefits of the 2.5 times smaller simulation time step and higher frequency sampling provided by the HIL404.

However, HIL404 is so much more than just a faster HIL402 tuned for very-high frequency applications. It is a device that brings many advanced features of our industrial grade 6-series devices to the 4-series:

  • Nonlinear machine modeling.
  • Accurate real-time converter power losses calculation.
  • Extended connectivity with out of the box support for CAN, RS232, USB 3.0, ETH protocols, including device paralleling support.


Fig. 13. JMAG-Typhoon HIL Integration Workflow


HIL 404 supports direct import of high-fidelity JMAG-RT electric motor models directly obtained from JMAG’s Finite Element models (FEM). With one click the nonlinear and spatially varying inductance FEM derived models run in real-time with unprecedented fidelity.

In addition, HIL404 supports one click import of power semiconductor switching and conduction losses directly from datasheet look-up tables.  It has never been so easy to run high-fidelity and accurate thermal mode­ls in real-time.

By leveraging the ultra-high fidelity and ease of use of the existing Typhoon HIL solution, and by bringing the extra speed to the table, the HIL404 makes the HIL testing methodology truly applicable for the emerging high frequency power conversion applications.



Take a Test Drive. Configure your C-HIL Testbed for your specific drives project.

Start Designing and Testing


Congratulations! Now that you know everything about HIL testing electric drives, download our free Virtual HIL software or configure your HIL with exciting Typhoon toolchain features below:

Configure your C-HIL Testbed for Drives


Get a Quote
Recommended HIL

Recommended Toolbox

Recommended Interface

Recommended      Test

Any questions?

Fill out the form below to download your exclusive copy of this page (with bonus content) to take offline.


Medium Voltage Synchronous Machine Drive

HIL Model Example

Model highlights |

  • Mains Circuit Breaker controlled through Modbus
  • 3-level Active Front End Converter (switching model)
  • DC Link with a Braking Chopper, Pre-charge circuit controlled through Modbus
  • 3-level NPC Inverters drive the synchronous machines
  • Nonlinear machines with fluxes as functions of current magnitudes
  • Machine Excitation Control implemented in signal processing, current reference provided through Ethernet Variable Exchange

Get your exclusive copy of this page (with bonus content) to take offline.