-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBattery_RandomLoadTest.m
More file actions
27 lines (27 loc) · 1.11 KB
/
Battery_RandomLoadTest.m
File metadata and controls
27 lines (27 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
% This is to test the battery under a random load signal
% each step value is randomly selected and will remain for a random
% duration ot time before the next step
function Battery_RandomLoadTest(Battery)
%% Setting the Measurement device
SMU_Name = 'B2902A';
%% storage folder
Str_Add = ['Data',filesep,'Evaluation',filesep,'RandomLoad'];
%% bring battery to the standard point
Battery_Initialize(SMU_Name, Battery, Str_Add, 'Full');
%% Build random profile
PassedIn = 10e3; % Number of steps in 1 round
No_Iterations = 60; % Number of iterations
Min_Current = -35e-3;
Max_Current = 150e-6;
Min_TimePeriod = 1;
Max_TimePeriod = 120;
Current_Level = Min_Current + (Max_Current-Min_Current)*rand(PassedIn*No_Iterations,1);
Time_Duration = Min_TimePeriod + (Max_TimePeriod-Min_TimePeriod)*rand(PassedIn*No_Iterations,1);
%% Do measure
Finish_State = false;
Iter = 0;
while ~Finish_State
Start_Index = Iter*PassedIn +1;
[~,Finish_State] = Battery_RandomLoadSingle(SMU_Name, Battery, 'discharge', Current_Level(Start_Index:Start_Index+PassedIn), Time_Duration(Start_Index:Start_Index+PassedIn), Str_Add);
Iter = Iter+1;
end