Skip to content

Latest commit

 

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

String-Art-Machine

An automated String Art machine that performs both the automated nailing process and the string weaving process.

Introduction

This project presents an automated String Art machine designed to handle both the automated nailing and string weaving processes. The system architecture integration and control flow are built upon the following core components:

  • Control Unit & Embedded System: Powered by an ESP32-WROOM-32 microcontroller managing real-time motion control, sensor data processing, and execution commands.
  • Software & Image Processing: A Python-based framework is utilized to convert digital source images into optimized string-path coordinates and numerical control data.
  • Position Tracking & Feedback System: To ensure high-precision positioning and prevent accumulative mechanical errors during operation, the system employs a robust feedback mechanism:
    • A NEMA23 Closed-Loop Stepper Motor with an integrated encoder to prevent step loss.
    • Optical Limit Switch Endstops serving as red-light sensors for precise homing, position validation, and path tracking.

Hardware Components

The primary hardware and mechatronic components utilized in this project are listed below along with their corresponding visual documentation and technical reference links:

1. Controllers & Microcontrollers

  • Microcontroller: ESP32-WROOM-32(Handles real-time motion control and sensor data processing)

ESP32 WROOM 32

  • Signal Converters: MAX485 / RS485-TTL Module (Converts RS485 differential signals from encoders into TTL logic for the ESP32)

ESP32 WROOM 32

2. Actuators, Drivers & Encoders

NEMA23 Closed Loop Stepper Motor

CS-D508 Motor Driver

  • Drill Motor: RS-775 DC Motor (High-torque DC motor driving the drilling mechanism).

CS-D508 Motor Driver

CS-D508 Motor Driver

3. Power Supplies (SMPS)

The system utilizes dedicated Switch Mode Power Supplies to separate power stages for stability:

  • 48V Supply: MT-500-48 SMPS (48V, 10A) - Powering the main motor drivers.

48V 10A SMPS

36V 10A SMPS

24V 10A SMPS

4. Voltage Regulation (DC-DC Step-Down)

  • High-Power Buck Converters: 3x XL4016 DC-DC Step Down Regulator Modules (300W, 10A).
    • Note on Implementation: One of these buck converters replaces a standard XL4016 module, as the high-capacity XL4016 was readily available and deployed to maintain power consistency across the logic and sensor circuits.
XL4016 300w XL4016 200w

5. Sensors & Position Tracking

Optical Limit Switch Endstop

Mechanical Design & Assembly

The mechanical structure of the String Art machine is detailed in this section. The design progresses from the top-level system assembly down to the individual custom-designed components.

1. System Overview (Top View)

The main layout of the system, illustrating the positioning and integration of the mechanical and electronic sub-assemblies, is provided below.

Top View Technical Drawing

2. Custom Components

The following custom parts were designed for the physical construction of the machine. Universal .step files are provided for replication, alongside visual references for each component.

  • Drill Main Unit: Core housing for the drilling mechanism.

    Top View Technical Drawing
  • Drill Mounting Rod: Structural support component for the drill unit.

    Drill Mounting Rod
  • Drill Servo Gear: Transmission gear for the servo-actuated mechanism.

    Drill Servo Gear
  • Motor Mount: Bracket designed to secure the NEMA23 closed-loop stepper motors.

    Motor Mount
  • Slider End: End effector and guide component for the linear motion axis.

    Slider End
  • Chassis: The primary structural frame supporting the entire operation.

    Chassis
  • Table / Bed: The main work surface where the string art generation takes place.

    Frame

System Wiring & Connections

To ensure system stability, prevent step loss, and protect the low-voltage microcontroller components, the electrical architecture is divided into three isolated stages.

(Note: Ensure all sub-systems share a physical Common GND network to prevent signal noise).

1. Power Distribution Layout

This section details the AC-to-DC power routing, voltage regulation stages, and the common ground network used to power the system.

  • AC Mains Input: 220V AC grid ($L, N, \text{PE}$) supplies power to the primary SMPS units.
  • Main SMPS Units (Power Supply):
    • MT-500-48 SMPS (48V, 10A): Dedicated to powering the main NEMA23 closed-loop stepper motor driver (CS-D508).
    • MT-350-36 SMPS (36V, 10A): Supplies power for the auxiliary motor drivers.
    • Mervesan MT-250-24 SMPS (24V, 10A): Provides base voltage for DC motor drivers and DC-DC step-down modules.
  • DC-DC Step-Down Stages (Voltage Regulation):
    • XL4016 Buck Converter 1: Steps down voltage to 5V to supply logic power for sensors, encoders, servos, and level shifters.
    • XL4016 Buck Converter 2: Steps down voltage to 3.3V to power the ESP32 microcontroller.

2. Logic Level Shifting & MCU Interface

This section details the control signal pathways and pin mappings between the low-voltage ESP32 and the 5V peripheral interfaces.

The ESP32 operates at a 3.3V logic level. Level shifters are dedicated specifically to stepping down 5V signal outputs (such as encoder receiver outputs, sensor signals, and driver feedback) down to 3.3V to protect the ESP32 GPIO pins, while control output signals are driven directly from the microcontroller.

