Pages: [1] 2 3   Go Down
Author Topic: Magnetic levitation  (Read 25057 times)
0 Members and 2 Guests are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 4
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).






* ArduinoMagneticLevitation_schem.png (69.86 KB, 942x1226 - viewed 2993 times.)
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13739
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool!, well done

Code ?
Logged

Rob Tillaart

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

Offline Offline
Jr. Member
**
Karma: 4
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* MagneticLevitation.ino (7.38 KB - downloaded 1313 times.)
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13739
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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),
Logged

Rob Tillaart

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

Cairns - Green Island for Winter
Offline Offline
Full Member
***
Karma: 2
Posts: 148
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: January 29, 2012, 06:10:58 am by tytower » Logged

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

Offline Offline
Jr. Member
**
Karma: 4
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 4
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


* IMG_3645_800x600.jpg (91.23 KB, 800x533 - viewed 934 times.)
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Cheers,
Kari
Logged


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

0
Offline Offline
Newbie
*
Karma: 0
Posts: 10
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

ਪੰਜਾਬ
Offline Offline
Edison Member
*
Karma: 12
Posts: 1601
Another year! Alone! :(
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

PID Values? ,How you managed them?
Logged

"Real Men can Accomplish  Anything"
-  Website  
- skype : nishants5  

ਫ਼ਤੇਹ ਕਰੂਂ !

UK
Offline Offline
God Member
*****
Karma: 13
Posts: 903
Twitter: @simonmonk2
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

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

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 73
Posts: 7198
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley 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  smiley-wink
Logged


UK
Offline Offline
God Member
*****
Karma: 13
Posts: 903
Twitter: @simonmonk2
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 217
Posts: 13739
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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 smiley
Logged

Rob Tillaart

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

Hamme, Belgium
Offline Offline
Sr. Member
****
Karma: 4
Posts: 387
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

@robtillaart sssst  smiley-zipper He is an evil genius and he wrote a book about being it
Logged


Pages: [1] 2 3   Go Up
Jump to: