GreenBox 3 Safe Multi-ECU Consolidation Demo

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GreenBox 3 Safe Multi-ECU Consolidation Demo

tristan_mcdaniel
NXP TechSupport
NXP TechSupport
6 0 6,617

With the introduction of the new GreenBox 3 real-time development platform, NXP offers a game-changing platform that promotes ECU consolidation for enabling the future of automotive electrification. With its offering of eight (8) Arm Cortex-R52 cores, lockstep Arm Cortex-M33 cores, and a dedicated DSP/ML accelerator, the S32E288 was developed according to an ISO 26262 ASIL D-level process for safe, high-performance compute that facilitates parallelization of multiple real-time applications. These applications could range from motor control to steering and chassis management, thus allowing developers the opportunity to reduce the complexity and cost of their designs by limiting the number of dedicated MCUs necessary. In order to showcase these advantages and the possible use cases of the GreenBox 3, we developed a consolidated ECU demo that highlights the performance of the S32E288 under heavy loads and spotlights the functional safety capabilities of the device.

tristan_mcdaniel_0-1673451594094.png

Fig. 1: S32E2 Real-Time Processors Block Diagram

 

Foundation of the Propulsion Domain Control Demo

At its heart, this consolidated ECU demo aims to showcase the types of applications that a user could reasonably expect to run on the GreenBox 3 hardware. Historically, applications such as motor control, battery management systems, and inverter algorithms would reside on dedicated MCUs found distributed throughout the vehicle. However, as the industry tends towards domain-based and zonal-based vehicle architectures and as the performance of MCU cores increases, the viability of consolidating all of these previously disjoint functions begins to offer new ways of thinking about how software is deployed on the vehicle.

 

tristan_mcdaniel_1-1673386269859.png

Fig. 2: S32E Real-Time Processor Safe Multi-ECU Integration Demo Platform

With this change, we first identified the types of algorithms that may be running on a typical electric vehicle (EV) and hybrid-electric vehicle (HEV) as part of the systems that help to control the overall powertrain domain. At first glance, applications like field-oriented control (FOC) motor control and battery management system (BMS) algorithms are the first types of powertrain applications to come to mind. However, these are not the only real-time, high-compute applications that could be running in the powertrain domain. Other powertrain-related applications could also include torque control, stability control, energy optimization, on-board charging, and power conversion.

Powertrain Domain Applications per Core

With these applications in mind, we ultimately chose eight of them that could each be executed on a single Cortex-R52 core and would offer a unique set of performance and timing requirements. These applications include the following:

  • EV Range Optimization with Model Predictive Control (MPC)
  • Kalman Filter Thermal Monitoring
  • Battery Management System (BMS) State of Charge (SOC) Monitoring
  • Chassis Control
  • DC/DC Inverter Power Conversion
  • Front and Rear Motor Field-Oriented Control (FOC)
  • Electronic Power Steering

 

tristan_mcdaniel_2-1673386516130.png

Fig. 3: Powertrain Domain Applications per Core

tristan_mcdaniel_3-1673386625644.png

Fig. 4: GUI of S32E Real-Time Processor Safe Multi-ECU Integration Demo Platform Highlighting Applications Running on Each Core

With these applications in mind, let’s now explore a bit about how each one is applicable to the powertrain domain, what type of performance and resources they need, and how we implemented them on the GreenBox 3:

EV Range Optimization with Model Predictive Control (MPC)

By taking advantage of NXP’s Model-Based Design Toolbox (MBDT), we were able to deploy a MATLAB Simulink model executing MPC for a hybrid-electric vehicle (HEV). This model uses real-time vehicle data in order to predict the optimal torque commands for the internal combustion engine versus the electric motors and battery system. To do this, the MPC design involves a Linear Parameter-Varying model to help approximate the nonlinear vehicle model. By finding the region for optimizing range, battery state of health, and fuel consumption, the vehicle is able to intelligently determine which power plant should be active based upon the criteria of optimizing fuel economy and battery longevity.

For such an application, the demands on the core consist of the ability to react to incoming, real-time data that is supplied from different regions of the vehicle. Once aggregated, the vehicle must make deterministic decisions to quickly adapt to changes in terrain and driver demands such that range is optimized.

Kalman Filter Thermal Monitoring

