Blog

2026.10.03

High-speed inline AI visual inspection: from image trigger to PLC reject

High-speed inline AI visual inspection: from image trigger to PLC reject

Implementing AI visual inspection on a high-speed line requires more than a model that distinguishes good from defective products. The system must image a moving item at the right position, associate the decision with that item, and deliver a reject command to the PLC before the item reaches the actuator. This guide is for manufacturing, quality and engineering teams planning automated 100% inspection in a Thai factory. It focuses on timing, position, product identity and physical rejection.

Define the line conditions before selecting an AI camera

An offline test in which an image can be recaptured has different constraints from a running line. A correct classification attached to the wrong item can scrap a good product and let a defective one pass. Acceptance criteria therefore need to cover capture availability, end-to-end decision latency, item association, actual reject success, false rejects and missed defects. A single model accuracy figure cannot describe those outcomes.

Measure maximum and minimum pitch, speed and acceleration, orientation variation, reflective surfaces, permitted stops, available PLC I/O and distance from camera to reject station. Quality engineers should define each defect with real samples and borderline examples. The overview of AI visual inspection explains the wider applications; this article concentrates on the moving line and its reject action. The guide to automated full inspection provides the broader process context.

Calculate the timing budget from pitch and distance

If belt speed is v millimetres per second and the leading edges of successive items are p millimetres apart, the arrival interval at one position is approximately p/v seconds. That interval is not entirely available for AI inference. Exposure, sensor readout, image transfer, preprocessing, inference, result transmission, PLC scan and actuator movement each take time. If the camera-to-reject distance is d millimetres, travel time at constant speed is approximately d/v. These are design relationships, not standard performance values for Thai plants.

Build a measured end-to-end timeline and allow for speed variation, trigger jitter, belt slip and communication delay. Test at maximum speed and with consecutive defective items, concurrent image saving and recipe changes. A supplier’s claimed items-per-minute throughput does not prove that the correct individual item will be rejected. Specify speed, pitch range, station distance and permitted jitter in the request for a demonstration.

Use trigger and encoder signals for different purposes

A photoelectric sensor can trigger an area camera when an item reaches the imaging point. The trigger delay, short exposure and strobe must align. Transparent packages, openings and reflective surfaces can cause missing or duplicate triggers; verify with actual good, damaged, missing and overlapping items. When speed changes, a timer alone may no longer represent position. An encoder count recorded at capture can be tracked to the reject position. Check that the encoder shaft corresponds to product movement: belt slip or a transfer conveyor can break that assumption. A downstream presence sensor can help resynchronise.

Omron’s FH specifications list encoder input and industrial interfaces for certain controllers, while other controllers in the series have different capabilities. Confirm the exact model. Omron’s feature description discusses multiple trigger timings and parallel image processing, but actual capacity still depends on the camera and inspection configuration.

High-speed inline AI visual inspection: from image trigger to PLC reject - figure 1

Choose area scan or line scan by the moving surface

An area camera may be simpler for discrete containers or parts whose relevant face fits into one field of view. Line scan is often considered for film, web material, textiles or other continuous surfaces. Its image lines must follow motion; fixed-time acquisition during a speed change can stretch or compress the apparent defect. Basler’s TDI explanation describes how multiple stages integrate light from a moving target. TDI can help with demanding light conditions, but accurate motion synchronisation remains essential.

More pixels do not automatically make a small defect visible. Verify its pixel size in the actual field of view, lens resolution, depth of field and travel during exposure. Try lighting angles with real materials: scratches on shiny metal and contamination on transparent packaging may need very different illumination. Mechanical guides that stabilise orientation can simplify the AI task.

Make lighting and exposure repeatable

The model sees an image created by the camera and lighting, not the defect directly. Ambient light, vibration, product height, dirty lenses and replacement lamps alter that image. Capture normal good products across shifts, material lots, cleaning and warm-up conditions. Short exposure reduces motion blur but demands sufficient light; more intensity alone may introduce glare or heat. Consider strobes, diffusion, polarisation, hoods and product guides according to the defect.

Version the camera, lens, exposure, gain, light current, strobe delay, inspection region and model together as a recipe. A product change that switches only the model can leave an old lighting configuration behind. After maintenance, compare a reference image before relying on production decisions.

Measure the full inline AI latency

An advertised inference time is only one part of the response. Timestamp the trigger, exposure, readout, transfer, preprocessing, model inference, postprocessing, PLC receipt and actuator action. Multiple cameras sharing an edge computer may queue images at peak load. Keep background image archiving or cloud upload separate from the time-critical decision path where possible. Record the latency distribution and worst observed conditions, not only the mean.

