cnc_lathe — part_count (yolox-bin-count)
Physics
Section titled “Physics”On a manual-load CNC lathe cell, finished parts drop or are placed into a collection bin or chute with no single-file crossing point a photo-eye could watch reliably: parts land at random orientation and can stack or touch. A downward-looking camera frames the full bin opening and runs yolox detection on each polled frame to count discrete parts currently visible in the bin; because parts accumulate rather than cross a line, the count is a presence/object tally (polled on an interval) rather than a line-crossing event, and the operator or an automatic bin-empty signal resets the baseline after each bin swap. A ring light mounted around the lens gives even, shadow-free illumination so touching parts keep separable edges for detection; the lens field-of-view is set to frame the full bin interior at the mounting height above the bin lip. Since the bin fills over minutes, not milliseconds, polling at 1 fps is far above the Nyquist requirement for a part-arrival rate on the order of one part every 10-30 s on a single-spindle lathe, while keeping GPU load low; a trigger input is not needed because there is no fast-moving single-file event to catch.
Sensor
Section titled “Sensor”- Spec: industrial GigE/PoE area-scan camera, downward-mounted, fixed-focal C-mount lens, LED ring light
- Signal: counter ({count}), range n/a
Example parts
Section titled “Example parts”- Teledyne FLIR Blackfly S BFS-PGE-16S2C-CS GigE PoE camera with 8mm C-mount lens
- Basler ace 2 a2A1920-51gcPRO GigE area-scan camera (1920x1200, global shutter, PoE)
- Advanced Illumination RL1550 LED ring light (coaxial, machine-vision, white)
Mounting
Section titled “Mounting”Mount the camera on a rigid overhead arm or fixture directly above the bin opening, high enough that the lens’s field of view covers the full bin interior with margin for parts near the rim, and angled straight down to avoid perspective distortion that would make stacked parts hard to separate. Mount the ring light coaxially with the lens. Keep the fixture clear of the lathe’s chip conveyor, tailstock travel, and any swing-arm loader.
Wiring
Section titled “Wiring”Camera connects via PoE Ethernet to the edge box’s GigE Vision NIC; ring light draws 24 V DC from the edge box’s power distribution on a dedicated fused circuit, kept separate from coolant and chip-conveyor wiring to avoid coolant-mist exposure at connectors (use IP67-rated connectors/cable glands given the lathe’s coolant environment).
Validation
Section titled “Validation”run the lathe for 30 cycles with a manual tally of parts dropped into the bin and compare the detector’s cumulative count at the end of the run (after an empty-bin reset)
Expected: counted parts within +/-1 of the manual tally when parts remain visibly separable; re-tune score_threshold if chips/coolant film obscure part edges
Safety notes
Section titled “Safety notes”- lock out/tag out the lathe (LOTO) before mounting the overhead camera fixture near the spindle, chuck, or tailstock travel
- verify the fixture and its mounting arm cannot be struck by the chuck, tailstock, or any swing-arm loader at any point in its travel
- electrical safety for PoE camera cabling and ring-light wiring in a coolant-mist environment, use IP67-rated connectors and route clear of coolant spray
500–1800 USD, difficulty 3/5, ~60 min install downtime.