Hello everyone, my name is Manuel Fedou. I'm an application engineer for electrification at Speedgoat.
In this webinar, I will present how to accelerate the development of power systems with real-time testing, from renewable energy integration to the development of onboard systems.
We will explore the following concepts:
- Real-time testing can be used to design and test control strategies and systems required for power generation, transmission, distribution, and onboard power systems.
- Real-time testing allows expediting control systems innovation for more diverse energy sources, integrating renewable technologies, smarter grids, and hybrid and electric power systems.
- You can easily transition from Simulink-based desktop simulation to real-time testing with your hardware.
We will cover the following topics: First, I will go through power system challenges and how real-time testing can help. Then, we will go through power generator development and their integration in the grid. We will explore power transmission and distribution, and we will finish with onboard power systems.
But first, let's see which challenges are common to all those power systems and why we need real-time testing.
First, real-time testing enables you to accelerate time-to-market. You can adopt a control prototyping solution, enabling rapid innovation independently from the production hardware configuration. With this test and prove new ideas and integrate new components as you change requirements. It takes you one click to build the real-time application and run it on target.
Second, with real-time testing, you can detect design flaws at the earliest possible state. Analyze and compare desktop and real-time simulations to detect design flaws in your models and algorithms. Prove concepts, inject faults, and test environmental conditions. Take advantage of signal monitoring, data logging, and parameter tuning capabilities.
Third, you can perform automated and extensive testing. Simulate physical plans to enable continuous test and integration when the actual hardware is not available. Perform an automated test in a safe environment without risks of damaging equipment or injuring operators.
Let's see how to apply these benefits to our pick of today's power systems. But what do we mean by power systems?
Power systems analysis can be seen across different domains. First power generation, developing new power generators, testing them, and testing the integration in the electric grid. Then testing power transmission, power distribution, and microgrids. Third onboard power systems, which are in many ways similar to microgrids, cover electric ships, aircraft onboard power systems, and electric vehicles. Let's look at typical market drivers for real-time testing for power generators. Power generation technology requires ever-increasing power levels, power efficiency, and greater fault tolerance to help build a more resilient power grid.
Solar or wind forms require complex control shortages and certification. Real-time testing allows to design and test control footages rapidly and test proper functioning and assess compliance of equipment before development. In an electric grid, diverse power generation technologies increase integration testing requirements for software hardware safety and security. Diverse power sources and increasing electrification of onboard power systems require smarter grids, increasing filtration power supply to the grid, and changing power needs require additional power storage management and forecasting technologies. Grid real-time simulation provides an adult tool for integration testing and to simulate and test grid resilience.
Onboard systems in automotive, aerospace, and marine domains present similar challenges to smart grids. Different types of generators need to be integrated. Power needs to be managed, and electric loads need to be controlled. Ongoing electrification, climate tent, and changing end-user requirements require a very high innovation base to remain competitive while at the same time maintaining quality levels.
With real-time testing, you can rapidly innovate, test, and prove new control ideas. Thoroughly test and automate testing of control systems with hardware-in-the-loop simulation of digital twins. This timeline represents a Model-Based Design path without iterations with the objective of showing you how controls development and testing benefit from real-time testing.
With Model-Based Design and real-time testing, you can go from early designs through all the iterations and test cases with flexible prototypes. You can use real-time simulation for rapid control prototyping or hardware-in-the-loop testing. But also other use cases such as power hardware-in-the-loop or virtual commissioning are possible.
Regardless, suppose you're trying to build an HDL simulator to test your embedded controller or rapidly prototype controls, vision, or signal processing algorithms. In that case, you can adapt your desktop model for real-time simulation testing with just a few steps. Rapid control prototyping allows you to swiftly test and iterate your control design early in the development cycle. It allows you to speed up software development, expose design flaws earlier, and shorten the time-to-market of your embedded controller.
But you need powerful and flexible hardware to be able to directly run your simulated designs and connect with your physical plant. Embedded controllers typically are not flexible enough because you cannot easily add or modify IO interfaces to deploy new designs. Also, you cannot easily monitor log or fine-tune data during real-time execution. The second key use case is hardware-in-the-loop simulation or HIL for short. HIL simulators allow you to test and validate your embedded controller versus the simulated plant running in real-time. This is a great way to reduce cost and safely test your immediate control in a reproducible and automated way in scenarios that would otherwise be hard to mimic in real life.
Another HIL setup is Power-HIL. Typical setup for Power HIL can look like this and comprises a power amplifier between a device under test (DUT) like a three-phase power part of a solar plant or energy magazine of an electric ship and the HIL simulator. Amplifiers and real-time target machines are connected through a high-bandwidth fiber-optic connection. With Power HIL, you can test your electrical component integrated on the power grid or in an onboard power system.
Now let's map these technologies with some of the challenges we mentioned for power systems. To accelerate the development of complex power systems, leverage rapid control prototyping, then thoroughly test your design against expensive, unavailable equipment to perform integration testing of components with avoiding downtimes to manage the probability between different levels of power systems control to ensure compliance with certification requirements to execute operator training and predictive maintenance, you can use hardware-in-the-loop and power hardware-in-the-loop.
Let's recap the real-time simulation and testing workflow with Speedgoat. It is made for Simulink with a vast range of protocols, built for speed, scalable and configurable, and perfectly integrated into MATLAB torching.
Perhaps you would like to integrate motor controls into your power systems with Motor Control Blockset. Auto-model power electronics, power systems, and consider Simscape Electrical. You can use Simulink Test to automate testing in real-time.
Let's now recap the Speedgoat hardware portfolio. Speedgoat provides real-time target machines for office, lab, and field use with more than 200 commercial off-the-shelf I/O modules. All real-time target machines are configured to meet simple rate IO and environmental requirements, and we support the latest MATLAB libraries.
Let's check the IO connectivity and protocol support. I'll pause for a few seconds. Whether you're prototyping control strategies or test controllers against digital twins, connectivity shouldn't be a hurdle for you. We are supporting key protocols for all industries, including, for example, DNP3 and MODBUS.
We have covered power system challenges and introduced real-time testing with Speedgoat. Let's now focus on power generation. Here are some typical use cases for real-time testing of power generators.
- For research and prototyping, you need to accelerate lab experiments and test and develop new concepts without embedded devices. For that, leverage rapid control prototyping.
- To test controllers of power generators, you can implement digital twins of multi-domain power generation systems and plug-and-play iOS to interface with sensors to emulate them. You can do that with HIL for multi-domain power generators.
- To test the integration of power generators in the grid and test compliance with critical regulations, use HIL for power systems analysis and power HIL.
We're going to go through these different use cases with examples of wind turbine development. And we start with the development of prototypes. When engineers are developing and testing new concepts, the success story of the British company Wind Technologies is a good example of how you can use rapid control prototyping for power generation.
They developed controls for brushless doubly-fed induction generators offering significant cost reductions and reliability improvement compared with conventional doubly-fed induction generators to prototype the design quickly. They used Speedgoat's real-time target machine to deploy their controls in real-time and control the generator's ability to easily and effectively transfer code from Simulink to the real-time target machine, resulting in a significant time saving over the course of the project.
Later in the development process, you will need to test the controller, which could be a PLC in the case of a wind turbine. You can take advantage of HIL for testing your power generator controller. HIL can replace prototypes or production hardware with a real-time system. It enables to automate testing more easily with tools such as Simulink Test. It is safer to test with real-time simulations than most power generator hardware which can break down dealing with very expensive and dangerous hardware. It enables you to start many design and test tasks earlier because you can test controllers even if the hardware is not available. But for that, you will need a real-time simulation of the power generator. Here the wind turbine. You can use Simulink and physical modeling tools to create a multi-domain digital twin of the generation systems.
Let's look at the multi-domain model of a wind turbine connected to the electric grid model, including an electric generator through the mechanics controls supervisor logic and agreed to model. This enables us to test a winter band controller based on the state machine's hysterically simulated model on the real-time performance machine.
Open the model in Simulink. I can go from desktop to real-time, testing what is compiled and loaded on the speed code target in one click. The external simulation starts, and we can inspect the results. That impacts the state machine and observes the state's charge admission in real-time. We're simulating the startup of a wind turbine. First, the wind turbine is parked. Then it starts accelerating, and when it reaches sufficient speed, we can generate power and connect to the grid.
Let's open the scope and look at electrical power as soon as generation is activated. Let me introduce you following user story about wind farm development from the company Hydro Quebec. Hydro Quebec engineers use Simulink and Simscape Electrical to model and simulate individual wind turbines and entire wind turbine farms. They use Simulink Coder to generate code for real-time simulations, as in our example. Modeling is essential not only for planning investments but also to detect situations that can cause an outage. With MathWorks tools, they can simulate power, electronics, mechanics, and control systems environment, and their models respond like turbines in the field.
So we focused on the power generator itself. Multi-domain physical simulation. Now let's consider the wind or solar farm from how it interacts with the power grid. Why is it so important to analyze how this device is going to affect the grid?
When dealing with interconnected systems, distributed resources are tied into an interconnected grid. Then we are dealing with non-dispatchable generation. We have viable power production depending on whether viable resources such as wind and solar. Simulating this is going to involve we have controls such as reactive power control and protection coupled to interconnection. So, we need to test the interoperability. Because the system is so interconnected, that connection needs to be regulated. We here focus on renewable generators, but for traditional, it is the same kind of challenges.
Ideas to define how the device should ask in specific cases, such as low voltage, to avoid cascaded scenarios that could result in a blackout. For example, when a bunch of devices drops at the same time. Grid codes at the boundary to such scenarios. For example, in cases where the grid voltage drops, you have standard defining. If the device must stay connected to the grid, or one in the most trip. Similar codes also apply in the frequency domain.
Let's look at grid codes commonly used in the US. For example, used for distributed energy systems. We have a voltage right through the frequency, right through code. For the voltage read through, the grid code defines for short voltage drop, the device must read through longer or stronger voltage drop. It may right through, but for an even longer or stronger voltage drop, the device must trip. Let's build a model to simulate and test all systems that are considering the system at a higher level. Here, focusing on the simulation of the devices and the grid while using Simscape Electrical specialized technologies to build the model. This is the model of the interface of the solar and wind power generators to the grid. Through are going to simulate to validate grid code compliance. In this model, we are testing an algorithm for grid code check agree with him and use some grid measurements to decide if the device should trip.
Typically, you would implement the protection and control algorithm on the production system on a real-time automation controller. You would have to test against the prototype or the physical system. We want to use a Speedgoat system to simulate the equipment in real-time in order to test the controller with him.
Let's start the simulation from Simulink directly on the target. The simulation starts, and we can inspect the results in Simulink Data Inspector on the tops we are plotting grid voltages and, on the bottom, you have generated active and reactive power, simulating the grid voltage drop first the power generator.
Will stay connected, but after some time according to the grid code to device trips from the network as defined by the mag strip condition of the grid code. Then for performing HIL testing, you would deploy the grid code check, agreed into protection relay. Add Speedgoat IO blocks to a similar model; you could use IP communication and then perform hardware-in-the-loop and test the controller.
We've covered power generators and are going to explore real-time testing of power transmission and distribution systems. Typical challenges for controls of power transmission and distribution are scheduled on this page of units under supply and demand assistance. A reliable and economical operation of microgrids with high penetration levels of intermittent generation. Bidirectional power flows at the distribution level.
The development of new voltage and frequency control techniques was the ability of controls at different levels. For that, you can use HIL. For POS systems, analysis, and power here to interest integration of devices in the power grid. This typically involved controllers and some protection devices. Real-time testing enables to test of such controllers safely. For that, we're going to emulate the grid electromagnetic, transient EMT, or phasor-based simulation performed distributed simulation on multiple cores and targets unable to test grid controllers control protection devices.
To connect the controller to the simulator with IO protocols such as EtherCAT, Modbus, we can also test power system components inside a virtual grid with power here. There are different levels of grid controls with control transients ranging from microseconds milliseconds to seconds to hours.
We can cover these different levels with our higher modules and simulation technologies. Depending on the application, you can perform phasor simulation or EMT. FPGA-based simulation enables you to test on a higher-level grid control, and management specialist simulation or more EMT simulations on the other side are useful for prediction studies and require smaller time steps. You can also combine both simulations depending on which part of the network you need to be testing.
HIL and power HIL are great tools to test flexible AC transmission fast. You can test power flow control, reactive power control, voltage control, power quality improvement, and harmonic mitigation can leverage examples from staticsynchronouscompensator.com static via ACH, potato unified Power Flow controller with phasor audited models that you can run on real-time equipment. In the case of power here you can emulate transmission to test fast devices for example. Exact same applies for have voltage direct current transmission of each VDC.
Let's look at the HVC model with all controls. We have a rectifier, inverter, primary and secondary controls, and master control. The outputs of the master control are sent via the NPS Free Master. On the other end, we have a model. We rent this loop backtest in real-time. Let's run it. And with this, we can validate the dentistry communication. We can inspect simulation results and see. That printing points are sent successfully by the master control. Controls regulate the grid voltages and currents accordingly. Here we focus on one key protocol for power systems control GMP three distributed network protocol used in the power generator and distribution industry.
Its communication between SCADA systems and remote terminal units is to use intelligent electronic devices ideas. It ensures interoperability in the electric grid and opposes you to design and test smart grid applications. In production features in politicians, which is exactly what we tested here, we support the industry master and slave. There is a nice success story for HVC transmissions. Aston Grid used motor bases and, with much love in Simulink, to model, simulate, verify, and generate code for the EDC control system that developed a simulation set conceptual flow design using simile and subscript electrical. They built a plant model that included AC Grid Connection Transformers and loads to verify the control design and plan model functionality. They want closed-loop simulations in Simulink. Next, they refined control algorithms in preparation for deployment to a real-time target.
OK, now let's move to a real-time simulation of distribution networks. We can consider an example of the IEEE European low voltage test feeders. Having the following attributes. Simulation results over one day period and static power flow calculation results. This network can be simulated using a phased approach, the goal being here to test the high-level grid controller device. This network can be first simulated on a desktop. Seems to keep electrical compares very favorably in benchmark testing. Layouts can be represented using a MATLAB graph. Function segmentation is calculated. Using tools from graph theory. Then we can model the system in Simulink. Here what we're going to show is explicit partitioning. We use model referencing to split the network into different regions that will run on separate cores; segmentation and multicore execution allows us to scale up the simulation. Segmenting the model introduces algebraic groups, which must be broken. This means that there will be some small transients introduced into a segmented system response compared to the full model can, however, mitigate this effect.
Next, we use MATLAB scripts to automatically build the network. We are not going to build these huge models per hand. IEEE network data are parsed by MATLAB scripts that generate the Simulink model.
Here you can see a visual demonstration of how such a network can be built.
For explicit partitioning, we define how concurrent execution will be setup on the target by the different tasks. Then, we build the real-time application. We generate C-code from the Simulink and Simscape electrical network and build the model to run on the real-time target.
Because of the size of the network, this requires several minutes, using distributed computing for generating code from the different referenced models. At the end, an application file is generated which can be used to deploy to a target.
Now we can deploy the real time application to the target connected to the computer from MATLAB command line. We connect to the target, load the application and start the real-time simulation from MATLAB. Let’s open the SDI where simulation results are streamed. We can observe the results of the phasor simulation and inspect different voltages and currents. In our case, the simulation is setup to have a change in the load parameters every 0.6 seconds.
We can measure task execution and validate the multicore execution of the model. We still use the same application and target object. We first enable profiling, then run simulation on target for a couple of seconds and retrieve profiling data from the target. Let’s open profiler results. We can check task execution time and how tasks were distributed on the different cores.
As a result, we see that the tasks execution time is very well distributed on the four targets.
Distributed simulation allows us to reach a sample time of 4 milliseconds which could not be reached without multicore simulation. For simulating bigger networks, we can distribute the simulation on multiple targets.
To summarize, you can scale up grid simulations with Multicore and multi target execution and use low latency interfaces such as aurora or shared memory. When choosing a solution for multi-target timing and synchronization, you need to consider
- the distance between the individual system components, ...
- the requirements on timing accuracy, …
- and what types of interfaces are available or preferred.
Speedgoat offers support for common timing protocols like PTP or IRIG for local devices and connections to third-party devices. For long distance synchronization, a GNSS receiver can be used to receive a globally available, highly accurate clock signal from satellites. Many Speedgoat I/O modules are equipped with clock and trigger pins for synchronization. Additionally, specialized modules are available to add ultra-low latency communication.
Now we can look at a specific use case where power generation and distribution is mixed up: Microgrids
In microgrid, power generation devices are integrated in the power network. In the microgrid, we have solar panel power generation producing variable power depending on weather conditions, we have an energy storage system, and feeders. And the microgrid is connected to the distribution grid.
Here we will test a microgrid controller supporting operations such as islanding or peak shaving.
We can run the model in real-time. We are plotting in blue the energy flowing from the utility grid to the microgrid. It is negative because we are producing electrical power and delivering power to the grid.
In orange you can see power going to the energy storage system. As we are running the model in external mode. we can change setpoints on the fly. We can island the microgrid from the utility grid you see that the blue curve goes to zero. Now we can also reconnect the microgrid to the utility grid and we can introduce changes in the weather condition from clear to cloudy which affects the generated power
Let’s inspect grid currents and voltages which are affected by the islanding operation. Let’s look at the power delivered by the battery. And let’s inspect electrical power generated by the solar generator, dropping when we introduced the changes in weather conditions
Here, I would like to point out an io module supporting many different protocols that are very popular in microgrid controls. The Multi-Node Simulator -32, which can be used together with any of the Ethernet-based I/O modules from the IO75x generation. It is capable to physically simulate a high number of slave and master nodes.
It can be used for many different applications such as industrial installations, production plants, ships, wind farms, solar parks, in the power grid.
This module can be used to interface Simulink with multiple Programmable Logic Controllers (PLC), power analyzers, power converters, inverters, grid protection relays, and many other industrial equipment
There is a nice success story about DC microgrid development from the Mondragon university
Using HIL testing enabled them accelerate control development of DC power converters and helped assess DC microgrid stability under different operating conditions. They praised Speegoat HIL solution as a versatile platform to include different levels of model fidelity to assess the grid stability on different operating conditions. We can conclude this chapter on transmission and distribution, let’s move to onboard power systems.
We will cover onboard power systems for marine, aerospace and automotive applications.
Onboard power systems require detailed system level analysis. Planning of power generation is critical because some devices may require large quantity of electrical power over specific period. For that you can test controllers with hardware-in-the-loop testing. Integration of power components needs to be derisked and we need to make sure that equipment can handle faults. For that you can add power HIL. On then operators need to be trained, and maintenance of those equipment need to be supported, and for that you can use simulators as virtual commissioning platforms
All-electric ships (AES) and hybrid solutions typically include an integrated power system (IPS) connecting power sources, loads, energy storage systems, and electric propulsion modules (EPM) in a zonal electrical distribution system. The vast complexity of such marine power systems requires a thorough evaluation and validation phase and performing integration tests and simulations to guarantee the interaction of many electrical parts before building the actual ship.
We are going to explore a model of an electric ship.
In this demo, we present the hardware in the loop testing of the microgrid architecture of a fully electric ship. We will be implementing an industry reference architecture from the electric ship research and development consortium. The two-zone onboard grid will be deployed to a Speedgoat target computer at 20 kHz. Such model covers not only electrical components but also gas diesel engines, power electronics, batteries and electric motors. Actually, the microcontroller under test will be controlling a propulsion motor using field-oriented control.
With this model, we introduce AC generation and control. Each generator consists of a salient-pole synchronous machine, a GAST gas turbine and an AC1A exciter. We have an ideal AC/DC rectifier. We have modeled the motors as Permanent Magnet Synchronous machines with field-oriented control so we could evaluate a broader range of operational responses – in particular we wanted to simulate a stylized full-ahead crash-stop.
What we mean in full-ahead crash-stop is we liked to evaluate the performance of the drive during quadrant 2 regeneration. For the purposes of this example, we created a stylized piecewise linear torque-speed curve, where you can see an incursion into quadrant two. The time-period of the maneuver is condensed, so we could see the response in a reasonable time.
In the power plot, we see negative power between 18 and 20 seconds. So, we confirm that the propulsion motor module response is functionally correct for this scenario.
We can start the model on the real-time machine and inspect generator and motor power outputs. Then we can start setting up Speedgoat FPGA driver blocks to communicate between the TI board and Speedgoat target computer. We use quadrature encoder drive blocks to connect to the target and we use PWM capture block to receive PWM signals from the microcontroller. This means that we are simulating the onboard power systems together with power electronics component to add more fidelity to the modelling, and to be able to test interoperability between different level of controls.
And as the hardware design progresses, we can detail to the plant model resolution to make a whole HIL testing closer to reality. Here’s the simulation results that meet our expectation. The speed control is behaving as expected and we see double humps of PWM signals for inverter.
Like electric ships, onboard power systems for more electric aircrafts are similar to microgrids: We have
- Power Generators
- Electric Motors
- Energy storage
- Electrical distribution
Let’s consider an example model of a more electric aircraft.
- The model has the following components,
- Two Brayton Cycle Gas Turbines (gas, thermal and mechanical domains)
- Two PMSGs with FOC control (electrical and thermal domains)
- Two PMSMs with FOC control and ideal speed reference (electrical and mechanical domains)
- Two DC/DC converters
- Four PMSM actuators with average-value power converters and FOC control
I’ll open the model so that we can have a look in more detail. The Brayton-Cycle gas turbines are modeled using gas and thermal domains. As you can see here, we connect the generator to the main shaft using a constant speed drive.
On the electrical system, we drive the permanent magnet synchronous machines with field-oriented control. We then feed the modulation wave to an average-value converter, so that we can see the EMT response without harmonics. And we also have the PMSM drives for some actuators such as ailerons.
We’ll now simulate the model on the real-time platform. We load the model and start the simulation. We can inspect results in real-time in SDI. This output power curves from diverse motors and generators plotted and we will look at some specific responses more in details.
We see generator power ramps to around 250kW (negative means generated power in this case). In this scenario We are ramping the power consumed by the electric turbines and have instructed the energy management system to use battery power when the generators reach 250kW, so I am seeing expected response here – note that the ripples that you are seeing is a consequence of the actuators cycling from positive to negative angle.
Here we see the angle of the left aileron cycling from positive to negative.
This is the duty-cycle driving the left-aileron motor. If I zoom in we can see a double-hump, which is what we expect to see when using space-vector modulation.
Here we see the thermal response of phase A stator winding in both generator 1 and generator 2. Only generator 1 has active cooling, so we can see the difference in response, and confirm that the active cooling circuit is functioning as expected. In this case, the active cooling circuit is configured to regulate temperature to 60 degrees Celsius.
For the purpose of this demo, we have parameterized this system to show a thermal response in only a few seconds of simulation time.
The task profiler lets us see task-execution-time at different rates. The baserate is the electrical sample time, which is 50 microseconds. Subrate1 is the sample time associated with the gas turbines, and subrate2 is the sample time associated with the generator thermal system. There are two things to note here. First, the model sections associated with the different sample times have been distributed to different cores – this is known as implicit concurrent execution – we have explored explicit partitioning in our distribution grid demo. Second, the thermal system takes around two base rates to execute, and the gas turbines takes around 3 base rates to execute. This tells us that we would be unable to simulate the full system in real-time if we did not split the sample-times across the different model sections.
You can simulate electric vehicle onboard power systems in a similar way and combine with powertrain for full vehicle simulation. For instance, using Powertrain and Vehicle Dynamics Blocksets, you can rapidly assess electrified powertrain capabilities. These tools provide you with a great starting point to build electrical or hybrid vehicle models with well documented reference applications
One very important aspect for all onboard power systems is energy storage systems, for instance battery packs
- You can add battery pack models to simulate battery cells and generate fault scenarios.
- You can perform diagnostics on cell level, measure voltage between cell terminals.
In this example, the measured cell voltage values are fed into a driver block for the IO991 module which converts this numerical values into electrically isolated voltages, each relating to individual battery cell.
Let us conclude with a success stories on battery management systems.
Leclanché Energy Storage Solutions is developing the next generation of lithium-ion battery packs for autonomous vehicles. Being unable to properly test and verify new BMS algorithms before operation with real battery packs, Leclanché started using Speedgoat battery cell emulators for hardware in the loop testing of their BMS algorithms. Such tests required also using fault insertion and a communication protocol like CAN. They were able to thoroughly validate their BMS and state estimation algorithms; thus, reducing test time by around 50% , increasing coverage and finding bugs at an early stage.
Now we reach the end of this presentation
So, I’ll conclude with these three key points:
- MathWorks Tools together with Speedgoat provide a unified control design and testing platform for power generation, power grid and onboard power systems
- You can easily transition from Simulink-based simulation to real-time testing with your hardware
- And you can test embedded controllers and electrical power components faster
Many thanks for your attention