Posted on 28 May 2019

Rapidly Design, Prototype, and Test your DSP Controller with PSIM and Typhoon HIL

Free Bodo's Power Magazines!




By Ivan Celanovic and Nikola Celanovic Typhoon HIL Inc., USA; Hua Jin, Powersim, Inc, USA and Simone Castellan, University of Trieste, Italy

The growing complexity of power electronics (PE) systems, intensifying competition, rapidly shrinking product development cycles, and exploding test and quality assurance costs are forcing power electronics industry to accelerate the adoption of advanced tools for design, test, and verification. This trend is particularly evident in power electronics embedded control software whose size, complexity and importance is rapidly increasing. This is only to be expected because power electronics control software:

  • Provides large value added to the product via increased functionality and new features;
  • Provides an opportunity to quickly develop new products based on existing hardware platforms; (i.e. using solar inverter power hardware for grid storage power hardware)
  • Provides the opportunity for newcomers to offer competitive solutions in different verticals thanks to the availability of modularized hardware.

If automotive industry can be taken as an indication of how the power electronics is going to develop, we should brace ourselves for a software dominated power electronics. For example, today’s car has between 20 and 70 processors with 100 million lines of embedded code amounting to approximately 1GByte of embedded code [1]. Less than 20 years ago cars had one or no processors. Testing automotive embedded software then was much simpler. Manual testing was acceptable, as it is still the standard practice in most of the power electronics industry today. But times are rapidly changing.

In addition, power electronics industry is currently undergoing a power semiconductor revolution with the development of new wide-bandgap semiconductor devices, i.e. SiC, GaN, which are imposing more demanding design requirement specifications for controllers which in turn require a new set of tools for automated design, test, and verification.

Product Development Process

Here we propose a model based process for power electronics embedded controller development - described with “V diagram” - as shown in Figure 1.

Power electronics model based design process depicted with “V diagram”

A new design project starts with high level specification and system level models with high level of abstraction. Once the system level model is simulated and performance is satisfactory, design seamlessly moves on to rapid prototyping (via automatic code generation) to hardware-in-the-loop (HIL) system with the rapid control prototyping hardware. After this step, design moves to control code targeting, production of the final code for the final controller platform - followed with testing of the final controller on the HIL. In the final development stage, controller is interfaced with real converter and tested in the laboratory, only this time in only a limited number of operating points, just what is needed to verify the power and controller hardware. Depending on applications, some converters will be further tested in large system configuration, such as parallel converter configuration, micro-grid configuration or similar. This last step can also be done in both HIL and real hardware setups.

The key in this new, agile control development process is to be able to test after each step, and to test relentlessly. Testing after each step eliminates design problems early on in the process without waiting for the bugs to surface late in the design or deployment stage of the product. Indeed, model based design process where we can design and test each step of the way, as shown in Figure 1, shortens the design cycle, improves the controller quality and saves money. Furthermore, unified model based design tool chain will enable streamlined and efficient communication of design specification from the design phase all the way to product deployment across boundaries of the hardware, controls, software, and test departments.

The offline simulator PSIM and the Typhoon Hardware-in-the-Loop (HIL) real-time simulator, with their unique and dedicated focus on power electronics applications, provide the ideal toolset for the model based design process.

Design and Simulation

The key for shortening the design cycle (narrowing the “V” curve) in model based design is to begin with the embedded controller code development as early in the design cycle as possible and to start testing it as early as possible. The PSIM offline simulator enables engineers to simulate the power stage and the controller independent from the power and control hardware [2]. Another advantage of model based design is the code reuse and model reuse from previous designs. In addition, PSIM offers a variety of control design tools to help designers quickly evaluate and tune control algorithm. One example is the frequency response analysis to measure transfer functions of open loop or closed loop systems. This enables design engineers to evaluate performance, test the robustness, and check the feasibility of requirement specification early in the design phase.

Rapid prototyping: Typhoon HIL + DSP Interface Board + PSIM Auto Coder

After the design was simulated against various operating scenarios and the control algorithm optimized and fine tuned to meet the design specification, the control model is ready for rapid prototyping on a platform that interfaces with the real-time hardware-in-theloop simulator.

