Each mode was tested with the maximum number of actuators i.e NORMAL mode with 12 actuators, FAST1
mode with 6 actuators, and FAST2 with 3 actuators. As can be seen, the SPI bus gives the best results,
reaching over 1 kHz of communication speed in FAST2 mode and 3 actuators. The UART and USB buses
generally give similar results. The division between priority normal and priority high was accomplished using
a script that changes the scheduler priority of the running test program:
CONTROL_PID=$(sudo pidof -s <NAME_OF_YOUR_EXECUTABLE>)
CONTROL_PRIORITY=99
sudo chrt -f -p ${CONTROL_PRIORITY} ${CONTROL_PID}
This script changes the priority only when the program is already running (otherwise it will not work). It can
be used when your program cannot be run directly with sudo - for example it is useful when dealing with
ROS nodes.
You can also embed the following snippet in your C++ code if you can run it with sudo directly:
struct sched_param sp;
memset(&sp, 0, sizeof(sp));
sp.sched_priority = 99;
sched_setscheduler(0, SCHED_FIFO, &sp);
During testing on Raspberry PI SBCs we have found out that isolating a CPU core (isolcpus) specifically for
the CANdle process did not result in a performance increase - rather made it less performant.
4. So ware Pack
The MD80 x CANdle so ware pack consists of a few modules. All of them are based on the main CANdle C++
library which takes care of the low-level communication and provides API for high-level so ware.
4.1. CANdle C++ library
CANdle C++ library is the base module of so ware that all other modules are based on. It takes care of
low-level communication between the host and the MD80 controllers. Using the CANdle C++ library directly
is the best option to reach the full performance of the drives when it comes to communication frequency
between the host and MD80 controllers.
www.mabrobotics.pl