Skip to content

Wiring Diagram

Pin Assignments

These are the default pin assignments in firmware/include/config.h:

ESP32 to TMC2209 (Theta Axis)

ESP32 PinTMC2209 PinFunction
GPIO 16STEPStep pulse
GPIO 17DIRDirection
GPIO 4ENEnable (active low)
GPIO 18UART TXTMC UART
GPIO 19UART RXTMC UART

ESP32 to TMC2209 (Phi Axis)

ESP32 PinTMC2209 PinFunction
GPIO 21STEPStep pulse
GPIO 22DIRDirection
GPIO 23ENEnable (active low)
GPIO 18UART TXShared with theta
GPIO 19UART RXShared with theta

TMC2209 Driver Wiring

Power

PinConnection
VMOT24V motor supply
GND (motor)24V ground
VIO3.3V (from ESP32)
GND (logic)ESP32 ground

Motor Outputs

PinConnection
A1, A2Motor coil A
B1, B2Motor coil B

UART Configuration

For UART mode, connect:

  • MS1: To address selection (see address table)
  • MS2: To GND for UART mode
  • PDN_UART: To ESP32 UART TX/RX through 1kΩ resistor

TMC2209 Address Selection (MS1 pin)

AddressMS1MS2
0x00GNDGND
0x01VIOGND
0x02GNDVIO
0x03VIOVIO

Schematic

Full KiCad schematics are in the repository:

mcpositioner/hardware/
├── positioner.kicad_pro # Project file
├── positioner.kicad_sch # Main schematic
├── positioner.kicad_sym # Custom symbols
└── sym-lib-table # Symbol library table

View online: hardware/ on Gitea

Power Supply Notes

Motor Power (24V)

  • Minimum 3A capacity for two NEMA 17 motors
  • Add bulk capacitance (100-470µF) near drivers
  • Keep motor power wiring short and thick

Logic Power (3.3V)

  • ESP32’s 3.3V output can power both TMC2209 VIO pins
  • Current draw is minimal (~10mA per driver)

Cable Considerations

Motor Cables

  • Use shielded cable if runs are long (>1m)
  • Keep motor cables away from sensitive RF connections
  • Twisted pairs reduce EMI

Measurement Cables

  • The antenna under test connects to the VNA via coax
  • Ensure enough slack for full theta/phi rotation
  • Consider using rotary joints for continuous rotation