It always surprises us that magnetic levitation seems to have two main purposes: trains and toys. It is reasonably inexpensive to get floating Bluetooth speakers, globes, or just floating platforms for display. The idea is reasonably simple, especially if you only care about levitation in two dimensions. You let an electromagnet pull the levitating object (which is, of course, ferrous). A sensor detects when the object is at a certain height and shuts off the magnet. The object falls, which turns the magnet back on, repeating the process. If you do it right, the object will reach equilibrium and hover near the sensor.
Some students at Cornell University decided to implement the control loop to produce levitation using an Altera FPGA. An inductive sensor determined the position of an iron ball. The device uses a standard proportional integral derivative (PID) control loop. The control loop and PWM generation occur in the FPGA hardware. You can see a video of their result, below.
However, the team also wanted to display data on a VGA screen. While it is possible to do this without a computer, it is much easier to write some software for this task, so the device has an embedded NIOS II processor core that handles tasks including displaying data and changing PID constants.
This project is a good example of marrying FPGA logic for high speed and a CPU for easier development. The sensor and other factors meant the ball didn’t have good control laterally, so the device uses a tube to constrain the ball.
Floating speakers and globes usually use a strong permanent magnet in the floating part and four magnets to balance laterally. We’ve seen that done with an Arduino. For the truly adventurous, you can levitate a spinning magnetic top with no electronics at all. Honest.