An AVR Atmega based PID magnetic levitator

This is a magnetic levitator implemented using Atmega8 microcontroller.
Magnetic levitation is a method by which an object is suspended with no support other than magnetic fields.An AVR Atmega based PID magnetic levitator
To make a magnet levitate, an hall sensor is attached to a coil. The coil acts as an electromagnet, and the hall sensor measure the distance of the magnet from the coil.
The coil it is driven by PWM impulses, the closer the magnet is from the hall sensor, the bigger is the duty cycle and vice versa.
The coil works only if the magnet is in a certain range, out of this range no current flow through the coil, and the system is in is idle state.
The system has to mantain the equilibrium position of the magnet, the pull force of the coil has to be equal to the gravity force that pull the magnet to ground.
To stay on the budget, a small 12V 50N coil (ZYE1-P25/20) is used, with this coil the system can not lift heavy loads.
The hall sensor used it the Allegro A1302.
Because the heavy loads limitation, i’ve to put the hall sensor next to the coil, this solution produce a problem, the magnet can be pull even by the ferrite core of the coil, If it gets too close to the coil. To prevent this situation we have to emitting less current to the coil.
A bigger coil and a more sensible hall sensor can lift heavier load, and also the magnet can levitate far away from the coil.
To adjust PWM intensity, a PID controller is used.
A proportional-integral-derivative controller (PID controller) is a generic control loop feedback mechanism (controller) that calculates an “error” value as the difference between a measured process variable and a desired setpoint. The controller attempts to minimize the error by adjusting the process control inputs.
The micro runs at 8Mhz, every 1ms the hall sensor it is checked, and the PWM for the coil is adjusted. The PWM period is 1953Hz.Schematic An AVR Atmega based PID magnetic levitator
For more detail: An AVR Atmega based PID magnetic levitator


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top