Skip to content

Multiple Drivers

Christian Köhlke edited this page Dec 16, 2024 · 5 revisions

UART Communication

To be able to communicate with multiple drivers over UART there are several possibilities. See in the datasheet 4.3 UART Signals on page 20 and 21.

1. Software Addressing (easiest)

Software Addressing

For up to 4 drivers, addressing each one over one UART connecting can be used. With each UART Package an address is beeing send and only the correct TMC driver reacts and answers that package. The addressing of the drivers is beeing done by pulling the MS1_ADDR0 and MS2_ADDR1 pins to LOW or HIGH. Addressing the Drivers is already builtin the library by setting the driver_address when creating the TMC_2209 obbject. See demo_script_06_multiple_drivers.py

2. Analog Switches

Analog Switches

With analog switches more than 4 drivers can be addressed with UART

3. Only Write Access

Only Write Access

You can connect all drivers with the same connection to the TX Pin of the Raspberry Pi, but the only write access is possible

Moving multiple motors

VACTUAL

by setting VACTUAL via UART all motors can be moved simultaneous without blocking the code and without using resources on the raspberry pi, but no accurate movement is possible with VACTUAL.

STEP/DIR

You can move several motor with the STEP/DIR interface with velocity ramping via threads simultaneously. see demo_script_07_threads.py

This function can be used to move a motor x steps in a thread:

run_to_position_steps_threaded(steps)

To wait for a motor to finish its movement use this function

wait_for_movement_finished_threaded()

you can also use this function to stop the threaded movement immediatly:

stop()