2
$\begingroup$

Given a CAN bus with one master and any number of motor drivers, is there a way to measure the time between sending a command from the master (e.g. a PC running ROS) and the execution of the said command (e.g. the motor starting to move)?
This matters since it affects the maximum update rate of the robot's control loop.

$\endgroup$
2
$\begingroup$

Use an oscilloscope.

Place oscilloscope probes on an i/o line on the master and a motor phase line on the slave. Toggle the i/o line just before sending the can bus command for a step change in the motor control. Measure the time difference between i/o trigger and pwm step change. Blocking the motor so it's angle does not change makes it easier to see the pwm change.

There are many variations on this depending on your system. For some pc's (new laptops) getting access to an i/o line is not trivial.

Measurement of latency using code only by capturing time stamps and sending messages is less accurate because you start making assumptions about what the latency in the controller is.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.