CbChargeSOMDriver: refactoring of contactor control for AC and DC use-cases#64
Open
mhei wants to merge 8 commits into
Open
CbChargeSOMDriver: refactoring of contactor control for AC and DC use-cases#64mhei wants to merge 8 commits into
mhei wants to merge 8 commits into
Conversation
Signed-off-by: Michael Heimpold <michael.heimpold@chargebyte.com>
…ame CbTarragonRelay class This will helper later to re-use the contactor control classes on other platforms. Signed-off-by: Michael Heimpold <michael.heimpold@chargebyte.com>
Signed-off-by: Michael Heimpold <michael.heimpold@chargebyte.com>
The goal is to re-use the existing contactor control classes and the same configuration keys are already known for Tarragon platform. However, the control path for the contactors is different and thus it introduces a new "relay" class CbCarrierBoardRelay which bridges between the CbChargeSOM and the contactor control classes. Please also not, that there is no physical "relay" on the existing carrier boards, but it is only a 'switch chip' - for this reason, we do not need to model 'closing delays' at the moment. Signed-off-by: Michael Heimpold <michael.heimpold@chargebyte.com>
On platforms with safety controller, it's better to have async events when contactor states change. So add this as infrastructure. Signed-off-by: Michael Heimpold <michael.heimpold@chargebyte.com>
Signed-off-by: Michael Heimpold <michael.heimpold@chargebyte.com>
Introduce a new config option for this because it is kind of different to AC and phase count configuration. Also introduce a new conncector type: use a string which is most probably introduced later by upstream. The connector is now used to determine AC vs DC use-case. Signed-off-by: Michael Heimpold <michael.heimpold@chargebyte.com>
Now that we have proper DC contactor control, we can simplify the relay class again and get rid of switching two relay channels from the same instance: the proper modelling is 1:1, i.e. a relay class instance corresponds to a single channel and the combination is ensure in the layer above. Signed-off-by: Michael Heimpold <michael.heimpold@chargebyte.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does not only affect CbChargeSOMDriver, but also influences CbTarragonDriver - but there is no functional change expected.
It restructures the contactor control classes, developed and used by CbTarragonDriver, and make then usable also for CbChargeSOMDriver. For this, the files are moved to the recently introduced library part of this repo.
CbChargeSOMDriver gains then support for phase count switching in AC use-cases, with the same wiring possibilities already supported by CbTarragonDriver.
The contactor control classes can also be used to model the DC use-cases in a better way, so a new configuration parameter is introduced for DC use-cases as well.
Note, that there is currently no cross-check implemented, which checks whether the safety controller configuration really fits to the EVerest side. This might be implemented in a subsequent PR but needs some infrastructure rework before.
One downside of this is, that users needs to configure the feedback type twice at the moment: the CbChargeSOMDriver wants to know which kind of feedback of the contactor is used, and the safety controller needs this information too.