Skip to content

Battery Current Adjustment with SOC bug #445

@dguittet

Description

@dguittet

Describe the bug
Assume there is 1 kW required from the battery and this is calculated at the beginning of the time step as requiring 2 A from the battery. When the thermal response is applied to the capacity model, reducing the capacity, the adjustment to the current can result in extreme current changes.

To Reproduce
Steps to reproduce the behavior:
Add these tests to lib_battery_capacity_test.cpp:

TEST_F(LiIon_lib_battery_capacity_test, CurrentChangedBySOCLimits) {
    double I = 35.;
    double dt = 1./60.;

    auto cap = std::make_shared<capacity_lithium_ion_t>(19984, 90, SOC_max, SOC_min, dt);
    cap->updateCapacityForThermal(90);
    cap->updateCapacity(I, dt);

    printf("I %f\n", I);                 // I is now 53956.800000
}

TEST_F(LiIon_lib_battery_capacity_test, CurrentChangedBySOCLimits1) {
    double I = -35.;
    double dt = 1./60.;

    auto cap = std::make_shared<capacity_lithium_ion_t>(19984, 10, SOC_max, SOC_min, dt);
    cap->updateCapacityForThermal(90);
    cap->updateCapacity(I, dt);

    printf("I %f\n", I);                 // I is now -41966.400000
}

Expected behavior
The current adjustment cannot be calculate correctly within capacity_t since more information is required for battery_t to provide the requested power. The current adjustment should be minor and should signal to the battery_t iteration that the required current needs to be recomputed.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions