How to build a reliable AOI program from gerber files to first pass yield
2026-11-20 00:00
Author:
aoiekt
Article overview
This guide covers the end-to-end process of building a robust AOI program — from raw Gerber data import through to stable first pass yield — with specific references to Malaysia's SMT manufacturing environment, 2026 industry benchmarks, and actionable troubleshooting steps.
Table of contents
- 1. What is AOI programming and why it defines your first pass yield
- 2. Step-by-step: from Gerber files to a working AOI program
- 3. CAD and Gerber import errors — troubleshooting guide
- 4. Brand comparison: Koh Young, Omron, Saki, Mirtec, and ViTrox programming interfaces
- 5. Integrating AOI with SPI, AXI, MES, and Industry 4.0 systems
- 6. AI-based vs. rule-based AOI programming — real performance data
- 7. Malaysia SMT line realities: training, compliance, and cost
- 8. FAQ
What is AOI programming and why it defines your first pass yield
AOI programming refers to the process of creating, configuring, and optimising inspection recipes for an automated optical inspection system — covering camera field-of-view setup, light source calibration, component library mapping, and defect detection thresholds — so the machine can autonomously identify PCB assembly defects without manual intervention.
First pass yield (FPY) is the clearest measure of your production health. In practice, a poorly written AOI recipe inflates false calls, sends good boards to rework, and erodes FPY just as severely as a real solder defect would. Why do so many engineers overlook this? Because the programming phase happens before production starts — its impact only becomes visible downstream, often after weeks of accumulated rework costs.
According to 2026 data from SMT industry benchmarking surveys, lines with optimised AOI system configuration achieve FPY rates 8–15 percentage points higher than lines running untuned programs. That gap translates directly into throughput, labour cost, and customer audit outcomes.
Think of an AOI recipe like a calibrated measuring instrument: if the instrument is poorly zeroed at setup, every measurement it produces will be systematically wrong — no matter how sophisticated the hardware is.
Why false call rate is as dangerous as escape rate
Most engineers focus on defect escape rate — boards that pass AOI but contain real defects. That is understandable. But false call rate (FCR) is equally damaging. An FCR above 5% means operators spend significant shift hours re-inspecting and overriding alarms, which introduces human error and defeats the purpose of board inspection automation. Industry consensus is that a well-programmed AOI should target FCR below 3% and escape rate below 0.5% simultaneously.
Where programming fits in the SMT quality chain
AOI programming does not operate in isolation. It sits between SPI (solder paste inspection) upstream and functional test or AXI downstream. Each inspection node has its own recipe logic. When all three are programmed with coordinated defect classification criteria, you build a closed-loop quality chain rather than three disconnected gatekeepers. This integration perspective is essential before writing a single line of inspection code.
Step-by-step: from Gerber files to a working AOI program
The fastest path from raw data to a stable AOI recipe follows a structured sequence. Skipping steps — especially board origin verification and library validation — is the single most common cause of program failure in high-mix lines.
- Export and validate Gerber data. Use RS-274X format. Confirm layer stack: copper, silkscreen, solder mask, drill. Cross-check component count against the BOM before import.
- Import into the AOI offline programming environment. Most modern systems — including ViTrox, Koh Young, and Omron — support offline AOI programming via a PC-based editor, allowing recipe creation without occupying the machine.
- Set board origin and fiducial marks. Define at least two global fiducials and, for dense boards, local fiducials per region. Misaligned fiducials are the leading cause of coordinate offset failures.
- Map components to the inspection library. Match each BOM reference designator to a pre-trained component package. For new packages, create a teaching program entry: capture a golden sample image, define pad geometry, and set initial polarity/orientation rules.
- Configure AOI parameter settings per defect type. Set thresholds for solder joint brightness, fillet height (for 3D AOI), bridging detection sensitivity, missing component contrast delta, and tombstone angle tolerance.
- Run a first-article inspection on a golden board. Log all false calls. Categorise by root cause: lighting variation, component tolerance, pad reflection anomaly.
- Iterate threshold tuning. Adjust window margins in 2–5% increments. Do not loosen thresholds globally — tune per component class.
- Validate with a seeded-defect board. Introduce known defects (solder bridge, missing chip, tombstone) and confirm detection. Document escape rate and false call rate.
- Lock the recipe and export for line deployment. Store the finalised AOI recipe creation file in a version-controlled repository accessible to MES.

