Skip to content

Commit b3fde5e

Browse files
committed
Make all existing unit tests pass.
1 parent 4abbe9a commit b3fde5e

File tree

202 files changed

+13354
-5093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+13354
-5093
lines changed

ChangeLog.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
# Change Log
22

3-
## Version 1.3 (2022)
3+
## Version 1.4 - In Development
4+
5+
*This version is in development and maybe broken* ;)
6+
7+
Features
8+
9+
- Simulink Connection Bus for Simscape,
10+
which was newly introduced in R2021b,
11+
is used to define high-voltage line connection for Simscape Bus.
12+
Connection Bus definition makes the use of Simscape Bus more robust.
13+
14+
Models
15+
16+
- High-voltage battery component has two new referenced subsystems,
17+
and now there are 3 models.
18+
First one is a simple iosthermal model as included from the first release.
19+
Second one (new in this version) uses System-Level Battery block
20+
from Simscape Driveline, and it can simulate battery temeprature.
21+
Third one (new in this version) uses Battery block
22+
from Simscape Electrical, and it can simulate more
23+
battery characteristics such as fade.
24+
25+
## Version 1.3 (April, 2022)
426

527
MATLAB Release
628

@@ -24,7 +46,7 @@ GitHub Repository
2446
- GitHub Pages is enabled:
2547
https://mathworks.github.io/Simscape-Hybrid-Electric-Vehicle-Model/
2648

27-
## Version 1.2 (2022)
49+
## Version 1.2 (April, 2022)
2850

2951
MATLAB Release
3052

@@ -102,7 +124,7 @@ Other updates
102124

103125
- Refactored many folders, models, and scripts.
104126

105-
## Version 1.1 (2021)
127+
## Version 1.1 (November, 2021)
106128

107129
MATLAB Release
108130

@@ -120,3 +142,7 @@ Highlights
120142
showing the workflow as well as real-time application.
121143
- Real-Time application presented in the video will be added
122144
to this project in future updates.
145+
146+
## Version 1.0 (May, 2021)
147+
148+
Initial release.
190 KB
Binary file not shown.

Components/BatteryHighVoltage/BatteryHVBasic_refsub.mdl renamed to Components/BatteryHighVoltage/BatteryHV_refsub_Basic.mdl

Lines changed: 862 additions & 332 deletions
Large diffs are not rendered by default.

Components/BatteryHighVoltage/BatteryHVDriveline_refsub.mdl renamed to Components/BatteryHighVoltage/BatteryHV_refsub_Driveline.mdl

Lines changed: 1054 additions & 629 deletions
Large diffs are not rendered by default.

Components/BatteryHighVoltage/BatteryHVElectrical_refsub.mdl renamed to Components/BatteryHighVoltage/BatteryHV_refsub_Electrical.mdl

Lines changed: 1178 additions & 873 deletions
Large diffs are not rendered by default.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Component / High Voltage Battery
2+
3+
Component to simulate the electrical
4+
(and optionally thermal) dynamics
5+
of a high voltage battery pack.
6+
7+
The most basic version `BatteryHV_refsub_Basic` computes
8+
the voltage and current of the battery
9+
with no temperature dependence.
10+
11+
To consider the battery temperature,
12+
`BatteryHV_refsub_Driveline` uses
13+
the [Battery block from Simscape Driveline][url-drv-batt].
14+
15+
[url-drv-batt]: https://www.mathworks.com/help/physmod/sdl/ref/batterysystemlevel.html
16+
17+
For more battery behaviors such aging,
18+
`BatteryHV_refsub_Electrical` uses
19+
the [Battery block from Simscape Electrical][url-elec-batt]
20+
21+
[url-elec-batt]: https://www.mathworks.com/help/physmod/sps/ref/battery.html
22+
23+
## Harness Model
24+
25+
<img src="images/image_BatteryHV_harness_model.png"
26+
width="700" alt="Harness Model for High Voltage Battery Component">
27+
28+
## Main Component Subsystem
29+
30+
Basic version
31+
32+
<img src="images/image_BatteryHV_refsub_Basic.png"
33+
width="700" alt="Vehicle 1D Component">
34+
35+
*Copyright 2022 The MathWorks, Inc.*

Components/BatteryHighVoltage/harnessModels/BatteryHV_harness_model.mdl

Lines changed: 3073 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
%% Model Parameters for High Voltage Battery Harness Model
2+
% This script is run automatically when harness model opens.
3+
% If you edit this file, make sure to run this to update variables
4+
% before running harness model for simulation.
5+
6+
% Copyright 2022 The MathWorks, Inc.
7+
8+
%% Load bus defition
9+
10+
defineBus_HighVoltage
11+
12+
%% Input signals and related parameters
13+
14+
battSigBuilder = BatteryHV_InputSignalBuilder;
15+
16+
batteryHV_InputData = Discharge(battSigBuilder);
17+
18+
% For the From Workspace block
19+
batteryHV_InputSignals = batteryHV_InputData.Signals;
20+
batteryHV_InputBus = batteryHV_InputData.Bus;
21+
22+
% Simulation stop time
23+
t_end = batteryHV_InputData.Options.StopTime_s;
24+
25+
% Initial conditions
26+
initial.hvBattery_SOC_pct = batteryHV_InputData.Options.InitialSOC_pct;
27+
initial.hvBattery_Charge_Ahr = batteryHV_InputData.Options.InitialCharge_Ahr;
28+
29+
%% High Voltage Battery - Essential
30+
31+
batteryHV.nominalVoltage_V = 350;
32+
33+
batteryHV.internalResistance_Ohm = 0.01;
34+
35+
batteryHV.nominalCapacity_kWh = 4;
36+
37+
batteryHV.voltagePerCell_V = 3.7; % Open Circuit Voltage. 3.5V to 3.7V assuming Lithium-ion
38+
39+
batteryHV.nominalCharge_Ahr = ...
40+
batteryHV.nominalCapacity_kWh / batteryHV.nominalVoltage_V * 1000;
41+
42+
% Initial conditions
43+
44+
initial.hvBattery_SOC_pct = 70;
45+
46+
initial.hvBattery_Charge_Ahr = batteryHV.nominalCharge_Ahr * initial.hvBattery_SOC_pct/100;
47+
48+
%% With Finite Capacity
49+
50+
% At SOC 50%, voltage is 90% of the nominal.
51+
batteryHV.measuredCharge_Ahr = batteryHV.nominalCharge_Ahr * 0.5;
52+
batteryHV.measuredVoltage_V = batteryHV.nominalVoltage_V * 0.9;
53+
54+
%% Thermal model parameters
55+
% These parameters are used when thermal model is enabled
56+
% in the Battery block from Simscape Driveline
57+
% or the one from Simscape Electrical.
58+
% These are not used by the Basic referenced subsystem.
59+
60+
ambient.mass_t = 10000;
61+
ambient.SpecificHeat_J_per_Kkg = 1000;
62+
ambient.temp_K = 273.15 + 20;
63+
64+
initial.ambientTemp_K = ambient.temp_K;
65+
66+
batteryHV.RadiationArea_m2 = 1;
67+
batteryHV.RadiationCoeff_W_per_K4m2 = 5e-10;
68+
69+
batteryHV.thermalMass_kJ_per_K = 0.1;
70+
71+
initial.hvBattery_Temperature_K = ...
72+
273.15 + batteryHV_InputData.Options.InitialTemperature_degC;
73+
74+
%% More Thermal model parameters
75+
% These parameters are used when thermal model is enabled
76+
% in the Battery block from Simscape Electrical.
77+
78+
batteryHV.measurementTemperature_K = 273.15 + 25;
79+
80+
batteryHV.secondMeasurementTemperature_K = 273.15 + 0;
81+
82+
batteryHV.secondNominalVoltage_V = batteryHV.nominalVoltage_V * 0.95;
83+
batteryHV.secondInternalResistance_Ohm = batteryHV.internalResistance_Ohm * 2;
84+
batteryHV.secondMeasuredVoltage_V = batteryHV.nominalVoltage_V * 0.9;

0 commit comments

Comments
 (0)