Ask HN: have you built an electromagnetic levitator?
The specific challenge is to suspend a Canadian penny from the ceiling; it's primarily steel, and strongly influenced by magnets. My current strategy is to:
- use an arduino for the controller
- drive an electromagnet with a sinusoidally modulated voltage
- use a hall effect sensor to detect the distance of the penny
- in the arduino, change the maximum voltage of the electromagnet, based on the voltage coming from the hall effect sensor
I don't know how the penny will behave when it's in the field, so I don't know if the hall effect sensor will be able to detect the penny's distance. Obviously, when the penny isn't magnetized, it will be invisible to the sensor, but I hope it will behave differently when it's actively being levitated.
I am not sure why this system will become less stable as the distance from the electromagnet increases, but it seems like it must. It also seems like the amplitude of the sine wave is going to need to increase, based on the distance from the penny, to cause grosser adjustments to the penny. I'm assuming that because in the opposite case, when the penny is close to the electromagnet, it seems like you will only need to make small adjustments to keep the penny a specific distance. I assume the relationship between distance and the amplitude of the sine wave will be non-linear, which will determine the maximum distance the penny could ever be.
Here is a specific question: how do I determine the force of attraction between the penny and the electromagnet given the distance and the voltage of the magnet?
This is still in the earliest stages, so any advice at all will be appreciated!
6 comments
[ 0.20 ms ] story [ 24.1 ms ] threadI think you'll be learing a lot about servo systems, search for PID control loops.
And good luck, that's a tricky thing you're trying to do there.
Be sure to post it if you got it working!
The more I look into the problem, the more challenges I'm finding. A friend of mine did this for his master's thesis back in 2002, so I know it's not impossible, but he had a strong background in EE (whereas I'm a relative n00b).
Also, thanks for the search query. I'm checking on it now.
Also, the magnetic field is going to be proportional to current, not voltage (and because electromagnets are highly inductive, you can't assume the two will be linearly proportional).
In fact you might be able to use the current rise in response to a voltage pulse as a measure of the inductance of the magnet/penny system and use that to measure the distance.
The old levitating spheres that The Sharper Image sold used an optical system (IR LED and photodiode) to detect the position of the sphere and modulate the magnet (arranged horizontally just above where the sphere would hang), but that might not be as impressive as having it hang out in space.
Sounds like a tricky problem :)
Great idea about the voltage pulse! Let me see if I have this right: with a known voltage, the current will rise in proportion to the nearness of the penny? That is, for a fixed voltage, when the penny is closer, the current will be higher?