Rivian Expands Full-Vehicle Simulation Using MATLAB and MATLAB Parallel Server

Publisher:SecretWhisperLatest update time:2024-07-11 Source: elecfansKeywords:Rivian  MATLAB  Server Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Engineers across the automotive industry are increasingly relying on simulation to evaluate handling, acceleration, range, and other key performance indicators. Evaluating vehicle performance through simulation is faster and less expensive than physical testing. Full vehicle simulation also helps design work happen earlier in the development process, before prototype hardware is available. However, as the cost and efficiency benefits of vehicle simulation become more apparent within an organization, the increased demand for simulation presents a number of challenges for vehicle simulation.

Given the complexity that comes with interfacing with commercial simulation software and running full vehicle simulations, a dedicated team of simulation engineers with the necessary expertise is required. However, this team can quickly become overwhelmed by the demands of various stakeholders, including property engineers, performance engineers, dynamics engineers, range and efficiency engineers, and senior management. Simply executing the multiple simulations requested by these teams can also become a bottleneck, especially when these simulations are run continuously on commercial software. Finally, the lack of standardized vehicle data, coupled with ad hoc post-processing of simulation results, exacerbates these difficulties, leaving engineers scrambling to obtain golden source data and adopt approved methods for reporting results.

At Rivian, our team has developed a scalable, easy-to-use platform for configuring, running, and post-processing a large number of full-vehicle simulations. Developed using MATLAB® and Simulink®, this vehicle simulation interface (VSI) platform helps reduce redundancy, increase reuse, and improve simulation throughput through parallel processing. With an intuitive user interface built with App Designer, the platform also makes simulations easily accessible to engineering teams across the company, eliminating simulation request bottlenecks (Figure 1).

image.png

Figure 1. VSI user interface.


This article describes how we designed VSI using object-oriented principles, how we leveraged it to make simulation more accessible, and how we used parallel processing to scale simulation workloads.

Object-Oriented Design of VSI

When we began designing the VSI platform, an object-oriented approach was the most straightforward way to achieve our goals of flexibility, extensibility, and reusability. We started by defining a few basic objects: Vehicle, Load Case, and Simulation. In this case, a Vehicle object represents a Rivian vehicle, such as the Rivian R1T, Rivian R1S, or Rivian EDV (our electric van). This object also represents the configuration of the vehicle, defining the specific battery pack, powertrain, tires, front and rear drives, and other components. Load Case objects are used to define simulation scenarios, including speed profiles, environmental conditions, and driving conditions. And a VSI Simulation object is simply a combination of a Vehicle instance and a specific Load Case (Figure 2).

image.png

Figure 2. VSI simulation includes specific vehicle configurations and predefined test scenarios.

From a programming perspective, the concept of Simulation can be thought of as a superclass that forms the underlying framework of the VSI platform. The properties of this superclass include vehicle configuration and test scenario properties that can be selected through the user interface, as well as a set of methods for creating models, running simulations, performing post-processing, extracting metrics, and sharing results (Figure 3). With the object-oriented programming capabilities of MATLAB, we can easily create an implementation of this class structure for the VSI platform. MATLAB handle objects are particularly useful for encapsulating all the information contained in a simulation (not only the vehicle and test scenario, but also user settings, results, and metrics) and efficiently transferring this information within the VSI without copying the data. These objects can then be converted to metadata text files and archived, allowing us to recreate any historical simulation by reconstructing the objects from the metadata.

image.png

Figure 3. The VSISim superclass, including simulation entry and execution methods.

Making simulation more accessible and maximizing reuse

We have deployed VSI as a MATLAB toolbox and standalone executable (compiled with MATLAB Compiler™) that can be used by colleagues who do not have MATLAB installed. With easy access to VSI, the team no longer has to wait for Simulink engineers to run simulations and get results.

The left side of the VSI interface (shown in Figure 1) is used to select vehicle configurations and test scenarios, while the right side of the interface displays a list of simulations represented by different colors. Red indicates simulations that have not yet been run, green indicates completed simulations, and amber indicates completed simulations as well as out-of-date results (which may occur, for example, when new component data becomes available or a model is revised). It is worth noting that simulation results from VSI are shared; engineers may find that the simulation they want to run has already been completed by someone on their team or an entirely different team. Engineers can leverage existing simulation results and avoid running duplicate and unnecessary simulations, saving time and computing resources.

After defining and selecting the simulation to run, the engineer clicks the button labeled Run&Post-Process (see Figure 1). The simulation is launched behind the scenes through the MATLAB API using a combination of Simulink and commercial simulation software (Figure 4).

image.png

