Go Down

Topic: Magnetic levitation (Read 28447 times) previous topic - next topic

ea123

Hello,
here is a magnetic levitation project realized with arduino. The suspended ball is a permanent magnet whose distance from the electromagnet is measured by a hall effect sensor placed under the coil. The digital control loop is a PID algorithm that modulates a PWM output to energize the electromagnet through a MOSFET. A voltage regulator is used to provide a fixed voltage and to limit the current in the coil (the schematics can be found in attachment).

http://www.youtube.com/watch?v=7yGMYXWVjSU



robtillaart

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

ea123

You can find the sketch file in attachment. Basically it consists in the following functions:

1) PWM setup to change the frequency from the default value (490 Hz) to 3921 Hz;
2) A command handler used to configure the controller gains and setpoint through the serial line (when arduino is connected to USB cable);
3) A state machine that manages the transition between OFF, IDLE and CONTROL modes (this to avoid the controller to turn on the electromagnet
   at full power when the ball is not in range);
4) The control loop.


robtillaart


I forwarded the tube to a teacher at a technical school this afternoon and he was so enthousiastic he thinks about adding it as a exercise in the semester.

Thanks again (also for the code),
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

tytower

#4
Jan 28, 2012, 09:50 pm Last Edit: Jan 29, 2012, 12:10 pm by tytower Reason: 1
Any chance of a picture?
Edit - when I logged in am -no videos but schematic pic was there
I think videos might have been turned off for a time by the server.
Good as gold now thanks
Governments should do what they were designed to do only.
Manage the larger issues best done by Government.
My Family and my Property are no

ea123

Quote
I forwarded the tube to a teacher at a technical school this afternoon and he was so enthousiastic he thinks about adding it as a exercise in the semester.

Thanks again (also for the code),


good! It' a nice didactical project indeed.

ea123

Quote
Any chance of a picture?


Hi, look at the attachment. As you can see the connections are done on a breadboard...it's just an experiment.

GaryP

Time for a contest! Who can create longest gap!!!

Two of these and I could hang a painting on the air?

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

PatrickM

Thanks much for sharing.  I have a very similar project, but I'm driving the magnet through a D/A and then an opamp instead of with a PWM signal.  I'm wondering if you ran into problems with the hall effect picking up both the field of the electromagnet and the field of the levitated magnet.  I was planning on using two hall effect sensors (one at each pole of the electromagnet) and looking at the difference in the signals.  This should give a good reading on the levitated magnet.

Also, how did you come up with your PID values?  Did you model the system in Matlab or something similar?  Or did you just experimentally come up with the values?

-Patrick

NI$HANT

PID Values? ,How you managed them?
"Real Men can Accomplish  Anything"

- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੁਂ!

Si

Very nice!

This is mine, it uses an optical sensor rather than the Hall sensor. Hall sensor much cooler.

http://www.dangerouslymad.com/projects/chapter-13-levitation-machine

--
My New Arduino Book: http://www.arduinobook.com

liudr

Super cool! I'll think about making this or having this made. That's the fun of being a teacher, you can order students to make things and that's all for their learning :) Considering this for instrumentation course because of PID and its application, also as a PR show item like my rotating stage with POV display.

I thought Si had one and thanks for posting so someone looking for this later sees two projects to learn from!

I shamelessly saved every file in a folder  ;)

Si

At some point, I will update mine to use a Hall sensor - I still have long term dreams of a planetarium ceiling populated with floating, rotating planets!

However, one power outage and it would be raining celestial bodies!
--
My New Arduino Book: http://www.arduinobook.com

robtillaart


An evil genius would use a 2nd hand nuclear reactor from a Borg space ship - or if those are out of stock, a car battery as backup for the power supply.

idea ! -> Arduino as intelligent UPS controller :)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

JO3RI

@robtillaart sssst  :smiley-zipper: He is an evil genius and he wrote a book about being it
http://www.JO3RI.be

Nederlandstalige sectie - http://arduino.cc/forum/index.php/board,77.0.html -

Go Up