final project

May 13, 2025
magnetic propulsion physics
...

the idea

In April, I decided to completely pivot from my original idea to build a magnetic propulsion train. I wanted to incorporate concepts that I learned in a course on electromagnetism that I took last fall, and I immeditely thought of maglev trains. I ultimately decided against magnetic levitation due to the limited time I had left to complete the project.

the science

Magnetic levitation trains work by utelizing magnetic fields and do not rely on motors to operate. My design includes a track with embedded magnets, and a train with 2 solenoids.

hardware

The very first thing I did was design my train and track. I wanted to make sure that my train would stay on the track regardless of the influence of the magnetic field, so I used ball bearings instead of wheels. The legs of my first train iteration were too short, but my second print fit pretty well!

...
...

Since I can't see if current is running through the solenoids, I wanted to make sure that I could sucessfully run the most simple case of my design. In the place of solenoids, I wired up 2 DC motors to a motor driver, connected them with an external 12 bolt power supply, and also configured a hall sensor. I'm glad I did—I fried two L9110 motor drivers running this simple circuit before checking the data sheet:

...

L9110s are unable to handle more than 1 Amp of continuous current, and my circuit was running at almost 2 Amps. I upgraded to an L298N, which was suitable for my use, and it worked!

I moved on to configuring my parts to attach to the train. I soldered the hall sensor and solenoids to wires:

...
...

With this design, the hall sensor just barely cleared the track

...

Ultimately, I was worried that the hall sensor would get loose and create friction between the train and the track, so I designed another train with even longer legs. I also created two different spacings for the distance between the solenoids since I wanted to see if breaking the symmetry between the spacing of the magnets and the spacing of the solenoids would make it easier to integrate the software with my design.

...

software

Running current through the solenoids is ultimately what makes the train move, so the coding component is arguably the most integral piece of the project. No matter the framework, the gist is to digitalWrite HIGH or LOW through each end of the wire depending on the placement of solenoid. Sending HIGH, HIGH or LOW, LOW to a solenoid essentially turns the solenoid off. HIGH, LOW and LOW, HIGH correspond to current running counter-clockwise or clockwise through the solenoid. Current running counter-clockwise makes the solenoid act as an electromagnet with north pole facing up; clockwise corresponds to north pole facing down.

The greatest challenge was getting the timing of these current changes right: In the case of the magnets alternating polarity in the track, I wanted to flip polarity of each solenoid just as they passed the middle of a magnet, so it would repel the magnet it was passing over and attract the next. Placing the solenoids so one was off-center made it so that there was never a dead-zone where both solenoids got stuck directly over magents of the same pole.

My code was formatted in a way where the hall-sensor readings would determine the polarity of the solenoids; however, it could not differentiate between readings of the same value going from N-->S versus S-->N. This resulted in an oscillating behavior:

I tried to integrate states so that the train would "know" when to flip to north or south based on the previous action it took, however, I was unable to make this framework work. I plan on attempting again with more accurate hall sensor readings!

...

next steps

The hall sensor readings I got weren't super steady: they fluctuated depending on the polarity of the electromagnets. I plan on shielding them so that they are less affected by the magnetic field generated by the solenoids. I will also offset them from the solenoids in order to create more distance between them. Another reason why my design didn't work could be because my electromagnets were functioning as inductors. Since I was flipping polarity so quickly, the solenoids may not have had time to fully reverse the flow of current. This could have resulted in the solenoids storing energy from the magnetic field rather than interacting with it. I'm going to try and use a different core for the solenoid which will amplify the magnetic field and hopefully make it act more like an electromagnet.

Check back in the summer for more updates!