Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.6 Smart Charging Calculate Composite Schedule #609

Closed
folkengine opened this issue May 7, 2024 · 3 comments
Closed

1.6 Smart Charging Calculate Composite Schedule #609

folkengine opened this issue May 7, 2024 · 3 comments
Assignees

Comments

@folkengine
Copy link
Contributor

folkengine commented May 7, 2024

OCPP Version

OCPP1.6

Describe the bug

When attempting to determine the Composite Schedule in 1.6, if a Profile's chargingSchedulePeriod begins after the start of the requested time range, even if it is within the time range, the Profile's chargingSchedulePeriod won't be applied.

To Reproduce

For example, given these two Profiles:

{
  "chargingProfileId": 1,
  "chargingProfileKind": "Absolute",
  "chargingProfilePurpose": "TxDefaultProfile",
  "chargingSchedule": {
    "chargingRateUnit": "W",
    "chargingSchedulePeriod": [
      {
        "limit": 2000.0,
        "numberPhases": 1,
        "startPeriod": 0
      }
    ],
    "duration": 1080,
    "minChargingRate": 0.0,
    "startSchedule": "2024-01-17T18:00:00.000Z"
  },
  "recurrencyKind": "Daily",
  "stackLevel": 1
}
{
    "chargingProfileId": 100,
    "chargingProfileKind": "Recurring",
    "chargingProfilePurpose": "TxDefaultProfile",
    "chargingSchedule": {
        "chargingRateUnit": "W",
        "chargingSchedulePeriod": [
            {
                "limit": 11000.0,
                "numberPhases": 3,
                "startPeriod": 0
            },
            {
                "limit": 6000.0,
                "numberPhases": 3,
                "startPeriod": 28800
            },
            {
                "limit": 12000.0,
                "numberPhases": 3,
                "startPeriod": 72000
            }
        ],
        "duration": 86400,
        "minChargingRate": 0.0,
        "startSchedule": "2023-01-17T17:00:00.000Z"
    },
    "recurrencyKind": "Daily",
    "stackLevel": 0
}

If you set the start of the time range to 18:01:00 the generated Composite Schedule will include the time range that started at 18:00:00:

{
    "chargingRateUnit": "W",
    "chargingSchedulePeriod": [
        {
            "limit": 2000.0,
            "numberPhases": 1,
            "stackLevel": 1,
            "startPeriod": 0
        },
        {
            "limit": 11000.0,
            "numberPhases": 3,
            "stackLevel": 0,
            "startPeriod": 1020
        }
    ],
    "duration": 21540
}

The breakdown is:

Start Time> 2024-01-17T18:01:00.000Z
            period #1 {limit: 2000 numberPhases:1 stackLevel:1} starts 0 Seconds in
            period #2 {limit: 11000 numberPhases:3 stackLevel:0} starts 17 Minutes in
            period #2 ends after 5 Hours 59 Minutes

However, if the time range starts one second before the Profile's chargingSchedulePeriod, even though the Profile's period is within the time range requested, it will not be applied:

{
    "chargingRateUnit": "W",
    "chargingSchedulePeriod": [
        {
            "limit": 11000.0,
            "numberPhases": 3,
            "stackLevel": 0,
            "startPeriod": 0
        }
    ],
    "duration": 21601
}
Start Time> 2024-01-17T17:59:59.000Z
            period #1 {limit: 11000 numberPhases:3 stackLevel:0} starts 0 Seconds in
            period #1 ends after 6 Hours 1 Seconds 

This image will show a graphical breakdown of the data:

CompositeSchedule

Anything else?

liboccp PR #606 has tests that include both examples shown above.

@folkengine
Copy link
Contributor Author

folkengine commented May 16, 2024

bugfix/composite-schedule-calculation is a branch that is working on this issue.

No longer needed. Fixed in #619

@Pietfried
Copy link
Contributor

This should be fixed with a rework of the composite schedule calcuation: #619

@folkengine
Copy link
Contributor Author

This should be fixed with a rework of the composite schedule calcuation: #619

Confirmed. #745 will include tests used to verify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants