-
Notifications
You must be signed in to change notification settings - Fork 79
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
Refactor/bsp interface #379
Conversation
243fe8d
to
1072f72
Compare
Hi @corneliusclaussen |
This is a refactoring that was planned for quite some time. As it breaks the BSP interfaces in an incompatible way, all BSP drivers will need to be changed. It should be relatively easy though.
In addition a lot of small improvements were made. As this breaks code for many users we will also announce this on the mailing list as well as in todays community dev meeting |
Another note: EvseManager itself will need internal refactoring as well at some point as it got quite complex, but for now this is more about improving the interfaces to the outside so that we hopefully do not need to break BSP compatibility soon again. |
Please especially review the following: interfaces/evse_board_support.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
General notes:
- Not sure what guidelines do you follow, but what about using "this" to improve readability?
- Code documentation
e396e87
to
3420b10
Compare
I will need to do another round of review, but at least I can confirm that the SIL is working now, also in multiple subsequent charging sessions. |
Hi, How should we handle these? Add them on demand later? |
About the BspEvent error codes: I'm trying to collect all useful error codes in this enum at the moment. I'll have a look at your list as well and will include them, I think it is a good moment as we are breaking things anyway right now. Of course also more can be added later on. |
I looked through the ChargeControl C documentation and added the lock motor failure details. I renamed them a bit to align better with the wording used in MREC codes. The other error codes such as RCD and powermeter do not belong to this interface, they should go into the ac_rcd and powermeter interfaces. Those will become reportable errors as well soon with the new error handling framework. |
13b76d2
to
3bdd847
Compare
@corneliusclaussen I have a question regarding the detection of an EV. It's possible to implement this via different approaches (only CP, only PP, mixed CP/PP). Is it up to the implementor of the board support package to decide if an EV is connected or is there some kind of EVerest policy how to detected this? |
@corneliusclaussen: Would it be an option for you to cut the plug lock stuff out into a dedicated interface? This would make the bsp interface even more generic and minimalistic. BSPs with plug lock capabilities could easily implement both interfaces in a single module (e.g. Yeti if I'm right) and boards with no hardware support at all could easily just skip it. On platform like our Tarragon, we have for example two hardware plug lock interfaces. Our plan would be to create a module which cares about a single one, but customers could use another module instance for the second plug lock (e.g. for locking a fixed cable while a socket is in use...). |
No, the BSP just sends the states etc, it does not need to find out if a car is connected or not. The norm leaves that as a choice for the implementation afaik. EvseManager always uses CP to detect a plugin. If configured for Socket (non tethered) it will use PP afterwards to determine the current limit (and set it to 0 if PP value is invalid). This means: attached cable: CP only (nothing else is possible) I do not see an application where PP only makes sense? |
In this case EvseManager would need to decide when to lock/unlock. In all HW that we have here this is actually done by an MCU (which ensures proper unlocking in case of Linux fails etc). It could be done though as the MCU can still do it on its own and not use the evsemanager supplied information. I factored out the RCD for the same reason of . I can make a draft, but probably after charin testival |
@mhei : Another though on this: If we refactor out all motor lock things into a separate interface, would it make sense to also move all PP related things to this motor lock interface? If there is a socket it also requires a lock and only with a socket PP is useful? If there is a fixed attached cable you don't need motor lock but you also don't need PP. What do you think? |
5c95274
to
0889146
Compare
I like this idea. Reason is that when we factor out RCD stuff, then IMHO the EvseManager is in charge to control whether the plug should be pull-able from the socket or not and not the BSP (since it does not have the information about the tripped RCD/RCM). (I such an error case, this could then e.g. require explicit force-removal trigger via OCPP...)
I agree that this is usually related, but as I mentioned, I'd like to (re-)use the lock motor interface for other purposes as well. Having then a stray PP interface in this interface would make things more complex on this side. |
Agreed. Then we leave PP in the bsp interface and create a new one with just the lock/unlock commands and error reports for the lock |
c6b55b5
to
5f8780e
Compare
I pushed a draft for the interfaces/connector_lock.yaml, pls have a look. It is not used that, I'll implement in evsemanager once the interface is agreed |
@corneliusclaussen : connector lock interface (aka motor lock interface) LGTM, thanks for addressing this topic so quickly 👍 |
Hello together, We at chargebyte would like to give you a brief update on the current draft of the BSP interface. We have tested the new interface for CP/PP and contactor handling with our hardware platform for the AC path. Everything seems to work as expected with the EvseManager. Some comments are still open from the code review, but once these are answered we see no problems to create a pull request from it. Also the reported bug with resuming of the charging session by the EV (CP B -> C -> B -> C transition) works now after we updated everest framework. We know that it will probably take a lot of effort on your side to prepare everything that it can be merged into erverest-core, but we are looking forward to working with the new interface soon :-). Are there already plans when the new interface will be available? Thank you and best regards |
One additional note to the CP B -> C -> B -> C transition scenario. There is still 100% duty cycle for a short time after the second switch from B to C. I think this not expected. |
Will look into the comments. Apart from that I would like to move all error logic over to the new error handling in framework. After that I will undraft the PR |
b2f68eb
to
c2e57a7
Compare
853ef93
to
dea0de0
Compare
5d48b56
to
0eb2a50
Compare
All comments should be addressed now. It was tested both in SIL as well as on real hardware. |
fec80d9
to
d8a6680
Compare
bded59b
to
0c61816
Compare
- The new evse_board_support interface replaces the old board_support_AC interface both for AC and DC. - Move from abstract events (e.g. CarPluggedIn) to CP states A/B/C/D/E/F to simplify BSP drivers - This moves the complete IEC61851-1 state machine into EvseManager - create new interfaces for AC_RCD and connector_lock - Charging subsystem is now using the new error framework - Added most MREC error types that relate to charging - Yeti and umwc driver will need MCU firmware updates that will come soon - Added most MREC fault codes to NodeRed SIL UI Signed-off-by: Cornelius Claussen <[email protected]>
0c61816
to
02382f7
Compare
Add {} to if Co-authored-by: Kai Hermann <[email protected]> Signed-off-by: corneliusclaussen <[email protected]>
Signed-off-by: Cornelius Claussen <[email protected]>
if (caps_received) | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (caps_received) | |
break; | |
if (caps_received) { | |
break; | |
} |
No description provided.