Figure 4. Workflow diagram for cluster simulation and the VSI interface showing five scheduled simulations (highlighted in blue). Purple status indicates that a simulation is in progress; red status indicates that a simulation is complete.

After individual simulations are complete, the logged data is sent back to the MATLAB workspace for processing, converted to the Apache® Parquet data file format, and ultimately archived in a shared directory. We also developed a set of MATLAB scripts to aggregate the results to generate key metrics, report on simulation status against targets set in our requirements management system, and generate automated reports summarizing key performance indicators for Rivian senior management.

Scaling through parallel processing

In the VSI user interface, engineers can choose to run simulations in parallel using multiple cores on their local computer or using a remote Amazon® Web Services (AWS®) cluster (Figure 5). The local approach leverages Parallel Computing Toolbox™ and is the most popular approach for engineers testing model updates and changes. The remote approach is based on an AWS EC2 instance running MATLAB Parallel Server™ and is suitable for production environments with tested and validated models.

image.png

Figure 5. VSI options for parallel processing.

MATLAB Parallel Server and MATLAB Job Scheduler play an important role in the remote parallel workflow. VSI first calls the parcluster function from MATLAB Parallel Server to create a cluster object based on the AWS EC2 profile we defined. After creating a simulation object for each simulation to be run in parallel, VSI creates a job on the cluster and a separate task for each simulation. The job and its tasks are submitted to the AWS EC2 instance through the MATLAB Job Scheduler. The scheduler coordinates the execution of the job and assigns tasks to the various cluster workers. When the simulation is complete, MATLAB post-processing functions are run on the cluster, and the results are archived and shared. For large jobs, such as the one involving 14 lengthy simulations, the remote parallel approach is much faster, completing the job in 68 minutes, while the sequential approach takes more than 9 hours (Figure 6).

image.png

Figure 6. Benchmark simulation times for sequential (yellow), locally parallel (blue), and remotely parallel (red) approaches.

Over the past six months, our colleagues at Rivian have used VSI to perform more than 9,000 full-vehicle simulations, totaling approximately 2 million simulated miles.

Planned improvements

Designing and building the VSI platform using MATLAB and Simulink helped us achieve key goals. We created a unified platform for engineers and non-engineers to run full-vehicle simulations, post-process results, and create reports. We eliminated simulation request bottlenecks, reduced redundancy in simulation tasks, and increased simulation reusability. We also maximized throughput by enabling simulations to run in parallel on multiple cores in an AWS cluster or on a local workstation.

We plan to make numerous improvements to VSI, including deploying the platform as a web app, adding dashboards for key performance indicators, and simplifying the use of Design of Experiments (DOE) from the user interface. In parallel, we are also continuing to develop and expand Rivian’s MATLAB Minimart, a collection of internally built MATLAB toolboxes for data transformation and viewing, launch and braking analysis, and a variety of other frequently requested capabilities.


Keywords:Rivian  MATLAB  Server Reference address:Rivian Expands Full-Vehicle Simulation Using MATLAB and MATLAB Parallel Server

Previous article:Maximizing ESD Protection for Automotive Ethernet Applications
Next article:Correctly understand the VGS detection mechanism of DRV8705-Q1

Recommended ReadingLatest update time:2024-11-16 09:37

Matlab/Simulink simulation analysis of permanent magnet synchronous motor constant voltage-frequency ratio open-loop control system (Part 1)
Preface This chapter uses a constant voltage-frequency ratio open-loop control method to drive the rotation of a permanent magnet synchronous motor. First, the control principle of the constant voltage-frequency ratio is analyzed, and then a simulation analysis of the constant voltage-frequency ratio open-loop
[Embedded]
Matlab/Simulink simulation analysis of permanent magnet synchronous motor constant voltage-frequency ratio open-loop control system (Part 1)
Design of Industrial Automation Control System Based on MATLAB and Simulink
MATLAB and Simulink help engineers address the increasing complexity and flexibility requirements of modern production equipment. Industrial automation and mechanical engineers use Model-Based Design in MATLAB and Simulink to: Design and test machine control and scheduling logic Run automa
[Embedded]
Design of Industrial Automation Control System Based on MATLAB and Simulink
Following Tesla's lead? Rivian's electric pickup truck will be equipped with an electrochromic glass roof
(Image source: electrek.co) According to foreign media reports, Rivian confirmed that it will offer an electrochromic glass roof for its electric pickup and SUV models, as well as several other options such as fixed glass panels, a two-piece removable composite roof, and a standard fixed roof. Pickup trucks are
[Automotive Electronics]
Following Tesla's lead? Rivian's electric pickup truck will be equipped with an electrochromic glass roof
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号