A Digital PID Controller Using RTAI

Ricardo Guerra, H. J. Gonçalves Júnior, Walter Fetter Lages, Osvaldo Aranha · 2002

This work presents an implementation of a digital PID (Proportional + Integral + Differential) controller in a PC machine running RTAI. PID controllers are well known and have a wide range of applications in the control of analog processes such as servomotors. The well implemented PID controllers are usually hard real time systems. The PID controller described in this work uses the PC parallel port as an analog I/O interface. Just two bits are used as ‘analog’ interfaces through a technique called Pulse Width Modulation (PWM). This technique allows an analog interface to be built without the use of conventional A/D and D/A converters. Real time tasks were provided by threads under LXRT hard real time mode. The implementation of PWM under RTAI using the timing functions provided by RTAI are presented and the convenience of using these functions for actual real time control is discussed. In particular, the semantics of rt sleep() is analyzed in detail and it is shown that the current semantics can lead to a confusing interpretation of what a periodic task is and what a task period is. Furthermore the current semantics of rt sleep() is incompatible with the semantics of rt busy sleep(), which can lead to even more confusion. A new semantics for rt sleep() is suggested.

Read the paper · More papers on PaperTik