Flight Sim Headtracker (3D Printable)

by LimaJuliett in Circuits > Computers

708 Views, 2 Favorites, 0 Comments

Flight Sim Headtracker (3D Printable)

IMG_0224.jpg
IMG_0222.jpg

Flight simulators are amazing, but reaching for a hat switch (or worse, a keyboard) every time I wanted to look over my shoulder got really old really fast. But fear not, for there is a solution: headtracking! This allows you to control the view in-game with your head position in real life. (Google/YouTube “TrackIR” if you want to learn more.) The most popular route is to shell out the $100 on a nice TrackIR sort of thing, but I’m in college and therefore 1. am broke, and 2. have access to pretty nice 3D printers. So here’s the DIY way to do it, complete with over-engineering, over-explaining, and generally being far nerdier than required. A no-nonsense guide (as well as CAD and .stl files) is available on my GitHub page.

Supplies

  • 3D printer access and materials (filament, etc.)
  • Fusion 360 (free for hobbyists, also not a necessity)
  • CAD and/or .stl files (included under Step 1, also on my GitHub page)
  • M3 hardware (10 mm or 12 mm bolts, nuts)
  • Wide viewing angle LEDs
  • Wire
  • Soldering equipment (or some other way of creating a circuit)
  • Shrink wrap is handy but not a necessity
  • Some way to power LEDs (I used an old 5V wall wart)
  • Hot glue (Yeah, it's in there somewhere. Wouldn't be an Instructables without it.)

The idea behind each item is explained in the article, so don't worry if you don't have access to everything on this list. These are just all the things I used.

Review CAD, Modify If Necessary

As I created this in Fusion 360, .f3d files are available for download, both through this page and this project’s GitHub page. .stl files are also available, but they will be harder to make changes to. (Fusion 360 is free for “hobbyists,” which is why I use it and provided the relevant files.) There are two parts: one is the actual frame which houses the LEDs, and the other is extra support that fits the curvature of my particular baseball cap. I did not end up needing this part, so I recommend printing just the frame and adding the support later if you need it.

I’m not going to try and explain my design process; I’m an amateur and I’m sure there are lots of ways I could’ve done this better/cleaner/more flexibly. At the end of the day, it worked and that’s good enough for me. That said, here are some things I took into account while designing:

  • The camera will lose track of light points if they get close enough together to form one large “blob” of light. That means the maximum and minimum pitch angles of the head are dependent on the angle formed between the horizontal and the members connecting the LEDs. Play with the head_back_limit and head_forward_limit parameters in Fusion 360 to see what I mean. Mine are set as follows: (these numbers I got by tracking my head with my prototype head tracker, and they’re about as far as I can move my head while still being able to see my monitor.)
  • Head back: 45 degrees
  • Head forward: 35 degrees
  • The brim of my baseball cap is sloping down when it’s in a normal position on my head. The triangular piece on the bottom of the LED frame is made to account for this angle, and is controlled by the down_tilt_compensation parameter in Fusion 360. I recommend getting a friend to take a picture from the side of you with your hat of choice on to get some idea of where to set this. 20 degrees works well for me.
  • For the extra support piece, I knew I’d have a hard time measuring the curvature of my hat’s brim accurately, so I intentionally designed the support to be slightly flatter than my estimate of the hat brim. This keeps the bolts in tension instead of compression, and has the part tending to bend more instead of less (a “frowning” beam when mounted to an upright hat). I don’t have a reason for why this is better other than intuition, so if I’m wrong please correct me in the comments. :)

3D Print

Pretty self-explanatory. I printed this on a Prusa Mk.3 in PLA with 15% infill and 0.3mm Draft quality and it’s been great. Not pretty, but it’s plenty strong enough (even for the kind of abuse I put it through). You may want to avoid shiny filaments since reflections of the LED light could create a slightly larger bright spot.

Mount to a Hat

IMG_0244.jpg

