Sponsored By

Featured Blog | This community-written post highlights the best of what the game industry has to offer. Read more like it on the Game Developer Blogs.

Making the Wireless Digital Katana – Hardware Development in Australia

My experience developing a combination of software and hardware,highlighting the problems unique to Australia and how I do my development on a shoestring (as in no) budget.

Paul Taylor, Blogger

November 13, 2013

8 Min Read

My name is Paul Taylor; I am a Systems Engineer living down in Australia. When I’m not riding Kangaroos or swatting flies, I’ve been developing a Wireless Digital Katana. In essence it is a very high-speed, high-accuracy motion sensitive input device. Right now I am running a Kickstarter campaign to fund my project into the real-world, interestingly it began months ago when another person’s Kickstarter failed to deliver.

The seed is planted…

June 2012 I saw the video on the Clang Kickstarter campaign (it’s amazingly well done, you should check it out www.kickstarter.com/projects/260688528/clang) at one point in that video they demonstrated a digital sword controller and I fell in love. I watched the project evolve, unfortunately backer discontent rose, the project slipped behind and it became clear that the sword controller was not going to eventuate through their campaign. It was that moment that I decided to make a great sword motion controller happen.

Prototyping like a boss…

My work started like all great things, with the Internet. Had this been done before? Had it been done well? How should I approach it? The answers were simple: Beyond plastic adaptors for Wii Remote controllers, the sword controller did not exist.

I decided on two components for the next step: Motion Sensors and a Microcontroller to get the signals from the sensors to the PC.

Some more internet research and I knew that I would be using an Arduino microcontroller at the heart of the Digital Katana (the sword became a Katana (Japanese Sword), as it is the type that I train with (in Iaido) and have the most appreciation for).

Arduino microcontrollers are Open-Hardware, have a huge community and are both powerful and relatively simple to program, I grabbed one off my desk for the first iteration (it is HUGE) way too big to be practical, but had enough room to debug the ugliest programming problems. My research into motion sensors found many great sensors that work with Arduino microcontrollers, however I settled on the only all-in-one 9-axis motion sensor. In the space of 4x4x1mm this tiny device can track acceleration (gravity and motion), magnetism (think of a 3D compass), and rotation (via on-board gyroscopes). To buy these parts in Australia turned out to be impossible, there are two major factors which make Australia so remote, slow postage and the ‘Australia Tax’.

Living in Australia has some perks (great surfing, lots of space, cultures from every part of the globe) and a mythical beast I refer to as the ‘Australia Tax’, it is the huge price increases artificially put on products sold here (You’ll see in recent and old media companies including Adobe, Microsoft and Sony defending these blatant rip-offs).

I quickly jumped on eBay and found some samples to test, then waited…. It would be 2-4 weeks before I could progress on the electronic components of my project, so I used my most valuable Wild-Card for prototyping: Guesstimation (I know it is not a word, I’m making it a word). Taking educated guesses at where my project would lead I began pre-ordering all types of hardware: Various wireless modules, Batteries, connectors, Arduino boards. All up I spent less than $100AU on these guesstimated parts.

Locally I purchased a bokken (wooden practice katana) and some tools to help modify it.

Fast-forward a couple of weeks and enough hardware arrived for me to assemble the first prototype. It was an ugly pile of wires that would spit out huge quantities of text via a serial connection to a text box on my PC, if you poked the pile of wires the numbers would change. From the outside not exactly exciting, but to see my creation alive, even just barely was exhilarating and super-motivating.

24 hours later I had cut and drilled the bokken, attached the sensors, Zip-Tied the amazingly huge Arduino to the side and was swinging my wooden katana (now a digital katana) around with that huge text stream pouring onto the PC screen.

Now that the controller was alive, it was time to work on the software that would realise the serial text stream into something more tangible. I’ve done a lot of video game programming, so it was only a weekend of work to create the first 3D interactive simulation of the digital katana. You can see lots of pretty graphs and debug text, this was really helpful, especially as some of the Axis and rotations were initially backwards.

