DEV2: DIR signal at low speed
Hi,
I observed with my oscilloscope, that the DIR signal is not a DC value for small movements. There is just an area around the step signal. I fully understand that this is enough. But in fact this is just another operation which may consume some time.
Would't is make sense to change the value of DIR only when there is a change in direction?
Just a thought. There is no need for me to change that. It took me some time to understand that and now I want to share it.
If this is not interesting, feel free to ignore or delete this post.
Just a thought. There is no need for me to change that. It took me some time to understand that and now I want to share it.
If this is not interesting, feel free to ignore or delete this post.
Comments
What does not a DC value mean for someone without electronic background?
You are right that with SLOW_DIRECTION_CHANGE 1 there is a interrupt pause in step signals when direction changes or a new move is started. I think it would be good to remove the new move part. I could force setting old directions every time when a driver is switched. So it only happens if any of the xyze axes change direction. Also often it is the case anyway for a circle it will happen only 4 times. So still a gain and minimal timing improvement.
Your step/dir image makes me a bit nervous if it would not already work. But we only set dir pin when it changes to new value while steps are set and unset at next interrupt call. Or did I see multiple direction changes in that image? But will test soon with my logic analyser.
(I don't have slow direction changed enabled btw)
https://tinyurl.com/y4c49b5r
My step pin is on the top, dir on the bottom.
It happens during interpolated moves/direction changes/corners.
https://tinyurl.com/y3ynkj5y
Here's the short capture if you happen to use saleae's Logic 2 app or (anything that can open these):
https://drive.google.com/file/d/1jU0PkJ8GWlr0MIOuOH7GXg20ARW1emsr/view?usp=sharing
I once actually saw this a while back when I was debugging timer frequencies.
Uh, somehow it never came across me that that dir "fade" might not be normal until now, haha.
I am sorry, the image was taken BEFORE your changes.
https://imgur.com/a/3hu1JPL
you see I have no spikes/switches for dir here. This is even with SLOW_DIRECTION_CHANGE 1
@AbsoluteCatalyst
You have same behaviour left and right and different in a intermediate area. What were the move commands you used to measure this for? Also could not access the logic file - it is private. Wanted to check closely if the dir changes are same time as steps or not. And also when does dir get set back - seems somewhere between steps. Maybe a stepper interrupt without step contained. So far a bit mysterious.
Sorry about that, file should be public now
I'll do another test today soon too
the command I used was
G1 X150 F500000
(just maxed out speed)
Actually there might even the case that by chance some steps not counted would get executed.
With this fix it seems fixed at least where I saw some toggling previously I now don't see them any more. Hope this is in your test case as well. I had a hard time with my timings to get these special condition.
Interesting, I wonder if it was creating any strange artifacts or vibrations in prints.
Can't see any though, coming from my main Due machine.
I hadn't run the analyzer on my Due, but my newer mini V2 which seemed to have it happen every time I made a direction change unlike your RADDs. Odd.