Power electronics model based controller design and testing workflow starts with offl ine simulation in PSIM

Figure 2 shows the work flow of the rapid prototyping process. From the PSIM graphical representation of the control algorithm the control code is generated automatically and downloaded to the DSP located on the TI Controller Card which resides on the Typhoon HIL DSP Interface Board which is then connected to the HIL machine. The power stage is then compiled in the Typhoon HIL compiler to run on the HIL machine in real time. The result is rapid development of the executable specification of controller and power hardware, independent from the control and power hardware.

Automated HIL Testing

Owing to its ultra-high fidelity, and test automation features, Typhoon HIL system enables excellent test coverage, including fault conditions, of the final control software that is fast, affordable and repeatable [3]. Ultra-high fidelity of the Typhoon HIL system enables the most realistic controller testing environment short of real converter setup. Such testing allows unsupervised verification of the controller performance in all operating points (including hardware faults), at a rate that is at least three orders of magnitude higher than what can be achieved by manual testing.

User Case: Grid-Connected Inverter Design

The model based design process was demonstrated in a user case study. In a project by University of Padova and University of Trieste, Italy, a team of researchers were to develop controller for a battery charger that can also supply grid with reactive power.

The basic control concept was first developed and implemented in PSIM. Using PSIM’s SimCoder Module and F2833x Target, DSP related elements, such as ADC and PWM, were added to the schematic. After the system is fully tested and simulated, DSP code was automatically generated and loaded to the TI DSP connected to Typhoon HIL600 emulator via the Typhoon HIL DSP Interface Board. The power stage of the system was created in Typhoon’s schematic editor, and a model for the power stage was compiled and uploaded to HIL600. A PSIM and Typhoon HIL setup, shown in Figure 3, depicts the computer that runs both PSIM and the Typhoon HIL software and is connected to both the DSP Interface Board and the Typhoon HIL600 emulator.

Full design, simulation, prototyping, testing, and verification of the controller is done from the comfort of the engineer´s desk

In a very short time, all the voltage and current loops were closed, and the control code was running with the power stage emulated in real-time in the hardware-in-the-loop setup.The team was able to focus on test scenarios that are very difficult to do in the real laboratory such as the investigation of the operation in the presence of grid voltage harmonics, unbalanced grid voltage, and load unbalance. The ease with which one can generate various grid conditions in the HIL and the write scripts to automate such tests is starting a new chapter in the history of power electronics controller software development and quality assurance.

Schematic diagram of reactive power compensator simulated in real-time with 1μs time step

Figure 4 shows the schematic diagram of the grid connected inverter power stage in Typhoon HIL Schematic Editor and HIL real-time waveforms . Waveforms show that, even with grid voltage unbalance and harmonics, the proposed controller can keep the grid voltage and current in phase, achieving reactive power compensation.

New Control Design Paradigm

The combination of the offline simulator PSIM and its auto code generation capability, coupled with the Typhoon HIL real-time emulator, offers a significant advantage in the design, analysis, and testing of the overall power electronics system. It allows the control algorithm, control hardware, and power stage to be developed independently of each other.

There is no doubt that the field of power electronics need both hardware verification and at the same time good coverage of operating points. Because the hardware used to be demanding enough in its own right, typically the software received reduced attention which resulted in high quality cost and field problems. Fortunately, there is now the PSIM-Typhoon tool set available that makes it possible to design, test, and verify power electronics control software in a systematic, process driven and repeatable way laying the foundation for rapid development of new and improved power electronics solutions.

[1] Ebert, C.; Jones, C., “Embedded Software: Facts, Figures, and Future,” Computer, vol.42, no.4, pp.42,52, April 2009
[2] PSIM User Manual,
[3] Typhool HIL User Manual,


VN:F [1.9.17_1161]
Rating: 0.0/6 (0 votes cast)

This post was written by:

- who has written 791 posts on PowerGuru - Power Electronics Information Portal.

Contact the author

Leave a Response

You must be logged in to post a comment.