CNC Pen Plotter
An autonomous 2D plotting machine that translates digital coordinates into physical drawings on paper using a synchronized triple-stepper Cartesian mechanism for all axes (X, Y, and Z).
Author: [Lazarescu Matei-Cristian]
GitHub Project Link: link_to_github
Description
The CNC Pen Plotter is an embedded real-time device designed to physically draw graphics onto a sheet of paper. The system acts as a precise executor for coordinate data sent from a PC via USB (UART). Instead of relying on a high-level operating system, the STM32 Nucleo-U545RE-Q microcontroller uses DMA to receive a continuous stream of coordinates without blocking the CPU.
Once the data is parsed, the firmware utilizes Bresenham's line algorithm to calculate the exact interpolation needed to draw straight lines. All three axes (X, Y, and Z) are driven by 28BYJ-48 unipolar stepper motors, controlled via ULN2003 drivers. The Z-axis motor rotates a mechanism to lower the pen when drawing or lift it when moving between shapes. The entire motion system is strictly synchronized using asynchronous Embassy tasks and hardware timers to generate specific step sequences, preventing step loss and maintaining smooth kinematics.
Motivation
Translating digital graphics into physical reality requires a deep understanding of hardware-software synchronization. While commercial plotters or 3D printers handle this using advanced, pre-built frameworks, building one from scratch entirely in bare-metal Rust (no_std) represents a significant engineering challenge. This project was chosen to demonstrate the capability of handling asynchronous real-time communications, software-defined stepping sequences (Half-Step/Full-Step) for geared motors, and mathematical motion control (linear interpolation) on a highly resource-constrained embedded system.