Control Board Subsystem – Arduino, CNC Shield & MKS DLC32
1. What Is a Control Board?
A control board is the brain of the CNC laser engraver. It receives G-code commands from software (via USB, Wi-Fi, or SD card), interprets them using embedded firmware (GRBL), and generates precise electrical signals — STEP, DIR, PWM — that drive motors and the laser module.
Two control board setups are common in DIY laser engravers: the classic Arduino Uno + CNC Shield (budget builds) and the modern MKS DLC32 V2 (dedicated laser controller, used in our CLE build).
2. Arduino Uno R3 + CNC Shield V3
The Arduino Uno R3 is an 8-bit AVR microcontroller board (ATmega328P, 16 MHz) that runs the GRBL firmware. It communicates with the PC over USB-Serial and outputs STEP/DIR pulses to the CNC Shield, plus a 1 kHz PWM signal on pin D11 to control the laser.
The CNC Shield V3 is a plug-in expansion board that snaps directly onto the Arduino headers. It breaks out four stepper driver slots (X, Y, Z, and a clone channel), a spindle/laser PWM terminal, limit switch inputs, and separate motor power (Vmot) — isolating the high-current motor supply from the Arduino's 5V logic.
⚠ Critical Voltage Warning
The Arduino is powered at 5V. The CNC Shield motor rail (Vmot) is connected directly to 12V or 24V. Never connect the Vmot rail to the Arduino's VCC. The Arduino must be powered via USB or its barrel jack independently, or through a buck converter (12V → 5V) wired to the Arduino's 5V pin.
Vmot = 12–24 V (motor supply) ≠ VArduino = 5 V (logic supply)
Use Buck Converter: 12 V → 5 V, I ≥ 1 A → Arduino 5V pin
GRBL on Arduino Uno
GRBL is open-source CNC firmware flashed onto the Arduino's flash memory (32 KB). It parses G-code, runs a real-time motion planner, and drives three stepper axes simultaneously. Key settings:
$100=80 ; X steps/mm
$101=80 ; Y steps/mm
$102=400 ; Z steps/mm
$32=1 ; Laser mode ON (power scales with speed)
$30=1000 ; Max spindle speed (S1000 = 100% laser power)
Limitations of Arduino + CNC Shield
8-bit processor: Limited motion planning buffer and slower step rates vs. 32-bit boards.
No Wi-Fi / Bluetooth: Must stay connected to a PC over USB during operation.
No offline control: Cannot run from SD card without extra hardware.
No dedicated laser firmware: GRBL on Arduino treats the laser as a spindle — functional but not optimized.
Voltage danger: Accidental connection of Vmot to logic rail destroys the board instantly.
3. MKS DLC32 V2.1 – Dedicated Laser Controller
The MKS DLC32 V2.1 is a 32-bit ESP32-based controller purpose-built for laser engravers. Unlike the Arduino + CNC Shield combo, it integrates everything on one board: the microcontroller, motor driver sockets, power regulation, laser PWM output, and interfaces for USB-C, SD card, and a TFT touchscreen.
It runs FluidNC (or GRBL-ESP32), a 32-bit port of GRBL optimized for the ESP32's dual-core 240 MHz processor. This gives it a far larger motion planning buffer, smoother step generation, and wireless G-code streaming over Wi-Fi.
Safe 24V input: Built-in onboard regulation supplies clean 5V and 3.3V — no external buck converter needed.
Dedicated laser port: Separate PWM + TTL laser output prevents interference with motor signals.
32-bit ESP32: Larger step buffer, smoother acceleration, and better look-ahead than 8-bit Arduino.
Wi-Fi streaming: CLE Laser Control software can stream G-code wirelessly — no USB tether required during operation.
TFT touchscreen support: Direct connection to the TS35-R 3.5" display for offline standalone operation.
SD card offline mode: Runs G-code directly from MicroSD without any PC connected.
4. STEP / DIR / EN Signal Protocol
The control board communicates with each stepper driver using three digital signals:
STEP: Each rising edge advances the motor by one microstep. Step frequency = motor speed. Higher frequency = faster rotation.
DIR: Logic level sets rotation direction. HIGH = forward, LOW = reverse. Must be stable before the STEP edge.
EN (Enable): Active LOW. When pulled LOW, the driver energizes the motor coils. When HIGH (or floating), the driver is disabled and the motor freewheels.
A full-step NEMA 17 motor moves 1.8° per step (200 steps/revolution). Microstepping divides each full step by driving the two motor phases with sinusoidal current ratios, producing intermediate rotor positions. The CNC shield jumpers (MS1/MS2/MS3 pins) or driver UART configuration set the divisor.
Higher microstepping gives finer resolution and smoother motion, but reduces peak torque (since each microstep delivers less current per phase) and requires higher STEP frequency for the same speed.
6. Laser PWM Control – From G-code to Photons
The control board outputs a PWM signal (Pulse-Width Modulation) on its dedicated laser pin to control laser power. The G-code M3 S<value> sets the power, where S ranges from 0 (off) to 1000 (full power by default in GRBL).
Duty Cycle D = S / Smax (Smax = $30, default 1000)
OCR1A = ⌊ 255 × S / 1000 ⌉ (Arduino 8-bit timer register)
MKS DLC32: 16-bit PWM → finer resolution, same mapping
M3 S0 → Laser OFF (D = 0%)
M3 S500 → 50% power (D = 50%)
M3 S1000 → Full power (D = 100%)
M5 → Laser OFF + spindle disable
With laser mode enabled ($32=1), GRBL also applies velocity compensation: the actual PWM duty is scaled proportionally to the current feed rate vs. the programmed feed rate. This ensures constant energy per millimeter even when the head decelerates around corners — preventing over-burning.
Pactual = Pprogrammed × (vcurrent / vprogrammed)
7. GRBL / FluidNC Configuration Parameters
GRBL stores its configuration in non-volatile EEPROM (Arduino) or NVS flash (ESP32/MKS). Settings are accessed via the $$ command and modified with $N=value. The most critical parameters for a laser engraver:
Setting
Name
Typical Value
Effect
$100
X steps/mm
80–100
Steps per mm of X travel
$101
Y steps/mm
80–100
Steps per mm of Y travel
$110
X max feed (mm/min)
5000–10000
Maximum X travel speed
$120
X acceleration (mm/s²)
500–2000
Ramp-up rate; too high causes missed steps
$30
Spindle max RPM
1000
S1000 = 100% laser power
$32
Laser mode
1
Enables velocity compensation for laser
$20
Soft limits
1
Stops motion before hitting frame boundaries
$21
Hard limits
1
Triggers emergency stop on limit switch contact
$22
Homing cycle
1
Enables $H home command using limit switches
Homing Sequence
When $H is sent, GRBL moves the machine toward its limit switches at homing speed ($25), backs off, then approaches slowly ($27 pull-off distance). This establishes Machine Zero (MPos 0,0,0) — the absolute reference for all subsequent moves.
$H ; Run homing cycle
G28 ; Move to pre-defined home position
G92 X0 Y0 ; Set current position as Work Zero
8. Complete Signal Flow: G-code → Motor + Laser
The control board runs two parallel signal paths simultaneously. The motion path sends STEP/DIR pulses to the stepper drivers at the rate required to achieve the commanded feed rate, while the laser path outputs a PWM signal whose duty cycle encodes the commanded power (S-word), scaled by velocity compensation.
The official GRBL documentation covering all $ settings, G-code support, laser mode ($32), homing, limit switches, and step/direction signal timing. Primary reference for all GRBL configuration.
Full documentation for FluidNC — the GRBL-ESP32 port running on the MKS DLC32. Covers YAML configuration files, Wi-Fi setup, WebUI, SD card operation, and all machine parameters.
Official hardware documentation, schematic, pinout diagrams, and firmware releases for the MKS DLC32 V2.1. Includes wiring guides for TFT screens, driver installation, and laser connection.
Detailed A4988 documentation including Vref current-setting procedure, microstepping truth table, timing diagrams for STEP/DIR signals, and thermal considerations. Essential reference for proper driver setup.
⭐ These resources cover firmware configuration, hardware schematics, and driver setup — from GRBL internals to physical wiring of the MKS DLC32.