PID control (Proportional, Integral and Derivative control) is a widely used control algorithm. It can be used to control position of an object, temperature of an oven, speed of a car and so on. Here we are using it to control the position of a magnet in air.
Projects from Make: Magazine
Magnetic levitation with PID control
This project uses Arduino Duemilanove to realize a PID controller and levitate a magnet in stable condition.
This is a view of the magnet (the white disk in air) floating stably.
The coils are made by winding wires to a core shown in this picture, which is made from a piece of pencil and two pieces of paper board.
There are two Hall sensors in the center of the four coils to detect the position of the floating magnet. There is a big ring magnet underneath the four coils (not seen from this picture since it under the wood board). The ring magnet provides the force to push the floating magnet up, however, it is not stable. The four coils stabilize the floating magnet in x and y directions.