Specify what happens when a result misses its deadline. Options include routing an undecided item to quarantine, stopping the line or another quality-approved fallback. A timeout must never silently become a good-product decision. Siemens and P&G’s published case describes edge processing, PLC integration and single-item rejection at high speed. It is their implementation, not a guarantee for another model or plant.

Keep a one-to-one link between item and decision

Sequence position alone can shift after a missing trigger, duplicate image, manual removal or line merge. Assign an in-line item ID at the trigger and connect it to timestamp, encoder count, line, recipe version, image ID, AI decision, reject request and reject confirmation. A printed serial is helpful but not required for a temporary line ID. State when that ID expires. At multiple inspection stations, pass the ID forward or reidentify it rather than having each station count independently.

Retain model version, score or confidence, threshold, defect class, image reference and PLC handoff time in the event log. Scores from different model versions are not directly comparable. Label an unreadable barcode or unknown ID explicitly; do not leave an orphaned decision that the PLC might apply to the next item.

High-speed inline AI visual inspection: from image trigger to PLC reject - figure 2

Define states, queues and the PLC handshake

Draw the item’s transitions: unseen, triggered, captured, decided, awaiting reject, physically confirmed. Set a deadline and fallback for each transition. A capture failure must be a distinct status, not a blank field that looks like OK. Give result messages a sequence number; reject a duplicate message without a second actuation and alarm on a missing sequence when appropriate. Define which controller has final authority to actuate the reject device.

Several items may occupy the camera-to-reject span at once, so an ordered queue is required. Never overwrite an old result because the queue is full. Stop feeding, stop the line or quarantine undecided items according to the product risk. After communication recovers, compare item ID and valid encoder-position window before applying a delayed result. An item that already passed the reject point must not be acted on later.

During acceleration or deceleration, a fixed timer moves the reject point relative to the item. An encoder helps only while its count still matches actual product motion. Decide what happens on reverse movement, manual intervention, emergency stop and restart. Recipe changeovers are another boundary: old-recipe items may still be between camera and reject station after a new model loads. Carry recipe version with each queued item, or empty the span before switching if mixed products are not allowed.

Confirm physical rejection, not just the PLC output

A pusher, air jet and diverter each have a different trigger position and recovery time. Send the target item ID, valid position and expiry with the reject request where the control architecture permits. With simpler discrete I/O, document reset timing and queue order just as carefully. Test back-to-back NG items, empty spaces, missing triggers, stuck gates and communication loss. A stale reject pulse must not hit the next good item.

If a downstream sensor can confirm the reject, record command and physical result separately. A device can receive the NG signal yet fail because of low air pressure, a full reject bin or a jam. The line needs a quality-approved alarm, stop or quarantine response when a rejected item remains in the main flow. The acceptance test should show the actual item’s destination.

Set camera-to-reject distance on the real machine

Increasing the distance between camera and reject station gives the decision more time, but also leaves more items in flight and requires a longer tracking queue. A transfer to another belt or a change in direction adds position uncertainty. Too short a distance may cause the slowest valid decision to miss the actuator’s start deadline. Choose the station layout using product pitch, actuator response and recovery, space for the reject bin, guarding and cleaning access as well as AI latency. Moving a camera after installation requires the encoder count and reserved reject position to be checked again.

At the machine, alternate defective and good items and compare their IDs with both the reject bin and the main stream. A run consisting only of consecutive NG items can miss the failure in which the good item immediately following an NG is also pushed away. Test the minimum product pitch of every relevant recipe to see whether the actuator recovers in time. If low air pressure prevents an actual reject, an automatic retry is safe only if the intended item is still in the actuator’s valid window. An unconditional second pulse may reject a different item.

Reconcile the PLC and AI clocks

Record whether the clocks on separate controllers are synchronised before comparing their logs. With clock drift, a log can appear to show a PLC reject before the AI decision. Use item ID, sequence number and encoder count as primary matching keys, and timestamps for latency analysis. Decide whether control can continue if clock synchronisation is lost and what evidence remains. A network retry may deliver the same decision more than once; the PLC should actuate no more than once for one item ID.

Separate false rejects from escapes

A good item classified NG creates scrap or reinspection; a defective item classified OK creates escape risk. Report true positives, false positives, false negatives and true negatives with their denominators by defect class. Keep capture failures, unidentified items, missed deadlines and mechanical reject failures as separate categories. A claimed “99% accuracy” from a dataset dominated by easy good images says little about rare critical defects.