Development could now continue in 3 Dimensions, and it became clear that is some situations the motion sensor would get weird, really weird. The tracking would be great one minute, and jumping all over the place snapping about the next. Testing showed that the sensors have a few orientations where behaviour is less than ideal. I solved this by adding a second sensor to the tip of the Digital Katana, giving me the luxury of reading from either sensor and even mixing data from both sensors. The result has been a dramatic improvement in tracking and reliability, no longer did I have to put up with weird motion tracking.

The following Monday a pair of Wireless transceivers appeared in the mail box (I ordered these weeks prior), so I was able to start working on creating a Wireless link. I avoided using a Wi-Fi (Wireless Network) module, instead opting for a more direct approach, utilising a wireless link directly between the PC and the Digital Katana. Two days of tears and I was unable to get the wireless link happening, looking through the schematics provided by the chip manufacturer I was able to identify a missing capacitor on my wireless units.

Simply adding one of these little guys to each unit had my wireless transmission operational. Unlike traditional Wi-Fi which can take huge quantities of data, the direct link is only capable of transmitting 32 bytes of data in each packet (transmission). Packing the information from a 9-axis motion sensor into a group of just 256 1’s and 0’s was a mathematical adventure. I won’t bore you with the details (contact me if you’re dying to know), suffice to say I succeeded and was able to evolve the Digital Katana into the Wireless Digital Katana.

Finding an Arduino that would be compact enough to fit inside of the wooden bokken, yet powerful enough to perform all of the required computation was the next challenge I had to overcome. There were three contenders:

Arduino Pro Mini, 3.3v 8Mhz

Arduino Pro Mini, 5v, 16Mhz

Arduino Nano V3, 5v, 16Mhz

All of these had only 32KB of code storage (the giant Arduino Mega has a whopping 256kB of storage), so a lot of time was spent optimising my code which was initially 120kB down to 32kB. It involved a lot of late nights and coffee to devise code that was smarter and thus smaller.

With the code shrunk I was able to start testing Arduino the boards. The 3.3v 8 MHz Pro Mini was too slow, it could keep up some of the time, so I filed it into the not-so-great ideas basket. Both the other Arduinos were easily fast enough for the job. The 5v Arduino Nano is 10mm longer and a little higher due to the USB plug, but was my final solution as it means anyone tinkering with the Wireless Digital Katana can easily update the processor software, if I had used the smaller Pro Mini updating the software would require specialised hardware (an FTDI programmer).

With the 5v solution required on the Wireless Digital Katana, I needed to find a power solution that could supply a continuous voltage of 5v to the device for at least 1 – 2 hours. The most dense (capacity for size) rechargeable batteries that were common enough to consider were the Lithium-Polymer and Lithium-Ion types. This resulted in another eBay splurge, ordering quite a few different Li-Po and Li-Ion batteries along with various USB chargers.

Testing yielded that a type 1400 Li-Ion battery (the same size as a AA battery) contained more than enough power for the Digital Wireless Katana, and I was able to drill a hole in the base of the Katana to subtly contain the battery. Any engineers reading this article will already be screaming “but a 1400 Li-Ion is only 3.7v and your circuit needs 5v!”, and they are in fact correct. The solution was to either move to 2x batteries (more weight and charging difficulties) or utilise a tiny step-up converter.

Since the rapid growth in USB portable devices, and subsequent rapid growth in portable charging solutions, the cost of DC-DC step up converters which output 5v have plummeted. What would have cost 10s of dollars 2 years ago is now available for less than $2.

This solved my voltage issues with a small (8%) power usage overhead.

Designing the receiver was actually very simple, it utilises the same Arduino Nano board as the Wireless Digital Katana, yet performs less work, simply receiving packets from the Katana and passing these on to the host PC. I’m currently using 3D printing to design a compact and elegant case for the receiver.

Taking my project from a really cool prototype to a Kickstarter campaign (http://www.kickstarter.com/projects/511679941/open-source-digital-katana-with-real-time-tracking) was one of the last challenges.

  • Sourcing components in bulk

  • Calculating international shipping

  • Filming a video.

  • Documenting processes and timelines.

These are just some of the tasks that you’ll never need to face if you are designing things at home. Moving my project into the public space has been a massive change in demands.

So if you’re a budding engineer or tinkerer, learn to love eBay, dream big, and have fun!

 

Read more about:

Featured Blogs

About the Author(s)

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like