Read rate through SimpleMotion USB adapter

I have 4 Ioni boards on the IoniCube board. In Linux using the SimpleMotionV2 library it seems to take 16ms for a bus transaction with a single board. To sequence through all 4 boards is taking around 66ms. This is to slow, I would like to update the boards at 100Hz but I can’t.

I am using all the tricks show on this page:

Is this typical for a transaction cycle time?

I thought my transactions where much shorter until recently after updating my Linux kernel, lots of system packages and ROS packages. I don’t have an easy way to go back and I am wondering if something has happened to my system or it has always been this way and I never noticed.

Looks like I made a mistake. I rolled the kernel in Ubuntu Xenial back from 4.4.0-77-generic to 4.4.0-53-generic an the USB cycle time is dramatically shorter and gets me back to what I thought I remember seeing, my update loop runs at around 80hz.

So I guess the question is what happened with the kernel. Let me know if you have any insight.

Good to hear you found a solution.

BTW, if you or anyone here knows how to set FTDI latency to 1 ms in Linux, let us know :slight_smile: In Windows it can be changed in device driver settings, so I guess it is possible in Linux somehow as well.

I bet that would help many apps. I.e. I have done working SimpleMotion driver to LinuxCNC, it might benefit from lower latency.

Well, it looks like the latency_timer is the problem and the solution. I found that you can change the latency timer here: /sys/bus/usb-serial/devices/ttyUSB0/latency_timer

and so I did a comparison and the previous kernel defaults to 1 and the new kernel defaults to 16. If I echo a 1 into the latency_timer file then it behaves as it should.

I knew about the latency timer but didn’t think about it as the cause of the problem but your question made me go look. Thanks.

1 Like

I made change to SM library to set low latency mode automatically on connect. May require that app is run with root permissions (not sure about it). It is in develop branch on Github.

Perhaps @Curt_Meyers finds it useful, and hopefully few more as well :slight_smile: