Accelerate Development of Electric Vehicles with Real-time Testing - MATLAB & Simulink
Video Player is loading.
Current Time 0:00
Duration 44:53
Loaded: 1.23%
Stream Type LIVE
Remaining Time 44:53
 
1x
  • Chapters
  • descriptions off, selected
  • captions off, selected
      Video length is 44:53

      Accelerate Development of Electric Vehicles with Real-time Testing

      Manuel Fedou, Speedgoat

      Overview

      This webinar will present how real-time testing accelerates innovation of automotive electrification, from electric powertrains and power management systems to high-voltage DC battery chargers. Thorough HIL testing is crucial to de-risk integration testing of electric propulsion and battery management systems.

      Highlights

      In this webinar, you will learn how to:

      • Run power electronics and electric motors on real-time CPUs or FPGAs
      • Perform HIL testing of power management systems and of battery chargers
      • Perform rapid prototyping to test and tune new powertrain controls and power management strategies designed with Simulink
      • Create real-time digital twins of electric vehicles
      • Connect real-time models to ECUs with Speedgoat IO protocols or to electrical components with power amplifiers

      About the Presenter

      Manuel Fedou is a senior application engineer for electrification at Speedgoat, Switzerland. Prior to joining Speedgoat in 2016, Manuel worked as application engineer for MathWorks in Germany and as automation project manager for Turck in Switzerland. He received a M. Sc. degree in Electrical Engineering from Supélec, France, an M.Sc. degree in Mechanical engineer from TUM in Germany. As electrification engineer at Speedgoat, Manuel is responsible for the areas of power systems, power electronics, motor control and battery management systems.

      Recorded: 2 Feb 2022

      Hello, everyone, and welcome to this webinar on how to accelerate the development of electric vehicles with real-time testing. My name is Manuel Fedou, and I am an application engineer for electrification at Speedgoat. As introduction, let's summarize how your development process can benefit from real-time simulation and testing.

      You typically want to get from an early design idea to deployment in production. The simple example, let's say you design a cruise controller for your new electric powertrain. If you developed the controller in Simulink, you can quickly iterate and test your designs against a simulated plant all performed in desktop simulation.

      But to prove your design against real dynamics, you should also test it with a real vehicle. And you can do so with real-time testing for RCP, short for Rapid Control Prototyping. From your Simulink model, you generate real-time application and deploy it to a Speedgoat target machine, which directly connects with vehicle sensors and actuators through the vehicle network analog and digital interfaces.

      Once you have tuned and verified your controls, you can use Embedded Coder to generate the embedded code for the ECU from the same controller model. Instead of proceeding immediately with physical testing using real vehicles, you front load ECU validation with hardware-in-the-loop testing and trick the ECU into believing it's controlling a real car when it is actually connected to real-time digital twin of it.

      Today, we will look at these workflows for different applications related to electric vehicles. We can list many use case areas for real-time testing of electric vehicle components. First, power electronics and motor controls require electric drives, power converters, and battery chargers. Second, energy management for battery packs and fuel cells, and third, we can list many powertrain application and domain controllers like supervisory controls and diagnostics, torque coordination, regenerative braking, and cross-domain communication.

      We're going to look at market drivers for real-time testing for these different use cases. For power electronics and motor controls, the use of wide-bandgap semiconductors is leading to higher switching frequencies and higher controlled bandwidth. Engineers must face the increasing complexity of control systems and time to market pressure. And testing the digital controller directly connected to the motor of inverter is inefficient and can damage the equipment.

      With real-time testing, you can design and test advanced controllers with a few clicks and leverage sub-microsecond sample times and switching frequencies in the megahertz range. You can perform here testing of power converter controllers faster and more safely, all while ensuring all functional safety and certification requirements. You can use electric motor emulation to safely test power inverters and electric vehicle power converters for extreme and fault conditions.

      With all that, battery modules require fault detection, cell balancing, and State-of-Charge estimation algorithms. BMS of fuel cell control firmware and front end must be tested thoroughly, including charge and discharge cycles that can take days. You can perform here testing of electric vehicle designs, automate testing of drive cycles for the normal and extreme driving conditions. You can verify, validate, and test battery management system controllers and hardware components using battery cell emulators. And you can safely test BMS under extreme and fault conditions without risking battery damage and explosion.

      Concerning powertrain application domain controllers, designing innovative electric powertrain requires advanced control design. Chassis control algorithms such as anti-lock braking, torque vectoring, and electronic stability control are critical safety features. And the most challenging physical conditions for these algorithms to operate in, such as driving on icy surfaces or with poorly loaded trailers, are also the most difficult to test.

      We use real-time testing to perform trade off studies of architecture and size key components such as the battery pack and traction motor using digital twins. Perform automated tuning and automated testing of controls and hardware components to ensure that functional, safety, and certification requirements are met. Test safety features in most challenging physical conditions with HIL.

      In this webinar we look at power electronics and motor control. For example, we will see how to perform rapid prototyping to deploy Simulink controls against real power electronics and modules. We look at battery management systems and see how to test a piece of BMS controller with a cell emulator.

      And finally, we will look at full vehicle real-time simulation from electrical powertrain to multi-domain digital twins of full vehicles. For example, we will deploy algorithms such as torque vectoring on real-time equipment coupled with real-time simulation of electric powertrain, pair automatic protocol such as CAN and couple the simulation with a 3D engine.

      But first, why do we need real-time testing for automotive electrification? Real-time testing enables you to accelerate time-to-market. You can adopt control prototyping solution enabling rapid innovation independent from the production hardware. With this, test and prove new ideas, integrate new components as you change requirements. It takes you one click to build a real-time application and run on target.

      Second, with real-time testing, you can detect design flaws at the earliest possible stage, analyze and compare desktop and real-time simulations to detect design flaws, prove concept, inject faults, and test environmental conditions, take advantage of signal monitoring, data logging, and parametric tuning capabilities. Third, you can perform automated and extensive testing, simulate physical plants to enable testing when the actual hardware is not available, perform and automate tests in a safe environment without risks of damaging equipment or injuring operators.

      A real-time simulation and testing platform simplifies your workflow, and let you design and test better controllers, and plan models faster. You can innovate, and you are not constrained by the testing environment or with the hassles of integrating solutions. Benefit from plug and play real-time solution shields you from interoperability issues. Experience the unity of simulation testing with real-time target hardware or directly from MATLAB and Simulink.

      So seamlessly integrated solution is composed of two main components. The first one is Simulink Real-Time, the solution from real-time test and simulation from within MATLAB and Simulink. It comes with several hot capabilities that allow you to easily create, control, and monitor your real-time application. And it serves as your real-time operating system.

      The second component is powerful and scalable Speedgoat return target computer hardware equipped with I/O. The real-time application created from the Simulink model runs on it together with the Simulink Real-Time operating system.

      Let's suppose you are working on a novel cruise control function for the next generation electric vehicle. You and your team have been designing, specifying, and sizing new software and hardware components based on a full vehicle simulation. The vehicle model is comprised of of both Simulink components for the vehicle controls as well as multi-domain, physical Simscape components for high fidelity simulation of the vehicle plant, including battery, electric motor, and thermal cooling systems.

      Regarding the cruise control function for instance, you may have been using this model for prediction controller performance and a set design. Next step, you may want to validate and verify the new cruise control functions for execution of the embedded controller. We start configuring the target machine in Simulink Real-Time app. Under the hood, code generation is optimized for Simulink Real-Time engine, and a fixed step solver is set.

      You can rapidly connect to the Speedgoat target computer and click on Run on Target button. This will automatically build a real-time application from your Simulink model, download, and run it on the Speedgoat target computer. The Simulink instrumentation and docking capabilities remain available for you to experiment in real-time.

      To test the new embedded controller, you also need your model to be able to interface with your embedded controller through real-time capable I/O and specific protocols. Implementing the controller interface is also very simple. With Speedgoat I/O Blockset, you can, for instance, implement communications through CAN protocol via simple drag and drop of blocks.

      There are five learnings we can draw for this example. You don't have to leave Simulink. You don't need to familiarize yourself with extra tools. Just connect to hardware with a few clicks and experiment in real-time. Switching back and forth is easy, and configuring I/O, namely the connections to your hardware, is quite smooth.

      After learning about the real-time workflow, let's go now through Speedgoat's products and services offerings to understand better what real-time system is comprised of. Each system is configured to individual requirements about performance and I/O. Changing requirements is not a problem as you can reconfigure I/O.

      You can choose from a vast range of I/O connectivity options and exchange them at a later date, or do it on target machines especially designed to work with Simulink and Simulink Real-Time not only for the current and supported releases. We also make the promise to support future releases, hardware quality, our long-term warranty and maintenance services, and true long-term operability of the real-time testing hardware.

      Delivery of each real-time system includes the real-time target machine, I/O modules configured to your needs together with accessories such as terminal boards, and cables, and the Speedgoat I/O Blockset. The Blockset library allows for connectivity to the hardware. And no matter whether you're protecting control strategies or testing controllers against your digital twins, productivity shouldn't be a hurdle for you.

      We are supporting key protocols from automotive and other industries such as CAN and FlexRay, serial protocols, PWM generation capture, and battery cell emulation. More than 200 I/O modules are available and ensure that your workflows remain uninterrupted. I/O configuration is simple. I/O and hardware of any kind is represented by Simulink blocks, placing them in your model and configuring I/O and protocols is done within Simulink.

      A very important category of I/O for high performance interfaces is FPGAs. For instance, FPGAs are vastly used for power electronics and motor control applications to generate PWM signals or emulate sensors such as encoders. Speedgoat offers two types of FPGAs, configurable ones and Simulink programmable ones.

      Configurable FPGAs allow you to use frequency I/O-- lots of protocols without FPGA programming language. There are many code modules represented by Simulink driver blocks. And you can configure your FPGA on the fly and directly from Simulink. Speedgoat provides different configuration files so that you can get the best performance out of the I/O modules for dedicated applications.

      FPGAs can also be used to schedule execution of subsystem's entire real-time application and, as said before, individual modules, or even to synchronize multiple target computers. Programmable FPGAs allow you to outsource both parts of your algorithm and signal I/O to the FPGA using the HDL Coder workflow from within Simulink. Speedgoat provides you with ready-to-program I/O you and protocol driver blocks, so it doesn't necessarily become more complicated because you can leverage and start rapidly using hardware-proven example models.

      Ultimately, you have more flexibility for your advanced use cases. Several FPGA I/O modules allow using both workflows, so it's possible to start simple with the configurable workflow and evolve to the programmable one as you go. Regardless of the workflow, Speedgoat FPGAs work like any other I/O modules and can be reconfigured.

      So we have introduced real-time control testing with Simulink and Speedgoat. Let's continue our journey in automotive electrification with power electronics and motor controllers. Electric and hybrid vehicles require electric motors, of course, but also plenty of power electronics converters such as 3-phase inverters, DC/DC converters, or AC/DC converters.

      In recent years, power electronics and motor control have been evolving fast, partly driven by the automotive electrification megatrend. At the component level, the use of wide-bandgap semiconductors is leading to more compact and efficient power converters. At the same time, this increases the bandwidth, switching frequencies of controllers from a range of tens of kilohertz to all the way to several megahertz.

      Another driving factor comes from control algorithms. Complete control algorithms like Kalman filter or model predictive control may work very well in simulation, but testing them with your hardware may lead to delays. You typically deal with fixed-point implementations that have word size or limited processing capacity. Therefore, there is a drive toward larger processing capacity and flexible control platforms.

      Let's see how real-time testing can help to manage these typical challenges. To develop next generation of power converters and electric models, you can use rapid control prototyping to validate requirements before designing the embedded hardware through data and tune parameters using MATLAB and Simulink. Then, to ensure safe testing conditions, use hardware-in-the-loop testing to test in safe conditions and automate testing easily. And in both case, when dealing with high switching frequencies and close up bandwidth in megahertz range, you can make use of lowest latency FPGAs as already described in this webinar.

      There are several benefits when adopting rapid control protecting. Your final product will probably require an embedded board with the microcontroller or FPGA. You would have to select the right chip depending on the size of the code, switching frequency, and the required I/O channels. These are many requirements to validate. With rapid controlled prototyping, you introduce a hardware platform that's independent from the final embedded device. As a consequence, you can find this and it was very early in the development phase.

      Some mistakes can be found also with desktop simulation, but we know that testing on hardware can introduce new variables. You can change requirements as you are validating and finding mistakes. For example, you can integrate new components such as new I/O channels without having to redesign the embedded hardware.

      You can tune parameters and log data using MATLAB and Simulink. You can add communication interfaces by simply using driver blocks, and you keep the focus on the control algorithm. Eventually, you don't have to think about accessing onboard memories and I/O registers.

      Let's have a look at the demo for electric motor control. We use the Baseline real-time target machine with Simulink programmable FPGA, 3-phase inverter, and a brushless DC motor. With the demo, you can quickly get started with PWM control, parameter estimation, and rapid control prototyping.

      Let's check out how you can control a routine application directly from within Simulink. Connecting to the target and starting the application just takes a few clicks. When the application is running in External mode, we can change parameters, and the change will take effect immediately. For instance, let's switch the control inputs to manual user control with network controls inside Simulink, we can now set the motor speed and review the logged data.

      Now, let's say you want to optimize the field-oriented controller gains. FOC Autotuner from Motor Control Blockset automate estimation process of the control loop gain for motor control development. It works in real time with Speedgoat's real-time systems.

      It estimates FOC gains to meet control requirements by injecting disturbance to control inputs for parameter estimation. You can run the FOC Autotuner with Speedgoat hardware.

      We see that the speed tracking is slow with under damping at first, but in certain perturbations FOC Autotuner automatically calculate the control loop gains. After start with slow speed tracking, the velocity tracking significantly improves once the new gains are calculated.

      Now, let's see how to thoroughly test the controller. For example, you may want to test all fault scenarios for an electric motor, but you want to do this safely. And maybe you do not even have the electric motor available to test your controller. For this, you can set up hardware-in-the-loop or a simulation with Speedgoat. The hardware-in-the-loop setup contains the controller and the test, here a microcontroller, and a HIL real-time simulator that runs real-time simulation of the plant together with I/O modules.

      Thus, HIL can replace prototypes or production hardware with the real-time system. It enables us to automate testing more easily with tools such as Simulink test. It is safer to test with real-time simulations than with most power electronics hardware, which can break down. It enables to start many design or test tasks earlier because you can test controllers even if the hardware is not available.

      Let's look at a model HIL demo setup. On one side, we deploy the controls and the PWM generation on the Baseline target machine. This is our device in the test. On the other side, the Speedgoat HIL simulator runs a real-time simulation of the motor and inverter models and generates analog signals, emulating current measurements and encoder signals.

      For this, we need a real-time simulation of the electric motor. Such model require 3-phase inverter and a motor. Depending on your application, you can use different level of motoring fidelity for your model.

      The basic e-drive proof of concept uses an average inverter and the lumped parameter motor. For field weakening control, you can use an average inverter and a flux-based motor. To test torque ripple compensation, a switching inverter and a spatial harmonics-based motor could be used.

      These curves basically show you how these three level of model fidelity differ from each other. So we've got lumped parameter model, saturation model, saturation plus spatial harmonics motor. From either dyno testing or FEA, we should be able to obtain the flux, what we call the flux table.

      In order to feed the flux table to the saturation model, we must invert that to a current table. As you can see, the lower two table, current ID and IQ table. Here is an animation of the flux variation and different rotor positions.

      The left plot comes from Ansys Maxwell which shows how flux density changes-- the rotor position changes. The right plot is a MATLAB plot of the flux surface at different rotor positions. You notice that the flux surface constantly shifts when the rotor rotates. That variation introduced special harmonic components in the flux linkages, currents, and torque. So in this type of high-fidelity model, we're trying to capture the rotor position-dependent components.

      To simulate our electric drive, we also need to model the inverter. For this, we can choose different level of modeling fidelity. We can choose an average model for the inverter, which is great for basic e-drive proof of concept. To validate switching events and analyze harmonics, we need a switched or subcycle averaged model of the inverter.

      And the switching frequencies in automotive, which a few tens of kilohertz simulating switching and harmonics require support time around 1 megahertz, which can be obtained by using FPGAs to run the plans in real time. For this, you can convert a Simulink model to HDL code. In the case of Simscape electric models, they can be converted to switched linear models using the Simscape Two HDL Workflow Advisor. Then you can generate HDL code and implement the plan model on the programmable FPGA.

      By simulating power electronics in FPGA, you can reach simulation time step below one microsecond and PWM switching signals as low as four nanoseconds. This enable you to test your switching algorithm and compute the efficiency of your power converter. Once your power converter is implemented on the FPGA, you can start real-time simulation in one click and observe switching dynamics for switching frequencies up to hundreds of kilohertz on an oscilloscope or directly in Simulink using data streaming capabilities.

      Let's go back to our model HIL demo. We can start a HIL simulation. And inspect the analog current generated by the FPGA on an oscilloscope. We can tune the speed reference in real-time and see that it impacts the frequency of the currents plotted on the oscilloscope.

      A further HIL testing setup for electric power converters is power HIL. And that controller HIL, or the device in our test, is a piece of embedded hardware. Power HIL enables you to test the actual electric power equipment.

      Typical setup for power HIL could look like that. It contains a power amplifier in between device in a test, like the three-phase inverter of an onboard charger or a high voltage DC fast charger, and the HIL simulator running a simulation of the rest of the system, such as the vehicle on board power systems or the electric grid. Amplifier and speed, which will time target machine are connected through a high bandwidth fiber optic connection. With power HIL, you can test your electrical components like integrated on the power grid inside an electric vehicle.

      For example, an important power converter for vehicle electrification is a high voltage DC fast charger. How do you develop it with different charging standards, vehicles, and good conditions? In this case, we have a three-phase grid on one side and the converter and different DC charging voltages on the vehicle side.

      How to test for weak grids of all cases. With power HIL, you can use grid emulation to test various grid types, and also emulates different types of battery packs, while the availability of automotive and grid protocols could help testing the different charging standards and battery states on the other end. And you can test interactions with other components with multi physics simulations.

      So we have covered power electronics and motor through RCP, HIL, and power HIL. Let's continue our journey in automotive electrification with energy source of an electric car. We'll focus on battery management systems and how to test these systems. Real-time testing is a powerful tool supporting development of battery management systems or energy management solution, such as fuel cells.

      Typical challenges include the development of battery management systems optimized algorithms and fuel cell controls interfacing with different control protocols like CAN or EtherCAT. Rapid control prototyping can be used to address the challenges with off the shelf IO connectivity and communication protocols.

      While the typical changes include testing of controls and interfaces to power components like battery cells, thorough testing of control firmware under realistic conditions not trivial. You can use battery cell emulators to illuminate hundreds of cells in series, perform fault insertion for each cell, and thermal tests your temperature sensors. And when testing of battery management systems is required to make sure that the system behaves as expected.

      However, there's a complete charge and discharge cycle for typical electric vehicle battery pack takes hours. Producing design issues and fault conditions can be difficult and involve safety considerations. And does it make sense to do this type of testing for every software revision or design integration? You can use HIL testing to tackle the challenges. To increase confidence in design integration, test your BMS controller against a simulated battery pack.

      Let's take a quick look at the test model, which allows us to simulate battery cells and generate fault scenarios. This model was discussed in more details in the previous webinar of this series. We have a BMS under test and connected to an emulated battery pack using the battery emulation IO module. To simulate a fault, we added a switch which allows us to short 2,000 simulation without physical consequences. Additionally, we use a slider to set the charge and discharge currents.

      To perform diagnostics on cell level, we measure the voltage between two cell terminals. The measured cell voltage values are sent to the IO module, which converts the numerical values into voltage outputs, each relating to an individual battery cell. The BMS controller performs diagnostics on cell voltages and detects all voltage, under voltage, faults, and short circuits between two terminals. When we inject a short circuit fault, we can immediately notice the red warning light.

      Let's look at the results for the whole experiment in the simulation data inspector. We can notice small changes in cell voltages due to changes in current. And one of the cell voltages dropped significantly as we triggered the fault. Using this data, we can optimize the conditions based on which fault is detected to ensure safe battery management.

      The battery cell emulator from Speedgoat is defined to accelerate BMS testing. You can also sync up to five amps for each cell with the maximum output voltage of six volts and have up to 192 cells in series. Therefore, when emulating lithium ion technology, you can emulate the battery pack up of around 80 VDC at full charge. You can also include fault insertion and temperature stimulation at cell level.

      You can use Simulink and Simscape Electrical to model the battery cells and deploy to a Speedgoat real-time system. Each emulated battery cell will have electric behavior given by your model dynamics and its interaction with the BMS hardware on the test. For each battery cell, you can also have optional module to emulate temperature sensors and to test fault conditions like broken wire and short circuit.

      Let us now conclude with two success stories on power management. First, [NON-ENGLISH] Energy Storage Solutions is developing the next generation of lithium ion battery packs for autonomous vehicles, which enable to properly test and verify your BMS algorithms before operation with real battery packs. [NON-ENGLISH] started using Speedgoat battery cell emulators for hardware-in-the-loop testing of the BMS algorithms.

      As it is typically required, such tests required also using fault insertion and the communication protocol like CAN. They were able to thoroughly validate the BMS and state estimation algorithms using Speedgoat real-time solutions, thus reducing test time by around 50%, increase coverage, and finding bugs at an early stage.

      The second success story is from Nuvera, a company developing fuel cell technology for commercial vehicles. The technology uses both fuel cells and lithium ion batteries. And they use Simulink and Speedgoat hardware for quick iterations in the designs without having to put real engine at risk. When installing forklifts, the fuel cell engines should reduce 128 metric tons of CO2 annually.

      For these stories, we can conclude this chapter on battery management systems and battery cell emulation and move to testing electric vehicle powertrains. Let's look at typical changes and benefits of real-time testing for electric powertrains. To optimize efficiency and performance of electric powertrain controls and tuning algorithms such as generative braking or torque vectoring, use rapid control prototyping.

      You can test and develop new concepts in the field without embedded devices and leverage automotive protocols such as scan or flex array to connect to prototypes. Then to test powertrain controller in safe testing conditions and automate testing of issues, use HIL testing, when real-time models of electric powertrain architecture, including electric motors, power converters, energy store rate, and mechanical transmission.

      Automotive protocols are very useful to connect to the issue on a test. And if you want to test full electric vehicle architecture to manage the electrical and thermal characteristics and test multiple issues simultaneously, run HIL for full vehicle simulation.

      To illustrate this use case, we will look at the demo of torque vectoring application where motors apply different sometimes opposite torque to left and right wheels. This requires longitudinal and lateral vehicle dynamics models. For the powertrain system model, we need mapped motors, 14 degrees of freedom, body and wheels, models, electric vehicle control module, and we are going to simulate an increasing steer maneuver.

      The Powertrain Blockset gives you quick access to conventional and electrified powertrain models. The built-in libraries provide easy to use Simulink blocks, including batteries, electric drives, and electric motor controllers. Many well-documented and ready-to-use reference applications get you started quickly.

      These are Simulink-based fast-running models that you can fully customize an instrument and that are ready for HIL deployment and closed-loop simulation with your controls. The same model can be used to support you with different tasks, like tuning motor and brake controls. These unique capabilities, such as torque vectoring control or developing and testing battery management systems.

      This is the hardware setup we are going to use for this demonstration. The control and the power train and vehicle model are represented by two Simulink models that we will deploy respectively on a baseline target machine for the controller and a performance target machine for the powertrain vehicle model. The communication protocol is CAN.

      First we deploy the torque vectoring control algorithm to Speedgoat baseline target machine. For that we need to extend the control model with IO driver blocks. We could have torque vectoring control algorithm inside this model, which will be deployed to the real-time target machine running the controller.

      Then we set up the driver blocks for communication. On one side, we set up the CAN read blocks to read data packets coming from the CAN network. On the other side, we configure the CAN write blocks to write the control commands to the CAN network. And we deploy this model to the baseline target machine.

      To set up our HIL simulation, the powertrain vehicle dynamics model is deployed to Speedgoat performance target machine. To design torque vectoring control, we need a detailed powertrain and vehicle dynamics model. This is based on the powertrain box. We can reuse the powertrain vehicle dynamics model minus torque vectoring controller. We can configure the model for HIL simulation where the controller is external using this user interface.

      We interfaced the HIL simulator to the controller using CAM. The torque vectoring algorithms ran on the device in our test, which is the Speedgoat baseline target as previously explained. Now, let's build the model for real time execution and run it on the HIL simulator.

      On the dashboard, you noticed that the speed increases, which is one way to get feedback on the real-time simulation. We can also open Simulink Data Inspector and look at some signals in real time. One interesting curve is the torque vectoring control signal coming from the controller in the bottom right.

      One other way to look at the simulation results is to visualize the maneuver and vehicle behavior using a 3D engine Unreal coupled to the real-time simulation. The green car, which is the car using torque vectoring, is more performant than the blue car when steering, which means that the torque vectoring did the job.

      Let's mention this user story from Greenteam Stuttgart. They used Speedgoat and Simulink real-time to accelerate the development of their fully electric racing car. They used a baseline real-time target machine as an onboard ECU to accelerate control system development from Simulink to hardware.

      Sensors and actuators were interfaced using real-time UDP. New control algorithms could be auto-generated and deployed to the target machine at the click of a button. This enabled the team to stay focused on the control algorithms and powertrain innovations instead of ECU development, which saved months of development.

      To extend your digital twin models with more detailed electric and other physical components, you can do physical modeling with Simscape. It allows you to arrange fundamental components into a schematic which integrates with your Simulink model and fully supports code generation. With physical modeling, you get the highest fidelity simulation for things like batteries, fuel cell, thermal cooling systems, and more.

      And again, you don't have to start from scratch. For complete automotive models, Simscape vehicle templates provides a good starting point. This ready-to-use reference application enables you to easily explore modern architectures for conventional, hybrid, battery, electric, and fuel cell vehicles with Simscape-based subsystems. The user interface allows you to easily switch between different vehicle configurations and find the right model fidelity for your task.

      Perhaps you are working on a system thermal design, you would like to analyze the thermal behavior with an active cooling system, or system vehicle template configuration that compatible with real-time execution using Speedgoat hardware and Simulink real-time. You can directly use these models as high fidelity virtual vehicles to test early prototypes or embedded controllers.

      Now, the more high fidelity components you integrate, the more computational power you need to run your model. To achieve your sample time requirements, you may need to run your model distributed across multiple systems. Speedgoat target machines can be connected via PTB to easily synchronize system clocks. You can leverage cell memory to enable ultra low latency data exchange, and you can use interrupt signals to trigger synchronous execution. The flexible solution allows you to scale the systems you need at any time.

      Let's mention an example from a team of researchers at the Technical University of Munich developing fully autonomous all-electric race cars. Speedgoat mobile machine serves at the vehicle electronic control unit doing sense sensor fusion, highly performant motion control, and monitoring of the vehicle components. The car are powered by four electric motors requiring precise control to manage the combined force of a 500 horsepowers.

      The test time on the racetrack is extremely limited, and the team needed to verify the algorithms often. They decided to model a complete virtual vehicle digital twin which runs in real-time on a second Speedgoat target machine. To detect change between the two machines, using the same CAN interface as on the real car. This means that the issue doesn't see the difference between the real vehicle and the digital twin.

      Furthermore, the team created a virtual representation of the racetrack from sensor data. Co-simulation of Simulink real-time with the Unreal Engine for visualization enabled fully virtual testing of the complete software stack for sensor fusion and motion control in real-time. We can now conclude this chapter on electric powertrains.

      So we have talked about HIL simulation for power electronics, battery systems, or for full vehicles. Let's see how could such a HIL setup look for your application. Depending on your requirements, setups can range from a single target machine to complete HIL racks. Let's look at an example.

      Depending on the size of your group and how you organize development of embedded software, the HIL system setup and controller HIL testing can be done by the same or different teams. Let's assume your embedded system group is segmented into three. The HIL system engineers focusing on assembling and setting up the new HIL test system. The embedded software validation team in charge of running embedded software test campaigns. And embedded software development team tasked to develop and revise the immediate software.

      So the question is, how are we enabling these teams to succeed in their specific tasks? The system's engineers have previously built a HIL test system based on the Speedgoat performance machine. They are now challenged to specify a new, much more complex HIL test system, which is required to integrate high power actuators, electric loads, and sources.

      Implementing such a HIL system is time-consuming and requires specific expertise. With that in mind, the team decided to rely on Speedgoat's know-how to provide them with a modular rack-mounted HIL solution customized to their needs.

      The final solution looked as follows. Two rack-mounted performance real-time machines enabling distributed and synchronized simulation across multiple chassis. The setup fully integrates all power electronics components, the required signal routing and conditional modules, as well as breakout panels and the cabling harness. For the system engineers, this is the true plug-and-play solution.

      With the hardware hurdles off the table, the team was able to focus on the design of the digital twin and even introduced some innovations. For instance, model perimeters are now automatically fine-tuned to fit measured data. Connectivity with the controller was also done very quickly with simple drag and drop of Speedgoat driver blocks.

      Using Simulink real-time, the model ran on the Speedgoat machine with a simple click. And the team could verify correctness of all interfaces right from Simulink. The HIL system was instrumented with MATLAB's built-in App Designer. User interface controls directly connect with the real-time application, allowing HIL system operation to be Simulink-independent.

      In parallel, the softer validation team has been creating scripts to batch and optimize test workflows. Part of the team has been also using Simulink tests, which has shown to be a great asset. For instance, most of the desktop simulation tests were reused in the real-time runs. Real-time test campaigns were triggered with a few clicks.

      And a session of results was fast and easy using inbuilt visualization tools. Besides, detailed test reports could be generated automatically. This greatly simplified communication with the software development team and helped further expediting software revision work.

      We have now covered various HIL testing use cases in this webinar. Another key workflow in HIL testing is rest-bus simulation. It essentially means that parts of one or multiple vehicle buses are simulated to facilitate verification and validation of the ECU on a test.

      Speedgoat offers a complete solution for this workflow based on our IO 723 IO module for automotive bus simulation. This is a configurable IO module that can support up to six different buses, including CAN, CAN-FD, FlexRay, LIN. It provides you the capability of performing complex multi-bus simulation and gateways with time-stamping and synchronization capabilities.

      You might want to rework only specific component of an already existing ECU. Or perhaps you are in the middle of a test integration campaign, and you need to rapidly modify parts of your embedded design while avoiding the lengthy embedded software iteration process. In this case, you can utilize Speedgoat for bypass rapid prototyping.

      Unlike in full pass prototyping, where you would virtualize your full controller using the Speedgoat target as a prototype controller, with bypassing you only run specific parts of the software on target hardware. For instance, a modified design that you created in Simulink.

      Deterministic real-time behavior between bypassed and emitted components is achieved by establishing a bypass service with hooks and later links using the universal XCP protocol. This enables the ECU to send input data to the Speedgoat bypass unit through a data acquisition link. And the other way, signals are sent to the ECU through a signal injection link.

      In early design stages, bypassing allows you to rapidly prototype and test new function designs without being limited by the embedded hardware. So you can implement development stages with higher confidence and guarantee that your design choices will fit the emitted environment. During integration, bypassing allows you to rapidly introduce and test late design changes while minimizing the effort of software revisions.

      In summary, bypassing helps derisking and speeding up development stages. The XCP protocol is also commonly used in the automotive industry for ECU measurement and calibration. With Speedgoat prototyping solutions, you can perform measurement and calibration of early controls directly with your real-time target machine. You can do this either directly from within Simulink as shown already, or by using third party tools of your preference, such as CANape by Vector or INCA by ETAS.

      We now arrive at the end of this webinar. Let's quickly recap the key takeaways. Rapid control prototyping accelerates innovation and ensures faster time to market. Hardware-in-the-loop testing is essential to ensure reliability and safety of electric vehicles.

      Speedgoat solutions cover real-time testing for fully electric vehicle, power electronics and motor controls, and battery management systems. And Simulink real-time and Speedgoat provides the most integrated workflow to deploy Simulink systems to real-time. Many thanks.

      View more related videos