Magnetic Levitation

Magnetic Levitation
A quick bodge-build to see if I could suspend a magnet from an electromagnet.
 

Told you it was a bodge..

Pic Kit breakout board with two TC4423 drivers and a rotary encoder.

The rotary encoder sets the offset (from the balance point) and the gain of the loop.

The uP (Pic16F960) takes the signal from the hall effect sensor in to a 10 bit A2D this is multiplied by the gain settings and an offset added or subtracted. The output is fed to the 10bit PWM and a polarity signal.

when the field from the electro magnet matches the field from the magnets (+/-) an offset, the system is happy and the magnet suspended in mid air.
The A2D signal comes from the hall effect sensor mounted in a groove in the armature of the electromagnet

With just the output from the mosfet drivers you can suspend a magnet under a small solenoid.
With a bigger coil and a bridge of larger mosfets greater distances and larger magnets can be suspended. This coil is a reel of 0.5mm wire with a M10 bolt.
Suspending two 20mm magnets a 10mm socket and a peice of 40mm PVC pipe.