Wednesday, November 03, 2021

Revised 3D Printed Stargate, now with blue LEDs!

A couple years ago I started diving into the world of 3D printing, and also electronics, in order to produce a 3D printed Stargate from the TV series, Stargate SG-1. You can read about that journey on my original blog post here: https://jeremygustafson.blogspot.com/2019/10/3d-printed-stargate-journey.html

After publishing my Make on Thingiverse and posting a video of the gate on YouTube (https://www.youtube.com/watch?v=J1-aj0O4Irc), many folks commented that I should add a strip of blue LEDs in the center ring to make the wormhole effect more, well, worm-hole-y.

It took a while for me to get around to it, but I tweaked Dan/Boogle's original circuit board design to add an additional connection (and transistor) for the LED light strip, as well as tweak a couple other things about the board that had confused me as a newcomer to electronics, so hopefully now it's ever-so-slightly more beginner-friendly. I also spent a lot of time verifying and updating my instructions for the latest Raspberry Pi software, until I could successfully start from scratch and copy-paste my own instructions to set up a fully-functioning Stargate Pi.

My new circuit boards arrived from China this past summer-ish and there they sat, waiting for me to get over a weird energy hurdle required to "just start." As I've discovered about myself, avoidance is my preferred coping mechanism, and it takes being in a healthier emotional/mental place in order to get my bum in gear and start working on a project I'm nervous about. Why was I nervous? Because I'm terrified of failure. I'm working on getting over that.

One of these failure hurdles mentally blocking me from working on the stargate was that I still hadn't fixed my 3D printed warp core, which developed some flaky wiring issues almost immediately after I wrote about it. If I literally pushed on the whole warp core stack in a particular direction, all the lights worked, but if I let go or pushed it the other way, the bottom section of lights went out. I put that one off for ten months, then in October thought of a different, more reliable way I could wire the lights. I disassembled the whole thing, completely re-wired three quarters of the lights (one of the four sections still seemed sound, so I left it as-is), and re-assembled, all in less than a week. It was done in time to put on display when we had friends over for Halloween.

Succeeding at one project seems to give an energy boost, so I took advantage of that and jumped into the Stargate re-wiring. I hit some roadblocks with bringing the code from python2 (old, unsupported) to python3 (new, supported), namely that the new software drivers for the stepper motors somehow made the gate movements more... "chunky" is the best word I can describe it as. It sounded really horrible. I tried tweaking any number of settings but it just wasn't as good as the previous software. And, without wanting to bore you too much with programming details, there's one annoyance that can be easily explained: in the old software, you could say "move this many steps, and at this particular speed" and the stepper motors would move that many steps and at that particular RPMs. Easy. In the new software, they removed both of those features; you could only ask it to move one step at a time, and there was no speed control. Seems stupid. So I wasted a lot of time adding for-loops and "sleep"s to try to get the motors to run like they did before, to no avail.

Eventually, I said "this new software sucks, lemme see if I can get the old version of this to run under python3." Fortunately, it ended up being easy. When I tried doing this before, I only paid close enough attention to see the software throwing errors, and I foolishly assumed I wasn't smart enough to debug those. As it turned out, the only - and I do mean only - issues in this particular code, was that some of the formatting changed between python2 and python3. For instance, instead of something like this:

print "Some message"

It now needed to be formatted like this, with parentheses instead of a space:

print("Some message")

Once I understood that was literally the only issue, updating the old code to work was easy, and I was pretty much done. All that was left was polishing my documentation, uploading the new code, making a new video for YouTube, and writing about it (here, and also on Thingiverse). And with this project complete, now I can move on to finally finishing my 3D printed Stargate Atlantis.

But for now, I'll leave you with this video of the revised SG-1 gate in action: