Skip to content

Commit da9b5d6

Browse files
committed
Update Power Split Drive Unit component and impacted components. Add tests.
1 parent 7bdbe35 commit da9b5d6

File tree

264 files changed

+19337
-9098
lines changed

Some content is hidden

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

264 files changed

+19337
-9098
lines changed

Components/Engine/Engine_refsub_Basic.mdl

Lines changed: 163 additions & 158 deletions
Large diffs are not rendered by default.

Components/Engine/Harness/Engine_Component_harness_model.mdl

Lines changed: 45 additions & 57 deletions
Large diffs are not rendered by default.

Components/MotorDriveUnit/Harness/MotorDriveUnit_Component_harness_model.mdl

Lines changed: 320 additions & 421 deletions
Large diffs are not rendered by default.

Components/MotorDriveUnit/MotorDriveUnit_refsub_Basic.mdl

Lines changed: 481 additions & 527 deletions
Large diffs are not rendered by default.

Components/MotorDriveUnit/MotorDriveUnit_refsub_Basic_params.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
motorDriveUnit.dampSpringStiffness_Nm_per_rad = 10000;
1919
motorDriveUnit.dampSpringFriction_Nm_per_rpm = 100;
2020

21-
smoothing.mdu_dampSpringVelTol_rpm = 0.1;
21+
smoothing.MDU_dampSpringVelTol_rpm = 0.1;
2222

2323
%% Initial conditions
2424

25-
initial.motorDriveUnitTemperature_degC = 20;
25+
initial.MDU_Temperature_K = 273.15 + 20;
2626

27-
initial.AirTemp_degC = 20;
27+
initial.MDU_AirTemp_K = 273.15 + 20;
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Motor Drive Unit Component
2+
3+
This is a model of motor drive unit (MDU),
4+
which is a system of electric motor and its controller.
5+
The MDU model included in this component is highly abstract
6+
and simulates the behavior of power conversion
7+
between electric power and mechanical power
8+
with the considerations for the power conversion efficiency.
9+
10+
The component is provided as a block in
11+
Simulink library file
12+
13+
- `MotorDriveUnit_refsub_library.mdl`
14+
15+
It is designed to be used as a reusable model.
16+
The content of the block is
17+
`MotorDriveUnit_refsub_Basic.mdl`,
18+
and its parameters are defined in
19+
`MotorDriveUnit_refsub_Basic_params.m`.
20+
21+
`Harness` folder contains the following harness model
22+
to run simulation with the Engine component.
23+
24+
- `MotorDriveUnit_Component_harness_model.mdl`
25+
26+
## Test Cases
27+
28+
`TestCases` folder contains Live Scripts
29+
that are used to visually inspect the simulation behaviors
30+
of the model in various simulation scenarios as follows.
31+
32+
- Constant ...
33+
All inputs are constant.
34+
This is used to check that the harness model runs.
35+
36+
- Start engine 1 ...
37+
Starting the engine with a motor is simulated.
38+
This first case is configured for a light mechanical load,
39+
with which engine can start without a reduction gear.
40+
41+
- Start engine 2 ...
42+
This is the same as the above case, but
43+
it is configured for a heavy mechanical load,
44+
similar to a passenger vehicle.
45+
A reduction gear is used to increase torque from engine.
46+
47+
_Copyright 2022 The MathWorks, Inc._

Components/MotorDriveUnit/Test/MotorDriveUnit_Component_runtests.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@
5050
fullfile(TopFolder, "Test", "MotorDriveUnit_Component_UnitTest_MQC.m"), ...
5151
fullfile(TopFolder, "TestCases", "MotorDriveUnit_Component_testcase_Constant.mlx"), ...
5252
fullfile(TopFolder, "TestCases", "MotorDriveUnit_Component_testcase_Drive.mlx"), ...
53-
fullfile(TopFolder, "Utility", "MotorDriveUnit_Component_plotResultInputs.m"), ...
54-
fullfile(TopFolder, "Utility", "MotorDriveUnit_Component_plotResultOutputs.m"), ...
53+
fullfile(TopFolder, "Utility", "MotorDriveUnit_Component_plotResults.m"), ...
5554
fullfile(TopFolder, "MotorDriveUnit_refsub_Basic_params.m")], ...
5655
Producing = coverageReport );
5756

@@ -61,4 +60,4 @@
6160

6261
results = run(runner, suite);
6362

64-
disp(results)
63+
assertSuccess(results)
Binary file not shown.
Binary file not shown.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
function fig = MotorDriveUnit_Component_plotResults(nvpairs)
2+
% plots the simulation result.
3+
4+
% Copyright 2021-2022 The MathWorks, Inc.
5+
6+
arguments
7+
nvpairs.SimData timetable
8+
nvpairs.FigureHeight (1,1) {mustBePositive} = 300
9+
end
10+
11+
sigNames = [ ...
12+
"Motor torque command",...
13+
"Axle clutch switch", ...
14+
"Axle speed input", ...
15+
"Axle torque input", ...
16+
"Motor power rate", ...
17+
"Motor speed", ...
18+
"Motor temperature", ...
19+
"Battery power", ...
20+
"Battery current", ...
21+
"Battery voltage", ...
22+
"Battery SOC" ];
23+
24+
for i = 1 : numel(sigNames)
25+
fig = plotSimulationResultSignal(SimData = nvpairs.SimData, SignalName = sigNames(i));
26+
fig.Position(4) = nvpairs.FigureHeight;
27+
end
28+
29+
end % function

0 commit comments

Comments
 (0)