Back-and-forth motion example for TMC51x0 stepper motor driver.
This example demonstrates simple back-and-forth motion using the TMC51x0's internal ramp generator in positioning mode. The motor moves between two positions repeatedly (configurable travel distance in degrees).
TEST RIG SELECTION: Use SELECTED_TEST_RIG at the top of this file (TEST_RIG_FATIGUE or TEST_RIG_CORE_DRIVER). See esp32_tmc51x0_test_config.hpp for motor, board, and platform specifications.
Hardware Requirements:
- ESP32 development board
- TMC51x0 stepper motor driver
- Stepper motor connected to TMC51x0 (see motor selection above)
- SPI connection between ESP32 and TMC51x0
- Chip must be in SPI_INTERNAL_RAMP mode (SPI_MODE=HIGH, SD_MODE=LOW)
- Power supply: 12-36V DC (ensure adequate current capacity for selected motor)
Pin Configuration (using standard test config):
- SPI: MOSI=6, MISO=2, SCLK=5, CS=18
- Control: EN=11
- Clock: CLK=10
- Diagnostics: DIAG0=23, DIAG1=15
- Author
- Nebiyu Tadesse
- Date
- 2025