Kritisch: Relaisschleife nach Phasenumschaltung#3319
Open
s0170071 wants to merge 1 commit intoopenWB:masterfrom
Open
Kritisch: Relaisschleife nach Phasenumschaltung#3319s0170071 wants to merge 1 commit intoopenWB:masterfrom
s0170071 wants to merge 1 commit intoopenWB:masterfrom
Conversation
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.
Problem
Bei der internen openWB mit Phasenumschaltung kann es zu wiederholten Relais-Schaltungen (Relais-Schleife) kommen, wenn das Fahrzeug nach einer Phasenumschaltung nicht lädt.
Reproduktion
oder:
Was passiert (ohne Fix)
phases_to_use=1vs.phases_in_use=3→ löst Phasenumschaltung ausperform_phase_switch()schaltet die Relais korrekt (CP aus → Relais umschalten → CP an) — 2 Relais-Schaltungenphases_in_usefällt auf den Fallbackold_phases_in_usezurück — der steht noch auf 3 (vom vorherigen PV-Laden)phases_to_use=1vs.phases_in_use=3→ löst erneut eine Phasenumschaltung auskeep_charge_active_duration+ 20s Hauptschleife), bisfailed_phase_switchesdas Maximum erreichtUrsache
In
get_values()(Zeile ~98) wirdphases_in_useüber die Zählerströme ermittelt:python phases_in_use = sum(1 for current in counter_state.currents if current > 3) if phases_in_use == 0: phases_in_use = self.old_phases_in_use # Fallback bei 0AWenn das Fahrzeug nicht lädt (alle Ströme = 0), greift der Fallback auf
old_phases_in_use. Dieser Wert wird aber inperform_phase_switch()nicht aktualisiert, sodass er den alten Wert (3) behält.Lösung
Am Ende von
perform_phase_switch()wirdold_phases_in_useauf den neuen Sollwert gesetzt:python self.old_phases_in_use = phases_to_useDamit gibt der Fallback den angeforderten Zustand zurück statt den veralteten. Die State-Machine in
chargepoint.pysieht dann keinen Mismatch mehr und löst keine weitere Umschaltung aus.Dieses Muster wird beim Booten bereits verwendet (Zeile 64-65):
python self.perform_phase_switch(1) self.old_phases_in_use = 1Es fehlte nur innerhalb der Methode selbst.