I am trying to run custom trajectories on two motors using the motorcortex-cpp library. My objective is to synchronize the motion of these two motors.
Prior to installing motorcortex-cpp, while building and installing nng, mbedtls was enabled. In the cpp interface that I wrote on top of the mcx-cpp library, I am calling the function Request::setParameter()
to send joint position commands to the motor drives using the "jointAutoSetpointGenerator" parameter. As suggested by @Philippe, the maximum acceleration and jerk are set to high values (maximum acceleration = 100 rad/s2, and the maximum jerk = 1000 rad/s3). Our trajectory tracking controller ideally works at 1000 Hz (for fine control). However, a single call to setParameter takes about 20 milliseconds to return (with a variation of about 1 ms). This significantly brings down the frequency of the controller and affects its performance. How can I reduce this delay? Or am I doing something fundamentally wrong by using the jointAutoSetpointGenerator as a way to set the target position at such high rates?