Kalman Filters see a wide-range of applicable areas where they can be used to reduce noise seen on sensor measurements and estimate the different states of a control system. Through previous demos, we have showcased Kalman Filters applied to areas like battery cell estimation through the use of assembly code that is tailor-made for the target processor. With this level of optimization, applications are able to utilize all possible resources and advantages allotted by the processor’s architecture such that they can meet the strict time-constraints required while executing math-intensive code.

In this demo, we applied previous knowledge of Kalman Filters for filtering sensor noise on battery thermal monitoring applications such that the signal-to-noise ratio could be reduced. An application like this could be found within the battery of an EV for making informed decisions regarding the effects of temperature on the vehicle’s expected range and the battery’s expected life. With the inclusion of NXP’s Automotive Math and Motor Control Library (AMMCLib), users can leverage essential building blocks for rapid development of automotive embedded applications with high-performance arithmetic, trigonometric, digital signal processing, and math functions.

Battery Management System (BMS) State of Charge (SOC) Monitoring

Within an EV, the battery ultimately determines many characteristics of the vehicle’s driving capabilities from the expected range to the levels of supported charging speeds. Along with this, the battery is one of the most high-profile and expensive parts on an EV that will degrade over time and eventually require replacement. As a result, it is important to be able to estimate characteristics like the battery’s SOC, State of Health (SOH), and State of Power (SOP) in order to know the rate of degradation over time, what factors influence degradation and range, and how you can optimize each of these factors.

Through the use of a feed-forward neural network, a popular and time-tested strategy is implemented for SOC estimation. The BMS application will monitor cell and stack voltage and measure the ambient temperature. Using NXP developed tools in the area of neural networks along with literature and models provided by MathWorks, the application will use the above inputs to handle vehicle control by considering the current state of the battery and how it can handle the current loads.

Chassis Control

Within many intermediate and premium/luxury model vehicles on the road today, adaptive suspension and chassis control systems are implemented in order to improve ride quality across a wide range of road types while also allowing for more sporty driving when desired by the driver. These types of systems must be able to accept input from a multitude of sensors found around the chassis of the vehicle that allow for measuring traction, body roll, and overall travel of the suspension. Along with this, these systems could also be used in conjunction with the safety and crash detection systems in order to reduce the impact of certain types of impacts.

While comfort-oriented capabilities do not necessarily need to meet the strictest of reaction times, operations related to the crash detection system must be able to have a guaranteed reaction time and must meet certain ASIL levels. Since the S32E288 is developed according to processes that are certified to ISO 26262:2018 ASIL D functional safety, the GreenBox 3 can meet the safety requirements of the user application while the performance of the Cortex-R52 cores can help ensure the real-time requirements are met. Along with this, the 24 FlexCAN FD channels offered help to facilitate the simultaneous collection of chassis sensors spread throughout the vehicle. Through this application, we simulated a vehicle with independent front and rear suspension and utilized a Simulink model to determine ride characteristics of the vehicle as caused by powertrain and environment inputs.


DC/DC Inverter Power Conversion

Through the transition to EVs, one of the new systems that are introduced to the powertrain domain of a vehicle is the On-Board Charger (OBC) system. OBCs are primarily responsible for power conversion between the charger side and the vehicle side. This often consists of converting an AC input from the charger into DC to facilitate. As part of this conversion process, you will often find 3 main components:

  1. Electromagnetic Interface (EMI) Filter,
  2. Power Factor Conversion (PFC), and
  3. CLLC (Capacitor, Inductor, Inductor, Capacitor) or LLC (Inductor, Inductor, Capacitor) Converter

To support this conversion process, a powertrain MCU is needed in order to perform safety-related monitoring and sampling.

tristan_mcdaniel_4-1673387175367.png

Fig. 5: Main Components of an AC to DC Power Conversion System for OBC

In this demo, a 6.6 kW OBC is implemented with a forward control loop and a backward control loop. With each new ADC sample, the control loops will perform current detection, provide over voltage (OV) and under voltage (UV) protection, provide the PFC current Proportional-Integral (PI) controller along with the PFC voltage PI controller, perform AC RMS calculations, and many other functions. Overall, a single Cortex-R52 core is able to handle multiple control loops of varying frequencies that are all running in parallel while meeting strict timing constraints for reacting to faults like over voltage (OV) and under voltage (UV) to ensure a safe charging environment.


Front and Rear Field-Oriented Control (FOC)

