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

Feature: Add forced Tesla LFP balancing functionality #718

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dalathegreat
Copy link
Owner

@dalathegreat dalathegreat commented Dec 30, 2024

What

This PR implements forced balancing functionality for Tesla LFP batteries (Model 3/Y)

Why

To help keep LFP batteries balanced outside of a Tesla vehicle. This mimics more how the batteries would be commanded in a vehicle.

How

The forced balancing mode can be enabled via the Webserver. It is recommended to run this once per month on Tesla LFP batteries. Before enabling, make sure battery is close to full, and you have enough sun or grid power to continue charging and forcing the balance!

When enabling the Manual LFP balancing , the balancing runs for the specified amount of time, set in Balancing max time. The balancing parameters, Balancing float power , Max battery voltage , Max cell voltage and Max cell voltage deviation can also be adjusted from here.

image

@dalathegreat dalathegreat added the enhancement New feature or request label Dec 30, 2024

// During forced balancing request via webserver, we allow the battery to exceed normal safety parameters
if (datalayer.battery.settings.user_requests_balancing) {
datalayer.battery.status.real_soc = 9900; //Force battery to show up as 99% when balancing
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is the soc forced to 99%? As far as I can see, it is not used programmatically?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Incase the battery shows 100%, charging would stop in the Safety.cpp file. So we need to ensure it does not.

Could also be solved with an if == 100, then 99 check

Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't it make more sense to have the safety check take the user_requests_balancing into account? And have safety then also look at he max charge power for instance? Only if the combination is satisfied may charging continue.

if (millis() - datalayer.battery.settings.balancing_start_time_ms >= datalayer.battery.settings.balancing_time_ms) {
datalayer.battery.settings.user_requests_balancing = false;
datalayer.battery.settings.balancing_start_time_ms = 0; // Reset the start time
//TODO, raise info event? Balancing time elapsed. Turning off...
Copy link
Collaborator

Choose a reason for hiding this comment

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

perhaps a logging.println("TESLA: Balancing time finished"); ?

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

Successfully merging this pull request may close these issues.

2 participants