Need a FAST servo controller

Hi,

I’m building a prototype for my company. The prototype includes a camera that is mounted on pan & tilt module. The pan & tilt mission is time critial, as the camera has to be pointed very fast towards the desired location.

I’m using 2 super fast digital servos Hitec HS-6965HB that are rated at 0.08 seconds for 60 degrees. Since they have to move about 30 degrees at a time, then I expect them to finish moving about 40-60 ms after the command to move is executed in the PC.

However, testing a well-known servo controller from a different brand I discovered that the servos does not even start to move for as long as 70 ms after the command had been given. The delay may be due to bad design of the dll that comunicated with the controller, issues with USB driver, or design of the controller’s hardware/firmware.

I’m looking for a controller that will be able to send the new position to the servos immediatley after the invocation of a c++ command in the PC. More specifically, 10-30 ms delay is acceptable.

Could you please let me know whether you have a well-tested information regarding the delay in Pololu servo controllers ? I would preffer to use USB servo controller, but will choose serial controller in case it is faster then the USB solutions.

Hello,

Our servo controllers generate the servo control pulses at 50 Hz (every 20 ms), and new commands are reflected every update cycle. However, the updates are calculated for all 16 servos at once before every cycle. This means that in the worst case, your command could come in just after the new servo positions are calculated, requiring another 20 ms before they get incorporated and then possibly another almost 20 ms before the last servo pulse is generated. The serial command itself takes almost 2 ms, so your total could be about 40 ms from when you begin sending a serial command to when the pulse reflecting that command is generated.

If you only need two channels, you could use the best two channels and get closer to 20 ms for worst-case command-to-response time.

However, as you indicated, there are many things that could affect your total system response time. One main one is the servo response time. My understanding is that servo speed specs are just mechanical ratings, and that any servo with a gearmotor that can do 120 RPM will get a 0.08 s/60 degrees rating. Being able to turn 120 RPM is not the same thing as being able to start standing still, move 60 degrees, and stop in 80 ms. (That would mean the servo could swing back and forth at over 6 Hz, which I’ve never seen an RC servo do.) The other delay sources you mention might also be in play.

We do have a USB version of our servo controller that uses a USB-to-serial adapter, but we do not have control over the driver for that, and delays there might be heavily operating system dependent.

So, overall, I think 70 ms is not bad and probably is going to be similar for all servo controllers on the market. I would actually have a very difficult time measuring something like time from the command being given to the time of the servo beginning to move; how did you do it?

- Jan

Hello Jan,

Thank you for the fast response to my question. I’m aware of the fact that servo speed is measured during transition time and does not nessesarily indicates stop-to-stop time. However, I want to minimize other delays in the system.

Following your answer I think that I will try to use pololu controller with serial interface and try to achive 20ms response time. What would be the best 2 channels to connect my servos to - would it be the first 2 channels ? Is it possible to connect two pololus to a PC that is equiped with one serial port (I would like to connect 2 pan & tilt moduls at the same time) ?

For your question regarding how I measured the 70 ms delay:

  1. The controller I’m testing has a function to read registers that indicate the last received servos position command. I noticed that I need to call this function up to 70ms after giving a position command in order to receive the updated values.
  2. A camera is connected to the pan & tilt device. After the command is sent to the controller the PC grabs the next available image (which takes up to 33ms since the camera works at 30 fps). The image has a time stamp, so I can verify when it was grabed. Images that where grabbed too close to the time of sending the control command shows the scene in the previous camera position (in a sharp image which means that the image was not captured during servo’s transition). This means that the servos didn’t even start to move. I discovered that if I grab the image 180ms after sending the command to the controller (which indicates 30 degrees of position change), the aquired image show the scene from the new desired location.

Yaniv.

Unfortunately, it turns out that all of the channels will have similar worst-case delays of about 40 ms and best-case delays of around 20 ms, so I’m not sure if that will be good enough for you. I’m sorry about the mistake in my original reply.

If you need many of these units, we could make a customized version for you that would improve the delays to about 2 ms best case, 20 ms worst case. We could also generate the pulses a bit quicker, to get a 60 or 70 Hz pulse rate and quicker responses.

Since the channels are all the same, you have no need for connecting two controllers to one serial port, but it is possible.

- Jan

ok, that good to have an accurate information in this manner.

At this time I’m only building a prototype, and it will take several monthes before large quntities of controllers will be required.

Yaniv.