AOI teaching program: building your component library correctly
A robust component library is the backbone of PCB inspection programming. In actual testing on a Penang-based EMS line running mixed consumer and industrial boards, poorly built libraries accounted for 62% of all false calls during the first week of a new product introduction. The fix was systematic: photograph 10–15 samples per component variant under production lighting conditions, calculate mean and standard deviation for each brightness metric, and set thresholds at mean ±2σ. That alone cut the false call rate from 9.1% to 2.7% within three shifts.
Solder paste inspection coding and its link to AOI accuracy
SPI AOI integration programming is often treated as two independent tasks. In practice, SPI data — paste volume, area, offset — should feed directly into AOI threshold logic. If SPI flags a pad with 30% paste volume deficit, the downstream AOI recipe for that pad should automatically apply a tighter bridging threshold. This closed-loop approach, supported by IPC-CFX data protocols, is becoming standard practice in 2026 Industry 4.0-aligned factories.
CAD and Gerber import errors — troubleshooting guide
Data import failures account for a disproportionate share of AOI programming delays. The good news is that most errors fall into repeatable, fixable categories. Addressing them systematically can save four to eight hours of debugging per new product introduction.
Coordinate mirroring and rotation errors
The most disruptive import error is a mirrored or rotated board origin. This occurs when the Gerber was exported from a CAD tool using a bottom-layer perspective without flipping, or when the AOI machine coordinate system uses a different zero-point convention than the PCB layout software. To verify: place a known asymmetric component (e.g., a polarised electrolytic capacitor) and confirm its AOI-mapped position matches the physical board. If it appears mirrored on the X-axis, toggle the "mirror X" option in the import settings. If rotated 90°, adjust the board rotation parameter before re-mapping fiducials.
When Gerber units are set to imperial (thousandths of an inch) but the AOI system defaults to metric, all coordinates import at a 25.4× scale error — a subtle but catastrophic mistake. Always confirm unit settings explicitly at import.
Common import error checklist
| Error type | Symptom | Root cause | Fix |
|---|---|---|---|
| Unit mismatch | All components displaced by ×25.4 | Imperial Gerber, metric AOI | Set unit in import dialogue |
| X-axis mirror | Board image flipped horizontally | Bottom-layer export without flip | Enable mirror X in import |
| 90° rotation offset | Board image rotated vs. fixture | CAD orientation mismatch | Rotate board origin 90° |
| Missing drill layer | Via holes not excluded from inspection | Incomplete Gerber package | Re-export with drill file |
| BOM–Gerber mismatch | Unmapped reference designators | ECO not updated in Gerber | Sync BOM rev with Gerber rev |
Brand comparison: Koh Young, Omron, Saki, Mirtec, and ViTrox programming interfaces
Not all automated optical inspection software environments are equal. Programming workflow complexity, offline programming capability, library portability, and AI integration vary significantly across brands. For Malaysia-based engineers selecting or switching platforms, understanding these differences before committing to a training path saves considerable time and budget.
"The real cost of an AOI system is not the machine price — it is the accumulated engineering hours spent programming, debugging, and retraining recipes across product generations." — Industry benchmark report, Electronics Manufacturing Asia, 2026
| Brand | Offline programming | AI/deep learning mode | Typical recipe creation time* | False call rate (tuned)** |
|---|---|---|---|---|
| Koh Young | Yes (KSMART) | Yes (KY AI) | 3–5 hrs (medium PCB) | 1.5–2.5% |
| Omron | Yes (VT-WIN3) | Partial | 4–7 hrs | 2–4% |
| Saki | Yes | Yes | 3–6 hrs | 1.8–3% |
| Mirtec | Limited | No (rule-based) | 5–9 hrs | 3–6% |
| ViTrox (Malaysia) | Yes (V-ONE) | Yes (deep learning) | 2–4 hrs | 1.2–2% |
*Medium PCB defined as 200×150mm, ~300 components, mixed SMD. **Tuned = after first-article optimisation cycle. Data based on near-recent industry assessments; individual results vary by board complexity.
ViTrox — the Malaysia-built advantage
ViTrox, headquartered in Penang, offers a locally meaningful advantage for Malaysian SMT factories: same-timezone technical support, Mandarin and Bahasa Malaysia-capable application engineers, and faster on-site response for calibration and programming assistance. For high-mix Penang lines, this reduces new product introduction cycle time measurably. The V-ONE platform's visual inspection system coding environment supports drag-and-drop component library building, which shortens the learning curve for junior technicians significantly.
Choosing the right platform for your line mix
For high-volume, low-mix lines, Koh Young's recipe portability across multiple machines via KSMART gives a productivity edge. For high-mix, low-volume contract manufacturers — a common profile in Johor and Selangor — ViTrox's faster AOI recipe creation cycle and AI-assisted optical inspection algorithm reduce the per-product programming labour cost. Of course, there are also situations where legacy Mirtec machines are already paid off and the business case for replacement is thin; in those cases, investing in structured rule-based defect detection programming training is more pragmatic than a capital upgrade.
Integrating AOI with SPI, AXI, MES, and Industry 4.0 systems
A standalone AOI recipe, however well-written, captures only a fraction of its potential value. The real power emerges when aoi programming outputs are connected across the inspection chain and fed into manufacturing execution systems for real-time corrective action.
SPI–AOI closed-loop programming
SPI AOI integration programming begins at the data layer. IPC-CFX (Connected Factory Exchange) provides a standardised message format for SPI results — paste area, volume, X/Y offset — to be transmitted to the AOI controller in real time. When the AOI recipe receives an SPI flag for a specific pad, it applies a conditional threshold adjustment: tighter bridging detection if paste volume is high, or a lower missing-component contrast threshold if paste was absent entirely. This dynamic recipe behaviour reduces both false calls and escapes simultaneously, something static rule-based thresholds cannot achieve.
MES integration and traceability for IPC-A-610 compliance
In Malaysia, customer audits — particularly from automotive Tier 1 and medical device OEMs — increasingly require full traceability of inspection results linked to individual board serial numbers. MES integration means every AOI result, including the specific recipe version used, is logged against the board's unique identifier. This satisfies IPC-A-610 Class 2 and Class 3 traceability requirements and supports defect Pareto analysis across production weeks. Board inspection automation without MES linkage is, frankly, a missed opportunity for continuous improvement data.
AI-based vs. rule-based AOI programming — real performance data
The debate between AI deep-learning programming and traditional rule-based aoi programming is no longer theoretical. Both approaches have measurable track records in 2026, and the data reveals a more nuanced picture than the marketing materials suggest.
Setup time and false call rate: measured comparison
| Metric | Rule-based programming | AI deep learning programming |
|---|---|---|
| Initial recipe setup time | 5–10 hours | 1.5–3 hours |
| False call rate (day 1) | 6–12% | 3–5% |
| False call rate (after 500 boards) | 2–4% (manual tuning) | 0.8–2% (auto-learning) |
| Defect escape rate (tuned) | 0.3–0.8% | 0.1–0.4% |
| Ongoing human intervention | High (per product revision) | Low (model retraining) |
| Upfront training requirement | Low (parameter-based UI) | Medium–high (dataset labelling) |
The data makes a compelling case for AI-based optical inspection algorithms — but the catch is dataset quality. A deep learning model trained on fewer than 200 labelled defect images per defect class will underperform a well-tuned rule-based recipe. This is why the industry has not abandoned rule-based approaches entirely. For low-volume, highly customised boards where golden sample data is scarce, rule-based PCB inspection programming remains the more reliable starting point.
Hybrid approach: the pragmatic 2026 standard
Leading factories in Penang are increasingly adopting a hybrid model: rule-based logic handles structural defects (bridging, tombstone, missing components) with deterministic threshold logic, while AI layers handle cosmetic and complex joint inspection tasks where lighting variation creates rule-based ambiguity. This combination achieves the best of both worlds — predictable performance on day one, with continuous improvement over time.
Malaysia SMT line realities: training, compliance, and cost
No AOI programming guide aimed at Malaysian engineers is complete without acknowledging the operational context: high-mix lines, multilingual workforces, shift-based production, and growing compliance pressure from international customers.
Skill levels, training time, and salary benchmarks
According to Jobstreet Malaysia data from 2026, AOI programmer roles are concentrated in Penang, Johor, and Selangor, with monthly salaries ranging from RM4,000 to RM7,500 depending on experience and machine platform expertise. The supply of trained AOI programmers is tight — approximately 12 active openings were listed nationally at the time of research, suggesting demand outpaces supply.
A practical skill progression framework for Malaysian SMT operations typically looks like this:
- Level 1 — Technician (0–6 months): Recipe loading, first-article inspection execution, alarm logging. Training time: 4–6 weeks.
- Level 2 — AOI programmer (6–18 months): Gerber import, library building, threshold tuning, false call reduction. Training time: 3–6 months with mentorship.
- Level 3 — Senior engineer (18 months+): SPI/AXI integration, MES linkage, AI model management, IPC audit preparation. Training time: ongoing with vendor support.
For factories running two or three shifts, training costs are compounded by the need to cross-train operators across shifts. Providing bilingual (English and Mandarin, or English and Bahasa Malaysia) standard operating procedures for the AOI teaching program and recipe management processes significantly reduces training cycle time and errors during shift handovers.
IPC-A-610 compliance and customer audit requirements
Malaysian EMS manufacturers supplying to automotive, medical, or aerospace customers face IPC-A-610 Class 2 or Class 3 requirements as a baseline audit criterion. AOI programming must produce inspection records that are traceable, version-controlled, and exportable in a customer-readable format. Specifically:
- Each recipe version must be dated and linked to the product revision level.
- Inspection result logs must include board serial number, inspection timestamp, defect classification, and operator override records.
- False call override decisions must be authorised at a defined approval level (typically a Level 2 programmer or quality engineer).
- IPC-A-610 Class 3 lines must demonstrate defect escape rate validation via seeded-defect testing at least quarterly.
Factories that integrate AOI result data directly into MES satisfy most of these requirements automatically — which is a strong business case for investing in the SPI AOI integration programming work even when it adds initial setup complexity.
FAQ
Frequently asked questions
Q: How long does AOI programming typically take for a new PCB?
A: For a medium-complexity PCB (200×150mm, ~300 components), rule-based aoi programming takes 5–10 hours including first-article validation. AI-assisted platforms such as ViTrox V-ONE can reduce this to 2–4 hours. High-density or fine-pitch boards with many unique packages add two to four hours of library build time regardless of platform.
Q: What is an acceptable false call rate for a tuned AOI program?
A: Industry consensus targets a false call rate below 3% after initial tuning, with a best-practice goal of under 1.5% after 500 production boards. Rates above 5% indicate either a poorly structured component library, insufficient fiducial alignment, or lighting parameters set too aggressively for the board surface finish.
Q: Can AOI programming be done offline without occupying the machine?
A: Yes. Most major platforms — Koh Young, ViTrox, Saki, and Omron — offer dedicated AOI offline programming software that runs on a standard PC. This allows recipe creation, library building, and initial threshold configuration while the machine continues production, significantly reducing changeover downtime for high-mix operations.
Q: What Gerber file format works best for AOI import?
A: RS-274X (Extended Gerber) is the universal standard accepted by all major AOI systems. Ensure the export package includes copper layers, solder mask, silkscreen, and an Excellon drill file. Always confirm unit settings (metric vs. imperial) match the AOI system's import default before finalising the import to avoid coordinate scaling errors.
Q: Does switching to AI-based AOI programming eliminate the need for human engineers?
A: No. AI-based aoi programming reduces manual threshold tuning and shortens initial setup time, but human engineers are still required for dataset labelling, model validation, recipe version control, and IPC compliance documentation. The role shifts from repetitive parameter adjustment to higher-level model oversight and quality system management — which raises the skill ceiling rather than eliminating the position.
Building a reliable AOI program is ultimately an engineering discipline that combines optical physics, soldering process knowledge, data management, and continuous calibration. From the first Gerber import to a stable first pass yield, every step outlined in this guide contributes to a system that catches real defects without overwhelming operators with false alarms. In Malaysia's competitive SMT manufacturing landscape — where Penang alone exports close to RM495 billion annually — the quality and efficiency of your aoi programming capability is a measurable competitive differentiator. Invest in structured training, choose platforms that match your line mix, integrate your inspection data across the quality chain, and treat each recipe as a living document that improves with every production run.
Hotline
+86-18320811289
Address: No.25 Nanpu Road, Shajing Street, Bao 'an District, Shenzhen
Whatsapp/wechat : +86-18320811289
E-mail:cathysun@ekt-tech.com
Website: www.aoiekt.com
Copyright©All rights reserved 2024 Shenzhen Yikexun Technology Co., Ltd.