I am trying to monitor the position and velocity of MX-106 in 1kHz with U2D2/python SDK on Ubuntu 22.04. The baudrate is set to 1Mbps. Based on my understanding the read latency from U2D2 is limited by the Linux driver of USB-to-serial chip in this scenario, which can be set to 1ms in minimum by changing the value /sys/bus/usb-serial/devices/ttyUSB0/latency_timer.
Since there is other latency such as write latency, I find 1kHz frequency for monitoring not achievable especially when I try to monitor both current velocity and position.
Would there be any SW approach to reduce the latency under 1ms to enable stable 1kHz communication?
If this is not possible would there be HW approaches to handle this issue?
Could using a PCIe serial port card be an option?
Is there any documentation related to this issue?
Thank you for any help in advance and please let me know if you need any additional detail or clarification.
I can definitely try the SW suggestions you gave to me. However, I think my major concern is still not resolved yet.
I believe that the communication bottleneck is in the polling mechanism of the USB driver.
The write4ByteTxRx instruction in Python SDK consistently shows latency of 2ms with baudrate 1Mbps and 4Mbps when /sys/bus/usb-serial/devices/ttyUSB0/latency_timer is set to 1. This value changes to 16ms when I set /sys/bus/usb-serial/devices/ttyUSB0/latency_timer to 16. (Not sure why the latency is x1 when it is 16ms and x2 when it is 1ms). Still I believe this is strong evidence that the communication bottleneck is in polling mechanism of the USB.
I thought trying to achieve 1kHZ monitor/control with MX-106 & U2D2 would be some common scenario and was wondering how others (or Robotis) is dealing in such cases. Or maybe is this not so common and you mentioned OMY arm to notify this?
I am also wondering if direct connection from PC to U2D2 board via some PCIe to tty interface would work properly with Dynamixel.
You can ask this researcher if he/she ever achieved 1 kHz :
I am sure that you are aware of the raw speed of the USB Port which is many times faster than 1 kHz. Personally, I think that the controlling I/O rate is at the actuator’s hardware/firmware design (which is proprietary) so using PCIe won’t give you any better prospect.