Pin Assignments
These are the default pin assignments in firmware/include/config.h:
ESP32 to TMC2209 (Theta Axis)
| ESP32 Pin | TMC2209 Pin | Function |
|---|
| GPIO 16 | STEP | Step pulse |
| GPIO 17 | DIR | Direction |
| GPIO 4 | EN | Enable (active low) |
| GPIO 18 | UART TX | TMC UART |
| GPIO 19 | UART RX | TMC UART |
ESP32 to TMC2209 (Phi Axis)
| ESP32 Pin | TMC2209 Pin | Function |
|---|
| GPIO 21 | STEP | Step pulse |
| GPIO 22 | DIR | Direction |
| GPIO 23 | EN | Enable (active low) |
| GPIO 18 | UART TX | Shared with theta |
| GPIO 19 | UART RX | Shared with theta |
TMC2209 Driver Wiring
Power
| Pin | Connection |
|---|
| VMOT | 24V motor supply |
| GND (motor) | 24V ground |
| VIO | 3.3V (from ESP32) |
| GND (logic) | ESP32 ground |
Motor Outputs
| Pin | Connection |
|---|
| A1, A2 | Motor coil A |
| B1, B2 | Motor 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)
| Address | MS1 | MS2 |
|---|
| 0x00 | GND | GND |
| 0x01 | VIO | GND |
| 0x02 | GND | VIO |
| 0x03 | VIO | VIO |
Schematic
Full KiCad schematics are in the repository:
├── 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