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

zn/#2301 fix charging power plots #2302

Merged
merged 2 commits into from
Jan 3, 2020

Conversation

zneedell
Copy link
Collaborator

@zneedell zneedell commented Dec 11, 2019

The average load during an hour in kW should be the sum of the energy delivered (in kWh) of all charging events during that hour. This still doesn't handle charging sessions that span multiple hour bins, but that effect shouldn't be too big with fast chargers.

Fixes #2301


This change is Reviewable

Copy link
Collaborator

@JustinPihony JustinPihony left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if you addressed my comment, but I assume you've run this past others and your own records more accurate - so approving.

val energyInJoules = refuelSessionEvent.energyInJoules
val sessionDuration = refuelSessionEvent.sessionDuration
val currentEventAverageLoad = if (sessionDuration != 0) energyInJoules / sessionDuration / 1000 else 0
val energyInkWh = refuelSessionEvent.energyInJoules / 3.6e6
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't session duration need to be factored because we want the average...or do we want the total energy?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to get another set of eyes here. @colinsheppard or @wrashid maybe?

I think that session duration is being factored in implicitly because the time bins have fixed length. So if we count the number of kWh (energy) during a time bin and then divide by the bin duration (1 hr, so not explicitly done here) we get the average rate of power consumption, in kW.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, but isn't session duration often less than the hour bin?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right--let's say we have a 30 minute charging session that delivers 10 kWh. If that's the only session, the charger was delivering 20 kW for 30 minutes and 0 kW for 30 minutes, so it had an average load of 10 kW for the hour. I guess this isn't the only reasonable definition for average charging power, but I think this one will end up being the most useful.

@zneedell zneedell merged commit 4fc6452 into develop Jan 3, 2020
@zneedell zneedell deleted the zn/#2301-fix-charging-power-plots branch January 3, 2020 15:58
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

Successfully merging this pull request may close these issues.

Charging power plots aren't correct
2 participants