RPI4 latency - is this normal

More
25 Sep 2021 09:20 - 25 Sep 2021 09:36 #221539 by Markyd
Does the attached latency plot look even half way normal for a rpi4 ? I get jitter result of around 75000 after a 10 seconds or so.  Pinging 10.10.10.10 gives reasonable consistent times of 0.105, but every now and again it spikes up to 0.150 or 0.190. This plot is from a second
pi booting from an SSD (to allow me to test in the house where i have more space), but the actual pi in the workshop is running from an SD card. 

I'm running and rpi4 with mesa 7i96, 7i85 and 7i73 and steppers. I've got a config that works to a point, but i keep getting following errors.  I can mill manually commanding the axis for a couple of inches and it then throws a following error.  It will also throw a following error whilst homing sometimes.  Is latency on the servo thread (1,000,000) going to be the issue, or is it as likely to be settings in my hal/ini (which are both still work in progress)? 

Here's the main settings for X and Y.  Gearing on Z means that axis is set slightly differently.  Stepper drivers are generic leadshine (i think, from stepperonline).  whilst there are some entries in here from linear encoders they aren't currently being used for feedback.
[JOINT_0]
AXIS = X
MAX_VELOCITY = 20
MAX_ACCELERATION = 100
TYPE = LINEAR
SCALE = 400
ENC_SCALE = 0.005
ENC_OFFSET = 0
STEPGEN_MAX_VEL = 50
STEPGEN_MAX_ACC = 250
FERROR = 10.000
MIN_FERROR = 0.0025
DIRSETUP = 20000
DIRHOLD = 5000
STEPLEN = 5000
STEPSPACE = 5000
DEADBAND = 0.05
P = 1000
I = 0
D = 0
FF0 = 0
FF1 = 1
FF2 = 0
BIAS = 0
MAX_OUTPUT = 0
MAX_ERROR = 0.0127
MIN_LIMIT = 0
MAX_LIMIT = 380
HOME = 100.000
HOME_OFFSET = -5.000
HOME_SEARCH_VEL = -5.000000
HOME_LATCH_VEL = 0.500000
HOME_FINAL_VEL = 0.000000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

Any help in identifying my issue(s) will be greatly appreciated.  
Attachments:
Last edit: 25 Sep 2021 09:36 by Markyd.

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

More
25 Sep 2021 10:15 #221540 by tommylight
3rd post with the same topic!

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

More
25 Sep 2021 11:28 #221542 by Markyd
Apologies, i guess it is. I'd been searching the forum before starting a new thread, found a couple of older posts that I thought may be related and posted there also. I then found out how to do the latency histogram and then wondered it if was related to the other posts at all, hence starting this one, suspecting half my problem may just be my settings above.

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

More
25 Sep 2021 13:28 #221547 by Aaroncnc
What settings are you using for your rpi
Any over locks wifi by audio and video?

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

More
25 Sep 2021 13:29 #221548 by Aaroncnc

What settings are you using for your rpi
Any overclocks, wifi, bt, audio and video?

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

More
25 Sep 2021 13:36 #221549 by Markyd
FORCE_TURBO = 1 as per PWC's recommendation in another thread.
I also set ARM_FREQ = 1800 (as per pi400, I have a massive heat sink so it is running cool).
I am pretty sure BT is turned off, WiFi would also have been turned off when I plotted the histogram.

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

More
25 Sep 2021 14:02 #221554 by Aaroncnc
Try turning off audio as well.

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

More
25 Sep 2021 14:14 - 25 Sep 2021 14:54 #221555 by PCW
Replied by PCW on topic RPI4 latency - is this normal
You have the minimum ferror limit very small:
MIN_FERROR = 0.0025
(2.5 microns)

I would increase that to at least 0.01

As far as determining the source of following errors, the best way
is to first widen the following error limits (so you don't get a fault)
and then plot the following error (with HALScope) along with joint
velocity.

Also if the RPI is connected to the internet. make sure you have
ntp installed. The default RPI time demon (timesyncd) makes step
changes is the clock which causes changes in the servo thread
period too fast for the 7I96's DPLL to follow.
Last edit: 25 Sep 2021 14:54 by PCW.
The following user(s) said Thank You: Markyd

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

More
10 Oct 2021 06:26 #222714 by Markyd
thanks PCW. Turns out i had the parameter specified twice, with one being redundant. Things are now much better with regard the following error.

I'm still wondering if the latency histogram looks normal? i haven't seen anything else on here that looks like that.

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

More
12 Oct 2021 22:16 #222979 by andypugh

 haven't seen anything else on here that looks like that.

I think I have seen that castle in Lord of the Rings :-)

Note that the plot is +/-20 and the peak latency is 76. It might look a bit less odd at +/-100. But the gaps are, indeed, curious. 

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

Time to create page: 0.097 seconds
Powered by Kunena Forum