Welcome! Log In Create A New Profile

Advanced

Unlimited DIR outputs with single DIR line

Posted by newbob 
Unlimited DIR outputs with single DIR line
January 16, 2018 11:09AM
I've been playing with this and don't like the complexity and undetermined DIR output (toggle). I'm looking for ideas on how to send DIR to each of 10 steppers using single DIR line and stepper's STEP line to save on pins (it saves 9 pins with 10 steppers).

For circuit below:

Set STEP low
Set DIR high
Set pulse STEP higl-low to toggle dir
Set STEP low
Set DIR low



Circuit Simulator

Edited 3 time(s). Last edit at 01/16/2018 11:30AM by newbob.
Re: Unlimited DIR outputs with single DIR line
January 16, 2018 03:31PM
You don't need anything that complicated, you can just feed a single DIR line to all the stepper motors. With standard stepper drivers, the DIR signal only has to be stable from a little while before the rising edge ot STEP until a little while after.

Using a common DIR signal in this way does reduce the maximum step rate a little, because you have to set DIR one way, a little, pulse STEP to all the stepper drivers that need to turn that way, then set DIR the other way and pulse all the stepper drivers that need to go that way. You need a delay between each pair of steps, although you can overlap some of the delays with setting STEP back to LOW.

Edited 1 time(s). Last edit at 01/16/2018 03:32PM by dc42.


Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet [www.duet3d.com].
VDX
Re: Unlimited DIR outputs with single DIR line
January 16, 2018 03:38PM
... "standard stepper drivers" with optocouplers draws some Millamperes current, so will need more capable or parallel drivers ...


Viktor
Re: Unlimited DIR outputs with single DIR line
January 16, 2018 05:07PM
Quote
dc42
You don't need anything that complicated, you can just feed a single DIR line to all the stepper motors. With standard stepper drivers, the DIR signal only has to be stable from a little while before the rising edge ot STEP until a little while after.

Using a common DIR signal in this way does reduce the maximum step rate a little, because you have to set DIR one way, a little, pulse STEP to all the stepper drivers that need to turn that way, then set DIR the other way and pulse all the stepper drivers that need to go that way. You need a delay between each pair of steps, although you can overlap some of the delays with setting STEP back to LOW.

I wonder how badly this method affects microstep interpolation (microPlyer in TMC drivers). TMC docs say that it distributes microsteps based on previous step interval but I'd think that dir change would reset that interval to some kind of default.
Re: Unlimited DIR outputs with single DIR line
January 17, 2018 02:55AM
I don't believe it has any effect on microplyer interpolation. The chips latch the DIR signal on the rising edge of the STEP pulse - or for TMC drivers, both edges if you set the DEDGE bit. The datasheet give the required setup and hold times.

Edited 1 time(s). Last edit at 01/17/2018 02:56AM by dc42.


Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet [www.duet3d.com].
Re: Unlimited DIR outputs with single DIR line
January 17, 2018 03:16AM
How about a serial_in/parallel_out 16bit shift register? You send the DIR levels of all steppers thorugh one processor pin and store them in the register until you need to change any bit.
Re: Unlimited DIR outputs with single DIR line
January 17, 2018 10:23AM
Yes, shift register would do but it 'wastes' two pins and data has to be loaded serially (can be done via DMA with SPI or I2C but I don't have one) If another pin is available, circuit would be a easier, faster and more deterministic: Example here.



@dc42 I re-read the doc and it only says to keep step intervals stable.

Quote
Attention microPlyer only works perfectly with a stable STEP frequency. Do not use the dedge option if the STEP signal does not have a 50% duty cycle

I still think that step after dir change might be a special case.

Edited 1 time(s). Last edit at 01/17/2018 10:25AM by newbob.
Re: Unlimited DIR outputs with single DIR line
January 17, 2018 06:00PM
If you are reversing that motor by changing the value that DIR has when its step pulse occurs compared to the value of DIR at the previous step pulse, then yes it is a special case.


Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet [www.duet3d.com].
Re: Unlimited DIR outputs with single DIR line
January 17, 2018 09:54PM
It occurred to me that with common DIR line technique, when going diagonally (while one stepper dir line is high and other's low), extruder will move in a staircase like pattern. Microsteping will cover it up but it may be an issue, in corner cases, when printer lacks resolution and is moving slowly.
Re: Unlimited DIR outputs with single DIR line
January 18, 2018 03:35AM
Quote
newbob
It occurred to me that with common DIR line technique, when going diagonally (while one stepper dir line is high and other's low), extruder will move in a staircase like pattern. Microsteping will cover it up but it may be an issue, in corner cases, when printer lacks resolution and is moving slowly.

You mean because the X and Y STEP pulses cannot be sent at exactly the same time, if they need different values of DIR? That's true; however it only takes a few microseconds at most to send a step pulse and chang DIR, so it won't be noticeable because the mechanics can't react that fast.


Delta printer calibration calculator, mini IR Z probe, and colour touch screen control panel: [escher3d.com]

Large delta printer, and other 3D printer blog postings: [miscsolutions.wordpress.com]

Disclosure: I have a financial interest in sales of the Panel Due, Mini IR height sensor, and Duet WiFi/Duet Ethernet [www.duet3d.com].
Sorry, only registered users may post in this forum.

Click here to login