Document Bento spreader 3 deployment

This commit is contained in:
admin committed 2026-10-02 20:39:45 +02:00
1 parent 7ff3087775
commit c0d1c0aa79
4 files changed
+159 -63

No files matched your search

+59 -37
View File
@@ -160,69 +160,91 @@ Spreader 1+2 remains fresh bentonite from actual roll rpm, calibrated at
**2.75 kg/(rev*m)**. Spreader 3 is a separate material source: it can contain
bentonite or sand depending on the product. No material identity is inferred,
and no spreader-3 value is added to fresh-bentonite consumption or efficiency.
No total-bentonite aggregate or sand calibration is implemented.
No total-bentonite aggregate is implemented. Sand calibration is intentionally
not implemented yet.
`config/bento1-spreader3-material-consumption.yaml` uses generic
`linear_signal_discharge` with central calibration
`bento1-spreader-3-bentonite`: **0.4691089108910891 kg/(signal_unit*m)**,
gravimetric tray, 2026-09-08. Reference: **3.03 signal @ 2.3 m/min → 618 g/m²**.
The exact factor is `618 * 2.3 / (3.03 * 1000) = 2369/5050`; the supplied
approximation 0.4693069307 differs from this measurement-derived value.
The factor is derived as `factor = 618 * 2.3 / (3.03 * 1000)`.
Source `c5611859-275c-44c4-aec0-dfaccc87d478`, display name
“Austragsbehälter Austragsschnecke Geschwindigkeit Istwert”, origin
`AUFSTREUUNG_2/DischargeHopper_Output_Screw/ACT_Speed`.
ENLYZE's kg/m² metadata is not used as physical truth. Observed values on
2026-09-09 were around 3.0 during operation and 0.0 when inactive.
The source's ENLYZE unit metadata is not authoritative physical units.
- Application: `signal_sum * factor * 1000 / line_speed_m_min`, independent of width.
- Consumption rate: `signal_sum * factor * nominal_width_m` in kg/min,
- Application: `application_g_m2 = signal_sum * factor * 1000 / line_speed_m_min`, independent of width.
- Consumption rate: `mass_flow_kg_min = signal_sum * factor * nominal_width_m`,
multiplied by 60 for the existing kg/h integrator. This equals
`application_g_m2 * nominal_width_m * line_speed_m_min / 1000`.
- Same ERP nominal-width provider, `Bento 1-{production_order}` formatting,
gate signal `fef41976-1103-4090-b780-eaeecc02fdfa` strictly > 0.3 m/min,
ERP workplace `Bento 1`, and gate signal
`fef41976-1103-4090-b780-eaeecc02fdfa`
(`Transport Auszug Geschwindigkeit Istwert`, unit m/min) strictly > 0.3 m/min,
previous-value integration, 20-second maximum gap, and disjoint-run boundaries.
- Application points are emitted only while the gate is active; zero source
signal emits zero application during production.
Mass flow is independent of line speed. Speed is required for conversion to
application in g/m² and serves as the production gate; consumption does not
divide by speed. Consumption is attributed separately per production order.
| Calculation ID | Persistence |
| --- | --- |
| `bento1-spreader3-application` | `material_application_snapshots.application_g_m2` |
| `bento1-spreader3-consumption` | `material_consumption_snapshots.consumption_kg` |
The new linear source namespaces JSON checkpoints under
`<state-directory>/<sha256(consumption-calculation-id)>/`; existing 1+2 and K7
checkpoint paths remain unchanged. Use a separate supervised consumption runner
with the spreader-3 config. No schema changes are needed if the existing generic
snapshot tables are present; otherwise apply `db/schema.sql` before starting it.
Do not reset 1+2 state. No migration, deployment, or service restart was performed.
### Validation
Production validation, 30 Sep 2026 10:00–13:00 Europe/Berlin, order `12026000984`,
article `180205` (Bfix NSP 4900, 5,00 x 40 m): `8.999 @ 4.999 m/min` gives
**844.471112 g/m²**. Adding the measured 1+2 average of 3915.961 gives
**4760.432112 g/m²**, within the expected 4400–4800 range.
The gravimetric reference, source 3.03 at 2.3 m/min, gives approximately
**618 g/m²**. This is the calibration reference.
Before redeployment, stop the spreader 3 runner and back up its checkpoints and
snapshots. Clear only its consumption checkpoint directory:
`<state-directory>/c8d0426504f2ce2ff214818e4ffa9b4daf4182131c0af3c5a1cca23a3dee566a/`.
With the default state root this is
`/opt/git-projects/production-analytics/data/state/material/c8d0426504f2ce2ff214818e4ffa9b4daf4182131c0af3c5a1cca23a3dee566a/`.
There is no separate application checkpoint directory. Clear all affected snapshot
rows, across orders and timestamps, using these exact predicates:
Production plausibility check on **2026-09-30**, 10:00–13:00 Europe/Berlin,
order `Bento 1-12026000984`: average Spreader 3 source approximately **8.999**
and average line speed approximately **4.999 m/min** give Spreader 3 application
approximately **844.47 g/m²**. Spreaders 1+2 application was approximately
**3915.96 g/m²**. The manually combined value for this verified bentonite
production was approximately **4760.43 g/m²**, matching the expected overall
range of roughly **4400–4800 g/m²**. These rounded values are a plausibility
cross-check, not a precision measurement. This combined value is only a
validation cross-check: software intentionally does not automatically combine
Spreader 3 with spreaders 1+2 because it may contain another material.
```sql
DELETE FROM material_application_snapshots
WHERE calculation_id = 'bento1-spreader3-application'
AND machine_id = '5f42a4f6-9ca0-4f6f-9786-40d50a35b230';
DELETE FROM material_consumption_snapshots
WHERE calculation_id = 'bento1-spreader3-consumption'
AND machine_id = '5f42a4f6-9ca0-4f6f-9786-40d50a35b230';
An observed short startup peak of approximately **2132.5 g/m²** was verified
as physically consistent with Spreader 3 signal approximately **2.2339** and
line speed approximately **0.4914 m/min**. Low web speed during startup causes
the high g/m² value. It should not be filtered from material consumption:
consumption integrates mass flow and does not divide by line speed.
### Runtime and deployment notes
Spreader 3 now runs as a dedicated systemd service,
`production-analytics-bento1-spreader3.service`, using the normal project `.env`,
ENLYZE secrets and ERP secrets for production-order attribution. The deployed
service was verified running successfully and polling approximately every
10 seconds.
The shared material state root isolates calculation-specific JSON checkpoints
under `<state-directory>/<sha256(calculation-id)>/`. For consumption calculation
`bento1-spreader3-consumption`, the directory is:
```text
/opt/git-projects/production-analytics/data/state/material/c8d0426504f2ce2ff214818e4ffa9b4daf4182131c0af3c5a1cca23a3dee566a/
```
Perform cleanup before restarting with the corrected model; arrange a replay for
historical orders if corrected history is needed. Snapshot writes use
`ON CONFLICT DO NOTHING`, so existing application rows cannot correct themselves.
Leave spreaders 1+2 and K7 checkpoints and snapshots intact. These are instructions
only; no stored data has been deleted by this code change.
There is no separate application checkpoint directory. Existing spreaders 1+2
and K7 checkpoint paths remain unchanged; do not reset their state. No schema
changes are needed if the existing generic snapshot tables are present.
Verified accumulated state after correction for `Bento 1-12026000984`:
consumption approximately **11203.890692078 kg**, integrated running time
**31260 s**. This is only a runtime validation snapshot, not a calibration
reference or a precision claim for physical consumption.
The initial manual validation run created Spreader 3 state as user `mtazl`,
causing a state-directory ownership issue. The production service runs as
`production-analytics:production-analytics`; the calculation-specific state
directory must be writable by that service account.
This calibration is valid only for bentonite. Enable this runner only for
validated bentonite operation; until reliable material identification is available,
+3 -3
View File
@@ -40,7 +40,7 @@ consumption; the calculation algorithms are unchanged. There is no unit conversi
Missing/unreadable files, missing IDs, invalid metadata and incompatible type or
unit raise `CalculationConfigError` before a runner starts. Existing direct numeric
configurations remain supported; specifying both a reference and a direct factor
is rejected. References are supported by rotational discharge and linear signal application consumers.
is rejected. References are supported by rotational discharge and `linear_signal_discharge` consumers.
K7 uses direct mass rate and does not load or require a calibration file.
## Updating a calibration
@@ -90,13 +90,13 @@ be configured directly as a substitute for the central reference.
Calibration measurement: **3.03 signal @ 2.3 m/min → 618 g/m²**.
The exact derived discharge factor is `618 * 2.3 / (3.03 * 1000) = 2369/5050`,
stored at float precision as **0.4691089108910891 kg/(signal_unit*m)**.
The previously supplied approximation 0.4693069307 does not equal that expression.
Application is `signal_sum * factor * 1000 / line_speed_m_min`, independent of width.
Mass flow is `signal_sum * factor * nominal_width_m` kg/min, independent of speed;
the existing kg/h integrator receives this discharge multiplied by 60.
This measured bentonite calibration does not establish physical units from
ENLYZE metadata and must not be used for sand. Spreader 3 may carry sand on other
ENLYZE metadata and must not be used for sand. Sand calibration is intentionally
not implemented yet. Spreader 3 may carry sand on other
products. Its application, consumption and checkpoints remain separate from
fresh-bentonite spreaders 1+2, with no inferred material identity or automatic
sum. See [Bento material documentation](bento1-fresh-bentonite.md) for configuration,