Note that all the hardware used is standard M3 nuts and bolts. I used 10mm-long bolts, but 12mm would be needed for the main frame if the extra support piece were used. (Both sizes are fairly common.)

This involves drilling two holes in the middle of the brim to attach the LED frame. I marked spots on the hat with a pen, using the frame to make sure they’re correctly spaced, then drilled at those spots. The brim of my hat seemed to be made of some low-density plastic covered in fabric. Once the fabric starts to tear, the bit sailed right through. Since these are bolts, it’s okay if this hole is much larger than the threads of the bolt, we just don’t want it to be so big the head of the screw slips through. I’ve not needed to add washers to mine yet, and there’s no indication of washers becoming necessary in the future.

The nuts are held quite well in the plastic and I made my bolts fairly snug. Go slow and think about how tight these really need to be. (Just enough to hold the LED frame on and not fall out or wiggle loose. That’s not very tight. Remember: making it too tight and breaking the frame would be way more annoying than making the bolt a little tighter later if you need to.)

Attach LEDs

IMG_0242.jpg

I’d recommend taking the frame off the hat for this part. I’d also recommend using wide-angle LEDs, since you’ll probably want to rotate your head more than 30 degrees. (These are basically the same price on Amazon and 99% of the time it makes no difference whether you use wide-angle or normal LEDs. But you’re into airplanes and doing things the hard way, so welcome to the 1% of the time.)

The leads from the LEDs fit nicely into the holes in the frame, and the slight bending of the leads holds them in place well enough to add a dab of hot glue, because this wouldn’t be an Instructables without hot glue.

Camera and Software

IMG_0228.jpg
IMG_0247.jpg
IMG_0248.jpg
Opentrack Camera Settings.jpg
Opentrack LED Geometry.jpg
Opentrack Curves Yaw.jpg
Opentrack Curves Pitch.jpg

So we’ve got our LEDs, but we have to see them and then interpret the image. The first step is actually capturing an image we can use. To do this, we have to darken the image to such an extent, it’s impossible for the camera to see anything but the bright LEDs. I use a piece of exposed, developed film held over my camera with another 3D printed contraption. Definitely not the most elegant of solutions, but it’s very sturdy and works almost perfectly. The .stl and .f3d files are included in this step, just in case you also have a Razer Kiyo webcam. :)

Taping the film on works decently well for prototyping, with the biggest issue being the massive hassle of tearing it off and re-taping it for every company meeting. If people want a quick tutorial on creating this sort of “drop over” film holders for other webcams, let me know in the comments and I’ll come up with something.

As far as software goes, I use OpenTrack (GitHub), which is decently user-friendly and seems to “just work” (at least with DCS), while still being pretty capable. There’s lots of great things to explore in OpenTrack and you should spend some time with it, but there are three things to be aware of right off the bat:

  1. The Point Extraction settings are easily what I adjust the most. Play with these settings to figure out how they work, then tune it for your particular setup. Having the lights on in the room makes a difference.
  2. LED geometry is important. Weird things happen if this isn’t correct. Fortunately, we can measure accurately in Fusion 360 and also in real life! My settings are shown below.
  3. You will very probably want curves in one or more axis. Play with it, you can do almost anything.

See the pictures for my settings; they probably won't be perfect for you, but should provide a good enough starting point.

Tweaking

Hornet.jpg

As with many such projects, there will be some tweaking for a while in order to iron out all the kinks. Try different OpenTrack versions (I had issues with the latest version and am running 2.3.13), try adjusting curves, try different point extraction settings and clip geometries, and see how far you can actually tilt your head without losing useful sight of your monitor (it may be different for you than for me). Ultimately, the beauty in doing it yourself is you can tweak it however you like and make it work exactly the way you want. I hope this project provides a useful starting point for people wanting to get into headtracking without breaking the bank. Please feel free to comment with questions or suggestions and I’ll do my best to reply. See you in the virtual skies!