Page 1 of 1

Latency of Vint and Motor Controllers

Posted: Wed Jun 09, 2021 2:58 am
by Tom
Hello,

I am a mechatronics engineer building a differential drive robotic platform. I have built my own motor drive system for the robot using a Stm32 but was looking at changing to the 4a Dc motor controller to drive the motors. We are looking at using other Phidgets in the robot so integrating everything into the Phidget ecosystem made sense.

Initial testing looked good but there was some response issues when trying to control the robot. I put together a quick test using c# on windows where it measures the time it takes from starting a move (BeginSetTargetPosition()) to seeing the position change. The results were in the 100ms - 300ms range.

In my own system using usb coms the latency with the same test was less then 5ms.

The latency is an issue because it uses external sensors to find its real world position and the motors speed needs to be updated to keep the rover on track.

Is there anyway to speed up this response time?

I haven't isolated exactly where in the system the delays are coming from but I thought I would ask here to see if there was anything obvious before digging in with more testing or going back to my own drive.

Re: Latency of Vint and Motor Controllers

Posted: Wed Jun 16, 2021 9:43 am
by jdecoux
It looks like your are using asynchronous function calls (BeginSetTargetPosition), which will queue up if you are calling them faster than they can be dealt with.

Simple solutions could be to either use synchronous calls (myMotor.TargetPosition = x), or ensure you are limiting asynchronous calls to what the system can handle.