
Time-Series Analytics for SMT: FPY, Defect Rates and Hardware Degradation
First-Pass Yield, rolling defect rates and SQL-driven root cause analysis turn raw SMT machine logs into early warnings.
- Published
- April 6, 2026
- Author
- Hrushiekesh Reddy Kanjula
- Read time
- ~4 min
- Category
- engineering

An SMT placement machine logs every pick: component, placement coordinates, error codes, head temperature and nozzle vacuum. One log line is a historical fact. Thousands of them over time show a pattern, and the pattern can show a failure before it happens.
The assembly hub's analytics layer works in three tiers. Descriptive says what happened. Diagnostic says why. Predictive says what is likely next. This post covers how each is built.
First-Pass Yield
First-Pass Yield (FPY) is the percentage of boards that pass all inspections without rework. It is a core quality metric in electronics manufacturing.
FPY = (Boards passing all inspections) / (Total boards produced) × 100
The catch is rework. A board that fails AOI, gets reworked and then passes is not a first-pass yield. So the SQL view uses a NOT EXISTS subquery to exclude any board with a rework record.
CREATE VIEW first_pass_yield AS
SELECT
DATE(production_date) as day,
COUNT(*) as total_boards,
SUM(CASE WHEN NOT EXISTS (
SELECT 1 FROM rework_records r
WHERE r.board_serial = b.serial_number
) AND b.final_status = 'PASS' THEN 1 ELSE 0 END) as first_pass_boards,
ROUND(100.0 * first_pass_boards / total_boards, 2) as fpy_percent
FROM boards b
GROUP BY DATE(production_date);
Rolling defect rate
Daily defect counts are noisy. A slow day places fewer components, so a few defects look like a high rate. To fix this, I normalize to defects per 10,000 component opportunities (DPMO divided by 10).
Normalized Defect Rate = (Total defects / Total components placed) × 10,000
Then I compute 7-day and 30-day rolling versions with SQL window functions.
SELECT
day,
defects,
components_placed,
ROUND(10000.0 * SUM(defects) OVER w7 /
NULLIF(SUM(components_placed) OVER w7, 0), 2) as rolling_7d_rate,
ROUND(10000.0 * SUM(defects) OVER w30 /
NULLIF(SUM(components_placed) OVER w30, 0), 2) as rolling_30d_rate
FROM daily_production_summary
WINDOW
w7 AS (ORDER BY day ROWS BETWEEN 6 PRECEDING AND CURRENT ROW),
w30 AS (ORDER BY day ROWS BETWEEN 29 PRECEDING AND CURRENT ROW);The rolling rate smooths the daily noise. A slow climb in the 7-day rate is an early warning that daily counts alone would not show.
Root cause by weighted scoring
When the rolling rate trends up, the next question is which machine component is responsible. The RCA query correlates defects with the mechanical context of each placement: which head made the pick, which nozzle type, which tool was active.
It aggregates error codes by that context and applies a weighted score. The score favors systematic failures over random noise.
SELECT
placement_head,
nozzle_type,
COUNT(*) as error_count,
COUNT(*) * 1.0 / SUM(COUNT(*)) OVER (PARTITION BY placement_head) as head_share,
CASE
WHEN COUNT(*) > 50 AND head_share > 0.4 THEN 'CRITICAL'
WHEN COUNT(*) > 20 AND head_share > 0.25 THEN 'WARNING'
ELSE 'MONITOR'
END as severity
FROM machine_error_log mel
JOIN placements p ON mel.placement_id = p.id
WHERE mel.timestamp > DATE('now', '-7 days')
GROUP BY placement_head, nozzle_type
ORDER BY error_count DESC;A head with 40%+ of the errors on its machine is a nozzle maintenance candidate. A nozzle type that keeps landing in CRITICAL across several heads points to a batch quality issue with that nozzle supplier.

Hardware degradation signatures
Some machine failures are sudden. Most are gradual, and those are the ones analytics can catch before they disrupt production. The assembly hub monitors three signatures.
| Signature | What it shows | What it signals |
|---|---|---|
| Vacuum pressure drift | Each cycle logs nozzle vacuum at pick. A healthy nozzle holds a steady level. A nozzle with a microcrack or worn seal trends downward before it starts dropping components. Plotting the 50th and 5th percentile readings per nozzle shows this weeks before drops begin. | Nozzle wear |
| Pick cycle time elongation | A head in normal mechanical condition completes picks in a narrow time window. Longer cycle times mean more friction in the linear rails. | Lubrication maintenance. Caught early, it prevents the more expensive bearing replacement it leads to. |
| Placement accuracy drift | The vision system logs the delta between programmed and actual placement coordinates. A gradual drift in the mean, even within tolerance, means thermal expansion compensation is losing calibration. | Calibration. Catching it at ±0.05mm prevents reaching ±0.15mm, where placements start failing inspection. |

From analytics to action
A rising rolling defect rate chart is interesting. One that sends a Slack notification and opens a maintenance ticket in the engineering queue is useful.
The alerting layer runs as a scheduled background job. It checks threshold rules against the latest analytics views and pushes notifications when a rule fires. The rules are stored as configurable parameters in the database, not hardcoded in Python. Manufacturing engineers can tune thresholds without touching code.