maplerainresearch / MRR_ESPA

A basic 3D printer control board based on ESP32
Other
53 stars 18 forks source link

MRR ESPA with Trinamic drivers in UART mode #2

Open vivian-ng opened 4 years ago

vivian-ng commented 4 years ago

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:

vivian-ng commented 4 years ago

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.

vivian-ng commented 4 years ago

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.