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

Function bms_soc_update no longer called post-zephyr bms driver update #40

Closed
pasrom opened this issue Jan 19, 2024 · 3 comments · Fixed by #41
Closed

Function bms_soc_update no longer called post-zephyr bms driver update #40

pasrom opened this issue Jan 19, 2024 · 3 comments · Fixed by #41

Comments

@pasrom
Copy link
Collaborator

pasrom commented Jan 19, 2024

After the recent Zephyr driver update (commit f0ff664), the bms_soc_update function seems to have stopped being invoked. This has led to the State of Charge (SoC) no longer being calculated. Prior to this update, the function was regularly called at this location:

void bms_update(Bms *bms)
{
bms_read_voltages(bms);
bms_read_current(bms);
bms_soc_update(bms);
bms_read_temperatures(bms);
bms_update_error_flags(bms);
bms_update_balancing(bms);
}

Could you advise on the best location for invoking bms_soc_update in the current code framework to maintain precise SoC measurements?

@pasrom
Copy link
Collaborator Author

pasrom commented Jan 19, 2024

I recommend placing the call to bms_soc_update(&bms) before line 66, where bms_state_machine(&bms) is called.

err = bms_ic_read_data(bms_ic, BMS_IC_DATA_ALL);
if (err != 0) {
LOG_ERR("Failed to read data from BMS IC: %d", err);
}
bms_state_machine(&bms);

@martinjaeger
Copy link
Member

Thanks for raising the issue. I'm planning to do some further BMS testing tomorrow anyway, so I'll have al look into that.

@martinjaeger
Copy link
Member

I agree with your proposed fix and have created a PR (see link above).

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 a pull request may close this issue.

2 participants