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

BYD Atto3: Add 10 temperature sensors to datalayer #849

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

Conversation

dalathegreat
Copy link
Owner

@dalathegreat dalathegreat commented Feb 3, 2025

What

This PR makes it so you can track all 10 temperature sensors inside the battery

It also adds a method to skip using a specific temperature sensor, if you know it is broken.

Example, Sensor number 4 broken

image

image

Why

Better way to monitor the battery.

Also adds a way to use a battery without needing to replace a daughterboard with broken temp sensor (Note, requires deep knowledge of actual battery status)

How

All 10x measurements added to extended datalayer

Configurable option in .h file, SKIP_TEMPERATURE_SENSOR_NUMBER that can be tuned between 1-10 if needed

@dalathegreat dalathegreat changed the title Add 10 temperature sensors to datalayer BYD Atto3: Add 10 temperature sensors to datalayer Feb 3, 2025
@dalathegreat dalathegreat marked this pull request as ready for review February 5, 2025 21:19
battery_calc_max_temperature = battery_daughterboard_temperatures[1];
}
for (int i = 1; i < 10; i++) {
if (i == (SKIP_TEMPERATURE_SENSOR_NUMBER - 1)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it a likely scenario to have multiple failed sensors? if it is should this be an array or a bitmask of allowed sensors?

Copy link
Owner Author

Choose a reason for hiding this comment

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

For now it is so rare that a sensor would be broken. Best to keep it safe, and only allow bypassing a single faulted sensor. We also dont know if the BMS does something when sensors fail, so let's not risk it 😓

battery_calc_min_temperature = battery_daughterboard_temperatures[1];
battery_calc_max_temperature = battery_daughterboard_temperatures[1];
}
for (int i = 1; i < 10; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this start at sensor 0?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Not needed, since we init the value to [0] element at the start

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.

2 participants