Real-Time Control of Magnetic Bearings Using RTLinux
One of the most demanding applications of real-time control is the active magnetic bearing (AMB). Suspending a shaft rotating faster than 10,000 RPMs in a magnetic field with a gap of .015 inches—roughly the size of a grain of table salt—requires precise, reliable control of the magnetic field. Magnetic suspensions inherently are unstable. Think of a trapeze artist balancing a long pole on her chin, and you can appreciate the difficulty that a control system encounters when stabilizing a magnetic bearing. Magnetic bearings provide several advantages, however, which justify their use. The major advantage is magnetic bearings eliminate physical contact between the shaft and the support, minimizing friction and eliminating the wear inherent to conventional roller bearings.
A recent application under development in Japan is an implantable heart pump. Because magnetic bearings require no maintenance, this is an ideal situation in which to use them. For the same reason, satellite wheels also are a logical application.
The experimental test rig, shown in Figure 1, consists of two eight-pole laminated stator assemblies, with individual windings on each of the poles. The bearing assembly includes inductive gap sensors at the centerline of each pair of diametrically opposed poles. These bearings support a two-foot-long shaft driven by a brushless DC motor. Figure 2 shows a schematic of a single axis. The controller uses the signal from the gap sensor to adjust the current from the power amplifiers driving the magnetic coils to keep the rotating shaft centered in the gap. The original controller was an analog circuit, which was replaced by the digital controller. The capability of running either the analog or digital controller is retained. The digital controller is implemented on an Intel Pentium III PC with a multichannel data acquisition board and a multichannel analog output board. The PC is configured as a dual-boot system, and the user selects plain Linux or RTLinux at startup.

Figure 2. Schematic of a Single Axis of the Magnetic Bearing
A real-time OS must ensure that a specific task executes at a fixed rate, regardless of the many system-level demands that burden the OS. To meet this requirement, two organizations, FSMLabs and RTAI, have developed special-purpose kernels that run Linux as a low-priority task within a real-time OS. This substantially reduces the timing from the hundreds of milliseconds on desktop systems to the microsecond range. It also allows the user to control precisely the timing of critical control processes.
For this magnetic bearing project, I selected the free RTLinux implementation from FSMLabs. RTLinux, developed by Michael Barabanov and Victor Yodaiken in 1996, currently is marketed by FSMLabs, a private company located in New Mexico. FSMLabs provides two versions of RTLinux, including RTLinux/Free, which I used for this project. FSMLabs holds a software patent on RTLinux, but the patent's license allows it to be used in projects licensed under the GNU GPL.
Conceptually, RTLinux splits the OS into user space and a real-time kernel. You may think of these as two separate cities, walled off from each other and able to communicate only by guarded pathways, such as real-time, first-in-first-out devices (RT-FIFOs). User space is the familiar Linux system with all its friendly utilities, such as the vi editor, the GCC compiler and the shutdown command. The real-time kernel is the Spartan environment that relentlessly executes the real-time task regardless of the activities in user space.
Real-time programs are coded as kernel modules and do not use the main{} program construct of user-space C programs. The module requires two functions: init_module, which is called when starting, and cleanup_module, which is called when turning off the real-time module. The init_module creates the entry point for the real-time module and allocates the RT-FIFOs used to communicate with user space. To start the real-time module, use the insmod command. Once the real-time module starts, it can be stopped only by issuing the rmmod command or by pulling the plug on the processor. As a new user of RTLinux, I was quite unnerved to discover that despite issuing the shutdown command, the controller continued to run.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Home, My Backup Data Center
- New Products
- Developer Poll
- Trying to Tame the Tablet
- Validate an E-Mail Address with PHP, the Right Way
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.





34 min 48 sec ago
35 min 45 sec ago
36 min 51 sec ago
38 min 2 sec ago
41 min 31 sec ago
42 min 54 sec ago
1 hour 40 min ago
2 hours 59 min ago
6 hours 32 min ago
10 hours 46 min ago