Supercapacitor Parameter Identification

This example shows how to identify the parameters of a supercapacitor. Instead of collecting voltage and current waveforms from a real supercapacitor, the example generates voltage and current waveforms by running a simulation of a supercapacitor using parameter values that are already known. Then the example applies a parameter identification methodology [1] to the waveforms.

To assess the accuracy of the methodology, the example compares the identified parameters to the known parameter values. The example also shows how to further refine the parameter values using the Parameter Estimation tool provided by Simulink® Design Optimization™.

To identify the parameters of an actual supercapacitor empirically, you can:

  1. Collect voltage and current waveforms from the supercapacitor.

  2. Identify parameter values using the waveform data and the methodology described in [1].

To identify the parameters of a modeled supercapacitor, this example:

  1. Generates voltage and current waveforms by simulating a model that it configures using known values for supercapacitor parameters.

  2. Identifies supercapacitor parameter values using the generated waveform data and the methodology described in [1].

  3. Configures and simulates the supercapacitor using the identified supercapacitor parameter values.

To see how the approach works for a real supercapacitor, evaluate the accuracy of the identification methodology by comparing:

  • the data generated using known parameter values and the data generated using identified parameter values.

  • the known parameter values and identified parameter values.

If the accuracy is not sufficient, you can use the Parameter Estimation tool from Simulink Design Optimization to improve it. Use the identified parameter values as the starting values for the optimization.

Generate Data

Generate voltage and current waveforms by configuring and simulating a model using known values for the fixed resistances, fixed capacitances, and voltage-dependent capacitor gain parameters of the supercapacitor. Model the input current, configure the physical characteristics and self-discharge resistance of the supercapacitor using realistic values.

Observe the supercapacitor behavior during three distinct phases:

  1. Charge with constant current

  2. Charge redistribution from immediate to delayed branch

  3. Charge redistribution from immediate and delayed branches to long-term branch

% Open model
modelName = 'ee_supercapacitor_identification';
open_system(modelName);
set_param(find_system('ee_supercapacitor_identification','FindAll', 'on','type','annotation','Tag','ModelFeatures'),'Interpreter','off')

% Configure the supercapacitor using known parameter values.
%
% Supercapacitor block Cell Characteristics parameters
Kv = 190;                   % Voltage-dependent capacitor gain
R = [2.5e-3 0.9 5.2];       % Fixed resistances, [R1 R2 R3]
C = [270 100 220];          % Fixed capacitances, [C1 C2 C3]

% Store a copy of the known parameter values for an eventual comparison to
% parameter values identified using the methodology described in [1].
Kv_known = Kv;
R_known = R;
C_known = C;

% Specify input current by configuring the Step block.
%
% Step block parameters
stepTime = [40 1900 1917];  % Step time
initialValue = [28 0 0];    % Initial value
finalValue = [0 -25 25];    % Final value

% Specify the physical characteristics of the supercapacitor.
%
% Supercapacitor block Cell Characteristics and Configuration parameters
R_discharge = 9e3;          % Self-discharge resistance
N_series = 1;               % Number of series cells
N_parallel = 1;             % Number of parallel cells

% Specify the simulation duration
stopTime = 2100;

% Simulate and store voltage and current waveform data
sim(modelName);
t = simlog_ee_supercapacitor_identification.Sensing_current.It.i.series.time;
i = simlog_ee_supercapacitor_identification.Sensing_current.It.i.series.values;
v = simlog_ee_supercapacitor_identification.Sensing_voltage.V.V.series.values;

Perform Parameter Identification

Using the waveform data from the simulation, apply the methodology described in [1].

Immediate Branch Parameter Identification

During the first stage of the identification, a fully discharged supercapacitor is charged with constant current. The method assumes that the immediate branch stores all the initial charge because the time constant for the branch is relatively small.

Immediate branch parameters are calculated by taking measurements of the charge characteristic. Once charging current has reached steady-state at $t_1=20e^{-3} \rm{s}$, measure $v_1$ and use

$R_i=\frac{v_1}{i_1}$

where:

  • $t_1$ is time at parameter identification event $n=1$, $\rm{s}$

  • $v_1$ is terminal voltage at $t_1$, $\rm{V}$

  • $i_1$ is charging current at $t_1$, $\rm{A}$

  • $R_i$ is fixed resistance of immediate branch, $\rm{\Omega}$

