How to quickly get the position of each axis?

More
27 Aug 2021 01:30 #218841 by yi2580
Hello, I can ask how I can quickly obtain the position of each axis. The faster the better. How many subtleties or milliseconds can I obtain the position of each axis?
Thank you for your reply

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

More
27 Aug 2021 02:56 - 27 Aug 2021 02:57 #218847 by robertspark
what do you want to do with the information 

a gui is updated every ....

CYCLE_TIME = 100 - Cycle time of the Display GUI. Depending on the screen, this can be in seconds or ms (ms preferred). This is often the update rate rather then sleep time between updates. If the update time is not set right the screen can become unresponsive or very jerky. A value of 100ms (0.1 seconds) is a common setting though a range of 50 - 200ms (.05 - .2 seconds) may be useable. An under powered CPU may see improvement with a longer setting. Usually the default is fine.



servo period is  
SERVO_PERIOD = 1000000 - This is the "Servo" task period in nanoseconds

 
Last edit: 27 Aug 2021 02:57 by robertspark.

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

More
27 Aug 2021 03:12 #218848 by yi2580
Hello, thank you very much for your reply. How can I get these values? I want to use the information of these axes in my own GUI

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

More
27 Aug 2021 03:21 #218849 by yi2580
Now I want to use a faster reading speed, which may need to reach the nanosecond level. Now I can use self.status.actual under this def periodic (self) function_ Position [0] to get the position of the axis, but when I use other functions to use self.status.actual_ Position [0] cannot read the position of the axis. I wonder if there is a good solution

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

More
01 Sep 2021 22:15 #219369 by andypugh
I don't think that LinuxCNC even _knows_ the positions at the nanosecond level. It gets position updates from hardware every 1mS.

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

More
02 Sep 2021 05:43 #219401 by yi2580
Thank you very much for your reply. If only 1 millisecond is enough, how can I get the axis position every 1 millisecond

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

More
02 Sep 2021 09:46 #219422 by andypugh
Presuming that you want to use it in a realtime module, then it is available on HAL pins. (either Axis or Joint pins)

linuxcnc.org/docs/2.8/html/man/man9/motion.9.html#AXIS%20PINS

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

More
02 Sep 2021 09:50 #219423 by yi2580
OK, thank you very much. I'll have a good look at this

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

Time to create page: 0.256 seconds
Powered by Kunena Forum