Latency LED64

Technical Discussions on any InterfaceKits
KNS
Phidgetsian
Posts: 7
Joined: Fri Jan 16, 2015 11:20 am
Contact:

Latency LED64

Postby KNS » Fri Jan 16, 2015 11:32 am

Hi,

I've have just taken possession of the LED 64 (http://www.phidgets.com/products.php?product_id=1032). Links to a previous model, 1030, indicates that "output update rates" were on the order of 30 per second while the current version makes no mention of latency but does list 'USB fullspeed'. Does anyone know anything about the latencies associated with the 1032 model?

Thanks,
Ken

User avatar
mparadis
Site Admin
Posts: 649
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Latency LED64

Postby mparadis » Fri Jan 16, 2015 1:18 pm

The reason we don't have this specification is because it varies depending on the computer that the 1032 is plugged into. The 30 updates/sec of the 1030 was probably the result of a test using one of our computers, before we knew how variable this spec was. As far as I know though, the speed shouldn't have changed much since the 1030, so 30 updates/sec is probably a reasonable estimate.

KNS
Phidgetsian
Posts: 7
Joined: Fri Jan 16, 2015 11:20 am
Contact:

Re: Latency LED64

Postby KNS » Fri Jan 16, 2015 1:28 pm

Any easy, recommended, approach to benchmark on my machines. Thanks.

Edit: As noted over e-mail with the store, this device is extremely convenient, hence I'm grasping at any information that could justify use in the intended application. Obviously, the likelihood is that little has changed between the 1030 and 1032.

Edit 2: If anyone has suggestions for an equally simple device with low latency and C and/or Python API, I'm all ears.

User avatar
Patrick
Lead Developer
Posts: 3098
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Latency LED64

Postby Patrick » Mon Jan 19, 2015 9:49 am

Are you interested in latency or update rate? Latency should be on the order of 10ms or less. 1032 was designed to support a much higher update rate then 1030/1031 - especially for turning LEDs on and off without changing the brightness - you can probably expect and update rate of 100 times/second at least on a typical machine when controlling all 64 LEDs.

-Patrick

User avatar
mparadis
Site Admin
Posts: 649
Joined: Fri Oct 28, 2011 12:17 pm
Contact:

Re: Latency LED64

Postby mparadis » Mon Jan 19, 2015 10:16 am

We don't have a benchmarking tool or anything, but I hooked up an oscilloscope to the 1032 using my computer with the following specs:

OS: Windows 7 64-Bit
Processor: Intel Core i5-2400 CPU @ 3.10 GHz

Switching one LED on and off, I was able to get 3400 updates/sec. Your mileage may vary depending on your computer (an important factor is the way your OS's USB drivers behave- I've been told that Macs typically get even better performance in this situation) and how many LEDs you're updating at once. I think it's pretty safe to say that you'll be able to surpass 30 updates/sec on an average computer even updating all 64 LEDs at once.

KNS
Phidgetsian
Posts: 7
Joined: Fri Jan 16, 2015 11:20 am
Contact:

Re: Latency LED64

Postby KNS » Tue Jan 20, 2015 3:50 pm

Thanks. I'm only working with about 10 LEDs, and will individually turn them ON/OFF with no immediate need for brightness control (or that will simple be set at whatever value). Only one LED will be on at any given time. The intervals will be on the order of a couple hundred milliseconds to maybe 2 or 3 seconds. My key requirement is that the statement for ON or OFF be executed within a few milliseconds (the shorter the better). In many instances, as soon as one light is turned OFF (after a fixed duration), another will need to be turned ON.

If I understand you correctly, the high update rate will allow for sub-millisecond ON or OFF state changes on a reasonably configured system. Correct?

Ken

User avatar
Patrick
Lead Developer
Posts: 3098
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Latency LED64

Postby Patrick » Tue Jan 20, 2015 5:08 pm

Yes that's correct, however, the actual latency for each command is hard to predict - you can send several commands per ms, but there may be 10-20ms of latency between the command being called in your code and the light actually turning on / off. The library automatically groups commands into single packets, so often several commands will be sent and happen simultaneously.

-Patrick

KNS
Phidgetsian
Posts: 7
Joined: Fri Jan 16, 2015 11:20 am
Contact:

Re: Latency LED64

Postby KNS » Tue Jan 20, 2015 8:41 pm

Are there any realistically accessible ways to tighten that 10-20ms, including an application specific build of the library?

As noted earlier my fall-back is the parallel port but the LED64 is so convenient.

Ken

User avatar
Patrick
Lead Developer
Posts: 3098
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: Latency LED64

Postby Patrick » Wed Jan 21, 2015 10:10 am

Parallel port won't give you any better latency on the same PC. You should be able to achieve a very low latency most of the time - but because you are using a PC and not a real-time OS, it's impossible to guarantee that kind of timing all the time, there are all sorts of OS-level things which can occasionally block userspace applications as the kernel processes something. Depending on how important your timing is, these occasional occurrences may or may not be an issue.

One thing you can do to help is bump up the thread priority on your application.

-Patrick

frodegill
Phidget Mastermind
Posts: 114
Joined: Thu Mar 04, 2010 2:51 am
Contact:

Re: Latency LED64

Postby frodegill » Wed Jan 21, 2015 2:30 pm

KNS wrote:My key requirement is that the statement for ON or OFF be executed within a few milliseconds (the shorter the better).

How far do you want to go? Phidgets and the 1032 is a very good choice for controlling LEDs, but the system uses USB on a desktop OS (which does put limits on expected response time).
Right now I am working on a small hobby project involving an Atmel XMEGA and a MAX7219. The XMEGA Event System guarantees response time of two cycles(!) at 32MHz, and the MAX7219 controls 64 LEDs over a 10MHz serial interface. Using hardware for well below $50 (including microcontroller and LEDs) I can toggle individual LEDs in the 0.1ms range. But coding it is a nightmare, debugging is close to impossible and the hardware resources are extremely limitted. You can have an RTOS if you want it, but I would be surprised if Phidgets and 1032 is not by far your best choice.


Return to “InterfaceKits”

Who is online

Users browsing this forum: No registered users and 2 guests