Skip to content

Commit

Permalink
Enhance HVFaultSensor by adding new fault messages and correcting for…
Browse files Browse the repository at this point in the history
…matting in fault reporting. This update includes additional fault descriptions for improved diagnostics.
  • Loading branch information
maslyankov committed Jan 15, 2025
1 parent 7469645 commit 8c3a9ba
Showing 1 changed file with 35 additions and 4 deletions.
39 changes: 35 additions & 4 deletions src/sunsynk/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ def reg_to_value(self, regs: RegType) -> ValType:
for bit in range(16):
msk = 1 << bit
if msk & b16:
msg = f"F{bit + off + 1:02} " + faults.get(off + msk, "")
msg = f"F{bit+off+1:02} " + faults.get(off + msk, "")
err.append(msg.strip())
off += 16
return ", ".join(err)
Expand All @@ -281,34 +281,65 @@ def reg_to_value(self, regs: RegType) -> ValType:
"""Decode HV Inverter faults."""
faults = {
1: "DC Inversed Failure",
2: "DC insula�on impedance permanent fault",
3: "DC leakage current fault",
4: "Ground fault GFDI",
5: "Read the memory error",
6: "Write the memory error",
7: "DC START Failure",
8: "GFDI grounding touch failure",
9: "IGBT damaged by excessive drop voltage",
10: "Auxiliary power supply failure",
11: "AC main contactor errors",
12: "AC auxiliary contactor errors",
13: "Working mode change",
14: "DC over current SW Failure",
15: "AC over current SW Failure",
10: "Aux Power Board Failure",
16: "DC Ground Leakage current fault",
18: "AC over current TZ",
19: "All hardware failure synthesis",
20: "DC over current",
21: "DC HV Bus over current",
22: "Remote Emergency stop",
23: "AC leakage current is transient over current",
24: "DC insulation impedance",
25: "DC feedback fault",
26: "DC busbar imbalanced",
29: "Parallel comms cable",
27: "DC end insula�on error",
28: "Inverter 1 DC high fault",
29: "Parallel comms cable/AC load switch failure",
30: "AC main contactor failure",
31: "Relay open circuit fault",
32: "Inverter 2 dc high fault",
33: "AC Overcurrent",
34: "AC Overload (backup)",
35: "No AC grid",
36: "AC grid phase error",
37: "AC three-phase voltage unbalance failure",
38: "AC three-phase current unbalance failure",
39: "AC over current (one cycle)",
40: "DC over current",
41: "Parallel system stopped",
42: "AC line low voltage",
43: "AC Line V,W over voltage",
44: "AC Line V,W low voltage",
45: "AC Line U,V over voltage",
46: "Battery 1 fault",
49: "Battery 2 fault",
47: "AC grid freq too high",
48: "AC grid freq too low",
49: "Battery 2 fault",
50: "V phase grid current DC component over current",
51: "W phase grid current DC component over current",
52: "DC voltage too high",
53: "DC voltage too low",
54: "battery 1 voltage high",
55: "battery 2 voltage high",
56: "battery 1 voltage low",
57: "battery 2 voltage low",
58: "bms communication lost",
59: "AC grid V over current",
60: "AC grid W over current",
61: "Reactor A phase over current",
62: "DRM stop activated",
63: "ARC fault",
64: "Heat sink tempfailure",
Expand Down

0 comments on commit 8c3a9ba

Please sign in to comment.