08-12-2010 02:31 AM
Hello,
I need to control my servo motor using Labview (version 8.2). I need delay timer in 0.1 ms order (or better in 1 microsecond order). I found that Labview provides timer at least 1 ms.
Any help would be greatly appreciated.
08-12-2010 02:58 AM
Controlling motion without a motion control device gives me a headache. The headache becomes worse if you tell me that you want to use a non realtime system (like Windows or Linux) to do this.
That being said, LV for non-RT systems only gives you access to waiting times with a granularity of 1ms. With this granularity, we can hope that the timing will be quite "secure". Sadly, we do not have a guarantee for this.
Using a RT system, you have access to a timing granularity of 1us. So maybe this could be a solution for you besides of purchasing a dedicated motion control device like the PCI 734x or 735x. I think you should take a look here.
hope this helps,
Norbert
08-12-2010 06:14 AM
I agree with Norbert. You have to switch to a real time system of some sort. The 1 ms software timer in Labview is not for precise timing. The limitation is the OS, and not the people behind the Labview software. You may be able to run LabVIEW Real-Time on a standard desktop PC. But this is somewhat dependent on the mother board hardware. I think NI offer a 30 day trail version of LabVIEW Real-Time. But not for your Labview version. If NI do have a LabVIEW Real-Time trail version, they will also have the correct Labview version for 30 days trail also. Your locale NI office will help you.

08-12-2010 07:41 PM
Thanks for your quick response. but i have no more budget for purchasing new S/W. Is there any Windows Library (.dll) for timer that we can use in Labview?
08-13-2010 07:20 AM
You have been told that it will not work with any standard desktop operating system.
The reason is not that a faster timer is not readily available, it is that the OS does not permit control at that resolution - even if you could time it.
To do closed loop control of an external device you must do a minimum of three things: 1. Read the status of the device. For motion control this might be position, speed, and direction. 2. Decide what the device should do next. 3. Send new commands to the device. To do this in LV on Windows would require software tasks something like this: LV sends request to OS to read status. OS passes request to driver. Driver reads hardware. Driver tells OS it has data for LV. OS tells LV data is available from driver. LV calculates new command. LV sends tell OS it has command for driver. OS passes command to driver. Driver sets new value in hardware. (optional) Driver tells OS to tell LV that command is complete. Repeat.
Every time the OS gets involved an unknown amount of time is introduced into the system. In some OSes the time slices for task switching may be on the order of 10-20 ms. From the point of view of the OS the drivers are separate tasks from the application program. With a real time OS those times slices are precisely defined and can be 1 ms or 0.1 ms, or even faster if you hardware to handle the timing.
Lynn
08-13-2010 07:56 AM
The OS may have other tasks that the OS system developers deemed higher priority, which if they occur will delay your task's execution even more. And when the OS crashes, or decides your thread has crashed, your servo motor runs at full speed until it hits, the hopefully included, hardware limit switch (which, if it only signals the Motion Program won't do much at this point, because it isn't running anymore).
There was a product years ago, under the name "Steeplechase" (not sure if that was the product or the company after ten years) that basically that installed on a PC "under" WindowsNT, making NT a process that it ran. It was a realtime OS, so tasks actually dedicated to it were deterministic, in other words the predictably occurred a specific times. As Lyn said, Windows, Linux (with the exception of the RealTime versions) and most other "general purpose" OS are not deterministic. But deterministic doesn't mean "fast" necessarily. When the phrase "Real Time" is used it doesn't necessarily mean "Fast".
The granularity of timers, the predictability, becomes poorer as the OS becomes more complicated, and Windows, in all its flavors, is complicated (bloated).
Sorry, don't mean to rain on your parade, this is engineer, where decisions are made (hopefully) based on the realities.
Can a motion control system be built running under Windows, yes. Will it be fast and responsive, probably not. Will it be "safe", guaranteeing that control of the device remains under the program/operator, no.
