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

Improvement: Make BYD protocol more robust for offgrid use #751

Merged
merged 3 commits into from
Jan 10, 2025

Conversation

dalathegreat
Copy link
Owner

@dalathegreat dalathegreat commented Jan 4, 2025

What

This PR makes the BYD protocol easier to use for Offgrid mode

Why

If emulator starts battery, but is unable to see inverter right away, it will go into Fault mode

How

We now wait until we have seen a BYD inverter message before we start sending anything towards the inverter. This prevents any CAN_TX_FAILURE messages from happening.

@GoSmartEV
Copy link
Contributor

10 seconds is too short, as the battery in a Volvo, for example, only starts after 10 seconds. Then the inverter takes about 10-20 seconds to begin sending data over the CAN. Please increase this time to 60 seconds.

@dalathegreat
Copy link
Owner Author

@GoSmartEV , changed to 60 seconds in commit b81e0f5

@GoSmartEV
Copy link
Contributor

@GoSmartEV , changed to 60 seconds in commit b81e0f5

It doesn’t recognize it in the right way the battery and invertor

IMG_5791
IMG_5792

@dalathegreat
Copy link
Owner Author

Hmm, not really sure how to solve this. If this PR did not help anything, I suggest we close it as wont do for now, and investigate your startup issue more in detail

@GoSmartEV
Copy link
Contributor

GoSmartEV commented Jan 5, 2025

Hmm, not really sure how to solve this. If this PR did not help anything, I suggest we close it as wont do for now, and investigate your startup issue more in detail

the program does not correctly determine where the battery and where the inverter is

But the CAN message are at the correct

this problem was in the oldest firmware too, it feels like it’s just mixed up

@GoSmartEV
Copy link
Contributor

IMG_5912
IMG_5913

@dalathegreat
Copy link
Owner Author

So the problem is most likely related to OFFGRID use, incase the Inverter is not powered on, the messages sent towards it will result in the board going into CAN_TX_FAILURE.

We need to add an OFFGRID toggle, where the code ignores total CAN failures and properly allows the system to start

@GoSmartEV
Copy link
Contributor

So the problem is most likely related to OFFGRID use, incase the Inverter is not powered on, the messages sent towards it will result in the board going into CAN_TX_FAILURE.

We need to add an OFFGRID toggle, where the code ignores total CAN failures and properly allows the system to start

Yes, this helps, and yes, it’s working for off grid 👌🏻

@dalathegreat dalathegreat changed the title Improvement: Move BYD startup messages to 10s block Improvement: Make BYD protocol more robust for offgrid use Jan 9, 2025
@dalathegreat dalathegreat marked this pull request as ready for review January 9, 2025 13:56
Copy link
Collaborator

@mvgalen mvgalen left a comment

Choose a reason for hiding this comment

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

LGTM.

@dalathegreat dalathegreat merged commit ca77485 into main Jan 10, 2025
104 checks passed
@dalathegreat dalathegreat deleted the bugfix/BYD-CAN-startup branch January 10, 2025 14:22
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.

3 participants