Abstract
An inspection camera can only find small faults in knitted fabric if the image is sharp and its brightness stays in the range for which the detector was set. On an inspection machine, both conditions change during a shift: fabric of a different thickness moves the surface out of the depth of field, and the transmission of the fabric and the output of the LED backlight drift. This paper studies two control loops of the knitted fabric inspection station built on an ST-KFIM-01-240 machine: a servo-driven autofocus and an integral controller that sets the LED drive from the mean image brightness. Five focus measures (variance of the Laplacian, Tenengrad, Brenner gradient, normalised variance and the sum-modified Laplacian) were evaluated on backlit single-jersey texture blurred over 51 lens positions at two noise levels. All five peaked within one step of the true focus. At the higher noise level, however, the two Laplacian-based measures became multimodal (on average 2.0–2.4 local maxima) and their peak-to-background ratio fell to 1.3–1.6. Tenengrad kept a single peak with a ratio of 34. A coarse-to-fine hill-climbing search with a halving step found focus to within 0.5 step in about 10 image evaluations for every gradient-based measure, while a fixed small step stopped 16–38 steps away from focus. For the backlight, a model including the thermal derating of the LED and a step change in fabric transmission showed that the open-loop brightness error reached 0.18 of full scale after the change. An integral controller with gains of 0.2–0.6 per sample held the RMS error at 0.006–0.009 and recovered from the fabric change in 0.8–2.7 s. The recommended configuration is Tenengrad with adaptive hill climbing, refocusing on article change or on a drop in sharpness, and integral brightness control at a gain of about 0.5 per sample, a value well inside the stability limit of the discrete loop.