Main Content

Here’s a fun toy project I finally finished this month (Nov ‘22). It’s a racetrack built with a printed circuit board, and small 3D printed magnetic cars. They just drive around the circuit when you apply (the right) current! That’s it! That’s the project!

It started from a conversation with Kevin Lynagh, who did some experiments1 with moving magnets around a 2D grid with wires running both directions, which planted the idea of a racetrack version in my head. Thanks to my now rather extensive practice designing weird PCB geometries in Kicad with python, I was able to design a test board pretty quickly over the new years holiday and ordered it. It worked pretty well, I posted a short video and then forgot about it for a while.

Then I picked it up again in the spring, imagining it as kind of a slot car game. So this led me down a deep rabbit hole of a) building a wireless slot car controller, and b) a wireless charging station for the slot car controller.

I spent a fair bit of time learning about wireless charging, going so far as to do VNA measurements to get a better simulation model of the coil coupling. I learned some things, and should probably write an article about that at some point before I forget completely. I also built a second revision of the track board, with two lanes, because of course a slot track with one car is boring! I only did this because I failed to engage my brain properly. Had I engaged my brain properly I would have realized that the slot cars full of magnets would exert substantial force on each other when brought into close proximity in the narrow confines of a race track before ordering the board. Ah well; I realized eventually. I got the remote working enough to decide that actually it wasn’t that fun to drive this with a slot remote, especially if there was only one car.

So I dropped all that. A nice feature of projects done for fun is that their value is derived primarily from your enjoyment, so anything is reasonably in scope as long as you’re enjoying doing it. So arguably no waste was incurred here.

A lot of this kind of project goes as far as it takes to satisfy myself that I know how I would do it, and then there’s just not so much motiviation to go any further. It starts to feel like busy work. But, in this case I wanted a packaged up version that just worked, so I did one more board spin — what you see here — and now I’m pretty happy with it2.

The Design
The physics isn’t too complicated. To think about how this works you basically need to know one thing: The force created on a wire with a current is equal to the cross product B x I, which means that the force pushes orthogonally to the direction of the current and the direction of the B field. So if the magnetic field is pointed down into the board, and it’s overtop of a horizontal trace aligned with the X axis of the PCB, the magnet will be pushed vertically along the Y axis (the direction depends on the direction of current and B field, but we don’t have to concern ourselves with that too much, we can make it go either direction just by flipping the magnet).

The arrangement of the wires on the two phases allows it two be driven as a bipolar stepper motor, alternating the current in each 90 degrees out of phase. The controller on the Gauss Speedway does a bit of microstepping, performing 16 current steps per each cycle.

Then you have the problem of keeping the cars on the track, especially around curves where there are sideways g’s being pulled. That’s what the guard rails are for. These traces run along the outside, and push back in, so if the car deviates from the center, the force from the guard rail it moves towards increases, pushing it back.”

Link to article