task: main loop took 5.019013 seconds

More
1 year 1 month ago #334493 by hellvetica
Hi, I'm making a robot arm using linuxcnc.
I have a python interface that i'm playing with. I send the robot commands by setting the axis.L.eoffset-counts pins and the robot moves as expected.
I have a function that polls the robot for its position and waits until it reaches the desired position before sending the next point.
The position is read using the python interface 
Code:
s = linuxcnc.stat() s.poll() print(s.actual_position)

but every now and then, the robot reaches its position and waits there for another few seconds before the function exits. I realized that the position feedback gets stuck at some value, and my console prints
Code:
task: main loop took 5.019013 seconds

I also tried reading the position through the halui.axis.L.pos-relative but the same issue happens.
I assume this is because the internal emcStatus buffer doesn't get updated for those 5 seconds of the main loop.

Why does the loop take so long? How can I debug that?

Please Log in to join the conversation.

More
1 year 1 month ago #334615 by hellvetica
I don't know, it's the linuxcnc's output.
I just move the robot around when it happens.

However, I realized that every now and then one of my motors goes over its negative soft limit. I increased the soft limit and the issue seems to have stopped happening.
I still don't understand why that would cause the main loop to freeze for 5s.

Please Log in to join the conversation.

More
1 year 1 month ago #334678 by hellvetica
I'm controlling them with external offsets. Would that be the reason?

Please Log in to join the conversation.

Time to create page: 0.082 seconds
Powered by Kunena Forum