Mag Lev Without The Train (But With An FPGA)

It always surprises us that magnetic levitation seems to have two main purposes: trains and toys. It is reasonably inexpensive to get floating Bluetooth speakers, globes, or just floating platforms for display. The idea is reasonably simple, especially if you only care about levitation in two dimensions. You let an electromagnet pull the levitating object (which is, of course, ferrous). A sensor detects when the object is at a certain height and shuts off the magnet. The object falls, which turns the magnet back on, repeating the process. If you do it right, the object will reach equilibrium and hover near the sensor.

Some students at Cornell University decided to implement the control loop to produce levitation using an Altera FPGA. An inductive sensor determined the position of an iron ball. The device uses a standard proportional integral derivative (PID) control loop. The control loop and PWM generation occur in the FPGA hardware. You can see a video of their result, below.

However, the team also wanted to display data on a VGA screen. While it is possible to do this without a computer, it is much easier to write some software for this task, so the device has an embedded NIOS II processor core that handles tasks including displaying data and changing PID constants.

This project is a good example of marrying FPGA logic for high speed and a CPU for easier development. The sensor and other factors meant the ball didn’t have good control laterally, so the device uses a tube to constrain the ball.

Floating speakers and globes usually use a strong permanent magnet in the floating part and four magnets to balance laterally. We’ve seen that done with an Arduino. For the truly adventurous, you can levitate a spinning magnetic top with no electronics at all. Honest.

4 thoughts on “Mag Lev Without The Train (But With An FPGA)

  1. “So, we designed a red-neck cladding tube that would allow free y-axis motion, but prevent excessive x-axis displacement.” Thats funny!

    I like these projects that marry the softcore/hardcore processors and programmable logic on a single chip. I know it does not lend itself to much hacking projects together as in my experience it takes a lot of work to even get an LED to blink! But It does have its place in large and complex embedded projects.

    1. Soft cores are great and we are reaching a turning point I feel in the availability both in terms of being able to order units as a consumer and pricing of the hardware to run amazing softcores on cheap hardware with space for complex designs…

      But FPGAs are in of themselves no more difficult than using micro-controllers with proper training.

      You just need to be a bit more rigorous in your design methodology which is fine because you will need to synthesize and verify your design anyways. It’s not wasted red tape as people seem to think.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.