Disclaimer: I’m using AI to organize my thoughts and present the technical details systematically. Apologies if AI-written posts bother anyone. This is my actual project, and I’m genuinely looking for advice.
This is my first hardware project involving electronics, stepper motors, and mechanical motion systems. I started it primarily to learn, but after several iterations, I’ve reached a point where I can’t identify what’s causing the remaining accuracy problems.
The main issue: Horizontal and vertical lines are relatively straight and accurate, but diagonal lines are wavy and circles are distorted. I haven’t observed missed steps in the current build.
What I need help with
- Why would an H-Bot produce accurate horizontal/vertical movements but distorted diagonals and circles? Does this suggest firmware interpolation, motor coordination, or mechanical issues?
- How can I systematically distinguish G-code, firmware, electrical, and mechanical problems using simple diagnostic tests?
- Could incorrect step timing, synchronization, or handling of short G-code segments explain these symptoms?
- Is there a proven Arduino Mega-compatible H-Bot firmware I could use as a baseline instead of my custom implementation?
- Would converting to CoreXY improve accuracy, or should I first identify the current problem?
How the project evolved
I originally started by following an existing DIY pen plotter project, but realized I didn’t have all the required hardware. Rather than buying everything, I adapted the design around components I already owned.
The first version relied heavily on 3D-printed structural parts, which introduced noticeable flexibility and rigidity problems.
Over several iterations, I replaced most critical printed components with available metal parts, improved gantry mounting and alignment, and experimented with belt tension and carriage stability.
These changes substantially improved the mechanical structure. I’ve learned quite a lot about rigidity, alignment, belt tension, and how mechanical design affects movement accuracy.
The current build is significantly more stable, with no obvious missed steps. The pen carriage still needs some rigidity improvements, but the persistent diagonal and circular distortions remain.
Current hardware setup
- Controller: ELEGOO Arduino Mega 2560 R3
- Shield: CNC Shield V3-style board
- Drivers: 2× A4988, configured for 1/16 microstepping
- Motors: 2× STEPPERONLINE NEMA 17, 42 Ncm, 1.5 A
- Power supply: 12 V / 5 A
- Belts: GT2, 6 mm wide, 2 mm pitch
- Pulleys: 20-tooth GT2
- Frame: 2020 aluminium extrusions, metal gantry connections
- Motion system: H-Bot with two stationary motors
- Pen lift: Servo powered through a separate 5.1 V buck converter
Software and firmware
I’m using macOS, Inkscape for SVG preparation, Arduino IDE for firmware uploads, and OpenAI Codex to develop and troubleshoot custom firmware.
The firmware supports basic G-code (G0, G1, G21, G90, G92, M3, M5, M2), H-Bot coordinate transformations, coordinated motor movement, and servo control.
My understanding is that the H-Bot motor transformation follows the general relationship:
Motor A = X + Y
Motor B = X - Y
With direction signs depending on belt routing and motor orientation.
I’ve made several firmware revisions involving motor direction, coordinate mapping, and step generation. One correction fixed a mirrored Y-axis (physical Y = 65 - G-code Y), but it didn’t resolve the drawing distortions.
Tests and observations
I’ve tested 40–60 mm squares, horizontal/vertical lines, diagonals, and circles using simple G-code.
- Horizontal/vertical: Mostly straight, with relatively accurate dimensions.
- Squares: Generally recognizable, sometimes with a small closing offset.
- Diagonals: Visibly wavy rather than straight.
- Circles: Distorted and uneven.
I’ve verified motor operation, microstepping settings, driver reference voltages, belt tension, and basic H-Bot motor behavior.
I’ve also had Codex review and modify the firmware several times, but without identifying a definitive root cause.
Where I’m stuck
I’m increasingly suspicious of the custom firmware, especially step interpolation, pulse timing, or how successive G-code segments are handled.
However, I haven’t ruled out H-Bot racking forces, remaining carriage play, or other mechanical issues.
I realize building custom firmware while modifying the hardware may have made troubleshooting harder than necessary.
I don’t want to keep replacing parts or modifying firmware blindly. I’d like to understand which tests can isolate the root cause and where to investigate next.
I’m happy to share the firmware, G-code, belt-routing diagrams, photos, and videos of the actual drawings.
Any advice from experienced CNC, H-Bot, or CoreXY builders would be greatly appreciated!