Building a Digital Magnetic Levitation Platform!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
magnetic levitation a technology is so cool it almost looks like magic and yet you can buy these almost anywhere online for just 50 bucks but buying one is not only lame it's also a terrible way to learn how they work also the boards you can buy online are completely analog yuck i would rather build a digital one which means not only will i have so much fun writing a ton of code and doing control loops but i should in theory have way more control over exactly where and how the magnet levitates so i dove head first into designing my own doing next to no research before starting let's see just how that goes so first things first the basics the concept of magnetic levitation is actually pretty simple you get a permanent magnet which is the one you want to levitate a sensor below to determine its position and then you just need a handful of electromagnets so that you can fully control the strength and direction of the field add in some software and that should be it you can make a magnet float or at least that was my thought going into this project a few months ago i got started on the first step designing the control board the layout is very straightforward if you've seen my previous projects you'll know i have a microcontroller for the brains of the operation a usb port to upload my code some onboard power regulators a few mosfets to control the power of each electromagnet and a three axis hall sensor to determine the position of the floating magnet and after ordering all the parts and building up my board i was ready to test it but i don't have any electromagnets yet what do i do about that well i could buy them but obviously i'm not gonna buy them so instead i found an online tool which let me play around with a bunch of different parameters so i could figure out how to make an optimal electromagnet and after ordering a whole bunch of pretty expensive wire i started winding the coils it did not take very long for me to realize i could not do this by hand each coil has 2 000 turns and it took me like 10 minutes to do 200 and so i designed this a totally custom coil winder that i designed to relieve my pain i simply tell it how many turns i wanted to complete and then i use this little tool to guide the wire and it spins and spins and spins and in no time at all i had four coils the first two came out pretty terrible but the later two looked a lot better next i ordered a few fairly powerful neodymium magnets from amazon and after connecting everything up i was ready to start testing it did not go well but at least i made this pretty fun discovery so i was just testing on the electromagnet which is working pretty well so far when i discovered this back to actually trying to levitate it though yeah everything just felt incredibly unstable and i also managed to kill the board live on stream yeah i think that was it oh no luckily in this case i just killed a magnetic sensor so it was a pretty easy fix and after this unfortunate incident i 3d printed a shield to use for all future testing since i no doubt would be dropping the magnet again much better but i still couldn't figure out why the magnet was so flip happy and then i discovered this tear down which taught me three things one i have no idea what i'm doing two i need a permanent magnet ring around all the electromagnets for stability and three i need to be able to drive the electromagnets in both directions so they can push and pull for maximum control with this newfound knowledge i made a few changes i printed a new shield with integrated magnets and then i bought a few dual h-bridge drivers online usually you'd use these to drive dc motors or steppers but it will work for my application the h-bridge works by using four mosfets with the load connected to the middle between each pair by activating one mosfet of each pair at a time you can control which direction the current flows through the coil it was just a matter of connecting this up to my original motherboard hijacking the control lines from the original mosfets on the board and a little bit of hacking of this h bridge that i can actually use it on 3.3 volt instead of the five that it was meant for and it worked i can now push and pull with each of my coils so after verifying these new features i redesigned the main motherboard to include all of these new things built in and thanks to the magic of silicone i could replace this enormous hideous monstrosity with this which isn't just crazy small but it's actually way more efficient and more powerful and i'd like to thank pcbway for sponsoring this video and providing me with the pcb and stencil for this project a link to their site with more info is down below so you know what comes next clean the board paste the board part the board oh by the way this is what it looks like if you accidentally order just two components on a reel heat goes on and it's done ready to test shockingly i only had one small bug in my board design and it was a super easy fix with this little jumper so with this new board i have the power to command anywhere from negative 15 to positive 15 volts to each electromagnet and look at that it's strong enough to actually move the bass if i just move the magnet around above it oh but don't worry it didn't take me very long to fry something i'm not sure if it was caused by these capacitors which i had accidentally flipped the polarity of or if it was because i was operating dangerously close to the limits of the h bridge or maybe something else entirely but one thing is for certain one of the h bridge chips was getting really toasty and it was no longer operating like it should no worries though i ordered some new h-bridge chips swapped out the driver and got everything working again back to test oh well that didn't take very long it just ripped the pads clean off the board it's not an easy repair and worse still i didn't even get it on video so rather than attempt to repair this which would not be fun i just built up another board it only took about an hour and everything is working perfectly again i'll be using an additional shield on top of my shield from now on because well i'm gonna lose it if another part breaks okay so now it's time to really start tuning i spent a ton of time playing around with so many different settings at its core i'm using a pid control loop this type of loop is really basic but pretty capable unfortunately it's not going to be enough on its own so i started adding some filters i had a pretty gentle low pass filter on the inputs coming in this was just to help smooth out any noise from the hall sensor and then went in modified the libraries for this magnetic field hall sensor to allow it to read the full 12 bit resolution at one kilohertz and even with all this the control loop was still extremely unstable so it was time to get creative next up i added a tip correction algorithm this was aimed to compensate for the slight tipping of the magnet whenever you would power up the electromagnet and should in theory help prevent instability additionally i created a calibration routine where each pair of electromagnets would cycle through its full power range record the effects on the hull sensor so that it could later be compensated out and after days days and days of testing well i was never able to get it stable it looks and it feels so close and it really is so close but no amount of tuning i was able to do could stabilize it i think if i wanted to spend a few more weeks on this project i could make it work but it's a really tricky problem and honestly i've already spent way too much time on this project and i'm really excited about my next one which i want to move on to so i'm going to leave this project where it is for now if anybody out there has experience designing these levitators or as a pro at controls definitely reach out i'd be happy to test out some ideas and new algorithms but i'm gonna leave this where it is right now and i'm gonna call it a semi-success the board's fully working and the code kind of works it's just going to take a bit more to get it to levitate a magnet in a stable and pretty way a huge thank you to all my patreons your support as always is so helpful in keeping this channel going i've already made a lot of progress on this next project and it's going to be a really really cool one so be sure you're subscribed so you don't miss out on it until then hasta la vista
Info
Channel: 3DprintedLife
Views: 76,319
Rating: undefined out of 5
Keywords: electromagnetic levitation, digital magnetic levitator, magnetic levitation platform, diy magnetic levitation, magnetic levitator, arduino project, diy electromagnet, magnetic levitation, levitation control, 3d printed robot, robotics project, arduino robot, 3d printed, 3d printed project, custom pcb project, Neodymium magnet, custom control board, custom electromagnet, control loop, Electromagnetic generator
Id: IhG_qHAvJd0
Channel Id: undefined
Length: 8min 33sec (513 seconds)
Published: Thu Sep 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.