Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 03-01-2007, 01:26 PM   #1
LQ Newbie
Registered: Feb 2005
Posts: 3

Rep: Reputation: 0
Help with deciding Linux capability for Real-Time application

Hello Everyone,

I had noticed a few threads on Real-time application on Linux, but felt that i must start a new thread regarding the question in mind.

Background information --->
I am working on robotics with vision. I interface with the robot using an interface box, provided by the manufacturer. The communication takes place between the interface box and computer over a CAN bus. (The manufacturer chose to use CAN as the communication medium).

The interface box sends the robot current status information in two packets with a gap of 20ms. So at time T ms it sends Status (1st half of complete status) and at (T+20)ms it sends Status (2nd half of complete status). Then it sends a third packet requesting any use input, i.e asks to provide a new velocity profile or new position information that robot needs to move in. The robot waits for the entire duration of 20ms to accept the information. After this the above sequence repeats.

On my Linux box, I need to run three things
1. CAN Communication routine which runs every 20ms or when i need to send the new status information to the robot.
2. A high level control algorithm (runs for less than 1ms)
3. Image processing. This takes a lot of computational resources and needs to run all the time on the computer and be preempted when the CAN communication routine or the control routine run

Now I wondering if this would be classified as a hard real-time or a soft real-time system. In either case, could anyone suggest possible Linux distributions to use. Will a general desktop Linux distribution be able to handle the time constraints and computational requirements in this application?

I was thinking of using RTLinux. Could anyone suggest if they have worked on a similar thing, what they have done. I am traditionally from Windows background but have some working experience with Linux. But done very little programming on Linux.

One of the problems that I faced when using the Windows machine is that, it does not preempt the Image processing routine in time and runs for nearly 40ms and more before relinquishing control to the CAN communication routine. I am sure there could be ways for doing it on Windows, but could anyone provide me the Linux alternative.

Any suggestions would be greatly appreciated!!

Thanks everyone

Best Regards,
Old 03-03-2007, 04:45 PM   #2
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
I think it could be done on a normal Linux distribution, but I'd rather recompile the kernel with some real-time patches (but not necessarily RTLinux, which would handle the task without a doubt, BTW). The communication stuff can be split: the controlling part running as a high priority process (maybe some kernel module) and the visualization as a normal program. With priorities set correctly, the image processing will be preempted just as desired.

20ms is just 50times/second what is not that much. The question is about delays, which I think will not harm that.
Old 03-03-2007, 05:24 PM   #3
LQ Newbie
Registered: Feb 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Thank you Mara,
Could you suggest some other some real-time patches on Linux that can be used instead of RT-Linux.
I guess a simple multi-threaded application would give the required performance. What do you think. In past while some other people who have worked on similar stuff seemed to have used two different computers. I made a quick search for them on google, but there are so many options that pop up, could you suggest some from your experience that I could you use.

Thank you,
Best regards.
Old 03-04-2007, 02:44 PM   #4
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Start with

But one important note: also look into the standard kernel options (like the one setting HZ), they also make difference.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Real-time Linux gains real-time JVM LXer Syndicated Linux News 0 10-12-2006 11:54 AM
LXer: Real Time Coming to Linux Real Soon LXer Syndicated Linux News 1 08-23-2006 07:30 PM
LXer: Developing a real-time Linux data acquisition application LXer Syndicated Linux News 0 08-22-2006 12:54 AM
Having a hard time deciding..Kubuntu or Mepis?! RoaCh Of DisCor Linux - Distributions 5 07-20-2006 05:40 AM
Real time linux install hsuri Linux - General 0 05-18-2003 01:49 AM > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:08 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration