Linux Real Time Application Interface (RTAI) in Low Cost High Performance Motion Control

Lorenzo Dozio, Paolo Mantegazza · Virtual Community of Pathological Anatomy (University of Castilla La Mancha) · 2003

Advanced high performance multi-input-multi-output motion controllers are generally implemented on dedicated digital signal processors and microcontrollers, having an interrupt latency within a few execution cycles at most. The paper gives an operational view of the hard real time definition and an appropriate perspective on why low cost general purpose computers can be an effective substitute for such high demanding hard real time applications, provided a suitable hard real time operating system is available. The Real Time Application Interface for Linux described here is a viable and effective open-free source software approach for adding hard real time capabilities to a widely available general purpose operating system. It keeps real time applications separated from non real time ones, achieving high efficiencies for both kinds of executions by affording appropriate synchronisation and communication tools to allow an efficient interaction between the two environments. An overview of the development services and tools made available within such a framework is given, along with a sample of specific motion control systems implementations and a list of some known applications. 1. Real time (using low cost general purpose computers and open-free source operating systems) The term “real time” can have significantly different meanings, depending on the audience and application at hand. The computer science literature generally divides real-time systems in two main categories: soft and hard. A soft real time (SRT) system is characterised by its ability to execute a task according to a desired time schedule on the average. A video display is usually taken as a typical SRT example. It is clear that, because of the human eye dynamics, the loss of an occasional frame will not cause any perceived system degradation, providing the average case performance remains acceptable. Even if interpolation techniques can often be used to compensate for missing frames, the system remains SRT; the real frame is missed and the interpolated one is derived rather than actual timely data. Hard real time (HRT) systems instead embody guaranteed timing, cannot miss deadlines and must have bounded latencies, whose level depends on the particular application at hand. So an HRT system cannot use average case performances to compensate for worst case results. A typical example of an HRT system consists of a controlling system (computer) and a controlled system (plant). It is imperative that the state of the plant, as perceived by the controlling system, is consistent with the actual plant state, within an acceptable error margin (noise level). Moreover timing correctness requirements arise for the control actuations, which have to be performed according to the sampling rates for which the discrete time control system has been designed. Generally speaking hard real time constraints can be met with strict determinism by dedicated Central Processing Units (CPU) only, e.g. Digital Signal Processors (DSP) and DSP like † Research Fellow, [email protected], +39-02-2399-8329 ‡ Full Professor, [email protected], +39-02-2399-8340 microcontrollers, having a guaranteed interrupt latency in the range of a single/few execution cycles. General Purpose CPUs (GPCPU), i.e. any brand used in workstations, desktops, personal computers and their industrialised clones, are in principle rather unsuitable for hard real time applications. In fact Virtual Memory (VM) and its related Memory Management Unit (MMU), high dependence of performances on multi level caches, possible bus arbitration from “intelligent” Input Output (IO) subsystems, high depth piped execution and speculation, subject them to many non deterministic latencies and jitter, that can largely exceed even the longest instruction execution time. It is thus important to get both an operational view of the hard real time definition and an appropriate perspective of why GPCPUs are usable indeed for hard real time applications related to high demanding control systems, such as those typified by advanced high performance Multi-InputMulti-Output (MIMO) motion controllers. To more and more meet high demanding specifications nowadays such controllers often include some form of adaptivity, force control and active vibration suppression. Taking a high precision profiling machine as an example it is likely that, in such a view, the sampling rate could approach the 10 KHz range. A well programmed modern GPCPU has double precision floating point capabilities from a few to many hundreds millions Floating Point Operations (multiply-add) per Seconds (FLOPS), with possible giga FLOPS peaks achievable by using vector computation units (Single Instruction Multiple Data, SIMD), that come for free with many recent GPCPUs. So it allows the implementation of fairly complex control schemes, fully featuring what hinted above. Add the possibility of easily achieving even higher performances using Symmetric Multi Processors (SMP) with the adoption of off the shelf consumer dual processors boards, with just a small increase of the cost of a single processing unit, to realise that such a solution can meet high requirements at unprecedented cost/performance figures. Let us now suppose that the related process runs over a GPCPU with a Real Time Operating System (RTOS) which allows for the test code to be locked into memory, to be prevented from being paged to hard disk, and to be scheduled with a precisely timed execution at 10 KHz. It will roughly do the following:

Read the paper · More papers on PaperTik