Separate training and final test data by day, lot, product revision and equipment state where practical. Otherwise near-identical images may occur in both sets. Use actual borderline and real defective samples; synthetic defects alone may have different image characteristics. Record label corrections and require approval for threshold changes. A shift operator’s quick change to reduce false rejects can increase escapes.

Include real production variation in the training data

Real defects may be scarce. Compare supervised classification, defect localisation and anomaly detection according to whether the target is a scratch, contaminant, print fault, seal defect or dimensional change. The method’s name matters less than an agreed defect definition and a test set containing borderline cases. If artificial defects are made for training, recognise that their image features may differ from naturally occurring defects and confirm final performance on real defects.

Collect good-product variation too: material from different suppliers, seasonal temperature or humidity, printing revisions, lamp replacement and surface appearance after cleaning. Do not assume a Thai-factory defect rate without its own evidence. Sample the actual line over recorded periods and conditions. Link each image to its item ID and confirmed quality disposition, and keep a history of label corrections. Vague retrospective labels make later model improvement unreliable.

For retraining, record the model version, training data, evaluation results, approver, deployment time and rollback procedure. Treat the decision threshold as controlled equipment configuration. Loosening it during a shift to reduce false rejects can increase escapes; require approval and a change log.

Test the complete chain in FAT and SAT

FAT should combine the intended cameras, lighting, edge computer, PLC interface and simulated or actual reject output. Run mixed good and NG products at the specified maximum cadence, including consecutive NG, missed and duplicate triggers, delayed decisions and communication loss. State which factory conditions cannot be recreated at FAT and must be tested at SAT. Measure trigger-to-PLC and trigger-to-physical-reject timing with logs or external instruments.

SAT connects the system to the real Thai factory line. Check speed changes, vibration, ambient light, changeovers, cleaning, shift differences, belt slip and restart. Shadow operation can compare AI decisions with the current inspection method before automatic rejection is enabled. Resolve disagreements on physical samples with quality staff. Train operators in separate procedures for “defect”, “no image”, “unknown ID” and “reject failed”. Continue monitoring false rejects, escapes, capture failures and actuator failures after acceptance.

High-speed inline AI visual inspection: from image trigger to PLC reject - figure 3

Scope the investment around the line, not only the model

Compare camera and software quotes on the same scope: mounting, lighting, encoder, PLC changes, reject device, wiring, installation downtime, sample collection, FAT/SAT, training and maintenance. Use your own baseline for escapes, reinspection, downtime and scrap. Siemens and P&G report 10–20% less scrap depending on the product and deployment commissioned five to ten times faster than traditional bespoke vision systems. These are their reported case outcomes, not savings or project durations to assume for a Thai line.

The purchase specification should state the defect definition, maximum speed, minimum pitch, ID and result message, latency deadline, physical reject confirmation, timeout fallback and measurable acceptance tests. A generic AI accuracy promise does not replace those line-level requirements. For the wider implementation planning process, see the Thailand AI inspection guide.

Frequently asked questions

Can inline AI visual inspection be added to an existing PLC?

Sometimes. Check available I/O, communication protocol, scan time, existing reject queue and stop behaviour. The result must remain associated with the right item until the reject station. Evaluate a retrofit with the actual signal list and timing diagram.

Does an encoder eliminate reject-position errors?

No. Its measured shaft must represent item movement, and capture and reject counts must share a reference. Slip, transfers and manual movement can still require a downstream sensor or reidentification. Measure the error during SAT.

What accuracy should a high-speed AI inspection system report?

Ask for defect-class-specific false rejects and escapes alongside capture failures, timeouts, identity mismatches and physical reject failures. Record test sample counts, lots and line speeds. Agree on acceptance limits before tuning the threshold.

How do FAT and SAT differ for AI inspection?

FAT verifies the specified configuration and simulated line cases at the builder; SAT verifies actual speed, light, vibration, changeovers and operating procedures on site. Carry unresolved factory conditions into SAT and retain evidence through physical rejection.

Conclusion

High-speed inline AI visual inspection is an integrated control system. Calculate a time budget from pitch, register item position at capture, attach AI decisions to a stable ID, hand them to the PLC before a defined deadline and confirm that the correct item was physically removed. FAT validates the chain under specified test conditions; SAT proves it on the actual line.

If you are considering a retrofit or faster production, line speed, pitch, example defects and a PLC signal list are enough to begin scoping the camera configuration and acceptance test. Contact TOMAS TECH at the planning stage.

Sources