Skip to content

TMC5130 and TMC5160 are high-performance ICs combining both a stepper motor controller and driver.

License

Notifications You must be signed in to change notification settings

janelia-arduino/TMC51X0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Library Information

Description

TMC5130 and TMC5160 are high-performance ICs combining both a stepper motor controller and driver.

Both have serial communication interfaces, either SPI or UART, and combine a flexible ramp generator for automatic target positioning with an advanced stepper motor driver.

The TMC5130 and TMC5160 are register compatible allowing the same driver library to work with both.

The TMC5130 includes MOSFETs inside the IC to reduce part count and circuit size for driving motors up to 1.64A RMS per coil.

The TMC5160 uses external MOSFETs to drive higher current motors from 1A to several 10A per coil.

Stepper Motors

From Wikipedia, the free encyclopedia:

A stepper motor, also known as step motor or stepping motor, is a brushless DC electric motor that divides a full rotation into a number of equal steps. The motor's position can be commanded to move and hold at one of these steps without any position sensor for feedback (an open-loop controller), as long as the motor is correctly sized to the application in respect to torque and speed.

Wikipedia - Stepper Motor

Stepper Motor Controllers and Drivers

Stepper motors need both a controller and a driver. These may be combined into a single component or separated into multiple components that communicate with each other, as is the case with the TMC51X0 stepper motor driver. One controller may be connected to more than one driver for coordinated multi-axis motion control.

Stepper Motor Controller

A stepper motor controller is responsible for the commanding either the motor kinetics, the torque, or the motor kinematics, the position, speed, and acceleration of one or more stepper motors.

Stepper Motor Driver

A stepper motor driver is responsible for commanding the electrical current through the motor coils as it changes with time to meet the requirements of the stepper motor controller.

Motor Current

Several settings affect the magnitude of the motor current, depending on what mode the driver is in at a given velocity.

global_current_scaler

Global scaling of Motor current. This value is multiplied to the current scaling to adapt a drive to a certain motor type. This value should be chosen before tuning other settings because it also influences chopper hysteresis.

Real Units

Range 0..100 percent > 50 percent recommended for best results

Chip Units

Range 0..255 0: full scale 1..31 not allowed for operation 32..255 32/256..255/256 of maximum current

run_current

Automatic Current Control Enabled

run_current scales the current magnitude based on readings from the sense resistors.

Automatic Current Control Disabled

The current magnitude are not enforced by regulation using the sense resistors, but run_current scaled the PWM amplitude.

pwm_offset and pwm_gradient

Automatic Current Control Enabled

pwm_offset and pwm_gradient are used as initial values for automatic scaling.

Automatic Current Control Disabled

pwm_offset and pwm_gradient scale the PWM amplitude.

Examples

Wiring

Microcontroller

SPI

  1. TMC51X0-BOB

    1. Teensy 4.0

    2. Pico

  2. TMC51X0-EVAL

    1. Pico

  3. Wiring Documentation Source

    https://github.com/janelia-kicad/trinamic-wiring

Hardware Documentation

Datasheets

Datasheets

Host Computer Setup

Download this repository

https://github.com/janelia-arduino/TMC51X0.git

git clone https://github.com/janelia-arduino/TMC51X0

PlatformIO

Install PlatformIO Core

https://docs.platformio.org/en/latest/core/installation/index.html

python3 -m venv .venv
source .venv/bin/activate
pip install pip --upgrade
pip install platformio
pio --version

99-platformio-udev.rules

Linux users have to install udev rules for PlatformIO supported boards/devices.

  1. Download udev rules file to /etc/udev/rules.d

    curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/develop/platformio/assets/system/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules
  2. Restart udev management tool

    sudo service udev restart
  3. Add user to groups

    sudo usermod -a -G dialout $USER && sudo usermod -a -G plugdev $USER
  4. Remove modemmanager

    sudo apt-get purge --auto-remove modemmanager
  5. After setting up rules and groups

    You will need to log out and log back in again (or reboot) for the user group changes to take effect.

    After this file is installed, physically unplug and reconnect your board.

Compile the firmware

  1. Gnu/Linux

    make firmware
  2. Other

    pio run -e teensy40

Upload the firmware

  1. Gnu/Linux

    make upload
  2. Other

    pio run -e teensy40 -t upload

Serial Terminal Monitor

  1. Gnu/Linux

    make monitor
  2. Other

    pio device monitor --echo --eol=LF

Arduino Ide

Download

https://www.arduino.cc/en/software

Additional Boards Manager URLs

File > Preferences

https://www.pjrc.com/teensy/package_teensy_index.json
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json

Add Board Support Packages

  • Teensy by Paul Stroffregen
  • Raspberry Pi Pico/RP2040 by Earle F Philhower, III

About

TMC5130 and TMC5160 are high-performance ICs combining both a stepper motor controller and driver.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •