Active feedback stabilization of magnetic levitation
Motivation & Problem Description
Most magnetic levitation demos use a traction-type system, which means that the magnetic coil is located above the levitating object. This just doesn't look as cool as levitating an object with repulsion from below. However, repulsive levitation is generally unstable in two directions, which makes it harder to control. Additionally, most commercially available levitation systems have a significant power draw, which results in heating of the magnet & wasting of energy. Finally, the simplest levitation designs use optical sensors to detect the position of the levitated magnet, but there are problems with interference (eg, someone's hand blocking the beam, or the sensor being fooled by sunlight).
Solution
It is possible to create a simple configuration of magnets that is repulsively levitated and yet is unstable along just one axis instead of two. See for instance: levitating motor. A single controller is then able to stabilize the configuration longitudinally. The controller can then be designed to be inexpensive, low-power, and non-optical. Here is an example of an inexpensive controller that uses a Hall effect sensor to detect the magnet position, and an efficient & cheap pulse-width-modulation chip to drive the solenoid Low-cost magnetic levitation system for electronics learning. Additionally, this design uses a permanent magnet which attracts the electromagnet's iron core, so that there is a position where force balance can be achieved without current flowing in the solenoid. This in principle allows the system to draw zero power, on average, to support the magnet, if the stable position is adjusted correctly. The controller would then only drive current if the object was displaced, basically a virtual force that only exists when it needs to! The design featured in this paper is missing some component values (in order not to give students a way to 'cheat' on the design project!), and the exact IC chips are no longer available. However, it should be very easy to reconstruct this system.
The next step is to add a negative feedback loop that automatically adjusts the stable levitation position to coincide with the zero-average-power position. This is not a new idea, but it looks as though nobody has implemented this for a small-scale undergrad lab or DIY project. Here is an article on zero-average-power controllers for magnetic levitation: Vibration isolation system combining zero-power magnetic suspension with springs (This also gives you a sense for the bizarre properties of such a system: if you push on the magnet, it moves toward you!) In addition, this system should 'fail' in a safe way: if the magnet is removed, the velocity signal will go to zero, and the zero-power loop should eventually return the average current to zero, instead of constantly trying to pull the magnet back. (That is, the system is adaptive in some sense.)
It is possible to go a step further and remove the position sensor, if you are still able to sense the velocity of the levitated object (for insance, using a second coil of wire at the opposite end of the levitated spindle to sense the velocity of the magnet using Faraday's law). If the velocity controller is able to minimize the acceleration of the object, then the object is in approximate force balance equilibrium, on the low-frequency scale. This means that the current in the electromagnet is proportional to the equilibrium force, which depends on the position. Therefore the zero-average-power control loop can replace the position control. In practice, this system may not be all that stable to perturbations, but it would be interesting to see how minimal one could make the sensors.
Another way to eliminate the position sensor is to use self-sensing: if you are levitating a ferromagnetic object, then the inductance of the drive coil depends on the proximity of the levitated object. This in turn influences the response of the coil current at the PWM frequency. You can thus sense the position by measuring the modulation of the high-frequency fluctuations in the current caused by the PWM controller. This is discussed in Self-sensing magnetic bearing control system design using the geometric approach, which also talks about zero-average power control.
Finally, if you read through these papers, you will see that it is quite a chore to design the control system, especially if one wants to move beyond linear control and deal with the nonlinearities of the system. It would be interesting to train a hardware neural network for nonlinear control of the levitation system. It would probably be necessary to have a linear controller in place first to give some training data.
Further references
maglev train Here is a paper on designing a small levitating train, which could be used to replace the air-hockey-style bumper cars in undergrad mechanics labs.
Thesis project with details of several different configurations
Design, Fabrication, and Control of a Single Actuator Magnetic Levitation System
PWM Control of a Magnetic Suspension System
"Low-Cost" Magnetic Levitation Project Kits Not actually that inexpensive...