Unexpected Realtime Delay, but Good Latency Values
- tightmopedman9
- Offline
- Senior Member
Less
More
- Posts: 69
- Thank you received: 7
07 May 2022 18:11 #242242
by tightmopedman9
Unexpected Realtime Delay, but Good Latency Values was created by tightmopedman9
3 axis mill with a 5i25 and 7i77 on a ASRock Q1900B.
This machine ran for years on Wheezy and 2.7 RTAI, but I wanted to modernize it so I installed a 23" touchscreen and updated to 2.8.2, Debian 10 PREEMPT-RT and LinuxCNC.
After the upgrade I get the error Unexpected Realtime Delay on task 0 with period 200000 and DoLt not cleared from previous servo thread. Servo thread rate probably too fast.
If I adjust the servo rate to 250000 I do not get this issue. I get a following error when trying to home the machine if I keep the 200000 rate and ignore the errors or if I use the 250000 servo period.
Here is a picture of the latency histogram after running for ~30 minutes with youtube and 3 x GLXgears. Latency values were higher without isolcpus (which I never needed to use on the previous setup).
Shouldn't these latency values allow me to run an even faster servo period than 200000?
Attached is my .ini and .hal.
I have also tried 2.8.2 on RTAI and this resulted in slightly lower latency values, but still the same errors.
This machine ran for years on Wheezy and 2.7 RTAI, but I wanted to modernize it so I installed a 23" touchscreen and updated to 2.8.2, Debian 10 PREEMPT-RT and LinuxCNC.
After the upgrade I get the error Unexpected Realtime Delay on task 0 with period 200000 and DoLt not cleared from previous servo thread. Servo thread rate probably too fast.
If I adjust the servo rate to 250000 I do not get this issue. I get a following error when trying to home the machine if I keep the 200000 rate and ignore the errors or if I use the 250000 servo period.
Here is a picture of the latency histogram after running for ~30 minutes with youtube and 3 x GLXgears. Latency values were higher without isolcpus (which I never needed to use on the previous setup).
Shouldn't these latency values allow me to run an even faster servo period than 200000?
Attached is my .ini and .hal.
I have also tried 2.8.2 on RTAI and this resulted in slightly lower latency values, but still the same errors.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17966
- Thank you received: 4824
07 May 2022 18:22 #242243
by PCW
Replied by PCW on topic Unexpected Realtime Delay, but Good Latency Values
Do you need to run a faster servo thread period than the normal 1 ms?
Please Log in or Create an account to join the conversation.
- tightmopedman9
- Offline
- Senior Member
Less
More
- Posts: 69
- Thank you received: 7
07 May 2022 20:10 #242246
by tightmopedman9
Replied by tightmopedman9 on topic Unexpected Realtime Delay, but Good Latency Values
To be honest, I'm not sure. My drives are configured for torque control and on this page, linuxcnc.org/docs/html/config/pncconf.htm
it says:
if you are building a closed loop servo system that controls torque (current) rather then velocity (voltage) a faster rate would be better - something like 200000.
If slowing down the rate to 250000 is acceptable with torque control than I can just do that, but I wanted to avoid changing the servo period as it would require retuning the drives, no? Also, I would think that my latency numbers are good enough that I would be able to keep the 200000 period.
it says:
if you are building a closed loop servo system that controls torque (current) rather then velocity (voltage) a faster rate would be better - something like 200000.
If slowing down the rate to 250000 is acceptable with torque control than I can just do that, but I wanted to avoid changing the servo period as it would require retuning the drives, no? Also, I would think that my latency numbers are good enough that I would be able to keep the 200000 period.
Please Log in or Create an account to join the conversation.
- tommylight
- Online
- Moderator
Less
More
- Posts: 19479
- Thank you received: 6532
07 May 2022 20:48 #242251
by tommylight
Replied by tommylight on topic Unexpected Realtime Delay, but Good Latency Values
You can try this:
linuxcnc.org/docs/stable/html/getting-st...#cha:Installing-RTAI
It is RTAI kernel for Buster, should have much better latency.
linuxcnc.org/docs/stable/html/getting-st...#cha:Installing-RTAI
It is RTAI kernel for Buster, should have much better latency.
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17966
- Thank you received: 4824
07 May 2022 21:23 #242264
by PCW
Replied by PCW on topic Unexpected Realtime Delay, but Good Latency Values
250000 (250 usec = 4 KHz) should be OK for torque mode drives
and should not require a major change in tuning
and should not require a major change in tuning
Please Log in or Create an account to join the conversation.
- tightmopedman9
- Offline
- Senior Member
Less
More
- Posts: 69
- Thank you received: 7
07 May 2022 21:24 #242265
by tightmopedman9
Replied by tightmopedman9 on topic Unexpected Realtime Delay, but Good Latency Values
I appreciate the suggestion, but at the end of my first post I wrote: I have also tried 2.8.2 on RTAI and this resulted in slightly lower latency values, but still the same errors.
Don't my latency values imply that I could easily run the 200000 servo period without errors?
Don't my latency values imply that I could easily run the 200000 servo period without errors?
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 17966
- Thank you received: 4824
07 May 2022 21:55 - 07 May 2022 21:59 #242271
by PCW
Replied by PCW on topic Unexpected Realtime Delay, but Good Latency Values
The latency test is pretty optimistic, as it does no actual I/O
If you want to get a realistic idea of where the time goes,
take a look at all the tmax values after running LinuxCNC
for a long time:
halcmd show param *.tmax
(these are in units of CPU clocks on X86)
If you want to get a realistic idea of where the time goes,
take a look at all the tmax values after running LinuxCNC
for a long time:
halcmd show param *.tmax
(these are in units of CPU clocks on X86)
Last edit: 07 May 2022 21:59 by PCW.
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23170
- Thank you received: 4860
09 May 2022 23:39 #242427
by andypugh
It is possible that the system is just running out of time. PCW has suggested a way to tell, though calculations will be needed.
Replied by andypugh on topic Unexpected Realtime Delay, but Good Latency Values
Yes, though you also need to consider how long it takes to perform all the calculations in the servo thread.Don't my latency values imply that I could easily run the 200000 servo period without errors?
It is possible that the system is just running out of time. PCW has suggested a way to tell, though calculations will be needed.
Please Log in or Create an account to join the conversation.
Time to create page: 0.080 seconds