Once voltage has increased from $v_1$ by approximately $50e^{-3} \rm{V}$, measure $t_2$ and $v_2$ and use

$C_{i0}=i_1\frac{t_2-t_1}{v_2-v_1}$

where:

  • $t_2$ is time at parameter identification event $n=2$, $\rm{s}$

  • $v_2$ is terminal voltage at $t_2$, $\rm{V}$

  • $C_{i0}$ is fixed capacitance of immediate branch, $\rm{F}$

Once voltage has reached rated voltage, measure $v_3$ and $t_3$, and turn off charging current. After $20e^{-3} \rm{s}$, once charging current has reached steady-state value of $0 \rm{A}$ measure $t_4$ and $v_4$ and use

$t_4 = t_3+20e^{-3}$

$C_{i1}=\frac{2}{v_4}(\frac{i_1(t_4-t_1)}{v_4}-C_{i0})$

where:

  • $t_3$ is time at parameter identification event $n=3$, $\rm{s}$

  • $v_3$ is terminal voltage at $t_3$, $\rm{V}$

  • $t_4$ is time at parameter identification event $n=4$, $\rm{s}$

  • $v_4$ is terminal voltage at $t_4$, $\rm{V}$

  • $C_{i1}$ is voltage-dependent capacitance coefficient, $\rm{F/V}$

% Event n=1
t1 = 20e-3;
i1 = interp1(t,i,t1);
v1 = interp1(t,v,t1);

Ri = v1/i1;

% Extract charging data that interp1 can use to find time values rather
% than voltage values
[v3, v_max_idx] = max(v);
[v_charge, v_charge_idx] = unique(v(1:v_max_idx));
t_charge = t(v_charge_idx);

% Event n=2
delta_v = 50e-3;
v2 = v1+delta_v;
t2 = interp1(v_charge,t_charge,v2);
i2 = interp1(t,i,t2);

Ci0 = i2*(t2-t1)/delta_v;

% Event n=3
t3 = t(v_max_idx);

% Event n=4
delta_t = 20e-3;
t4 = t3+delta_t;
v4 = interp1(t,v,t4);
Qtotal = i1*(t4-t1);
Cq = Qtotal/v4;

Ci1 = (2/v4)*(Cq-Ci0);

Delayed Branch Parameter Identification

During the second stage of the identification, charge redistributes from the immediate branch to the delayed branch.

Delayed branch parameters are calculated by taking measurements of the hold charge characteristic.

Once voltage has decreased from $v_4$ by approximately $50e^{-3} \rm{V}$, measure $t_5$ and $v_5$ and use

$\Delta v=v_4-v_5$

$V_{ci}=v_4-\frac{\Delta V}{2}$

$C_{diff}=C_{i0}+C_{i1}V_{ci}$

$R_d=\frac{(v_4-\frac{\Delta V}{2})(t_5-t_4)}{C_{diff}\Delta V}$

where:

  • $t_5$ is time at parameter identification event $n=5$, $\rm{s}$

  • $v_5$ is terminal voltage at $t_5$, $\rm{V}$

  • $V_{ci}$ is voltage at which the total immediate capacitance is to be calculated, $\rm{V}$

  • $C_{diff}$ is total immediate capacitance at $V_{ci}$, $\rm{F}$

  • $R_d$ is delayed branch resistance, $\rm{\Omega}$

Wait for 300 seconds, measure $t_6$ and $v_6$ and use

$Q_{total}=i_1(t_4-t_1)$

$C_d=\frac{Q_{total}}{v_6}-(C_{i0}+\frac{C_{i1}}{2}v_6)$

where:

  • $t_6$ is time at parameter identification event $n=6$, $\rm{s}$

  • $v_6$ is terminal voltage at $t_6$, $\rm{V}$

  • $Q_{total}$ is total charge supplied to the supercapacitor, $\rm{C}$

  • $C_d$ is delayed branch capacitance, $\rm{F}$

% Event n=5
v5 = v4-delta_v;
discharge_idx = find(i<-20,1,'first');
t_discharge = t(v_max_idx:discharge_idx);
v_discharge = v(v_max_idx:discharge_idx);
t5 = interp1(v_discharge,t_discharge,v5);
delta_t = t5-t4;
Vci = v4-(delta_v/2);
Cdiff = Ci0+Ci1*Vci;
Rd = (v4-(delta_v/2))*delta_t/(Cdiff*delta_v);

