The analog platforms have the huge advantage of being continuous, aka not having any computational delay from input to output, and no quantization in time and amplitude, while being super simple to build.
Also, the quotation induce steps in the variation of the voltage, but current (hence field) does not follow instantly the voltage due to the inductance.
While it’s technically possible to levitate a single magnet, it’s essentially a point field you’re trying to control. In the same way you added more magnets to the base, you should make an array to levitate with passive stability built into the design. You might also consider induction coils like the worlds fastest maglev train. I’m sure there is a lot of control programming that goes into it, but it also has a degree of passive stability.
@@3DprintedLife a permanent magnet in the center of the platform and the base that pulls the platform down will keep it aligned in the XY directions because it will always pull it to the middle.
@@3DprintedLife You should look into making your coils the way that Tesla indicated in his Coil For Electromagnets patent. Also, read up on Howard Johnson’s The Secret World Of Magnets, great insight in both.
I did the same project 3 years ago in school. No one thought I would make it, but I did (and got best mark). For the software control, I noticed that execution time was more stable. That's why I altered to a faster uC and made the code stupidly simple. Literally, just if you're too far to the right, increase the PWM a bit in order to let the magnet go to the left. I may retry it next year with proper control theory.
@@GrandmasterUV Coil wrapped around a ferromagnetic material. In my case iron. Never ever neodymium, because you want to make an electromagnetic field with the coil.
I haven't read the other comments so maybe this already got mentioned, but in a typical repulsive levitator, you've got a ring of permanent magnets that establish a baseline field where the levitating magnet has a stable point along the Z-axis, and the electromagnets inside the ring are only there to prevent the floating magnet from sliding off in the X or Y axis - meaning the force they apply to the floater should be predominantly horizontal. It looks like you're trying to use the electromagnets to suspend *and* stabilize the floater, which is theoretically possible but incredibly difficult.
hey, thank you for this comment. Do you know any place I could read/watch up more on what you're describing? UA-cam only seems to have toys and demonstration videos.
No truer testimony than that of transparent dialogue where all fails are demonstrated as well as spoken to. Additionally, the lack of fear in presenting with no resolve is a measure of you. First video ive watched of yours. Havent a clue of what you're talking about. But love to watch integrity unpackaged. Awesome job and thank you 😊🙏🏼👏🏼
Fun fact, I found this video while procrastinating on my exam about control systems. We had studied this system in class and came to the conclusion that your solution, a PID controller wasn't a good solution even with adjustments as the plant is quite unstable. For this type of systems it is better to have a state space model system.
State space would also be my recommendation, since it is multiple input multiple output (MIMO). Some system identification or modeling would be required in order to use this though.
The PID controller is a real workhorse but it has it´s limitations. A more modern approach using State Space Model (H-infinity, reference tracking, etc. ) may give a better response. The other problem is trying to fit a controller without the plants model!!!!
This kinda reminds me of my test phase :) - isolating the system by locking certain DoF and get this to work first - proper filtering is essential - Getting rid of the serial print and checking timings with an oscilloscope might give a better understanding of what’s happening - try to find a equilibrium point (working point) of the system, since there are nonlinearities it’s not working over the full range.. -> try to vary the lev-height - Setting up a proper controller e.g. in state space representation and/or linearize certain variables (e.g. input/output linearization) -> the pid can’t directly “handle” a nonlinear system Nice approach and execution 👍🏼
Fairly certain there is not enough information from one magnetic sensor to uniquely determine the position and orientation of the floating magnet. Once you actually measure the position and orientation of the levitated mass, its magnetic field, and the shapes of the supporting field. Then it is much easier. Do you think those rockets flipping quickly and then landing precisely upright were flown by seat of the pants algorithms? I expect it is "3D models with mass and precise locations", a fair measure of "response functions", "equations of motions - masses, velocities, accelerations, moments of inertia, etc" You only have 12 core observables to track - x y x position of the center of the magnet. And the cells of a 3x3 rotation matrix to bring it to the proper orientation. Monitor those and simply use an objective function like the "total energy needed to rotate the disk and position it from its current position to the standard one. If the disk is not symmetric you can grab it with the field. So put "something" asymmetric on the disk to know up from down. east from west. etc. Any small magnets might work. You cannot easily grab a smooth magnet, unless you go to much higher sampling rates for observation and control. I love your signals, but it is frustrating to see you just winging it. A little bit of data and statistics. Use cameras to monitor position (that is why you need some way to "see" which way it is pointing, and some way to grab it and exert force to rotate in 3D or lift or pull down. Yes, you are close to the right field strengths and control signals and parts. But you have to measure, record and estimate the work needed (power times time) for each correction. You are flying the disk, not lifting it. Put yourself on the disk and it is easier to know what to do. Tilt five degrees down toward 23 degrees (clock wise from north)? You need a force to lift up at 23 degrees, and maybe one at 180+23 to lift up. The magnetic field works stronger over shorter distances, so lifting the nears part of the disk is easier than pulling the further one. When it gets level opposite sides are about equal. Get some coordinates and flight instructions. And keep track of energy., You have all to voltages, currents, charges, powers. You know or can measure the moments of inertia of the disk and anything attached. Best wishes. You are really close. Me, I could not even see those little things you were soldering and can only see the mathematics and physics, sensors and data. Put the disk on a thin panel in the right place. Then use the field to lift one side by exactly 3 mm, the put it down again. Repeat around the circumference and calibrate your currents. Get a separate 3 axis magnetic sensor and measure the fields. Strip down a 3D printer, set the fields at a given set of activation currents, and map the field so you can see it and know its values and fluctuations.
I noticed four depressions on your magnetic puck … I also noticed if that puck was held over the center of the magnetic field, the puck is repelled from the platform. Use this repulsion or push up to hold the puck up into a loose-like chuck that uses those depressions as a gripping point and attach it to a motor or even a drill. Using the drill over the platform and using the repulsion to hold the puck against the loose gripper or home made chuck ..spin up the puck as fast as you can and slowly lift away the device ….. the puck will remain centered and quite stable provided the puck is somewhat balanced to begin with. Because you now have a frictionless object floating ..the centrifugal forces you generated will take a very long time to dissipate. During this spin down ..You can collect data to determine the sequence of signals to your electro magnetics and use this data to program the same sequence of events to occur ..and push the puck into a spin electrically instead of mechanically. That process will almost write the code for you ..and then as long as you energize the platform it will spin and stably hover forever electrically, silently too. Paint the puck colorfully and you have a coffee table conversation starter like no other … you will be able to determine minimum RPM for stability and make any cool colorful design on your puck go through many visible changes by changing the RPM within the stable range and that should be pretty wide … you get A+ for tenacity you just need to program a spin into you idea and your home free .,. It was very entertaining to watch .,. Stay curious … Blitz
yes the polarity killed it. Have you considered adding a center magnet that pulls the platform to the center? then you can lift from the side without it shooting off to the sides.
I have a few suggestions at the software level. For one, it looks like the magnet is pretty much sliding off the field. It looks like it's oscillating and gaining energy which is causing it to do that. I might suggest that you adjust how aggressive your electromagnets will respond with some bias, preferring to use weaker forces. One concern you'll have is that you emit too big a force due to error and just throw the magnet off to the side which is maybe what's happening. By undercompensating rather than trying to achieve perfect precise control you can smooth out error and delay. It could be as easy as curving your output force exponentially, the further the magnet deviates the stronger the feedback should be. I would personally use e^x because its derivatives all start at one all the way down and it has useful properties. You can multiply by a constant to set where each derivative starts. E.g. 0.1 * e^x will result in very small changes initially but as x grows those changes accumulate. Additionally, you can apply more correction by scaling and translating x to a reasonable baseline. If you can design something that will let you update those three values in real time to let you test easily (e.g. without compile times and such) you might have some more luck.
this is cool, what might you call that "something" that could be designed which could update those values in real time? Im new to this stuff and so I don't know much terminology
The position and orientation of your magnet has 6 degrees of freedom, while your hall effect sensor only reads 3 values, so you probably need a very specific arrangement of permanent magnets to achieve stability in the remaining 3 degrees of freedom that you can't stabilize with software.
Thoroughly impressive that you got that far without a lot of background knowledge on the subject, I hear magnetism is one of the most complicated subjects in physics, just under astrophysics or something like that
A really challenging project. Most designs I have seen just force a set field that the levitating object, magnetic or diamagnetic, is forced into a stable position. You tried to dynamically live compute a field based on the starting condition. Kudos for trying.
It feels like the kind of thing a neural network would be good at trying lots of values for each of your variables, but the would really require simulating the whole thing so lots of tests can be done in reasonable time
What you needed to do is put the magnet at the top of a coned top structure and then spin it like a gyro for stability. Also I think the magnet field’s are potentially too close to one another.
Two types of time lag should be considered for a stable system. As the coils are inductive loads voltage will lead the current through the coils, however current is forcing the floating magnet back in position. Another issue is totally mechanical in nature. Once there is position disturbance of the floating magnet, the electromagnetic force cannot immediately bring it back. Newton's law rules (F=ma). You may have a look at the following video: ua-cam.com/video/xO9uNkeo6PQ/v-deo.html
Im a little tardy to the party but i still wanted to throw a suggestion or two at you for what its worth.. a couple of "classical" solutions for the instability problem in maglev that i like to employ are: - Rotation of the object you want to levitate, and - a diamagnetic or paramagnetic "cushion" to regulate the flow of the free electrons on their way through the levitating piece such as a thick solid chunk of aluminum or copper. basically spin the levitating part as fast as you can while "cushioning" (slowing, essentialy) the flow of the electrons being generated by your coils without disrupting the magnetic field that they are flowing through... hope this helps!
As a beginner in the DIY hobby it's really inspiring to see your proficiency at so many different realms of the hobby. From PCB design to programming to mechanical engineering, you seem to have it all covered. I hope to be as good as you some day and have just as wide an area of knowledge.
Not an engineer or in any way tech savvy but would a smaller disk make a difference? Having the coils “push” the disk back to the center only works if the disk is within the coils “reach”; if the disk pushes the boundaries of that reach, there’s a smaller window of time for correction before the weight and inertia take it beyond the boundaries and cause it to go over the edge. I imagine it’s like trying to balance a plate of water with one hand (where the water is the disk, the plate is the magnetic field, and your hand the coils). If the water takes up as much space as the plate, the more likely it’s going to spill when making corrective movements because it’s picked up speed and continues to move after your correction. However if the water only takes up half the size of the plate, you have much more room for error and thus more control.
Would you consider selling a kit to make your coil winder? Or provide a parts list and whatever software you used to drive it? I am interested in learning and sharing what I learn with my six year old daughter. Thanks.
Did you try turning it off and back on again? I couldnt resist. Im getting ready to start this build. with a couple mods, especially coils. I dont do vids but was going to record progress. Any suggestions?
Haha yes, many times. And it's really tricky but my best advice would be to figure out where to place the hall sensor such that the impact from electromagnets is minimal, and if possible select a hall sensor that can give faster readouts. Noise from the sensor and issues attempting to compensate for the distortion by the electromagnets were the biggest things impacting stability of my system.
Would adding more sensors be the solution? As a developer I know oftentimes problems in programming are solved by being more explicit. For example, could you get more by having a ring of Hall sensors around the perimeter of the base?
What I have learned is that PID just works with a lineal and simple system. This thing is full of non lineal components and lots of external perturbations. You need the almighty state space variable controller and start doing linearization of the variables for something more or less stable, pretty much the modern control assignment of an engineering degree.
Maybe my suggestions are useless.... but have you tried phase compensation? I can see there are oscillations in the output waveforms, which suggest that the system might be resonating at some frequencies. Another thing to try is PIDD² (or even PDD²) - I understand, the applied current is a proxy for controlling acceleration... I recall a combination of the two things mentioned above saved me once when I was having similar problems with another magnetic system.
MAGLEV is inherently unstable requiring a very fast control loop. I don't believe it is possible to make a stable control loop using digital for this application, but with a PID controller you can determine whether it will be stable via the step and impulse response. A more important check would be the amount of time required to sense vs. apply stimulus which is the most likely problem.
I know that is not the modern style of UA-cam hardware development, but you could test your whole circuit and all possible add-ons first with a breadboard and/or handmade PCBs made of thin copper wires instead of wasting resources by ordering a new industrial made PCB each time you change something. Greets from a hw-engineer.
The strength of the electromagnetics may not be enough to produce an adequate field. While it may be overkill, simulating the fielding and flux circuits may help to identify where issues are. You also have to anticipate adjustments when dealing with discrete delays so applying a regression could help too.
Hi, actually chose this as a project for my electronic engineering degree. Can you maybe give the chip type that you use instead of the l398N (h-bridge)?
Awesome! I'm using the TC78H660FTG but there are plenty of other similar options if you want one that can do more power or a higher voltage. I just love tiny qfn parts for my boards!
First of all great job 👍. Your problem seems to be caused by inefficient PID control, which is the reason for the incorrect control of the magnets. So what you need is a good filter against noise but also absolute fast accurate sensor data. You should look at the Kalman filter algorithm. This is also used for self-balancing robots and provides a very good value for commuting (so to say :predicts the values ;-) ) Then your PID should works like a charm.
thought... the floating magnet or metal disc. wld it be easier to stabilize if the weight was more towards center mass, this wld allow for better correction w less force needed. Yes?
Hello , I absolutely do not have any idea what you are talking about but I enjoy your videos, I was wondering maybe your magnet should have a stabilizer , or digital code , not just the platform , I think it would help out a lot because it would know where to pull or push away from directly, rather then on the port alone , lol maybe
How about filtering the sudden mechanical movement of the magnet by using a wider base for the floating magnet. I mean instead of floating just the magnet you can make a non magnetic base for it and remove the sudden glitches in the magnet's movement.
i bought one of these already fully assembled and the levitating magnet is stuck to a ferrometalic disk and the magnet is also much smaller than yours. I have swapped the provided magnet with my own and that has a big impact on its performance. So try different sizes of levitating magnets.
It seems the coils might be interfering with each other . Maybe scale down each coil . Not sure how magnetic fiels work but sure that you don't won't the field to overlapping each other
Fél évet töltöttem egy hasonló eszköz megépítésével. A digitális megoldások sajnos nem voltak működőképesek. Nem tudtam a belengést megállítani. Pedig nagy előnye lett volna, hogy MOSFET használatával hatalmasra lehetett volna növelni a teljesítményt. Végül az analog áramkörökket választottam, és sikerült megoldanom a stabil lebegtetést.
"I'm trying to work on a magnet car that can hover and levitate. I don't know how to make it happen, but I understand how to stabilize and control it. If you really want it to hover, just put a box-shaped structure around the magnet to stabilize it. Then, my friend, it should hover."
Yeah I did try that, later on in the video you'll see I embedded the magnet in a large printed disc to increase the moment of inertia. It did help but not enough and I can't add much more weight without it levitating too low.
the magnets radius is too big compared to the sensing range of the hall sensor. eveery time it rotates its being pushed in a random direction you need a smaller magnet or more hall sensors. and maybe a higher sensing and correction frequency?
Hm good suggestions, I think faster sensing and correction is definitely the biggest missing piece. But I'll need to find a new sensor to achieve better results there!
NEXT PROJECT:Build a Freq transmitter. Fix it to 13 Hz and transmit it at 10-15 dB sound level. Try making this device as tiny as possible. Make sure you have enough battery power for 10-12 hours use. Then go to a public place that has a lot of those FAKE flower pots around. Place your device on and cover it up. Do this with at least 5 more devices in the same area, and go back to replace each with a fresh coin cell battery. After about 2 weeks, pay close attention to your local news and see if you see your 'area' having more reports of fighting and anger outbursts. Final step, increase the sound level on all devices to exactly 50 dB and put new batteries in.
You should collaborate with HiPer Tops! He has a video on his channel about his world record breaking, hand made precision spinning top. Perhaps he’d be willing to craft another one, with an embedded N52 neodymium magnet… just an idea!
Can't we just make a circular loop and pass the current in it such that it makes a South pole after that we can place that in a plastic container so that magnet doesn't fall out. After that we just put the magnet South Pole so that it repels with that loop. Also container should have same dimaeter as magnet so magnet cannot change it position and levitate.
Oh! I did the prety same way with building similar one. I used 4 analog hall sensors and digital control board. With no success. Looks, like general microcontroller not fast enouth. I actually maked it to work with semi-analog cheme. Digital circuit now auto corrects offset voltage throuhg digital potentiometers.
Hi @3DprintedLife, Very cool project. I have been working on this for a while as well (ideologically speaking). Is there any way I can recreate what you did in an easy manner? I have a few ideas that might make this work, and we can share ideas/collaborate. I can do the heavy lifting of doing the experiments, as I am sure you're probably exhausted with this now. Lmk. Thanks.
You can try using AI based fuzzy logic instead of a PID loop that may help the stability factor. I hope you are not using the derivative portion of PID controller.
From what I remember you could benefit using z-transform control theory instead of PID. This might be helpful: UA-cam: " Z-Transform - Practical Applications - Phil's Lab #27 " or maybe a contact with the creator of the clip.
Well, your magnets are sitting a few mm away from electronics. What did you expect. Probably start by shielding any electrical line in the vicinity of magnetic fields as much as possible before attempting to do any fine tuning of the control circuit for (I hope) obvious reasons? Ideally move all electronics (apart from well shielded power lines to the magnets) so far away from the magnetic fields that you can't measure it any more. Just my 2cts.
i believe you need a ring magnet around your coils...i noticed you didn't have one. the ring magnet will stabilize your device you're trying to levitate.
The analog platforms have the huge advantage of being continuous, aka not having any computational delay from input to output, and no quantization in time and amplitude, while being super simple to build.
Yeah they do have a huge advantage over digital in that aspect
@@3DprintedLife The analog platform is best solution ;)
Fpga would also be a solution.
people tend to think that analog is "old and worse" when is actually the better. Digital is simply an approximation to simplify implementation
Also, the quotation induce steps in the variation of the voltage, but current (hence field) does not follow instantly the voltage due to the inductance.
While it’s technically possible to levitate a single magnet, it’s essentially a point field you’re trying to control. In the same way you added more magnets to the base, you should make an array to levitate with passive stability built into the design.
You might also consider induction coils like the worlds fastest maglev train. I’m sure there is a lot of control programming that goes into it, but it also has a degree of passive stability.
Ahhh that does make a lot of sense, thanks for the input! Will keep this in mind if/when I take a second attempt at this!
@@3DprintedLife a permanent magnet in the center of the platform and the base that pulls the platform down will keep it aligned in the XY directions because it will always pull it to the middle.
@@3DprintedLife You should look into making your coils the way that Tesla indicated in his Coil For Electromagnets patent. Also, read up on Howard Johnson’s The Secret World Of Magnets, great insight in both.
That being said, it is interesting that all designs use 4 emags vs the most stable 3 points needed to make something, like a table, stable.
@@3DprintedLife Static stability is impossible.
lol.. 0:36 ... "doing next to no research before starting..." this is my approach to everything!
It's the best approach for learning a lot. Not necessarily succeeding.
I did the same project 3 years ago in school. No one thought I would make it, but I did (and got best mark). For the software control, I noticed that execution time was more stable. That's why I altered to a faster uC and made the code stupidly simple. Literally, just if you're too far to the right, increase the PWM a bit in order to let the magnet go to the left.
I may retry it next year with proper control theory.
WHAT IS THE ELECTROMAGNETS MADE OF. IS IT COIL WRAPPED AROUND NEODYMIUM OR IS IT WRAPPED AROUND STEEL?
@@GrandmasterUV Coil wrapped around a ferromagnetic material. In my case iron. Never ever neodymium, because you want to make an electromagnetic field with the coil.
I haven't read the other comments so maybe this already got mentioned, but in a typical repulsive levitator, you've got a ring of permanent magnets that establish a baseline field where the levitating magnet has a stable point along the Z-axis, and the electromagnets inside the ring are only there to prevent the floating magnet from sliding off in the X or Y axis - meaning the force they apply to the floater should be predominantly horizontal. It looks like you're trying to use the electromagnets to suspend *and* stabilize the floater, which is theoretically possible but incredibly difficult.
hey, thank you for this comment. Do you know any place I could read/watch up more on what you're describing? UA-cam only seems to have toys and demonstration videos.
That’s what he’s talking about at 3:30
No truer testimony than that of transparent dialogue where all fails are demonstrated as well as spoken to. Additionally, the lack of fear in presenting with no resolve is a measure of you. First video ive watched of yours. Havent a clue of what you're talking about. But love to watch integrity unpackaged. Awesome job and thank you 😊🙏🏼👏🏼
It needed more googly eyes to achieve system stability...
Oooooooh that explains it!
Fun fact, I found this video while procrastinating on my exam about control systems.
We had studied this system in class and came to the conclusion that your solution, a PID controller wasn't a good solution even with adjustments as the plant is quite unstable. For this type of systems it is better to have a state space model system.
State space would also be my recommendation, since it is multiple input multiple output (MIMO). Some system identification or modeling would be required in order to use this though.
The PID controller is a real workhorse but it has it´s limitations. A more modern approach using State Space Model (H-infinity, reference tracking, etc. ) may give a better response. The other problem is trying to fit a controller without the plants model!!!!
This kinda reminds me of my test phase :)
- isolating the system by locking certain DoF and get this to work first
- proper filtering is essential
- Getting rid of the serial print and checking timings with an oscilloscope might give a better understanding of what’s happening
- try to find a equilibrium point (working point) of the system, since there are nonlinearities it’s not working over the full range.. -> try to vary the lev-height
- Setting up a proper controller e.g. in state space representation and/or linearize certain variables (e.g. input/output linearization) -> the pid can’t directly “handle” a nonlinear system
Nice approach and execution 👍🏼
I appreciate all the tips, all sound like very good ideas! Thanks!
Fairly certain there is not enough information from one magnetic sensor to uniquely determine the position and orientation of the floating magnet. Once you actually measure the position and orientation of the levitated mass, its magnetic field, and the shapes of the supporting field. Then it is much easier. Do you think those rockets flipping quickly and then landing precisely upright were flown by seat of the pants algorithms? I expect it is "3D models with mass and precise locations", a fair measure of "response functions", "equations of motions - masses, velocities, accelerations, moments of inertia, etc" You only have 12 core observables to track - x y x position of the center of the magnet. And the cells of a 3x3 rotation matrix to bring it to the proper orientation.
Monitor those and simply use an objective function like the "total energy needed to rotate the disk and position it from its current position to the standard one. If the disk is not symmetric you can grab it with the field. So put "something" asymmetric on the disk to know up from down. east from west. etc. Any small magnets might work. You cannot easily grab a smooth magnet, unless you go to much higher sampling rates for observation and control.
I love your signals, but it is frustrating to see you just winging it. A little bit of data and statistics. Use cameras to monitor position (that is why you need some way to "see" which way it is pointing, and some way to grab it and exert force to rotate in 3D or lift or pull down.
Yes, you are close to the right field strengths and control signals and parts. But you have to measure, record and estimate the work needed (power times time) for each correction. You are flying the disk, not lifting it. Put yourself on the disk and it is easier to know what to do. Tilt five degrees down toward 23 degrees (clock wise from north)? You need a force to lift up at 23 degrees, and maybe one at 180+23 to lift up. The magnetic field works stronger over shorter distances, so lifting the nears part of the disk is easier than pulling the further one. When it gets level opposite sides are about equal. Get some coordinates and flight instructions. And keep track of energy., You have all to voltages, currents, charges, powers. You know or can measure the moments of inertia of the disk and anything attached.
Best wishes. You are really close. Me, I could not even see those little things you were soldering and can only see the mathematics and physics, sensors and data.
Put the disk on a thin panel in the right place. Then use the field to lift one side by exactly 3 mm, the put it down again. Repeat around the circumference and calibrate your currents. Get a separate 3 axis magnetic sensor and measure the fields. Strip down a 3D printer, set the fields at a given set of activation currents, and map the field so you can see it and know its values and fluctuations.
I noticed four depressions on your magnetic puck … I also noticed if that puck was held over the center of the magnetic field, the puck is repelled from the platform. Use this repulsion or push up to hold the puck up into a loose-like chuck that uses those depressions as a gripping point and attach it to a motor or even a drill. Using the drill over the platform and using the repulsion to hold the puck against the loose gripper or home made chuck ..spin up the puck as fast as you can and slowly lift away the device ….. the puck will remain centered and quite stable provided the puck is somewhat balanced to begin with. Because you now have a frictionless object floating ..the centrifugal forces you generated will take a very long time to dissipate. During this spin down ..You can collect data to determine the sequence of signals to your electro magnetics and use this data to program the same sequence of events to occur ..and push the puck into a spin electrically instead of mechanically. That process will almost write the code for you ..and then as long as you energize the platform it will spin and stably hover forever electrically, silently too. Paint the puck colorfully and you have a coffee table conversation starter like no other … you will be able to determine minimum RPM for stability and make any cool colorful design on your puck go through many visible changes by changing the RPM within the stable range and that should be pretty wide … you get A+ for tenacity you just need to program a spin into you idea and your home free .,. It was very entertaining to watch .,. Stay curious … Blitz
yes the polarity killed it. Have you considered adding a center magnet that pulls the platform to the center? then you can lift from the side without it shooting off to the sides.
I have a few suggestions at the software level.
For one, it looks like the magnet is pretty much sliding off the field. It looks like it's oscillating and gaining energy which is causing it to do that.
I might suggest that you adjust how aggressive your electromagnets will respond with some bias, preferring to use weaker forces.
One concern you'll have is that you emit too big a force due to error and just throw the magnet off to the side which is maybe what's happening. By undercompensating rather than trying to achieve perfect precise control you can smooth out error and delay.
It could be as easy as curving your output force exponentially, the further the magnet deviates the stronger the feedback should be. I would personally use e^x because its derivatives all start at one all the way down and it has useful properties. You can multiply by a constant to set where each derivative starts. E.g. 0.1 * e^x will result in very small changes initially but as x grows those changes accumulate. Additionally, you can apply more correction by scaling and translating x to a reasonable baseline.
If you can design something that will let you update those three values in real time to let you test easily (e.g. without compile times and such) you might have some more luck.
this is cool, what might you call that "something" that could be designed which could update those values in real time? Im new to this stuff and so I don't know much terminology
also, would you explain why e^x is a good choice? what are its useful properties?
could you also explain how that equation might actually be implemented into the code?
The position and orientation of your magnet has 6 degrees of freedom, while your hall effect sensor only reads 3 values, so you probably need a very specific arrangement of permanent magnets to achieve stability in the remaining 3 degrees of freedom that you can't stabilize with software.
Thoroughly impressive that you got that far without a lot of background knowledge on the subject, I hear magnetism is one of the most complicated subjects in physics, just under astrophysics or something like that
I appreciate that! One day I hope to finish this project, once I learn a bit more about where I went wrong :)
Or maybe magnets in rotation around to stabilise it
A really challenging project. Most designs I have seen just force a set field that the levitating object, magnetic or diamagnetic, is forced into a stable position. You tried to dynamically live compute a field based on the starting condition. Kudos for trying.
It feels like the kind of thing a neural network would be good at trying lots of values for each of your variables, but the would really require simulating the whole thing so lots of tests can be done in reasonable time
Yeah you're definitely right! Still not an easy problem to solve but that would be a really cool thing to try!
Artificial intelligence is really good for this kind of thing.
What you needed to do is put the magnet at the top of a coned top structure and then spin it like a gyro for stability. Also I think the magnet field’s are potentially too close to one another.
The nice part about analog is the low latency control loop and greater efficiency. It certainly requires more math, though
Two types of time lag should be considered for a stable system. As the coils are inductive loads voltage will lead the current through the coils, however current is forcing the floating magnet back in position. Another issue is totally mechanical in nature. Once there is position disturbance of the floating magnet, the electromagnetic force cannot immediately bring it back. Newton's law rules (F=ma). You may have a look at the following video:
ua-cam.com/video/xO9uNkeo6PQ/v-deo.html
Im a little tardy to the party but i still wanted to throw a suggestion or two at you for what its worth.. a couple of "classical" solutions for the instability problem in maglev that i like to employ are:
- Rotation of the object you want to levitate, and
- a diamagnetic or paramagnetic "cushion" to regulate the flow of the free electrons on their way through the levitating piece such as a thick solid chunk of aluminum or copper.
basically spin the levitating part as fast as you can while "cushioning" (slowing, essentialy) the flow of the electrons being generated by your coils without disrupting the magnetic field that they are flowing through... hope this helps!
We need to go foward with reaearch what will it take to work together and revolutionize the way himans move
This is amazing! Could have a board game where the pieces move themselves 😍
That would be super cool!
Perhaps a quantum planet solar system?
Creative thought
As a beginner in the DIY hobby it's really inspiring to see your proficiency at so many different realms of the hobby. From PCB design to programming to mechanical engineering, you seem to have it all covered. I hope to be as good as you some day and have just as wide an area of knowledge.
Thanks! And you definitely can be this good and even better, just keep challenging yourself and practice those skills!
@@3DprintedLife do you mind if I ask you how you learned all of this knowledge?
I’d love to see part 2!
Since you already went through and learned about it could you explain the controls and the code a bit more?
Yes please part 2
Not an engineer or in any way tech savvy but would a smaller disk make a difference? Having the coils “push” the disk back to the center only works if the disk is within the coils “reach”; if the disk pushes the boundaries of that reach, there’s a smaller window of time for correction before the weight and inertia take it beyond the boundaries and cause it to go over the edge.
I imagine it’s like trying to balance a plate of water with one hand (where the water is the disk, the plate is the magnetic field, and your hand the coils). If the water takes up as much space as the plate, the more likely it’s going to spill when making corrective movements because it’s picked up speed and continues to move after your correction. However if the water only takes up half the size of the plate, you have much more room for error and thus more control.
In retrospect... did you really enjoy the iterations to iron out all the YOLO choices?
Heck yes, even though the project never fully worked I still learned a ton from it!
Would you consider selling a kit to make your coil winder? Or provide a parts list and whatever software you used to drive it? I am interested in learning and sharing what I learn with my six year old daughter.
Thanks.
Love that you put this out even though it didn't really work; great to see your process!
It was a whole lot of effort to just fail in the end, but that's part of the risk of trying new things!
Did you try turning it off and back on again?
I couldnt resist. Im getting ready to start this build. with a couple mods, especially coils. I dont do vids but was going to record progress. Any suggestions?
Haha yes, many times. And it's really tricky but my best advice would be to figure out where to place the hall sensor such that the impact from electromagnets is minimal, and if possible select a hall sensor that can give faster readouts. Noise from the sensor and issues attempting to compensate for the distortion by the electromagnets were the biggest things impacting stability of my system.
Hey, does anyone know what the magnetic tool he is using at 4:19 is called?
It's a magnetic pole finder
@@3DprintedLife Thank you very much :D
Would adding more sensors be the solution? As a developer I know oftentimes problems in programming are solved by being more explicit.
For example, could you get more by having a ring of Hall sensors around the perimeter of the base?
Hmmm maybe that would help! It's a very interesting idea
Can't wait to see this fully working
What I have learned is that PID just works with a lineal and simple system.
This thing is full of non lineal components and lots of external perturbations.
You need the almighty state space variable controller and start doing linearization of the variables for something more or less stable, pretty much the modern control assignment of an engineering degree.
The chinese DIY levetron kits use PIDs though.
Hello. Great video. I need to replace an h bridge like you do. Wich component you use to replace the big L292N? thanks!
So, when are we going to see an update on this build?
Maybe my suggestions are useless.... but have you tried phase compensation? I can see there are oscillations in the output waveforms, which suggest that the system might be resonating at some frequencies. Another thing to try is PIDD² (or even PDD²) - I understand, the applied current is a proxy for controlling acceleration... I recall a combination of the two things mentioned above saved me once when I was having similar problems with another magnetic system.
MAGLEV is inherently unstable requiring a very fast control loop. I don't believe it is possible to make a stable control loop using digital for this application, but with a PID controller you can determine whether it will be stable via the step and impulse response. A more important check would be the amount of time required to sense vs. apply stimulus which is the most likely problem.
Can anyone suggest in which website we can do these connections virtually..
I know that is not the modern style of UA-cam hardware development, but you could test your whole circuit and all possible add-ons first with a breadboard and/or handmade PCBs made of thin copper wires instead of wasting resources by ordering a new industrial made PCB each time you change something.
Greets from a hw-engineer.
🙏
The strength of the electromagnetics may not be enough to produce an adequate field. While it may be overkill, simulating the fielding and flux circuits may help to identify where issues are. You also have to anticipate adjustments when dealing with discrete delays so applying a regression could help too.
So you're telling us they invented sirens by accident while trying to make a DIY magnetic levitator?
Hi, actually chose this as a project for my electronic engineering degree. Can you maybe give the chip type that you use instead of the l398N (h-bridge)?
Awesome! I'm using the TC78H660FTG but there are plenty of other similar options if you want one that can do more power or a higher voltage. I just love tiny qfn parts for my boards!
@@3DprintedLife ah cool thanks, maybe some more questions will pop up on the next few days. Can I contact you here?
@@3DprintedLife "I just love tiny qfn parts" now that's something no hobbiest ever says :P
First of all great job 👍. Your problem seems to be caused by inefficient PID control, which is the reason for the incorrect control of the magnets. So what you need is a good filter against noise but also absolute fast accurate sensor data. You should look at the Kalman filter algorithm. This is also used for self-balancing robots and provides a very good value for commuting (so to say :predicts the values ;-) ) Then your PID should works like a charm.
What can i do to network with you
What kind of magnets did you use? Amazon link? Thanks
You should try using an array of electromagnetics, gives more resolution of control and error feedback.
Man it's been one of the most satisfying videos I've seen this year!... let us know if there is a second part 💪👌
Have you considered utilizing a fuzzy logic control instead of the PID?
I haven't but that would be an interesting idea to try!
WHAT ARE THE ELECTROMAGNETS MADE OF. IS THE COIL WRAPPED AROUND STEEL OR IS IT WRAPPED AROUND NEODYMIUM? THANKS
Magnet wire wrapped around a ferrite core (steel in this case)
Now I know why magnetic levitators are so expensive and why I should not bother trying to make my own! You saved me hours of my life, so thanks.
thought... the floating magnet or metal disc. wld it be easier to stabilize if the weight was more towards center mass, this wld allow for better correction w less force needed. Yes?
Hello , I absolutely do not have any idea what you are talking about but I enjoy your videos, I was wondering maybe your magnet should have a stabilizer , or digital code , not just the platform , I think it would help out a lot because it would know where to pull or push away from directly, rather then on the port alone , lol maybe
How about filtering the sudden mechanical movement of the magnet by using a wider base for the floating magnet. I mean instead of floating just the magnet you can make a non magnetic base for it and remove the sudden glitches in the magnet's movement.
Could It be possible to do this with a bed??
What is the app you show off at the end of the video? Thanks
That's just the serial plotter tool built into the Arduino IDE
Hi bro what coding software did you use
This should be featured on Hackaday’s fail of the week. Great project!
Hahah I would be honored if it was :D
@@3DprintedLife Your honored
Did you think about using a cone in cone getup?
"So, I dove headfirst in to designing my own, doing next to no research before starting." Ah perfect, I'm in good company lol
There is a free 2D magnetic simulation software called FEMM. It might help to see what your fields look like. Cool project as always!
Oh awesome that's really good to know, thanks!
i bought one of these already fully assembled and the levitating magnet is stuck to a ferrometalic disk and the magnet is also much smaller than yours. I have swapped the provided magnet with my own and that has a big impact on its performance. So try different sizes of levitating magnets.
Interesting, thanks for the tip!
Also wonder if iron cores at each coil would help with magnetic field strength.
It seems the coils might be interfering with each other . Maybe scale down each coil . Not sure how magnetic fiels work but sure that you don't won't the field to overlapping each other
I was thinking that coils are to close to each other maybe just spread them out . I just guessing.
Fél évet töltöttem egy hasonló eszköz megépítésével. A digitális megoldások sajnos nem voltak működőképesek. Nem tudtam a belengést megállítani. Pedig nagy előnye lett volna, hogy MOSFET használatával hatalmasra lehetett volna növelni a teljesítményt. Végül az analog áramkörökket választottam, és sikerült megoldanom a stabil lebegtetést.
Could try lining up the magnetic coils diagonally
Your too underrated, love your vids
I appreciate that!
"I'm trying to work on a magnet car that can hover and levitate. I don't know how to make it happen, but I understand how to stabilize and control it. If you really want it to hover, just put a box-shaped structure around the magnet to stabilize it. Then, my friend, it should hover."
Maybe try adding mass to the disk to slow it’s oscillation and give the controller a better chance?
Yeah I did try that, later on in the video you'll see I embedded the magnet in a large printed disc to increase the moment of inertia. It did help but not enough and I can't add much more weight without it levitating too low.
How did you made circuit board next video 🙏
about how much did all this end up costing?
Dude, this video is great. So happy I discovered your channel, cant believe you only have 43k subs
Buying electronic stuff on Amazon is like buying toothpaste at the pharmacy.
@Arpad Toth You don't get it. Change toothpaste with soap.
Could you use copper from old microwave?
the magnets radius is too big compared to the sensing range of the hall sensor. eveery time it rotates its being pushed in a random direction
you need a smaller magnet or more hall sensors. and maybe a higher sensing and correction frequency?
Hm good suggestions, I think faster sensing and correction is definitely the biggest missing piece. But I'll need to find a new sensor to achieve better results there!
@@3DprintedLife just get a smaller magnet to float.
Cost of project?
What PCB software do you use?
Looks like kicad
NEXT PROJECT:Build a Freq transmitter. Fix it to 13 Hz and transmit it at 10-15 dB sound level. Try making this device as tiny as possible. Make sure you have enough battery power for 10-12 hours use. Then go to a public place that has a lot of those FAKE flower pots around. Place your device on and cover it up. Do this with at least 5 more devices in the same area, and go back to replace each with a fresh coin cell battery. After about 2 weeks, pay close attention to your local news and see if you see your 'area' having more reports of fighting and anger outbursts. Final step, increase the sound level on all devices to exactly 50 dB and put new batteries in.
You should collaborate with HiPer Tops! He has a video on his channel about his world record breaking, hand made precision spinning top. Perhaps he’d be willing to craft another one, with an embedded N52 neodymium magnet… just an idea!
As I know nothing, what about more of with smaller coils in set places
What if you put an identical base and coils above as well as below? Also, speaker was very funny haha
Hey how you lernerd electronix??
A mix of University and self taught
@@3DprintedLife can you please make a video that how you learn electronic... please!
Copper or Brass for stability ??????
Man the coding part is something that I would love to learn. I just don't know where to begin when learning to code
Can't we just make a circular loop and pass the current in it such that it makes a South pole after that we can place that in a plastic container so that magnet doesn't fall out. After that we just put the magnet South Pole so that it repels with that loop. Also container should have same dimaeter as magnet so magnet cannot change it position and levitate.
what type of subject is this considered?
physics?
Mostly this is controls, but also some physics and sw engineering
Oh! I did the prety same way with building similar one. I used 4 analog hall sensors and digital control board. With no success. Looks, like general microcontroller not fast enouth. I actually maked it to work with semi-analog cheme. Digital circuit now auto corrects offset voltage throuhg digital potentiometers.
This project triggered my subscription impulse 😊
Hi @3DprintedLife, Very cool project. I have been working on this for a while as well (ideologically speaking). Is there any way I can recreate what you did in an easy manner? I have a few ideas that might make this work, and we can share ideas/collaborate. I can do the heavy lifting of doing the experiments, as I am sure you're probably exhausted with this now. Lmk. Thanks.
Forgot to mention, I am a software engineer with Electrical background. I have lots of experience in designing control algorithms.
I can respect leaving a project.🤜🏼🤛🏼
Remember your subconscious doesn’t forget😂😂😂
Its the most powerful part of your brain.
You can try using AI based fuzzy logic instead of a PID loop that may help the stability factor. I hope you are not using the derivative portion of PID controller.
From what I remember you could benefit using z-transform control theory instead of PID.
This might be helpful:
UA-cam: " Z-Transform - Practical Applications - Phil's Lab #27 "
or maybe a contact with the creator of the clip.
ive always wanted to use a fishing rod for winding things
You need an identical platform on top for balance.
I thought you'd done it until I got to the end of the video... come onnnn
Increase or decrease the diameter of floating disk or the weight 🤔
In any case you have to add something around
have you ever heard of a reed switch? - by the way Im super jealous of the tools you have to create and test - the possibliltys are endless
Only I can understand your painful days 😂 , Good job 👍 Keep it up!! ♥️
Well, your magnets are sitting a few mm away from electronics. What did you expect. Probably start by shielding any electrical line in the vicinity of magnetic fields as much as possible before attempting to do any fine tuning of the control circuit for (I hope) obvious reasons? Ideally move all electronics (apart from well shielded power lines to the magnets) so far away from the magnetic fields that you can't measure it any more. Just my 2cts.
i believe you need a ring magnet around your coils...i noticed you didn't have one. the ring magnet will stabilize your device you're trying to levitate.