# Electric vehicle

Detailed overview of the model definition, components, and capabilities of the Electric Vehicle model in the Microgrid Library.

## Introduction

This model consists of an electric vehicle (EV) with a 270 kW induction motor and a 250 Ah Li-ion battery. The 150 kVA battery charger is implemented using the Battery Inverter component from the Microgrid Library, which supports grid forming and following modes for vehicle-to-grid, grid-to-vehicle, and Uninterruptible Power Supply (UPS) operation. The powertrain control module (PCM) is based on a Field-Oriented Control (FOC) scheme with regenerative braking capability. The model includes a 20 kVA load for simulating the UPS mode. This is done by switching the battery inverter to grid-forming mode and disconnecting the grid.

This application example model does not implement any specific manufacturer’s topology for the drivetrain or for the battery converter. Rather, it demonstrates the use of ready-to-use power electronics and microgrid components in order to build a high-fidelity, system-level application. The Signal Processing toolbox is used to implement the powertrain controller and the mechanical load model.

## Model description

The model comprises of three main subsystems:

2. Charging Station
3. Electric Vehicle

The three-phase grid consists of a 240 V / 60 Hz voltage source and an RL-section impedance. The grid is connected to the rest of the circuit by the contactor S1, as can be seen in Figure 2. Next to the contactor is a 20 kVA load, which represents a household load that can draw power either from the grid or from the vehicle battery.

The Electric Vehicle (EV) consists of 4 main components:
• On-board 22 kVA Battery inverter
• Lithium-ion Battery
• Three-Phase Inverter with LC filter
• Induction motor

The battery inverter (Figure 3, right from the core coupling) is a component from the Microgrid Library, and it is implemented as a full switching model with its own control both in the grid following and the grid forming mode. In order to scale-down the inverter to 22 kVA, the component model is kept intact and only the mask-level parameters are changed (Table 1).

 Parameter New values Default values Nominal power 150 kVA 1.6 MVA Nominal voltage 240 V 480 V Nominal DC link voltage 400 V 10 kV

The EV presented in this model is realised using a battery with the following parameters:

 Type Lithium-Ion Nominal voltage 400 V Capacity 250 Ah

The Electric Vehicle subsystem consists of the EV model and the PCM. The electric vehicle model is shown in Figure 4. The internal modulator of the Three-phase Inverter component is used, and the carrier frequency is set to 20 kHz.

A full description of how the subsystems are mathematically modeled continues below, followed by a description of how the electric vehicle performs under Simulation.

The PWM reference signals ma, mb and mc are generated by the PCM, which can be seen in Figure 5. A Three-Phase Meter component is used to measure the currents and active power flow between the induction motor and the inverter. The PCM employs a simple FOC based scheme, in which the measured three-phase currents are transformed into direct (i_d) and quadrature (i_q) components, which are then controlled with PI regulators. The machine flux is related to i_d while the torque is related to i_q. The rotor flux angle ϴ_e, needed for the abc-to-dq and dq-to-αβ transforms, is calculated (Indirect FOC) from the machine electrical parameters, rotor speed, and measured currents.

The motor drive is realized using an induction machine with parameters shown in Table 3.
 Type Induction with squirrel cage Nominal voltage 400 V Maximum power 270 kW Maximum frequency 565 Hz Maximum RPM 16950 Number of pole pairs 2

The flux reference is generated in the flux_ref block and starts as a constant value ${\psi }_{ref}$ . As the motor speeds up, however, the armature voltage rises to maintain the flux. When the inverter voltage limit is reached, the rotor speed cannot increase further; this defines the base speed ${\omega }_{base}$ . Then, the Flux Weakening Method is employed to allow the rotor to go beyond the base speed; at this point the maximum flux reference is multiplied by the inverse of the measured rotor speed.

${\left(\psi }_{ref}={\psi }_{max}\frac{{\omega }_{base}}{{\omega }_{r}}\right)$
The torque reference is calculated in the spd_regulator subsystem (Figure 6) from the Throttle input in the SCADA panel. The Throttle is a value ranging from 0 to 100, and this value is first used for speed regulation as a percentage of the maximum speed (230 km/h). The output of the speed regulator is a reference torque, which is further processed by a C block that:
1. Limits the acceleration power to 270 kW
2. Limits the acceleration torque to 430 Nm
3. Limits the regenerative braking power to 60 kW
4. Limits he regenerative braking torque to 150 Nm
5. Multiplies the resulting torque by the throttle percentage

The induction motor is loaded with variable torque. The mechanical part of the electric motor is governed by Newton's Law for Rotation:

$\frac{d{\omega }_{m}}{\mathrm{d}\mathrm{t}}=\frac{1}{{J}_{m}}\left({T}_{e}-{\mathrm{T}}_{\mathrm{l}\mathrm{o}\mathrm{a}\mathrm{d}}-{D}_{f}{\omega }_{m}\right)$

where ${\omega }_{m}$ is the mechanical speed of the rotor, ${J}_{m}$ machine moment of inertia, ${T}_{e}$ machine electromagnetic torque, ${\mathrm{T}}_{\mathrm{l}\mathrm{o}\mathrm{a}\mathrm{d}}$ load mechanical torque, and ${D}_{f}$ linear friction coefficient.

