The pic is what I did for my own trajectory planner and PID controller. I am using Labview and using Dynamixel SDK protocol 2.0.
I am try to use my own joint trajectory planner + pid controller to replace the dynamixel control algorithm.
There are some confusion points during time setting.
as my understanding, there are two different time gap setting.
1. the time gap which I release each the reference position to controller.
2. the PID control time in each control loop. with the pos feeback time in each time reading the encoding.
When using the PWM control mode of DYNAMIXEL, it doesn't use any internal controller, but directly controls the PWM signal to the motor driver.
However, writing the PWM value to the control table and applying the updated PWM value to the motor driver will take time based on the main loop frequency of the DYNAMIXEL.
I believe 1khz is reasonable frequency for DYNAMIXEL though we do not disclose the exact frequency.
The timing of releasing the trajectory points to the motor should be tested and calculated based on your program as you will need to read the Present Position in order to send the next Goal Position.
Since your PID controller is unknown to us, you need to find out the control frequency of your PID controller.