Fix minActiveVoltage (#8867)

Reduce lower limit to >= 207V (230V-10%)
This commit is contained in:
VolkerK62 2023-07-09 10:40:32 +02:00 • committed by GitHub
parent ebff2049af
commit 1e14d2db2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,7 +50,7 @@ const (
timerInactive = "inactive"
minActiveCurrent = 1.0 // minimum current at which a phase is treated as active
minActiveVoltage = 208 // minimum voltage at which a phase is treated as active
minActiveVoltage = 207 // minimum voltage at which a phase is treated as active
guardGracePeriod = 60 * time.Second // allow out of sync during this timespan
phaseSwitchCommandTimeout = 30 * time.Second // do not sync charger enabled/disabled state during this timespan
@ -1261,15 +1261,15 @@ func (lp *Loadpoint) updateChargeVoltages() {
lp.publish("chargeVoltages", chargeVoltages)
// Quine-McCluskey for (¬L1∧L2∧¬L3) ∨ (L1∧L2∧¬L3) ∨ (¬L1∧¬L2∧L3) ∨ (L1∧¬L2∧L3) ∨ (¬L1∧L2∧L3) -> ¬L1 ∧ L3 ∨ L2 ∧ ¬L3 ∨ ¬L2 ∧ L3
if !(u1 > minActiveVoltage) && (u3 > minActiveVoltage) || (u2 > minActiveVoltage) && !(u3 > minActiveVoltage) || !(u2 > minActiveVoltage) && (u3 > minActiveVoltage) {
if !(u1 >= minActiveVoltage) && (u3 >= minActiveVoltage) || (u2 >= minActiveVoltage) && !(u3 >= minActiveVoltage) || !(u2 >= minActiveVoltage) && (u3 >= minActiveVoltage) {
lp.log.WARN.Printf("invalid phase wiring between charge meter and charger")
}
var phases int
if (u1 > minActiveVoltage) || (u2 > minActiveVoltage) || (u3 > minActiveVoltage) {
if (u1 >= minActiveVoltage) || (u2 >= minActiveVoltage) || (u3 >= minActiveVoltage) {
phases = 3
}
if (u1 > minActiveVoltage) && (u2 < minActiveVoltage) && (u3 < minActiveVoltage) {
if (u1 >= minActiveVoltage) && (u2 < minActiveVoltage) && (u3 < minActiveVoltage) {
phases = 1
}