|
Posted by waynegramlich on January 23, 2010, 4:52 pm
Joe Pfeiffer wrote:
>
>> Joe Pfeiffer wrote:
>>>> Joe Pfeiffer wrote:
>>>>> I can't imagine trying to close a servo loop with a processor running a
>>>>> "real" OS (Linux, XP, or anything else worthy of the name), no matter
>>>>> what hardware was doing the details of control and sensing. Things like
>>>>> that are what $1 specialized MCUs are for.
>>>> I basically agree. I am a huge fan of using dedicated MCU's for
>>>> tight real-time control. However, the EMC2 project over at:
>>>> <http://linuxcnc.org/>
>>>> is basically real-time Linux being used to control CNC machines.
>>>> This just shows that some people are pushing hard on real-time
>>>> Linux.
>>> I hadn't looked at their code... they're trying to do the acceleration
>>> and deceleration ramps under Linux? They're braver than I am.
>> Joe:
>> Yes, they do the accel/decel, kinimatics, etc. all under a real-time
>> variant of Linux. The documentation is pretty good too. They have
>> a pretty general purpose architecture for hooking into the real-time
>> Linux, including some GUI visualization tools. All-in-all, it is
>> pretty slick. The HAL User Manual is worth a quick read:
>> <http://www.linuxcnc.org/docs/HAL_User_Manual.pdf>
>> My general feeling is that a real-time Linux variant plus a bunch
>> of $1 MCU's can provide a very flexible and cost effective control
>> platform for robotics.
>
> Thanks, I'll take a look at that -- when you say real-time Linux, do you
> mean RTLinux? That seems a bit less wild, since in that system the
> real-time part isn't Linux (Linux is a task under the real-time part).
> Or do I just need to go RTFM?
Joe:
Reading the manual would help.
From section 2.1 of the HAL User Manual:
The RTAPI environment
RTAPI stands for Real Time Application Programming Interface. Many
HAL components work in realtime, and all HAL components store data
in shared memory so realtime components can access it. Normal Linux
does not support realtime programming or the type of shared memory
that HAL needs. Fortunately there are realtime operating systems
(RTOS’s) that provide the necessary extensions to Linux. Unfortunate=
ly,
each RTOS does things a little differently.
To address these differences, the EMC team came up with RTAPI, which
provides a consistent way for programs to talk to the RTOS. If you
are a programmer who wants to work on the internals of EMC, you may
want to study emc2/src/rtapi/rtapi.h to understand the API. But
if you are a normal person all you need to know about RTAPI is that
it (and the RTOS) needs to be loaded into the memory of your computer
before you do anything with HAL.
The following link gives an overview of EMC2:
<http://www.linuxcnc.org/content/view/11/10/lang,en/>
Here are few quotes to whet your appetite:
It can simultaneously move up to 9 axes and supports a
variety of interfaces.
Support for non-Cartesian motion systems is provided via
custom kinematics modules. Available architectures include
hexapods (Stewart platforms and similar concepts) and systems
with rotary joints to provide motion such as PUMA or SCARA
robots.
The following quote answers your question:
EMC runs on Linux using real time extensions. Support currently
exists for version 2.4 and 2.6 Linux kernels with real time
extensions applied by RT-Linux or RTAI patches.
For those of you who are interested, there actually *two* common
real-time extensions to Linux -- RTLinux and RTAI. EMC2 works
with both:
<http://en.wikipedia.org/wiki/RTAI>
<http://en.wikipedia.org/wiki/RTLinux>
I do not recall which variant is the *preferred* one at this time.
-Wayne
|