Real-Time Control of Magnetic Bearings Using RTLinux
Alternate control laws are implemented easily in C and experimentally verified. One of the more robust of these is shown in the difference equation:
y(n) = 1.4934*y(n-1) - 0.5576*y(n-2) + 0.5795*x(n) + .01487*x(n-1) - 0.5646* x(n-2)
The rotor has spun up to 11,000 RPMs successfully, with the AMB under full digital control, passing through a critical speed at 2,700 RPMs. In virtually all rotating machinery, from the humblest hair dryer to the modern passenger jet engine, critical speeds occur at distinct RPMs. At these critical speeds, the vibration of the rotating shaft grows large and places high loads on the bearings and other components. These present extreme tests for the bearings.
To change the coefficients of the control law while the rig is operating, I used RT-FIFOs. These are first-in-first-out files for communicating between Linux user space and RTLinux threads. Because RT-FIFOs are unidirectional, I created two separate files for two-way communication with the control module. Function rtf_create(fifo_id_no, fifo_length) allocates a buffer of the specified size for the specified FIFO ( /dev/rtf0, /dev/rtf1,..../dev/rtf64 ). It must be called from init_module(). Function rtf_destroy deallocates the FIFO at the completion of execution. It can be called from init_module( ) or clean-up_module(). This allows me to change the control law on the fly by changing the difference equation coefficients while the real-time module is running. Using the function rtf_get(fifo_id,&variables,sizeof(variables)) within the real-time thread reads the coefficients in a non-blocking mode. The user-space code for sending the coefficients to the real-time module is:
ctl = open("/dev/rtf1",O_WRONLY); write(ctl,&coeffs,sizeof(coeffs)); ctl = close(ctl);
This code is embedded in an NCURSES interface, which allows me to change the coefficients with manual entries as the rig is rotating. The NCURSES Programming How-To by Pradeep Padala (see the on-line Resources) is an excellent resource for this work.
In a similar way, I can access the data stream in the control program and send it to user space. The appropriate function in the real-time module is rtf_put(framerate_rtfifo_id, volts, offset). In user space, send the output to a file with cat /dev/rtf0 > file . A simple C program to convert the file to a readable form must be written.
RTLinux is used to control a working rotor test rig at Tufts University. The controller is realized on a conventional Pentium III personal computer using the RTLinux extension of the Linux operating system. The control algorithm is implemented in C. Various control laws can be implemented and tried on an actual experiment.
An additional advantage is the elimination of a target computer, since the real-time OS operates on the same processor as the host computer. Most applications developed as digital control systems launch as a startup executable on a proprietary real-time target computer. The approach presented here differs; it does not target a RT controller based on a proprietary development system. It uses a Linux software environment developed for applications in control and data acquisition requiring hard real-time (deterministic) execution.
I wish to acknowledge the support of Professors Fred Nelson and Denis Fermental at Tufts for supporting this work. This work was partially funded by C. S. Draper Lab. of Cambridge, Massachusetts.
Resources for this article: /article/8260.
Harland Alpaugh (firstname.lastname@example.org) is working on his PhD in Mechanical Engineering at Tufts University. He enjoys whitewater canoeing and often can be found on a stream in New England when the ice has disappeared.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- Profiles and RC Files
- Astronomy for KDE
- Maru OS Brings Debian to Your Phone
- Understanding Ceph and Its Place in the Market
- Snappy Moves to New Platforms
- Git 2.9 Released
- OpenSwitch Finds a New Home
- What's Our Next Fight?
- The Giant Zero, Part 0.x
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide