maplerainresearch/MRR_ESPA

MRR ESPA with Trinamic drivers in UART mode

Opened this issue · 2 comments

I received an email asking about TMC2209 drivers in UART mode. I thought it best to move the conversation to a more public space so that the collective wisdom of the open source community can be harnessed.

First, @luc-github has managed to use TMC2208 in standalone (aka "dumb") mode which does not use UART at all. Basically, the driver is configured using jumper pins much like normal "dumb" drivers like A4988.

For the MRR ESPA, the issues with getting UART mode working are:

  1. Lack of pins. Currently, there are only 3 free pins on the board. There are other pins that can be freed (bed heating pin, if a heated bed is not used; MOTOR_EN_PIN, if the motors are always enabled) but that gives at the very very most 5 pins. Each axis requires 2 pins for UART, which means at most, this board can support only 2 axes on TMC drivers in UART mode.
  2. Hardware serial. While the ESP32 has 3 sets of hardware serial, I have seen a lot of articles regarding getting all 3 to work. Most can get 2 sets working. One set will be used for serial terminal (USB to UART) already; that leaves only one other set of hardware serial for TMC driver in UART mode.
  3. Software serial. The lack of hardware serial is usually overcome with software serial. But software serial support for ESP32 on the TMCStepper library is still being worked on. Unless someone is able to work on the software development for this, software serial will not be an option at all. Remember, even if software serial support is somehow developed, there is still the issue with a lack of pins.

Consolidating:

  • Trinamic drivers in standalone mode works.
  • Trinamic drivers in SPI mode works. If you need silent operations, TMC2130 drivers can be used. For higher currents, TMC5160 should work too.
  • Trinamic drivers (TMC2208 and TMC2209) in UART mode has the limitations as outlined above.

For use of Trinamic drivers in UART mode on the MRR ESPE (which uses I2S for stepper and PWM), see this issue.

Please feel free to join in the conversation.

I was not very informed about the TMC2209 stepper drivers. TMC2208 has a fixed slave address, which is 0, and that means only one driver can be on the same UART port since there isn't any addressing capability. But TMC2209 allows configuration of up to four different slave addresses (0 to 3). This means up to four stepper drivers can actually share the same UART port. With @luc-github's help, I managed to get two TMC2209 drivers working on the same hardware serial on the MRR ESPA.

See this video for a quick look at how to set this up.

See this blog post for more details.