Rivian expands vehicle simulation with MATLAB and MATLAB Parallel Server

Publisher:EE小广播Latest update time:2024-01-02 Source: EEWORLDAuthor: Adithya Vignesh Jayaraman,RivianKeywords:Rivian Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Designing and building the Rivian vehicle simulation interface 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.


Engineers across the automotive industry increasingly rely on simulation to evaluate handling, acceleration, range and other key performance metrics. Evaluating vehicle performance through simulation is faster and less expensive than physical testing. Full vehicle simulation also helps design work occur earlier in the development process, before prototype hardware is available. However, as the cost and efficiency advantages of vehicle simulation become increasingly apparent within organizations, the increased demand for simulation has caused vehicle simulation to face a series of challenges.


Given the complexity of interfacing with commercial simulation software and running full vehicle simulations, a dedicated team of simulation engineers with the necessary expertise is required. However, the team can quickly become overwhelmed with demands from various stakeholders, including attribute 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, these difficulties are compounded by a lack of standardized vehicle data, coupled with ad hoc post-processing of simulation results, which leaves engineers scrambling to obtain prime source data and adopt approved methods for reporting results.


At Rivian, our team develops scalable, easy-to-use platforms for configuring, running, and post-processing high-volume full vehicle simulations. This Vehicle Simulation Interface (VSI) platform was developed using MATLAB® and Simulink® to help reduce redundancy, increase reusability, and increase simulation throughput through parallel processing . With an intuitive user interface built using App Design tools, the platform also makes simulation easily accessible to engineering teams across the company, eliminating the simulation request bottleneck (Figure 1).


figure 1. VSI user interface.


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


Object-oriented design of VSI


When we began designing the VSI platform, it was obvious that an object-oriented approach was the most straightforward way to achieve our goals of flexibility, scalability, and reusability. We first clearly defined several basic objects: Vehicle, Load Case and Simulation. In this case, the Vehicle object is used to represent a Rivian vehicle, such as a Rivian R1T, Rivian R1S, or Rivian EDV (our electric van). This object also represents the vehicle's configuration, 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. The VSI Simulation object is just a combination of a Vehicle instance and a specific Load Case (Figure 2).


figure 2. VSI simulations include specific vehicle configurations and predefined test scenarios.


From a programming perspective, the concept of Simulation can be regarded as a super class that constitutes the basic framework of the VSI platform. 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 the 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 just vehicles and test scenarios, but also user settings, results, and metrics—and efficiently transferring this information within a 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 3. VSISim superclass, including simulation input and execution methods.


Make simulation more equally popular and maximize reuse


We have deployed VSI as a MATLAB toolbox and standalone executable (compiled with MATLAB Compiler™) for use by colleagues who do not have MATLAB installed. With easy access to the VSI, teams no longer need 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 simulation list 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 when a model is revised). It's important to note that simulation results from VSI are shared; engineers may find that the simulation they want to run has been completed by someone on their own team or on a completely different team. Engineers can leverage existing simulation results and avoid running the same unnecessary simulations, saving time and computing resources.


After defining and selecting the simulation to run, the engineer clicks the button labeled Run&Post-Process (shown in Figure 1). Simulations are launched in the background through the MATLAB API using a combination of Simulink and commercial simulation software (Figure 4).


Figure 4. Workflow diagram of cluster simulation, and VSI interface showing five scheduled simulations (highlighted in blue). The purple status indicates that the simulation is in progress; the red status indicates that the simulation has been completed.


After an individual simulation is completed, the recorded data is sent back to the MATLAB workspace for processing, then converted to the Apache ® Parquet data file format, and finally archived in a shared directory. We also developed a set of MATLAB scripts that aggregate results to generate key metrics, report simulation status against goals set in our requirements management system, and generate automated reports summarizing key performance indicators for reference by 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 machine, or they can choose to do so using a remote Amazon ® Web Services (AWS ® ) cluster (Figure 5). The native approach leverages Parallel Computing Toolbox™ and is the most common approach used by engineers when testing model updates and changes. The remote method is based on an AWS EC2 instance running MATLAB Parallel Server™ and is suitable for production environments with tested and validated models.


Figure 5. VSI option for parallel processing.


In remote parallel workflows, MATLAB Parallel Server and MATLAB Job Scheduler play an important role. 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 creates 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 jobs and assigns tasks to individual cluster worker processes. When the simulation is complete, MATLAB postprocessing functions are run on the cluster, and the results are archived and shared. For large jobs, such as one involving 14 lengthy simulations, the remote parallel approach was much faster, completing the job in 68 minutes, while the sequential approach took more than 9 hours (Figure 6).


Figure 6. Baseline simulation times for sequential (yellow), local parallel (blue), and remote parallel (red) methods.

Over the past six months, our colleagues at Rivian have used VSI to conduct more than 9,000 full vehicle simulations, logging a total of 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 eliminate simulation request bottlenecks, reduce redundancy in simulation tasks, and increase simulation reusability. Additionally, we maximize throughput by supporting running simulations in parallel on multiple cores in an AWS cluster or local workstation.


We plan to make a number of improvements to VSI, including deploying the platform as a web application, adding dashboards for key performance indicators, and simplifying the use of design of experiments (DOE) from the user interface. At the same time, we are continuing to develop and expand Rivian's MATLAB Minimart, a collection of in-house built MATLAB toolboxes for data transformation and viewing, startup and braking analysis, and a variety of other frequently requested functions.


Author : Adithya Vignesh Jayaraman , Rivian


Keywords:Rivian Reference address:Rivian expands vehicle simulation with MATLAB and MATLAB Parallel Server

Previous article:The most disruptive week for the automotive industry is coming
Next article:Analysis of the competition landscape of the global L2+ assisted driving market in 2023

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

Application of Matlab language in harmonic analysis of power supply system
introduction The load of the power supply system is transitioning from traditional linear loads, such as motors, heat radiation electric lighting, and electric heating equipment, to nonlinear loads, such as frequency converters, electric vehicle chargers, gas discharge lighting, and household appliances with re
[Embedded]
Application of Matlab language in harmonic analysis of power supply system
Simulation case of BLDCM double closed-loop control system based on Matlab/Simulink
Under Matlab/Simulink, combined with Simulink basic modules and S-Function, a design scheme for brushless DC motor control system is proposed. The system adopts double closed-loop control: the speed loop adopts PI control, and the current loop is composed of current hysteresis comparator. The simulation results show
[Embedded]
Simulation case of BLDCM double closed-loop control system based on Matlab/Simulink
Latest Automotive Electronics 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号