Component Signal Type ESP32 Pin (3.3V) Level Shifter Direction Peripheral Pin (5V)
Stepper Driver (CS-D508) Pulse P18 Direct (3.3V) PUL+ (Blue)
Direction P19 Direct (3.3V) DIR+ (Brown)
Enable P17 Direct (3.3V) ENA+ (Green)
Alarm P16 5V $\rightarrow$ 3.3V ALM+ (Orange)
DC Motor Driver (BTS7960) Forward PWM P26 Direct (3.3V) RPWM
Reverse PWM P27 Direct (3.3V) LPWM
Right Enable P25 Direct (3.3V) R_EN
Left Enable P25 Direct (3.3V) L_EN
Servos (MG995) Drill PWM P21 Direct (3.3V) Signal (Drill Servo)
Slider PWM P14 Direct (3.3V) Signal (Slider Servo)
Encoders (RS485-TTL) Encoder 1 (RO) P22 5V $\rightarrow$ 3.3V RO (Green/Red)
Encoder 2 (RO) P23 5V $\rightarrow$ 3.3V RO (Yellow/Blue)
Sensors Optical Sensor P32 5V $\rightarrow$ 3.3V Signal Output

3. Actuators & Closed-Loop Feedback Connections

This section outlines the high-current drive outputs, motor phase connections, and hardware-level feedback routing.

  • Main Motion Control:
    • The CS-D508 Stepper Driver receives power from the 48V SMPS and outputs high-current drive signals to the NEMA23 Closed-Loop Stepper Motor (CS-M22323) phases.
    • Feedback Loop: The integrated encoder on the rear of the NEMA23 motor routes directly back to the dedicated feedback port on the CS-D508 driver. This ensures hardware-level correction to prevent step loss without adding processing overhead to the ESP32.
  • Auxiliary Actuation (Nailing & Stringing Mechanisms):
    • The BTS7960 DC Motor Driver controls the RS-775 DC Motor for high-torque operations (such as the drilling/nailing spindle).
    • The MG995 Servos draw power from the 5V regulated line and receive direct PWM signals from the ESP32 to actuate the slider and depth mechanisms.

System Integration & Real-World Assembly

This section documents the physical construction of the String Art machine, showcasing the integration of mechanical parts, electronics, and the execution of the main automated processes.

1. Electronics & Control Assembly

  • ESP32 & Breakout Integration: Real-world wiring and terminal block assignments on the main ESP32 development board.

    ESP32 Controller Unit
  • Stepper Driver & Signal Cabling: Industrial CS-D508 stepper motor driver wired to the motor phase lines and control bus.

    CS-D508 Stepper Driver Wiring
  • Logic Level Shifting & RS485 Interface: Breadboard-based signal conditioning circuits for level shifting and differential encoder communication.

Encoder Signal Converter Signal Shifter (Far Side)
Encoder Signal Converter Signal Converter Overview

2. Mechanical Integration & Feedback System

  • Rotary Encoder Assembly: Direct shaft-coupled rotary encoder for mechanical feedback and position tracking.
Bed Encoder Mount Dual Motor & Encoder Integration
Rotary Encoder Assembly Motor and Encoder Setup
  • Optical Homing Sensor: Precision limit switch mounted near the rotating bed for absolute zero position validation.

    Optical Limit Switch
  • Power Supply & Chassis Mobility: Power stage distribution layout and structural support caster installation.

Power & Main Motor Setup Chassis Caster Support
Power Supply Layout Caster Wheel Support

3. Operational Stages

  • Automated Nailing Process: The end-effector mechanism drilling guidelines and precisely inserting pins/nails into the circular bed.
Nailing Assembly 1 Nailing Assembly 2 Nailing Circuit
Automated Nailing Process 1 Automated Nailing Process 2 Automated Nailing Process 3
  • String Weaving Process: The automated routing of the string across the predefined coordinate paths.

    String Weaving Process

Software Architecture & Algorithm Breakdown

This section documents the software framework and the core image-to-string processing pipeline. The complete source code files are hosted directly within the repository files.

1. Image Processing & String Generation Pipeline

The Python-based framework processes digital source images, applies localized optimization algorithms, and generates numerical control paths for the ESP32 microcontroller.

Key Software Modules & Operations to Document:

  • Image Pre-processing Module: Grayscale conversion, contrast adjustment, and cropping filters.
  • Algorithm Core: Calculations mapping string density, line intersections, and nail-to-nail path sequences.
  • Data Exporter: Generation of numerical control data arrays and transmission protocols sent to the ESP32.

2. Algorithmic Transformation (Sample Input vs. Output)

Below is a visual representation of how the Python pipeline transforms a standard raster image into a vector-mapped string-art pattern:

Source Input Image (Girdi) Algorithmic String Output (Çıktı)
Original Input Image Generated String Art Result

About

An automated String Art machine that performs both the automated nailing process and the string weaving process.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors