2024

Overlock Machine
Automation System

Retrofitting a conventional industrial overlock sewing machine with an embedded control system — semi/fully automated operation using ESP32, FSM firmware, and mechatronic integration to improve throughput and reduce operator dependency.

  • ESP32
  • C / C++
  • FSM
  • PWM Control
  • SolidWorks
  • Servo / DC Motor
  • IR Sensors
  • HMI

Project Overview

The project involved retrofitting a conventional industrial overlock sewing machine with a fully embedded control system. The primary goal was to convert a manually operated machine into a semi/fully automated platform — improving production efficiency, ensuring stitching repeatability, and reducing operator fatigue in high-volume garment manufacturing environments.

The system was architected as a three-layer mechatronic integration: a sensing layer for fabric and state detection, a control layer built around an ESP32 microcontroller running a finite state machine, and an actuation layer driving motors and solenoids to replicate and extend human operator inputs.

System Architecture

Three decoupled layers communicate vertically — sensor signals flow up to the controller, control signals flow down to actuators.

SENSING LAYER IR Sensor (Fabric Detect) Limit Switch (End-Stop) Position / State Sensor Fault / Safety Detect Sensor Inputs CONTROL LAYER ESP32 — FSM Engine PWM Generator Interrupt / Timer Handler Control Signals ACTUATION LAYER Motor Driver (DC/Servo) Relay Module Solenoid Actuator Pedal Mechanism

Finite State Machine

The ESP32 firmware runs a five-state FSM. Each state has defined entry conditions, actions, and exit triggers — ensuring deterministic, safe operation.

IDLE Waiting FABRIC DETECTION IR reading STITCH INITIATION Ramp-up PWM CONTINUOUS OPERATION Steady sewing STOP / RESET Deactivate fabric in confirmed running end cond. reset / fault → back to IDLE no fabric / fault
01

Idle

System powered, waiting for operator input or sensor trigger. All actuators inactive. Periodic sensor polling active.

02

Fabric Detection

IR sensor confirms fabric insertion. Debounced reading prevents false triggers. Fault path returns to Idle if no fabric.

03

Stitch Initiation

Motor ramps up via PWM. Actuator mimics pedal press. Timing-critical routine synchronises with machine speed.

04

Continuous Operation

Steady-state sewing. Motor held at target speed. System monitors for end-of-fabric or fault conditions in real time.

05

Stop / Reset

Motor decelerates, solenoid resets presser foot. System returns all outputs to safe state and transitions back to Idle.

Control Sequence Flowchart

Event-driven sequence from fabric insertion to stitch completion and system reset.

START Power On — Initialise GPIO, PWM, Interrupts Poll IR Sensor Debounced reading Fabric Present? NO YES Activate Motor Ramp PWM — simulate pedal Monitor Operation Speed, fabric, fault state End Condition? NO YES Stop Motor Decelerate PWM to zero Reset System Clear flags — return to IDLE NEXT CYCLE

Technical Deep Dive

Embedded Control

  • ESP32 running Arduino framework
  • 5-state FSM in C/C++ with interrupt-based sensor handling
  • PWM speed control for precise motor actuation
  • Timing-critical routines synced to machine cycle speed
  • Software debouncing to suppress vibration-induced noise

Mechanical Integration

  • Custom brackets and linkages designed in SolidWorks
  • Servo/linear actuator replaces manual pedal input
  • Minimal machine modification — fully reversible
  • Vibration, load distribution, and backlash analysis
  • CNC-cut and 3D-printed custom mounting parts

Sensing & Feedback

  • IR sensors for fabric presence and end-of-seam detection
  • Limit switches for position and safety interlock
  • Fault detection prevents actuation without fabric
  • Adjustable sensor thresholds for different fabric types

Power & Electronics

  • Low-voltage control circuit isolated from mains
  • Motor drivers and relay modules for inductive loads
  • Flyback diodes on all inductive outputs
  • Regulated 5V/3.3V supply rails for MCU and sensors
  • Grounding strategy to reject industrial electrical noise

Results & Impact

Consistent and repeatable stitching cycles across varied fabric types

Reduced manual operator effort and fatigue in repetitive sewing tasks

Increased throughput by eliminating cycle-time variance between operators

Demonstrated scalable low-cost retrofitting approach for existing industrial machines

Non-invasive mechanical coupling preserved original machine reliability and serviceability