% Event n=6
TypicallyRdTimesCd = 100;
t6 = t5 + 3*TypicallyRdTimesCd;
v6 = interp1(t,v,t6);
Cd = (Qtotal/v6)-(Ci0+((Ci1/2)*v6));

Long-term Branch Parameter Identification

During the third, and final, stage of the identification, charge redistributes from the immediate and delayed branches to the long-term branch.

Long-term branch parameters are calculated by taking measurements of the hold charge characteristic.

Once voltage has decreased from $v_6$ by approximately $50e^{-3} \rm{V}$, measure $t_7$ and $v_7$ and use

$\Delta v=v_6-v_7$

$R_l=\frac{(v_6-\frac{\Delta V}{2})(t7-t_6)}{C_{diff}\Delta V}$

where:

  • $t_7$ is time at parameter identification event $n=7$, $\rm{s}$

  • $v_7$ is terminal voltage at $t_7$, $\rm{V}$

  • $R_l$ is long-term branch resistance, $\rm{\Omega}$

After 30 minutes from the start of the charging/discharging process, measure $t_8$ and $v_8$ and use

$C_l=\frac{Q_{total}}{v_8}-(C_{i0}+\frac{C_{i1}}{2}v_8)-C_d$

where:

  • $t_8$ is time at parameter identification event $n=8$, $\rm{s}$

  • $v_8$ is terminal voltage at $t_8$, $\rm{V}$

  • $C_l$ is long-term branch capacitance, $\rm{F}$

% Event n=7
v7 = v6-delta_v;
t7 = interp1(v_discharge,t_discharge,v7);
delta_t = t7-t6;
Vci = v6-(delta_v/2);
Cdiff = Ci0+Ci1*Vci;
Rl = (v6-(delta_v/2))*delta_t/(Cdiff*delta_v); % Rl value large

% Event n=8
t8 = 30*60;
v8 = interp1(t,v,t8);
Cl = (Qtotal/v8)-(Ci0+(v8*Ci1/2))-Cd; % Cl value too large

Collate Time and Voltage Data

Collate the time and voltage data for each parameter identification event in a MATLAB® table:

DataTable = table((1:8)',...
    [t1 t2 t3 t4 t5 t6 t7 t8]',...
    [v1 v2 v3 v4 v5 v6 v7 v8]',...
    'VariableNames',{'Event','Time','Voltage'}) %#ok<NOPTS>
DataTable =

  8x3 table

    Event     Time      Voltage 
    _____    _______    ________

      1         0.02    0.071799
      2      0.51803      0.1218
      3           40      2.2717
      4        40.02      2.2019
      5       56.675      2.1519
      6       356.67      1.8473
      7       499.28      1.7973
      8         1800      1.5865

Evaluate Accuracy of Identified Parameters

Configure and simulate the model using the identified supercapacitor parameters. Then, to evaluate the accuracy of the identified parameter values, compare the waveform output to the data generated by a simulation that uses known parameters.

% Create parameters for supercapacitor block using identified values and
% create copies for easy reference.
Kv = Ci1;
R = [Ri Rd Rl];
C = [Ci0 Cd Cl];
Kv_identified = Kv;
R_identified = R;
C_identified = C;

% Simulate the model and store voltage and current waveforms.
sim(modelName);
t_ = simlog_ee_supercapacitor_identification.Sensing_current.It.i.series.time;
v_ = simlog_ee_supercapacitor_identification.Sensing_voltage.V.V.series.values;

% Plot the data generated from simulating with known parameters on the
% same axis as the data generated from simulating with identified
% parameters.
figure;
plot(t,v,DataTable.Time,DataTable.Voltage,'o',t_,v_);
grid('on');
legend('Known parameters simulation',...
    'Measurements for parameter identification',...
    'Identified parameters simulation');

Optimization

Prerequisites:

  1. Simulink Design Optimization license

If the traces are not similar enough to meet requirements, then the identified parameter values can serve as initial parameter values for the Parameter Estimation tool from Simulink Design Optimization.

  • spetool('ee_supercapacitor_spesession');

Optimization Results

Display the parameter trajectory created using the Sum Squared Error cost function and Nonlinear least squares optimization method.

openfig('ee_supercapacitor_speresults');

References

[1] Zubieta, L. and R. Bonert. "Characterization of Double-Layer Capacitors for Power Electronics Applications." IEEE Transactions on Industry Applications, Vol. 36, No. 1, 2000, pp. 199-205.