Case study · Manufacturing · Japan

Predicting valve torque without a torque meter

BlueOC built and runs the cloud platform for APOSA — STK ENG's IoT sensor for industrial valves — and an AI model that estimates each valve's torque from inexpensive field data instead of costly factory equipment.

  • 100/sSensor samples per device, at peak
  • 5Data flows on one shared pipeline
  • 7Services rebuilt in Go and React
The challenge

Knowing how hard a valve is working

A valve assembly combines a solenoid valve, a pneumatic cylinder, a shaft and a ball valve. When the solenoid loses power, air pressure drops, the cylinder turns the shaft and the ball valve closes. STK ENG wants to know the torque on the ball valve during that moment — it is the clearest sign of the valve's condition.

The legacy platform stored files on a server's disk, every device shared one hard-coded access key, and all customers' data sat in one place.

Torque meter

Measures real torque, but is expensive and can't be fitted to every valve.

APOSA sensor

Inexpensive and fitted in the field; measures valve angle, pressure and voltage — but not torque.

The idea

Use APOSA data and an AI model to estimate torque, with torque-meter data to train and check the model.

How it works

A closed data loop

  1. 01

    Collect

    APOSA devices send sensor data to the cloud; factory torque meters send reference torque.

  2. 02

    Store & show

    The platform processes the data, stores it in a time-series database and shows it on dashboards.

  3. 03

    Predict

    The AI server pulls sensor data through the export flow and runs the torque model.

  4. 04

    Compare

    Predictions come back to the cloud and appear next to real torque, so accuracy can be tracked.

Five data flows

Everything the platform receives

FlowSent byWhat it carries
Sensor telemetry (ST)APOSA deviceTime-series sensor data: valve angle, pressure, voltage — up to 100 samples per second.
Reference torque (DL)Factory torque meterReal torque, used to train and test the AI. Time-zone aware, strictly validated and de-duplicated; only confirmed once written.
Power countAPOSA deviceA small counter reading every minute, on a slimmed-down path straight through the queue.
AI predictionAI serverPredicted torque, stored next to the real torque for the same device.
Data exportWeb users or the AI serverSensor and reference data downloaded as CSV — each party only sees devices it owns.
The platform

One pipeline for every data flow

We rewrote the platform as seven services. Every upload — from a device, a torque meter or the AI server — follows the same path; flows differ only in the last processing step.

  1. DeviceOwn key per device and data type
  2. Customer ServiceAuthenticates and tags the customer
  3. Ingestion ServiceSaves the raw file to S3 first
  4. Queue (SQS)Holds jobs; failures are retried
  5. Parser ServiceProcesses and writes per customer
  6. InfluxDBA separate data space per customer
  7. DashboardsGrafana and the web app
01

One way in

Every request passes one gateway, with a revocable key per device. Keys are split by data type, so a key for one flow can't be used for another.

02

Raw first, process later

Files land in storage the moment they arrive — nothing is lost if a server fails, and any file can be reprocessed.

03

Process through a queue

Receiving and processing are decoupled: devices never wait, and bursts of data are absorbed.

04

Isolated per customer

Each customer has its own data space and dashboards; no customer can see another's data.

05

One shared path

New data types plug into the same pipeline without rebuilding the system.

Inside the sensor flow

How a sensor file is processed

Each file is scanned once to check it is valid, then split across parallel workers. Files of repeated data are still stored, but don't raise alerts — avoiding false alarms.

  1. 01

    Read the job

    Take the valve's open and close calibration values for that moment.

  2. 02

    Load the raw file

    Fetch it from storage; NDJSON or CSV is detected automatically.

  3. 03

    Scan once

    One pass over the device clock spots burst duplicates, which skip alerting.

  4. 04

    Process in parallel

    Records are split into chunks for a worker pool; each gets its valve opening ratio.

  5. 05

    Detect anomalies

    Alert rules run on the opening ratio, only for files that need checking.

  6. 06

    Write & classify

    Telemetry and alerts are written in batches, and the raw file is filed as normal or abnormal.

The AI model

Two layers: a shared model and a per-valve calibration

The model runs on a separate machine outside the cloud platform, and handles each valve closing in three steps.

  1. 01

    Prepare

    Cut the segment where the valve goes from fully open to closed, drop closings with an unusual pressure curve, and resample each closing to exactly 100 points.

  2. 02

    Predict

    A BiLSTM network reads the whole 100-point sequence with 20 features — valve angle, pressure, voltage, current and values derived from them — and estimates torque.

  3. 03

    Calibrate

    A small XGBoost model for each valve type adjusts the estimate into the final torque.

Because the layers are separate, adding a new valve type — or correcting drifting accuracy — only means retraining the small calibration layer, not the main model. We also tested gradient-boosting models (XGBoost, LightGBM, CatBoost) on their own; their accuracy fell sharply on production lines missing from the training data.

Infrastructure

Built on AWS, defined as code

The whole system runs on AWS in Tokyo, declared with Terraform and deployed automatically through GitOps.

Entry

Users and devices come in through Cloudflare and a web application firewall to the load balancer — the only public component.

Compute

Services run on Kubernetes (Amazon EKS) in a private network across two availability zones, scaling pods and nodes with load.

Data

InfluxDB for time series, PostgreSQL for management data, Redis for caching, S3 for originals and SQS for queues.

Security

Databases sit in the private network, secrets are managed centrally, and each service can only reach what it needs.

Monitoring

Prometheus, Grafana, Loki and Alertmanager track metrics and logs and send alerts.

Backup & deploy

Daily database backups with a copy in Singapore; InfluxDB volumes are snapshotted. GitHub Actions builds, ArgoCD deploys.

Results

Before and after the rebuild

ResultsLegacy platformWith BlueOC
Storage Files kept on a server's disk. Raw files stored in S3 on arrival — nothing lost, everything reprocessable.
Access Every device shared one hard-coded key. A revocable key per device, split by data type.
Customer data All customers' data in one place. A separate data space and dashboards for each customer.
Processing Uploads processed directly by the server. Queued processing with automatic retries; devices never wait.
Torque Only where an expensive torque meter is fitted. Estimated by AI from field sensor data, shown beside real torque.

Have sensors, but not the answers?

Tell us what you measure and what you need to know. We'll tell you honestly whether AI can close the gap.