The mechanical load which is calculated inside the Load block is represented by the following formula:

${\mathrm{T}}_{\mathrm{l}\mathrm{o}\mathrm{a}\mathrm{d}}={F}_{load}\frac{{d}_{wheel}}{2{i}_{g}}$

where ${F}_{load}$ is the force that affects the vehicle, ${d}_{wheel}$ the diameter of the wheels, and ${i}_{g}$ is the gear ratio.

where ${F}_{grade}$ is a component of the gravitational force projected to the surface, ${F}_{rolling}$ the rolling resistance force and ${F}_{wind}$ is the wind resistance force.

${F}_{grade}=Wsin\alpha$

where $W$ is the weight of the vehicle and α is the slope angle.

${F}_{rolling}=V\left[\frac{km}{h}\right]{f}_{r}$

where $V\left[\frac{km}{h}\right]$ is the vehicle speed in $\left[\frac{km}{h}\right]$ and ${f}_{r}$ is the rolling resistance.

${F}_{wind}={A}_{d}\frac{{\rho V}^{2}}{2}$

where ${A}_{d}$ is the drag area and $\rho$ is the air density.

${A}_{d}={c}_{D}A$

where ${c}_{D}$ is the drag coefficient and $A$ is the frontal area of the vehicle.

${T}_{brake}=V{C}_{b}$

where ${C}_{b}$ is the adjustable braking coefficient (0-100).

 No. of processing cores 3 Max. matrix memory utilization 78% Max. time slot utilization 78% Simulation step, electrical 1 µs Execution rate, signal processing 100 µs
In order to avoid topological conflicts snubbers are added to the coupling elements:
• Core Coupling1 (inside Charging Station) – the red (current) side of the coupling is facing the contactor, so a fixed R-C snubber should be added with the following parameters:
• Core Coupling2 (inside Electric Vehicle) – the green (voltage) side of the coupling is facing the capacitor, so it should be added a fixed R-L snubber with the following parameters:

## Simulation

This application comes with a pre-built SCADA panel (Figure 7). The panel offers most essential user interface elements (widgets) to monitor and interact with the simulation in runtime. You can customize it freely to fit your needs.

The SCADA Panel consists of the following parts:
• Capture/Scope
• Car Dashboard subpanel
• Inverter Mode Presets Group
• DC Fast Charging Station subpanel
• Status LED Group
The Status LED group contains 5 LEDs that indicate if the EV is connected to the grid and the inverter operation mode based on the power flow direction (stand by mode if there is no power exchange). The DC Fast Charging Station subpanel controls all functions of the Battery Inverter (status, mode, voltage, frequency and P-Q references). The EV can be connected to the charging station only when the motor speed is zero and stopped from the Car Dashboard Start/Stop button. Similarly, the motor cannot be started if the DC charger is connected. The subpanel can also be used for monitoring the voltage and frequency of the grid, power exchange and synchronization status. For EV charging operation, P_ref must to be set to negative, and vice-versa for discharging. If the Inverter Mode is changed to Grid following, the S1 contactor inside Charging Station changes its status to open, and the local load will be powered from the battery. This would correspond to residential blackout situations where EVs can act as a backup power supply (V2G). The Inverter Mode Presets group contains macro buttons that automatically sets the parameters summarized in Table 5.
Table 5. Operations presets
P_ref Grid connection Operation Mode
EV Charging -150 kW On Grid following
Grid-to-vehicle 150 kW On Grid following
UPS 0 kW Off Grid forming

From the Car Dashboard the user can start and stop the motor and adjust the throttle and brake signals with the help of sliders. EV dynamics can be monitored using:

• Two gauges for speed and active power
• A trace graph for speed history
• A bar graph for SOC
• Four digital displays for rotational speed, electrical and load torques, and total distance
• Two LEDs for motor status and regenerative braking (Typhoon ReGen) status
• The Power/Torque Graphs subpanel
The Capture/Scope widget can be used to observe waveforms of the circuit quantities. Figure 9 displays the machine armature currents and voltages during motor acceleration.

Figure 10and Figure 11 illustrate a possible driving cycle of the EV. Initially, with the EV stopped, the throttle slider is set to 100%, which results in constant maximum torque reference being applied. When the maximum power is reached at 85 km/h, the torque reference is gradually reduced to maintain a constant power region. After the breakdown point at approximately 150 km/h, the maximum power cannot be maintained anymore (constant slip region).

When the vehicle reaches the maximum speed of 230 km/h, the throttle slider is set to zero. A negative torque reference is applied, which slows down the vehicle while charging the battery at the same time with the maximum regenerative power of 60 kW. As the speed is reduced, the torque magnitude increases for the same power. At 50 km/h, the 150 Nm torque limit starts acting, gradually reducing the regenerative power until the car stops.

Table 6. Minimum requirements
Files
Typhoon HIL files

examples\models\automotive\electric vehicle

electric vehicle.tse,

electric vehicle.cus
Minimum hardware requirements
No. of HIL devices 1
HIL device model HIL402
Device configuration 1