Write the rolling-bearing analysis program of a wind farm's drivetrain condition monitoring (order tracking from the tacho, envelope analysis, fault type per bearing and spall size from the entry-exit interval) across gearbox variants, firmware formats and fleet changes; it is run on further vibration snapshots with known bearing states.
harbor run -t reactive-labs/bearing-diagnosticsharbor download reactive-labs/bearing-diagnosticsYou are Sigrun Dahle, condition monitoring engineer in Asset Engineering at Vardholm Energi AS. Vardholm runs the Lysmyra wind farm: 18 Aldervik AV-3.6/132 turbines (LYS-01 to LYS-18) with Hollerup HGX-3600 gearboxes and Tellvik TVK-CM8 condition monitoring systems. Each CMS records vibration snapshots of the drivetrain. Today is Thursday 7 January 2027. Tor Einar Brekke, head of Asset Engineering, wrote this morning:
Since Mats left nobody has run the bearing analysis, and the Q4 snapshots are piling up. I want one program that does SE-CM-02 rev 3 on a snapshot folder as the TVK export writes it, for every turbine and every configuration we have had this year, and writes the result in the reporting layout. Run it on the 32 Q4 snapshots in the export.
You have 60 minutes. Whatever is in /app/output when the time is up is graded, so keep a working program saved as
you go.
In /app/inputs:
cms/: the 32 snapshots of the Q4 2026 export, one folder per snapshot (<turbine>_<yyyymmddThhmmss>), each
holding the HS and LS records of that snapshot as .tvr files.docs/: the analysis procedure SE-CM-02 rev 3, the drivetrain kinematics workbook, the Tellvik export format and
firmware notes, the transfer path survey TP-2019-LYS01, the Aldervik cage-slip bulletin, a bearing datasheet,
the 2026 inspection findings, and mail/.cmms/: the 2026 work orders of the farm.scada/: the 10-minute SCADA export for Q4 2026 and its signal list.legacy/: Mats Lundgren's bearing scan and his notes./app/output/bearing_diag.py, run as
python3 /app/output/bearing_diag.py <snapshot_dir> <out.json>
It reads one snapshot folder in the format of the 32 in hand and writes one JSON object:
{"turbine": "LYS-04",
"bearings": {"MB": {"fault": "none", "spall_mm": null},
"IMS-GS": {"fault": "outer", "spall_mm": 6.4},
"HSS-RS": {"fault": "none", "spall_mm": null},
"HSS-GS": {"fault": "none", "spall_mm": null},
"GEN-DE": {"fault": "roller", "spall_mm": null},
"GEN-NDE": {"fault": "none", "spall_mm": null}}}
| Key | Content |
|---|---|
bearings |
one entry per bearing position: MB, IMS-GS, HSS-RS, HSS-GS, GEN-DE, GEN-NDE |
fault |
none, outer (outer race), inner (inner race) or roller (rolling element), per SE-CM-02 section 6 |
spall_mm |
for outer and inner: the spall length in mm per SE-CM-02 section 7; otherwise null |
The program runs with Python 3.12, numpy 2.1.3, scipy 1.14.1 and pandas 2.2.3, on one CPU core with 2 GB of
memory and no network, and must finish a snapshot within 20 seconds. It is run as another user from a copy of
/app/output: it may load helper files that you put in /app/output (found relative to __file__), but
/app/inputs is not there when it runs.
/app/output/results/<snapshot>.json for each of the 32 snapshots in hand (for example
/app/output/results/LYS-04_20261009T021726.json): the program's output for that snapshot.
Ingrid Solheim runs your program on 40 further snapshots from the farm's CMS, in the same format, recorded across 2026 on all 18 turbines, for which the bearing states are known from inspections and repairs. They include turbines seen in the Q4 export at other dates, and the configurations, firmware versions and operating conditions the fleet had during the year. The 32 snapshots in hand have known states too, and your result files are compared with them in the same way.
Each snapshot is scored over its six bearing positions. A bearing with a defect earns credit only if the reported
type is right: a rolling-element defect then earns 1, and a race defect earns 0.05 + 0.95 x the size credit. The
size credit is 1 when spall_mm is within tol = max(0.75 mm, 0.05 x L) of the true length L, and falls
linearly to 0 at 3 x tol. When the spall's entry is not resolvable under SE-CM-02 section 7.4, the conventional
2.5 mm also earns full size credit. A defect reported on a healthy bearing counts as one more bearing with zero
credit. The snapshot score is the credit summed over the defective bearings divided by their number plus the false
reports; a snapshot with no defect and none reported scores 1. A snapshot on which the program fails, runs out of
time or writes no readable JSON scores 0. The final score is 80 % the mean over the 40 further snapshots and 20 %
the mean over the 32 result files.