no message
This commit is contained in:
@@ -708,6 +708,82 @@ class Bat_EV_SDL_V4 extends IPSModule
|
|||||||
* Batterie liefert real nur 3600 W.
|
* Batterie liefert real nur 3600 W.
|
||||||
* Dann wird EV = 2700 W, SDL = 900 W angenommen.
|
* Dann wird EV = 2700 W, SDL = 900 W angenommen.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
private function UpdateActualPowerSplit(float $pEvW, float $pSdlW): void
|
||||||
|
{
|
||||||
|
$totalPowerIst = $this->GetTotalBatteryPowerIstW();
|
||||||
|
|
||||||
|
$eps = 0.01;
|
||||||
|
|
||||||
|
$sumSoll = $pEvW + $pSdlW;
|
||||||
|
$sumAbsSoll = abs($pEvW) + abs($pSdlW);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Die Abweichung zwischen realer Batterieleistung und
|
||||||
|
* Netto-Soll proportional auf EV und SDL verteilen.
|
||||||
|
*
|
||||||
|
* Funktioniert auch bei:
|
||||||
|
* EV = +42000 W
|
||||||
|
* SDL = -40000 W
|
||||||
|
*/
|
||||||
|
if ($sumAbsSoll > $eps) {
|
||||||
|
$abweichungW = $totalPowerIst - $sumSoll;
|
||||||
|
|
||||||
|
$evAnteil = abs($pEvW) / $sumAbsSoll;
|
||||||
|
$sdlAnteil = abs($pSdlW) / $sumAbsSoll;
|
||||||
|
|
||||||
|
$rawEV = $pEvW + ($abweichungW * $evAnteil);
|
||||||
|
$rawSDL = $pSdlW + ($abweichungW * $sdlAnteil);
|
||||||
|
} else {
|
||||||
|
$rawEV = (float)$this->GetBufferSafe("CUR_EV_VAL");
|
||||||
|
$rawSDL = (float)$this->GetBufferSafe("CUR_SDL_VAL");
|
||||||
|
}
|
||||||
|
|
||||||
|
$filterAktiv = $this->ReadPropertyBoolean("FilterAktiv");
|
||||||
|
|
||||||
|
if ($filterAktiv) {
|
||||||
|
$tolPct = max(
|
||||||
|
0.0,
|
||||||
|
(float)$this->ReadPropertyFloat("FilterTolerancePct")
|
||||||
|
) / 100.0;
|
||||||
|
|
||||||
|
$needHits = max(
|
||||||
|
1,
|
||||||
|
(int)$this->ReadPropertyInteger("FilterHits")
|
||||||
|
);
|
||||||
|
|
||||||
|
$fEV = $this->FilterCurrent(
|
||||||
|
"EV",
|
||||||
|
$rawEV,
|
||||||
|
$pEvW,
|
||||||
|
abs($pEvW) * $tolPct,
|
||||||
|
$needHits
|
||||||
|
);
|
||||||
|
|
||||||
|
$fSDL = $this->FilterCurrent(
|
||||||
|
"SDL",
|
||||||
|
$rawSDL,
|
||||||
|
$pSdlW,
|
||||||
|
abs($pSdlW) * $tolPct,
|
||||||
|
$needHits
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$fEV = $rawEV;
|
||||||
|
$fSDL = $rawSDL;
|
||||||
|
$this->ClearCurrentFilterBuffers();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->SetIdentValue(
|
||||||
|
"Aktuelle_Leistung_EV",
|
||||||
|
(float)$fEV
|
||||||
|
);
|
||||||
|
|
||||||
|
$this->SetIdentValue(
|
||||||
|
"Aktuelle_Leistung_SDL",
|
||||||
|
(float)$fSDL
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/*
|
||||||
private function UpdateActualPowerSplit(float $pEvW, float $pSdlW): void
|
private function UpdateActualPowerSplit(float $pEvW, float $pSdlW): void
|
||||||
{
|
{
|
||||||
$totalPowerIst = $this->GetTotalBatteryPowerIstW();
|
$totalPowerIst = $this->GetTotalBatteryPowerIstW();
|
||||||
@@ -740,7 +816,7 @@ class Bat_EV_SDL_V4 extends IPSModule
|
|||||||
|
|
||||||
$this->SetIdentValue("Aktuelle_Leistung_EV", (float)$fEV);
|
$this->SetIdentValue("Aktuelle_Leistung_EV", (float)$fEV);
|
||||||
$this->SetIdentValue("Aktuelle_Leistung_SDL", (float)$fSDL);
|
$this->SetIdentValue("Aktuelle_Leistung_SDL", (float)$fSDL);
|
||||||
}
|
}*/
|
||||||
/**
|
/**
|
||||||
* Filtert die rückgerechnete Istleistung.
|
* Filtert die rückgerechnete Istleistung.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user