AlexanderTonn / SolarPowerhouse

Solar balkony power plant, which includes control logic for switching between micro inverter and battery depending on the state of charge. The repository containing any drawings and manuals.
Apache License 2.0
0 stars 0 forks source link

[BUG] Touch reaction slow #28

Closed AlexanderTonn closed 9 months ago

AlexanderTonn commented 10 months ago

:bug: Describe the bug

 :bangbang: To Reproduce**

Steps to reproduce the behavior:

:interrobang: Expected behavior

A clear and concise description of what you expected to happen.

:camera: Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

AlexanderTonn commented 9 months ago

Reason for the issue was the usage of "delay()" in the controlLogic.ino

// Set Relays on Mppt Mode
void relayOnMppt() {
  auto ms = secondToMs(uiSett_PVswitchingDelay);
  digitalWrite(K2_INVERTER_AC, LOW);
  delay(ms);
  digitalWrite(K1_INVERTER_DC, LOW);
  delay(ms);
  digitalWrite(K3_MPPT_CHARGER, HIGH);
  byModeActual = BATTERY_MODE;
}
void relayOnInverter() {
  auto ms = secondToMs(uiSett_PVswitchingDelay);
  digitalWrite(K3_MPPT_CHARGER, LOW);
  delay(ms);
  digitalWrite(K1_INVERTER_DC, HIGH);
  delay(ms);
  digitalWrite(K2_INVERTER_AC, HIGH);
  byModeActual = INVERTER_MODE;
}