Confusion about steplen and dirhold

More
11 Jun 2024 18:08 #302843 by vally72
I am trying to figure out, for a while and with no success, how to configure the steplen and dirhold parameters, for STEPGEN software to improve the latency (for a parallel port). On some parts of the documentation I found, quote:
"But the LinuxCNC software step generator has some parameters that let you increase the various time from one period to several. For example, if steplen is changed from 1 to 2, then it there will be two periods between the beginning and end of the step pulse. Likewise, if dirhold is changed from 1 to 3, there will be at least three periods between the step pulse and a change of the direction pin."
(linuxcnc.org/docs/html/motion/tweaking-steppers.html   &    linuxcnc.org/docs/stable/html/config/integrator-concepts.html)
According to this information, steplen and dirhold parameters set the number of the periods. But looking into STEPGEN documentation, steplen and dirhold set the timing in nanoseconds. 
How to set steplen and dirhold to imporve the latency on a software STEPGEN? Could be steplen and dirhold parameters used to define both, a number of periods and a timing interval in nanoseconds? 

Please Log in or Create an account to join the conversation.

More
11 Jun 2024 19:42 #302847 by PCW
Nanoseconds are correct but setting any of these timings does not affect latency.
(at least Nanoseconds are what the stepgen component uses)

It may be that the documents are out of date. Also if not using "reset mode"
the step length timing will be rounded up to multiples of the base thread period.
Note the stepconf uses reset mode (and in general it seems like a better idea
as it allows double the step rate of the non-reset mode)

When "reset mode" is used, the actual step length is determined by the reset time
(a wait loop unrelated to the base thread period)

Reset time does affect the host PC performance a bit as it wastes CPU in a do-nothing loop.

Please Log in or Create an account to join the conversation.

More
11 Jun 2024 20:52 #302850 by vally72
Thank you Peter. I will dig a little bit more on the DoubleStep as an option.
So, setting the steplen parameter to 2, it will set the steplen to 2 nanoseconds or it will set 2 periods for a step pulse?

Please Log in or Create an account to join the conversation.

More
11 Jun 2024 21:03 #302851 by PCW
Setting steplen to 2 sets the step length to 2 ns but this will get rounded up to
1 base thread period since that's the shortest period between output changes
unless you use reset mode. Same with dir setup and dir hold, they will get rounded
up to multiples of the base period.


 
The following user(s) said Thank You: vally72

Please Log in or Create an account to join the conversation.

Time to create page: 0.090 seconds
Powered by Kunena Forum