top of page

Magnetic Levitation

I designed a feedback controller to levitate an object using an electromagnet

Using a PID controller and an electromagnet, I was able to stabilize a magnet, and small weights (like a rubber duck), against small disturbances and eliminate steady state error to ensure longer term levitation.


The system was modeled as a mass with the force of gravity acting one way and a magnetic force acting in another. The controller was then designed to control the current through the electromagnet and as a result change the magnetic force on the small magnet.


The distance from the electromagnet was measured by using the voltage readout from two Hall effect sensors. Two were used to eliminate the effect of from the magnetic fields output by the electromagnet. One sensor was placed farther behind the other in order to subtract its reading from the other and eliminate the effect of the electromagnet, focusing in on the smaller reading of the magnetic object being levitated.


The controller was able to eliminate steady state error and handle small disturbances. It was also able to follow a sine wave while levitating. And most importantly, it was able to levitate a rubber duck as well.

Magnetic Controls

Field

Levitation

Goal

Project Gallery

bottom of page