Field-Oriented Control has become one of the de facto types of applications that users may decide to implement within the powertrain domain since it is the driving force behind traction control and the overall power plant of the vehicle. When controlling a 3-phase DC motor, Clarke and Park transforms are utilized for converting time domain components of a 3-phase system into an orthogonal stationary frame that is then converted to an orthogonal rotating reference frame (i.e. rotor flux reference frame). Ultimately, this allows you smooth control over the speed and torque of the motor across various ranges. When implemented in conjunction with a motor inverter board and 3-phase Permanent Magnet Synchronous Motor (PMSM) such as those from NXP’s MCSPTR2A5775E, development and testing of FOC applications can be performed on a GreenBox 3. With the inclusion of enough ports to support dual motor control and GTM motor control on the S32E288, meeting the demands of dual motor control on a single processor is possible.

tristan_mcdaniel_5-1673387378868.png

Fig. 6: Peripherals Supported in the S32E288 and Exposed on the GreenBox 3 to Enable Dual Motor Control

Safety-oriented and software-based resolver solutions are implemented in this demo to provide accurate motor position sensing based on resolver inputs without using expensive external components for Analog to Digital Conversion (ADC) and timing. In addition, use of the Automotive Math and Motor Control Library (AMMCLib) ensures compatibility and easy bring-up when used in conjunction with other NXP motor control hardware like the NXP MCSPTR2A5775E.


Electric Steering Control

One of the last applications implemented on the GreenBox 3 was electric steering control. In recent years, the adoption of electric power steering has been wide-spread in the automotive industry as it reduces the use of bulky hydraulic hardware and allows for easier integration of driver-assistance and autonomous features. Since steering is also crucial in safety-oriented applications, overall functional safety is paramount and can be met by the capabilities of the S32E288. Overall, electric power steering shares many of the same motor control requirements discussed in the previous FOC section, so the same characteristics also carry over to this application.

 

Application Offloading to DSP/ML Processor

The offering of the DSP/ML processor on the S32E288 means that certain mathematically intensive applications can be offloaded from the host cores in order to allow them to continue executing tasks that are more relevant to their capabilities. In this demo, we show the ability to offload the following applications from the Cortex-R52 cores and onto the DSP/ML processor:

  • EV Range Optimization with Model Predictive Control (MPC)
  • Kalman Filter Thermal Monitoring
  • Battery Management System (BMS) State of Charge (SOC) Monitoring

Due to the 25 GFLOPS of processing power that the DSP/ML processor affords, these applications are able to fully run in parallel while using less of the DSP/ML processor’s resources when compared to the CPU utilization these applications have when running on their respective Cortex-R52 cores. With the offloaded Cortex-R52 cores, you now have the possibility to run even more PDC-relevant applications concurrently.

 

GreenVIP Foundation

To start developing each of the previously mentioned applications, GreenVIP was chosen as a foundation for our project. The GreenVIP software platform works seamlessly with the GreenBox 3 hardware to support rapid prototyping and development of real-time applications. To enable this, GreenVIP offers EB tresos Studio projects for each core along with existing OS and driver integration. By utilizing GreenVIP, we were able to quickly start development with an established project structure that allowed for uniform code development for each core and provided complete documentation for developing our own custom applications/configurations into its existing project structure and build procedures.

 

Operating System

When deploying each application on the GreenBox 3 as part of this demo, we wanted to showcase the flexibility of supported operating systems (OS) that a user could utilize on the S32E288. As a result, we split the cores into 3 main OS groups:

  1. AUTOSAR 4.0.x Classic with NXP AUTOSAR OS
  2. FreeRTOS
  3. Baremetal

tristan_mcdaniel_0-1673450712638.png

Fig. 7: Breakdown of OS Deployed on Each Core

On cores where an OS is running, the main task is running alongside background tasks of lower priority such that we can utilize the execution time of the background tasks to help determine the overall CPU load of the main task.

 

Isolation in a Consolidated ECU

At this point, we have highlighted the performance capabilities of the GreenBox 3 and have showed the types of applications that this hardware is more than suited to run. However, one of the other aspects that needs to be mentioned is the functional safety implications for consolidating disjoint applications onto one processor.

In a traditional powertrain setup, applications like the ones previously mentioned would be distributed throughout the vehicle on MCUs that would primarily focus on running just that one application. By having disjoint MCUs, two main advantages were offered: (1) physical isolation and (2) easier incorporation of outside products. By deploying an application on its own, lower-powered MCU, the developer could easily manage the other applications that are running on that MCU and help ensure that a QM application could not affect a safety application during runtime. Along these same lines, an OEM could also incorporate products and applications from a Tier 1 into their design by deploying them onto their own MCUs in order to ensure that black-box algorithms cannot inadvertently affect other applications on the vehicle.

