Build Full Electric Vehicle Model
The electric vehicle (EV) reference application represents a full electric vehicle model with a motor-generator, battery, direct-drive transmission, and associated powertrain control algorithms. Use the electric vehicle reference application for powertrain matching analysis and component selection, control and diagnostic algorithm design, and hardware-in-the-loop (HIL) testing. To create and open a working copy of the conventional vehicle reference application project, enter
This table describes the blocks and subsystems in the reference application, indicating which subsystems contain variants. To implement the model variants, the reference application uses variant subsystems.
|Reference Application Element
Analyze Power and Energy
Double-click Analyze Power and Energy to open a live script. Run the script to evaluate and report power and energy consumption at the component- and system-level. For more information about the live script, see Analyze Power and Energy.
Drive Cycle Source block — FTP75 (2474 seconds)
Generates a standard or user-specified drive cycle velocity versus time profile. Block output is the selected or specified vehicle longitudinal speed.
Creates environment variables, including road grade, wind velocity, and atmospheric temperature and pressure.
Longitudinal Driver subsystem
Uses the Longitudinal Driver or Open Loop variant to generate normalized acceleration and braking commands.
Implements a powertrain control module (PCM) with regenerative braking, motor torque arbitration and power management.
Passenger Car subsystem
Implements a passenger car that contains an electric plant and drivetrain subsystems.
To model the electric plant, use the Toggle To Simscape Electric Plant button to switch between Simscape™ and Powertrain Blockset™ variants of the plant subsystem. By default, the reference application uses the Powertrain Blockset variant. The Simscape variant incorporates physical connections to provide a flexible way to assemble components.
Displays vehicle-level performance, battery state of charge (SOC), and equivalent fuel economy results that are useful for powertrain matching and component selection analysis.
Evaluate and Report Power and Energy
Double-click Analyze Power and Energy to open a live script. Run the script to evaluate and report power and energy consumption at the component- and system-level.
The script provides:
An overall energy summary that you can export to an Excel® spreadsheet.
Electric plant and drivetrain plant efficiencies.
Data logging so that you can use the Simulation Data Inspector to analyze the powertrain efficiency and energy transfer signals.
For more information about the live script, see Analyze Power and Energy.
Drive Cycle Source
Drive Cycle Source block generates a target vehicle velocity for a
selected or specified drive cycle. The reference application has these options.
Output sample time
Continuous operator commands
Discrete operator commands
Longitudinal Driver subsystem generates normalized acceleration and
braking commands. The reference application has these variants.
Longitudinal Driver (default)
PI control with tracking windup and feed-forward gains that are a function of vehicle velocity.
Optimal single-point preview (look ahead) control.
Proportional-integral (PI) control with tracking windup and feed-forward gains.
Low-pass filter (LPF)
Use an LPF on target velocity error for smoother driving.
Do not use a filter on velocity error.
Stateflow® chart models reverse, neutral, and drive gear shift scheduling.
Input gear, vehicle state, and velocity feedback generates acceleration and braking commands to track forward and reverse vehicle motion.
Stateflow chart models reverse, neutral, park, and N-speed gear shift scheduling.
Open-loop control subsystem. In the subsystem, you can configure the acceleration, deceleration, gear, and clutch commands with constant or signal-based inputs.
The controller subsystem contains the electric vehicle (EV) powertrain control module and the battery management system (BMS). By default, if you have AUTOSAR Blockset, the controller configurations comply with AUTOSAR. If you have Embedded Coder®, you can generate AUTOSAR-compliant code.
To determine the motor torque and brake pressure commands, the reference application implements a supervisory controller. Specifically, the powertrain control module (PCM) implements:
Regenerative braking control
Motor torque arbitration and power management
Converts the driver accelerator pedal signal to a torque request.
Converts the driver brake pedal signal to a brake pressure request. The algorithm multiplies the brake pedal signal by a maximum brake pressure.
Implements a regenerative braking algorithm for the traction motor to recover the maximum amount of kinetic energy from the vehicle.
Implements a virtual battery management system. The algorithm outputs the dynamic discharge and charge power limits as functions of battery state of charge (SOC).
Implements a power management algorithm that ensures the battery dynamic discharge and charge power limits are not exceeded.
Regen Braking Control has these variants.
Regen Braking Control
Series Regen Brake
Friction braking provides the torque not supplied by regenerative motor braking.
Parallel Regen Braking
Friction braking and regenerative motor braking independently provide the torque.
To implement a passenger car, the
Passenger Car subsystem
contains a drivetrain and electric plant
subsystem. The reference application has these
Differential and Compliance
Configure drivetrain for all wheel, front wheel, or rear wheel drive. For the all wheel drive variant, you can configure the type of coupling torque.
Front Wheel Drive
Rear Wheel Drive
Vehicle Body 3 DOF
Configured for 3 degrees of freedom
Wheels and Brakes
For the wheels, you can configure the type of:
For performance and clarity, to determine the longitudinal force of each wheel, the variants implement the Longitudinal Wheel block. To determine the total longitudinal force of all wheels acting on the axle, the variants use a scale factor to multiply the force of one wheel by the number of wheels on the axle. By using this approach to calculate the total force, the variants assume equal tire slip and loading at the front and rear axles, which is common for longitudinal powertrain studies. If this is not the case, for example when friction or loads differ on the left and right sides of the axles, use unique Longitudinal Wheel blocks to calculate independent forces. However, using unique blocks to model each wheel increases model complexity and computational cost.
To model the electric plant, use the Toggle To Simscape Electric Plant button to switch between Simscape and Powertrain Blockset variants of the plant subsystem. By default, the reference application uses the Powertrain Blockset variant. The Simscape variant incorporates physical connections to provide a flexible way to assemble components.
|Electric Plant Subsystem
Configured with electric battery
Mapped motor with implicit controller
Interior permanent magnet synchronous motor (PMSM) with controller