How siddhesh-04/cnc-plotter works
This repository is a small embedded/robotics project centered on a DIY CNC plotter, not a software service. The architecture is split between a firmware-controlled motion system and a set of sample inputs/media used to drive and validate it.
1. Core runtime: Arduino-based motion controller
- The execution environment is an Arduino UNO running a modified GRBL firmware.
- GRBL is the central control layer: it interprets G-code, handles axis motion, and coordinates basic machine behaviors like homing and travel limits.
2. Motion subsystem: 2-axis Cartesian plotter
- The machine uses two 28BYJ-48 stepper motors for X and Y movement.
- Each motor is driven through a ULN2003 driver board, with GT2 belts/pulleys converting motor rotation into linear carriage motion.
3. Toolhead subsystem: pen lift
- A single SG90 servo controls the pen up/down action.
- This is a separate control concern from XY motion, but still part of the embedded firmware workflow.
4. Safety and reference subsystem
- The hardware includes two limit switches for axis homing and travel limits.
- These switches provide the machine’s physical boundary/reference layer, which GRBL depends on for repeatable positioning.
5. Power architecture
- The plotter is powered from a 12V battery pack for the steppers, with an LM2596 buck converter regulating down to 5V where needed.
- This makes power delivery a distinct hardware boundary from the logic/control domain of the Arduino.
6. Mechanical structure
- The frame is built from MDF/acrylic, with steel rods or 3D-printed brackets as guides/supports.
- Mechanically, the system is a compact low-cost XY plotter with a lightweight pen holder optimized for simple drawing tasks.
7. Host-side workflow
- Design files are created externally, typically in Inkscape, then converted to G-code using the GcodeTools plugin.
- A PC-side sender such as Universal G-Code Sender (UGS) streams that G-code to the Arduino over serial.
8. Command/data flow
- The practical pipeline is: vector artwork or drawing → G-code generation → serial transmission via UGS → GRBL on Arduino → driver boards/servo → physical plotting.
- This is the main architectural flow to capture in a diagram.
9. Repository contents as support artifacts
- gcodeSamples/ contains ready-to-run G-code test cases for shapes and drawings.
- assets/ contains demo media, a project overview PDF, and wiring-related visuals.
- These are not runtime components, but they support setup, validation, and presentation.
10. Firmware packaging
- The Firmware/ directory contains the embedded side of the system, including a libraries.rar archive, indicating custom or bundled Arduino dependencies.
- The README references grblUpload.ino as the upload entry point, suggesting the firmware is intended to be flashed directly to the UNO rather than deployed as a multi-service application.
11. Overall architectural boundary
- The project has a clear split between:
- Offline authoring/tooling on a PC,
- Embedded control on the Arduino,
- Electromechanical execution on the plotter hardware.
- There is no backend database, cloud service, or web layer; the architecture is primarily embedded control + external G-code generation.
12. Best diagram framing
- If drawing the architecture, place the PC tools on the left, the serial link in the middle, and the Arduino/GRBL + motor/servo/limit-switch hardware on the right.
- Treat the sample G-code and demo assets as documentation/validation artifacts, separate from the live control path.
Main entry points: Firmware GRBL · gcodeSamples G-code Samples · assets Demo Media
Components 17
PC Workflow
Offline design and G-code preparation on the host machine.
- Inkscape · External vector design step used to create plotter artwork.
- GcodeTools · Converts vector artwork into machine-readable G-code.
- UGS Sender · Streams G-code from a PC to the controller over serial.
- Serial Link · USB/serial command path between host and Arduino.
Embedded Control
Arduino firmware and machine control logic.
- Arduino UNO · Microcontroller board running the plotter firmware.
- GRBL · Interprets G-code and coordinates motion, homing, and limits.
Firmware - Firmware Bundle · Repository firmware package and bundled Arduino dependencies.
Firmware
Plotter Hardware
Electromechanical motion, tooling, sensing, and power.
- XY Motion · Two-axis Cartesian carriage movement for plotting.
- X Stepper · 28BYJ-48 motor driving the X axis.
- Y Stepper · 28BYJ-48 motor driving the Y axis.
- ULN2003 Drivers · Driver boards that energize the stepper motors.
- Pen Servo · SG90 servo used to lift and lower the pen.
- Limit Switches · Homing and travel-limit reference inputs for GRBL.
- Power Chain · 12V battery input and 5V buck regulation for the machine.
- Frame · MDF/acrylic body with rods and brackets supporting motion.
Repository Support
Sample inputs and media used for validation and presentation.
- G-code Samples · Ready-to-run drawing programs used for validation and demos.
gcodeSamples - Demo Media · Project overview PDF and prototype video supporting presentation.
assets
Connections 18
- Inkscape → GcodeTools: artwork · Vector drawings are prepared for machine conversion.
- GcodeTools → UGS Sender: G-code · Plugin output is sent to the serial streaming tool.
- UGS Sender → Serial Link: stream · UGS transmits commands over the serial connection.
- Serial Link → Arduino UNO: commands · The Arduino receives streamed motion commands.
- Arduino UNO → GRBL: runs · The UNO hosts the GRBL firmware runtime.
- GRBL → XY Motion: coordinates · GRBL drives the two-axis plotting stage.
- XY Motion → X Stepper: X axis · The X carriage is actuated by a stepper motor.
- XY Motion → Y Stepper: Y axis · The Y carriage is actuated by a stepper motor.
- X Stepper → ULN2003 Drivers: driven by · Stepper coils are switched through ULN2003 boards.
- Y Stepper → ULN2003 Drivers: driven by · Stepper coils are switched through ULN2003 boards.
- GRBL → Pen Servo: tool control · GRBL/firmware workflow also manages pen up/down motion.
- GRBL → Limit Switches: homing · Limit switches provide boundary and reference inputs.
- Power Chain → ULN2003 Drivers: motor power · The power chain supplies the stepper driver boards.
- Power Chain → Pen Servo: 5V rail · Regulated 5V supply supports servo-level electronics.
- Frame → XY Motion: supports · The frame carries and guides the motion stage.
- G-code Samples → UGS Sender: validate · Sample G-code can be streamed through the sender for testing.
- Demo Media → Frame: documents · Repository media captures the build and machine setup.
- Firmware Bundle → GRBL: packages · Firmware contents support the GRBL-based upload workflow.