I haven't really built the printer yet or got all the hardware, but I rigged up a minimal test with 2 drivers and 2 motors.
It seems to work absolutely fine. I set the single shared direction pin before pulsing each step pin and can spin the motors simultaneously in the same or opposite directions.
Checking datasheets for a few stepper drivers, apparently the direction pin is sampled once at the beginning of each step:
The specified minimum signal times differ:
Driver |
Step high |
Step low |
Dir setup |
Dir hold |
A4988 |
1000 ns |
1000 ns |
200 ns |
200 ns |
DRV8825 |
1900 ns |
1900 ns |
650 ns |
650 ns |
TMC2208/9 |
100 ns |
100 ns |
20 ns |
20 ns |
I do not know if "bus capacitance" could be an issue at this sort of frequency, but that would make the minimum times longer. Each direct write to the port registers of the 16 MHz Arduino Nano I'm using takes a minimum of 2 cycles = 125 ns. With some hardware setups, there will definitely need to be an inserted delay between setting the direction and pulsing step, although my TMC drivers seem quite happy with no added delay, so the motors still step (effectively) in unison.
I looked at the source code for Teacup and it appears the macros to write out the direction and step of each motor are isolated in one place (pinio.h
), so the changes to insert the hack will hopefully be minimal.
This is great because it gives me 3 bonus MCU pins.