Once you move to a consolidated ECU design, one of the main concerns that a developer may have is how they can continue to promote isolation between applications of different safety levels during runtime and how can they easily incorporate applications from outside sources like a Tier 1. To solve this challenge, the S32E288 offers a System Manager Unit (SMU) through the lockstep Cortex-M33 pair that acts as the safety cores for the system. These cores will utilize two main components of the S32E288 in order to promote isolation and to be able to bring the system back to a safe state in case something happens during runtime: (1) XRDC and (2) per-core reset generation.

tristan_mcdaniel_2-1673450902520.png

Fig. 8: Without Isolation, Faults in One Core Could Lead to Faults in Other Cores within the Processor

The Extended Resource Domain Controller (XRDC) allows you the ability to dictate which cores have access to which memory and peripheral resources supported by the processor such that you can restrict the amount of access an application may have during runtime. For example, in this demo we showcase an application that encounters issues during runtime to the point that it starts to attempt write accesses to code areas for other cores. In a system without an XRDC, the lack of resource restrictions would allow the core running the faulty application to possibly affect memory regions and peripherals used by those other cores. In this case, the faulty application in this demo is able to overwrite the code and data areas for the other cores on the processor and is able to cause runtime errors in all of the other cores. If this were to happen, the only way to recover back to a safe state would be to reset the entire system.

However, once you properly configure the XRDC such that a core only has access to the resources it needs, you can prevent situations where a faulty application can affect the runtime execution of other applications on other cores. In the case of our demo, when the faulty application starts attempting to read and write to the code and data areas of the other cores, the XRDC will block all accesses to those memory regions since they were not assigned to that core. This prevents the faulty application from affecting the operation of the other cores and helps to contain the possible impact to just the one core.

tristan_mcdaniel_3-1673451022977.png

Fig. 9: With Isolation, Faults can be Isolated to only the Core with the Fault

Once accesses are blocked and the faulty application has been identified, you will want to have the ability to bring that application or core back to a safe state. To do this, the SMU cores have the ability to identify the fault during runtime through their constant monitoring of the system and will then issue a reset to the faulty core in order to bring it back to a safe state. Through the Reset Generation Module (MC_RGM) found on the S32E288, you can reset individual cores on the device without affecting the execution of the other cores. The XRDC and per-core reset generation ultimately allows you to maintain the integrity of the entire system and gives you the ability to return back to normal operation without having to reset the entire MCU.

tristan_mcdaniel_4-1673451139737.png

Fig. 10: With the Fault Isolated, the System can Return to a Safe State through Resetting the Individual Core with a Fault

 

Conclusion

Overall, the GreenBox 3 is designed for developing powertrain-oriented applications that will be deployed on either S32Z and S32E processors. Our consolidated ECU demo has proven that the eight Arm Cortex-R52 cores are more than capable of running a number of powertrain and vehicle control related applications such that developers can reduce the number of MCUs and wiring found throughout the vehicle. In addition, the XRDC and per-core reset generation functionality addresses many of the challenges introduced with ECU consolidation. Ultimately, the GreenBox 3 is uniquely situated to meet your zonal controller and electrification/powertrain domain applications and we look forward to seeing what types of applications you may deploy onto it. For more information, please reach out to your local NXP sales or FAE contact.

 

Glossary

Abbreviation

Definition

ADC

Analog to Digital Converter/Conversion

AMMCLib

Automotive Math and Motor Control Library

BMS

Battery Management System

DSP

Digital Signal Processor

ECU

Engine Control Unit

EMI

Electromagnetic Interference

EV

Electric Vehicle

EVSE

Electric Vehicle Supply Equipment

FOC

Field-Oriented Control

HEV

Hybrid Electric Vehicle

MBDT

Model-Based Design Toolbox

MC_RGM

Reset Generation Module

ML

Machine Learning

MPC

Model Predictive Control

OBC

On-Board Charger

OEM

Original Equipment Manufacturer

OS

Operating System

OV

Over Voltage

PFC

Power Factor Conversion

PI

Proportional-Integral

PMSM

Permanent Magnet Synchronous Motor

QM

Quality Managed

RTOS

Real-Time Operating System

SMU

System Manager Unit

SOC

State of Charge

SOH

State of Health

SOP

State of Power

UV

Under Voltage

XRDC

Extended Resource Domain Controller