Industry 4.0
AOI Operation Control
by MES Using IPC-CFX
A connected factory automates the AOI validation process.
by Matthew Fischer, Ranko Vujosevic, Ph.D. and Loc Do
Automated optical inspection (AOI) is typically used after solder reflow to detect missing components and defects. Performing a successful inspection of a panel is not enough, however. Manufacturing execution systems (MES) are used for process control and AOI data collection to ensure the following are accomplished:

  • All prior routing operations passed.
  • Valid test program is loaded on the machine.
  • Test start- and end-times and test results are captured.
  • Failed printed circuit boards (PCB) cannot advance in the production routing and must enter rework loop.

One of the fundamental features of an MES system is routing enforcement. A machine can perform an operation only if the MES system verifies all prior operations have passed and the correct test program is loaded. All PCBs must be serialized to capture the highest level of traceability. The MES verifies that PCBs entering the AOI machine belong to the program loaded on the machine. Once the operation is approved, the AOI machine performs the test, and it sends board-in and board-out events and test results to the MES. The MES collects test results into a central database, which permits factory-level reporting, avoids having to locate results on individual machines, and protects against data loss. The MES also controls the routing flow and prevents a panel that fails AOI test from moving to the next operation. The panel must enter a rework loop, and defects must be fixed or the panel scrapped. In addition, the MES can analyze the test results and provide automatic feedback and program modification for pick-and-place machines to eliminate problems that occur in the component placement operation. This was not in the scope of this project.

The Connected Factory Exchange (CFX) protocol was developed to facilitate Industry 4.0 implementation through vendor-independent integration among different equipment and between an MES and equipment.

The CFX-based integration between an MES system and an AOI machine presented here was tested on a Mirtec MV-6 Omni AOI machine at a customer site. Mirtec provided a full CFX implementation on the machine side.

IPC-CFX Applications for AOI Process Control
CFX is defined by IPC-2591. This standard defines the communication protocol among manual, semiautomated, and automated processes involved in printed circuit assembly.

Our goal was to implement complete CFX control of AOI machines by an MES. For that to work, AOI and MES must implement all necessary messages, and an AMPQ broker must be used to route messages between AOI and MES.

On the machine side, a full CFX implementation must support the following features1:

  • Send details of the active recipe when a recipe is activated.
  • Receive requests to activate recipes.
  • Indicate whether the requested recipe was activated or not.
  • Send the panel barcode when one is scanned.
  • Wait for permission before running a test.
  • Receive an indication of whether permission is granted or not.
  • Display error messages to the user.
  • Indicate when the test has completed.
  • Provide the test results.
  • Indicate when the panel has left the machine.

CFX messages implemented for MES control of AOI machines include:

CFX messages implemented for MES control of AOI machines
Top-Level Interaction
FIGURE 1 presents the top-level control flow between an AOI machine and an MES.

When a panel enters the AOI machine, the machine scans the barcode and sends a CFX message to the MES requesting permission to proceed. The MES performs a number of checks (FIGURE 2) and returns its determination to the machine.

If the MES determines the recipe currently loaded on the AOI machine is incorrect for the panel it needs to test, it sends the name of the correct recipe back to the machine. The machine must then load the correct recipe and request permission again.

If the MES determines any other test conditions are not met, it returns an error message to the AOI machine. The AOI machine must display this message to the operator and wait for the problem to be resolved. Once the problem is resolved, the machine can request permission to run again.

Once permission is granted, the machine inspects the panel and sends its results back to the MES via the CFX UnitsInspected message (FIGURE 3). There is no reply message defined by CFX for UnitsInspected, so the machine must follow up by sending the ValidateUnitsRequest message to check whether the MES accepted the test results. If it did, the panel may exit the machine.

MES – AOI integration flow
Figure 1. MES – AOI integration flow.
permission to test logic command flow
Figure 2. Permission to test logic.
Permission to Test
The MES system decides whether a board can be tested. Figure 2 illustrates the interaction between the AOI machine and the MES when the AOI machine requests permission to test.

Every time a machine requests permission to run, the MES performs a sequence of checks to ensure the PCBs are ready to be inspected. If any check fails, the problem must be resolved, and the machine must request permission again.

The first check ensures the serial number has been defined in the MES database, and that it is able to get basic information about it, such as the work order it belongs to.

The next checks involve locking. Often, time is wasted by repeatedly testing PCBs that have the same defect, or testing with a broken AOI machine. The MES prevents that from happening by locking the AOI machine, all serial numbers in a work order, or a particular PCB when set failure thresholds are met. Locking involves setting a flag in the MES database. The MES will not grant permission for a flagged item until the flag is manually cleared by a supervisor.

After that come checks related to the routing. The MES checks the history of the PCBs on the panel in the machine. It checks whether any were scrapped in a previous operation, or whether any failed a previous operation and have not yet completed rework routing. It also checks whether any operations were skipped or performed out of order.

The last checks involve the recipe the AOI machine uses to inspect the panel. The MES compares the name of the recipe currently loaded on the AOI machine with the correct recipe for the product. If it is incorrect or the machine did not inform the MES of its current recipe, the MES sends a request to the machine to change to the correct recipe.

If there are no problems, the MES grants the AOI machine permission to proceed with inspecting the PCBs.

Uploading Results
When the AOI machine completes its inspection of the PCBs on the panel, it sends the results to the MES. The MES performs some checks to determine if the test was valid, and if so, it saves the results in its database. If the test was valid, and any of the PCBs failed AOI inspection, the MES updates its locks based on what failed and how many times it has failed. The locks will then be consulted when the AOI machine or other operations after AOI in the routing request permission to run.

Based on the inspection results uploaded to the MES, the PCB is marked as one of the following statuses for the AOI operation:

  • Failed, if any true failure.
  • False call, if any false calls.
  • Passed, if all passed.

If one or more PCBs on the panel tested fail, the failed PCBs cannot proceed to the next operation and must be sent to rework first. A rework routing, describing the sequence of operations needed to rework a PCB, is attached to the PCB. All operations in the rework routing must be completed before the failed PCB can be brought back to the AOI machine for retesting.

Just inspecting a board and reporting it passed or failed is not enough. All test data must be captured and assigned to PCB serial numbers to ensure a defective PCB does not advance through production, and AOI test data are used to provide feedback to solder paste printing and pick-and-place operations in order to eliminate the problems found, without much production interruption. Integration with an MES can accomplish these objectives. CFX is a powerful standard to permit an MES to completely control the AOI operation. More and more AOI vendors are implementing CFX in full. Benefits of such integration for electronics assembly companies include preventing delivery of defective products to customer, higher line yield, increased productivity, and reduced cost.
test data collection and saving command flow
Figure 3. Test data collection and saving.
  1. Ranko Vujosevic and Matthew Fischer, “MES Based Process Control of Test Machines Using IPC-CFX,” PCD&F/CIRCUITS ASSEMBLY, July 2020.
Matthew Fischer is a senior software engineer, Ranko Vujosevic, Ph.D., is CEO, and Loc Do is a senior application engineer at Optel Software;